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(browseName QualifiedName, NodeId dataTypeId, NodeId variableTypeId, uint[] arrayDimensions);

Arguments

browseName (QualifiedName)
The BrowseName of the new variable type.
dataTypeId (NodeId)

The Data type contained in the new variable type.

Tip: A node inside the DataTypes class 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 the VariableTypes class 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);