InformationModel.MakeVariableType(browseName, dataTypeId, arrayDimensions)
Create a project variable type derived from the
BaseDataVariableType
(base variable) type, which contains the data type indicated by the second argument and returns a C# object of the corresponding IUAVariableType
type. Optionally, it is possible to create an array, specifying its size with the third argument.static IUAVariableType MakeVariableType(QualifiedNamebrowseName, NodeIddataTypeId, uint[]arrayDimensions);
Arguments
- browseName(QualifiedName)
- TheBrowseNameof the new variable type.
- dataTypeId(NodeId)
- The Data type contained in the new variable.TIP: A node inside theDataTypesclass represents the Data type. For example,OpcUa.DataTypes.Boolean.
- 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
MyVarType
variable, which contains an Int32 data:var myVar = InformationModel.MakeVariableType("MyVarType", OpcUa.DataTypes.Int32); Owner.Add(myVar);
Provide Feedback