InformationModel.MakeVariable<T>(browseName, variableTypeId, dataTypeId, arrayDimensions)

Creates a project variable of the type indicated by the third argument, and which contains the data type indicated by the second argument. It returns a C# object of the specified
<T>
type corresponding to the project variable created. Using the fourth argument (optional), it is possible to create an array, specifying its type and size.
static T MakeVariable<T>(QualifiedName
browseName
, NodeId
variableTypeId
, NodeId
dataTypeId
, uint[]
arrayDimensions
);

Arguments

T
IUAVariable
C# class, corresponding to the class of the C# object to return.
browseName
(QualifiedName)
The
BrowseName
of the new variable.
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
.
dataTypeId
(NodeId)
The Data type contained in the new variable.
TIP: A node inside the
DataTypes
class represents the Data type. For example,
OpcUa.DataTypes.Boolean
.
arrayDimensions
(uint[ ])
Optional. The size of the Array.

Returns

IUAVariable
A C# object that corresponds to the project variable created.

Example

var myTag = InformationModel.MakeVariable<FTOptix.CoDeSys.Tag>("CodesysTag", OpcUa.DataTypes.UInt16);
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.