How to Reuse Configurations with Library

How to Reuse Configurations with Library

Why to Reuse Configurations?

You can save any part of existing system configuration into a library for later reuse. This allows to save a lot of time when developing projects with similar configuration blocks. This is best explained with an example.

Let's assume you have a controller (a drive) for an electrical motor. A complex drive may have hundreds of settings that have to be set exactly right. Of course all the settings for all these drives can be manually configured but this is very time consuming and error prone.

But, you can make configuring of these types of drives lot easier. Considering you have already configured one drive once you can copy its configuration with all the settings (including I/O channels or other possible subelements) and paste it into a library as a pre-configured building block - a model. Now, you can use this pre-configured drive model for all drives of the same type.

An added benefit is that as a separate model you can store and maintain its settings in GIT, thereby having version control and history of that drive configuration.

How to Create Reusable Configuration Models

To copy configuration to library you first have to create a library. For that:

  • In Welcome mode select the Projects tab and click New Project button. Alternatively open File menu and choose Create New....
  • Select CDP Library and click Choose....
  • Type in the name of the library, select the storage location and click Next. Note that the name will also show in Resource tree, similar to how CDPCore and other resources are shown.
  • Select CDP version to be used and click Finish.

Now use Configure mode and locate a pre-configured configuration block in your system in Project tree or Configuration editor . To copy located object, right click on and choose Copy from the context menu.

Now, right click on the library name you want to paste the configuration block into and choose Paste from the context menu. After that new library element (i.e model) will appear in the library.

You can rename the newly created model for your convenience by right clicking on the name and choosing Rename... from the context menu.

To make the newly created pre-configured model available, the library must be built first.

  • Right click on library name in the Project tree.
  • Select "Build" in the context menu.

After build successfully completer, the newly created pre-configured model will appear as a new resource in a Resource tree in Configure mode. So you can add it to any application, by locating corresponding configuration element in application the model can be added into . Then locate model from Resource tree and add it by right clicking its name and then selecting Add from the context menu, or by double clicking on it.

Creating Configuration Models from Scratch

You can create new configuration models also from scratch (i.e without any existing system to copy from). For that, click on library name , then select "System configurator" editor and then add any resource from resource tree . Added resource becomes as base of the newly created model.

Additional Tips Using Libraries and Models

  • You can copy unlimited number pre-configured models into one library. You should rename them do reflect their content to be easily found from Resource tree later on
  • You can review and alter the copied configuration of the model in Configure mode almost in the same way systems can be configured. You can also add new resources (like new I/O channels etc) to model from Resource tree
  • Library must always be re-built for model changes to become effective in systems that use the model
  • You can also remove unused models from library. Just right click on the library name and choose Delete... To get model unlisted from Resource tree you have to remove resource once by right clicking model name in Resource tree and selecting Remove . Now, after library build deleted models will be not shown any more in resource list.