Contents
Strategic Partner Links
Sepasoft - MES Modules
Cirrus Link - MQTT Modules
Resources
Knowledge Base Articles
Inductive University
Forum
IA Support
SDK Documentation
SDK Examples
Data types can extend other data types, to add additional members, or override default values. The parent data type can be modified by selecting the data type itself in the tag member tree. Note that the data type can only be selected when the tag is first created. After that, it is not possible to modify the parent tag type.
Simply click the green + icon at the toolbar above the member tree. Data types can contain standard tags like OPC and DB, as well as folders and instance of other complex types.
Parameters, which can be used for property expansion in member tags, can be added by selecting the data type in the member tree. If a data type contains other complex types in it, there may be various points in the tree with custom parameters. While a data type can override the parameter values inherited from a parent, new parameters can only be added to the root node of the new data type.
The tags inside of data types are configured much like normal tags. However, in this case, the values can be thought of more as "default values", which will be used unless other values are specified when the instance is created. Most of the values configured in the data type can be modified later in sub types or instances. Furthermore, unlike normal tags, in the context of a data type many properties (general the string based properties) can reference the custom attributes of the type in order to build parameterized types.
As mentioned above, many properties in the member tag configuration can reference the parameters available in the data type. When instances are created, these references are replaced with the values defined for the type. Parameter references also support basic offsets and numerical formatting, providing a great deal of flexibility. To reference a parameter, use the syntax {ParameterName}
, or use Ctrl-Space to display a list of available parameters to choose from.
To offset a value, use the form {ParameterName+offset}
.
To format a value, use the form {ParameterName|format}
. The format pattern is the same as that used for the numberFormat
expression function. In short, "0" can be used to require a digit, and "#" can be used for optional digits.
For this example, we'll assume that we're parameterizing the OPC Item Path, and that the data type has an integer attribute named BaseAddress
defined. We'll pretend the OPC Server provides tags named like DataPoint1
.
OPC Item Path: DataPoint{BaseAddress}
Imagine that our data type had three fields, and these were laid out sequentially in the device.
Instead of specifying each address for each tag, we can simply offset from the base address:
Member 1: DataPoint{BaseAddress+0}
Member 2: DataPoint{BaseAddress+1}
Member 3: DataPoint{BaseAddress+2}
Continuing from the example above, imagine that our OPC server actually provided addresses in the form DataPoint001
, in order to stay consistent up to "DataPoint999". This can be accommodated
using number formatting in the reference:
Member 1: DataPoint{BaseAddress+0|000}
Member 2: DataPoint{BaseAddress+1|000}
Member 3: DataPoint{BaseAddress+2|000}
This format of three zeros means "three required digits". If our instance has a base address of 98, the resulting paths will be DataPoint098, DataPoint099, DataPoint100
.
The following tag properties can reference parameters:
Sub types and instances can override the properties defined in parent types. To do this, simply select the override control (the small grey ball) next to the property to override in the member editor.
Conversely, to remove the override, simply unselect the control.
Custom parameters can be overridden as well, but it is not required to specify that the value is an override. Simply provide a new value for the property. For inherited parameters, the delete button next to the parameter table will simply remove the override. The parameter can only truly be delete from the type that defines it.
UDTs have a few parameters already defined to make things easier for you. They give you access to the name and various paths associated with a UDT member Tag. These parameters can be accessed from anywhere in a Tag that a normal parameter can be used. Each of these parameters uses that Tag it is in as a starting point for it's path.
Parameter Name | Description |
---|---|
{InstanceName} | The name of the UDT Instance that this Tag is inside. |
{PathToParentFolder} | The full path to the folder that this Tag is in. |
{PathToTag} | The full path to the Tag using this parameter. |
{RootPath} | The full path to the UDT instance that this Tag is in. |
{TagName} | The name of the Tag that is using this parameter. |
Next_link |
---|