InformationModel.MakeVariableType(browseName, dataTypeId, variableTypeId, arrayDimensions)
Create a project variable of the type indicated by the third argument (supertype), and which contains the data type indicated by the second argument. It returns a C# object of the
IUAVariableType
corresponding to the project variable type created. Using the fourth argument (optional), it is possible to create an array, specifying its type and size.static IUAVariableType MakeVariableType(browseNameQualifiedName, NodeIddataTypeId, NodeIdvariableTypeId, uint[]arrayDimensions);
Arguments
- browseName(QualifiedName)
- TheBrowseNameof the new variable type.
- dataTypeId(NodeId)
- The Data type contained in the new variable type.TIP: A node inside theDataTypesclass represents the Data type. For example,OpcUa.DataTypes.Boolean.
- variableTypeId(NodeId)
- The Variable type from which the new variable type is derived.TIP: A node inside theVariableTypesclass represents the Data type. For example,FTOptix.CoDeSys.VariableTypes.Tag.
- arrayDimensions(uint[ ])
- Optional. The size of the Array.
Returns
- IUAVariableType
- A C# object matching the project variable type created.
Example
The following example shows an API that creates a
MyTagType
variable type derived from the CoDeSysTag
predefined type, which contains one Int32-type data:var myVar = InformationModel.MakeVariableType("MyTagType", OpcUa.DataTypes.Int32, FTOptix.CoDeSys.VariableTypes.Tag); Owner.Add(myVar);
Provide Feedback