The Multi-Instance Wizard provides a powerful, but simple mechanism for rapidly generating many instances of a UDT at the same time by specifying patterns for UDT parameters.

Value Patterns and Tag Names

Value Patterns

In order to define values for parameters (and the Tag names), you can use several different types of patterns (and combinations of patterns):

Range      number1-number2[/step]
A numeric range of values, such as 1-10. Optionally, a step parameter can be included, in order to only generate numbers at certain multiples. For example, 0-100/10 would generate 0,10,20, and so on.

Repeat      value*count
A value (numerical or string), and the number of times to use it. For example, North Area*10 would use the parameter North Area for 10 items.

List      value1, value2, value3
A comma separated list of values (or other patterns) to use.


Examples:

1-10,21-30,31-40      Results in 30 Tags being created, with the specified value ranges (so, for example, there would be no parameter 15).
A,B,C                         Results in 3 Tags, with each of the values.
0-100/5                     Results in 21 Tags (because range is inclusive), with values 0, 5, 10...100.

As mentioned, the size of the pattern will dictate how many Tags will be created. If some patterns are smaller than others, the last value will be repeated for the other Tags.

Tag Names

The names of the generated instances can be specified using a system similar to that of the parameter patterns. If you just want to use sequential names, you don't need to specify a pattern, as values will be generated automatically starting at one. You can also set the pattern to simply be the starting number to generate sequential names from there.

Base Name
A string base for the Tag name. This can also be a list of names, in which case the names will be used directly, and the name pattern won't be used.

Name Pattern
A pattern that will be used to generate values that will be appended to the base name.

At any time, you can use the Preview button to view the Tag names and parameters that will be created. Once you are satisfied, click OK to generate the Tags under the selected folder in the Tag provider.

On this page ...


IULocgo


UDT Multi-Instance Wizard


How to Make New Instances of a UDT

Once you have a UDT Definition created, you can make multiple instances of it with the Multi-instance Wizard. 

  1. In the Tag Browser, click the Add  icon to create a new folder.  We created one called Machine Motors.  
    You can create a single instance of the motor or use the Multi-instance Wizard to rapidly create many instances at the same time. In this example, we will use the Multi-Instance Wizard.
  2.  Right-click on the Machine Motors folder, and select Multi-instance Wizard to open the Instance Creation Wizard window.



  3. In Step 1 - Select Data Type to Create, select a UDT (i.e., Motor) from the dropdown.
  4. In Step 2 - Configure the Parameters, enter the following for your Motor:

    • Base Tag Name:  "Motor." Note the space at the end. Without this space your Tag names will look like Motor1, Motor2, etc.

    • Tag Name Pattern:  1-5  This creates five Tags Motor 1Motor 2, thru Motor 5

    • Parameter Patterns: the MotorNumber parameter is entered by default when we selected the data type to create in Step 1.

    • Pattern:  1-5 is the pattern of the parameter so the Motor 1 Tag will have a parameter of 1, Motor 2 will have a parameter of 2, and so on through Motor 5.

      You'll notice that after you enter the Pattern, the number of Tags to create is updated. In this example, five Motor Tags will be created.  Click Preview.




  5. In Preview, you will see how the Base Tag Names and Parameter Values get created. Click Back to go back to the Instance Creation Wizard window if you want to make an update. If you like what you see on the Preview window, click OK.  




  6. In the Tag Browser, expand Motor Tags 1-5  to see if all the members of the Motor UDT were created and are running.


Cannot Edit Existing Instances using the Multi-Instance Wizard

You cannot edit existing instances using the Mult-Instance Wizard. The Mult-Instance Wizard is only used for quickly creating many instances of a UDT at the same time. If you want to make a change to all your instances, refer to How to Edit an Existing UDT.



Related Topics ...


  • No labels