NodeType Property
General info
Label |
Node Type |
Description |
Selector property to select datasource specific node-item. |
Data type |
UInt32 |
Default value |
1 (syslib.model.codes.NodeTypeMode.NODETYPEOTHER) |
Type |
CodingGroup |
Code |
1833 |
Symbolic name |
MODEL_PROP_NODETYPE |
Lua access code |
syslib.model.properties.NodeType |
Available since |
1.10 |
- Parent classes
Attributes
| Name | Tooltip |
|---|---|
| PROP_CONFIGURABLE | The property is configurable and can be changed with DataStudio and the various inmation APIs. |
| PROP_VISIBLE | The property is visible in DataStudio and can be read by the inmation APIs. |
| PROP_SELECTOR | The property is a sub-object selector. |
| PROP_MANDATORY | The property is a mandatory field, that means an input is necessary. |
| PROP_HAS_DEFAULT | The property has a default value as standard. |
| PROP_SET_ONCE | This Property can never be changed. |
Codings
Coding group: NodeTypeMode
| Name | Code | Label | Tooltip |
|---|---|---|---|
NODETYPEOTHER |
1 |
Other |
This subclass defines properties for all other objects. |
NODETYPEOPCUA |
2 |
OPC UA |
This subclass defines properties for IO type OPC UA. |
NODETYPEOPCXMLDA |
3 |
OPC XML DA |
|
NODETYPEDROPZONE |
4 |
Dropzone |
This subclass defines properties for node item type Dropzone. |
NODETYPEMODBUS |
5 |
Modbus |
This subclass defines properties for node item type Modbus. |
NODETYPEIP21RECORD |
6 |
IP.21 Record |
This subclass defines properties for node items of type IP.21 Record. |
Examples
Read from or write to the NodeType property.
-- Read from the NodeType
syslib.getvalue("<OBJECT FULL PATH>.NodeType")
-- Write to the NodeType
syslib.setvalue("<OBJECT FULL PATH>.NodeType",
syslib.model.codes.NodeTypeMode.NODETYPEOTHER)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the NodeType
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.NodeType"));
// Write to the NodeType
Result result = sli.WriteValue(sc, new WriteItem(NodeTypeMode.NODETYPEOTHER, "<OBJECT FULL PATH>.NodeType"));
A switch-like function of the codings.
function get_coding_name(code)
local _ntm = syslib.model.codes.NodeTypeMode
if _ntm.NODETYPEOTHER==code then return 'NODETYPEOTHER'
elseif _ntm.NODETYPEOPCUA==code then return 'NODETYPEOPCUA'
elseif _ntm.NODETYPEOPCXMLDA==code then return 'NODETYPEOPCXMLDA'
elseif _ntm.NODETYPEDROPZONE==code then return 'NODETYPEDROPZONE'
elseif _ntm.NODETYPEMODBUS==code then return 'NODETYPEMODBUS'
elseif _ntm.NODETYPEIP21RECORD==code then return 'NODETYPEIP21RECORD'
end
end
return get_coding_name(syslib.model.codes.NodeTypeMode.NODETYPEOTHER)