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: The Data type is represented by a node inside the
DataTypes
classes. For example,
OpcUa.DataTypes.Boolean
.
variableTypeId
(NodeId)
The Variable type from which the new variable type is derived.
TIP: The Data type is represented by a node inside the
VariableTypes
classes. 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
Have questions or feedback about this documentation? Please submit your feedback here.