Skip to main content

Generate instances as a series

If the instances of a template follow a pattern—Anlage_01 through Anlage_20, the number in the OPC address, three aggregates in rotation—you do not need to write the values of the template variables to a file: The Generate series dialog box populates the table from Create multiple instances according to rules that you define for each variable. The instances are then created as usual via Create instances.”

 “Create Series” dialog showing the number of instances, one row per template variable, and a preview of the first instances

Generate a Series

  1. As described at Create Instances from File , open the dialog Create multiple instances and select the template.
  2. Select Create multiple instances based on patterns, number ranges, or value lists. The button is located above the table and, as long as the table is empty, also within it.
  3. Under “Number of Instances,” enter how many instances you want to create. The default is 10; the maximum is 10,000.
  4. Specify the mode for the instance name and each template variable (see below) and fill in the corresponding fields.
  5. Check the preview: It shows the first five instances as they would be created.
  6. Select Apply (Create Instances). The rows appear in the table at Create multiple instances; there you can still change individual values before the instances are created.

 “Create Multiple Instances” dialog with the table populated from the series: one row per instance, one column per template variable

The Four Modes

ModeWhat it doesFields
ConstantAll instances receive the same value.Value
CounterA pattern with the placeholder {0}, which is replaced by a sequential number for each instance.Pattern, Start, Step, Digits
Number RangeA number that increases by the step size for each instance.Start, Step
Value ListA comma-separated list; if it is shorter than the series, it starts over from the beginning.Values

For the counter, the value of the nth instance is calculated as Start + (n − 1) · Schritt; Digits pads the number with zeros on the left. The pattern must contain {0}; otherwise, the counter will be missing from the result.

The available modes depend on the variable type:

VariableModes
Instance nameCounter, constant, list of values
Number (integer or fractional)Constant, range of numbers, list of values
Yes/No, date/time, time spanConstant, list of values
Text and plugin referencesConstant, counter, list of values

For time ranges, the same notations apply as when importing from a file, such as 500ms or 2m—see Time Specifications in Template Variables .

Example

A typical example is a composite OPC address: the plant number and aggregate are specified as template variables in the trigger item, such as SPS.Anlage{Nr}.{Aggregat}.Temperatur (for information on how to assign a variable to a field, see Create Template ). Twenty plants with alternating aggregates:

VariableModeConfigurationresults in
Instance nameCounterPattern Anlage_{0}, Start 1, Step 1, Digits 2Plant_01 … Attachment_20
No.CounterSample {0}, Start 1, Step 11 … 20
UnitValue ListMotor, Pumpe, VentilMotor, pump, valve, motor, … – the list restarts from the beginning after the third entry

The first instance therefore reads SPS.Anlage1.Motor.Temperatur, and the second reads SPS.Anlage2.Pumpe.Temperatur. If all three aggregates of every system are to be connected, create three series—one for each aggregate as a constant.

note

The dialog generates values, not flows. Only Create instances in the Create multiple instances dialog creates the instances—and as applies there: If you change the template later, all instances will be updated accordingly.