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>(QualifiedNamebrowseName, NodeIdvariableTypeId, NodeIddataTypeId, uint[]arrayDimensions);
Arguments
- T
- IUAVariableC# class, corresponding to the class of the C# object to return.
- browseName(QualifiedName)
- TheBrowseNameof the new variable.
- variableTypeId(NodeId)
- The Variable type from which the new variable type is derived.TIP: The Data type is represented by a node inside theVariableTypesclasses. For example,FTOptix.CoDeSys.VariableTypes.Tag.
- dataTypeId(NodeId)
- The Data type contained in the new variable.TIP: The Data type is represented by a node inside theDataTypesclasses. 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