MqttIOItemType Property
General info
Label |
Item Type |
Description |
The type of data item. |
Data type |
Int32 |
Default value |
1 (syslib.model.codes.MqttIoItemType.PUBLISHER) |
Type |
CodingGroup |
Code |
12468 |
Symbolic name |
MODEL_PROP_MQTTIOITEMTYPE |
Lua access code |
syslib.model.properties.MqttIOItemType |
Available since |
1.72 |
- 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_HAS_DEFAULT | The property has a default value as standard. |
Codings
Coding group: MqttIoItemType
| Name | Code | Label | Tooltip |
|---|---|---|---|
PUBLISHER |
1 |
Publisher |
Publisher. |
SUBSCRIBER |
2 |
Subscriber |
Subscriber. |
Examples
Read from or write to the MqttIOItemType property.
-- Read from the MqttIOItemType
syslib.getvalue("<OBJECT FULL PATH>.MqttIOItemType")
-- Write to the MqttIOItemType
syslib.setvalue("<OBJECT FULL PATH>.MqttIOItemType",
syslib.model.codes.MqttIoItemType.PUBLISHER)
TcpConfig tcpcfg = new TcpConfig() { HostNameOrIp = "localhost", Port = 6512 };
SecurityCredentials sc = new SecurityCredentials() { ProfileName = "<username>", Password = "<password>" };
StatelessInterface sli = new StatelessInterface(tcpcfg);
// Read from the MqttIOItemType
Result result = sli.ReadValue(sc, new ReadItem("<OBJECT FULL PATH>.MqttIOItemType"));
// Write to the MqttIOItemType
Result result = sli.WriteValue(sc, new WriteItem(MqttIoItemType.PUBLISHER, "<OBJECT FULL PATH>.MqttIOItemType"));
A switch-like function of the codings.
function get_coding_name(code)
local _miit = syslib.model.codes.MqttIoItemType
if _miit.PUBLISHER==code then return 'PUBLISHER'
elseif _miit.SUBSCRIBER==code then return 'SUBSCRIBER'
end
end
return get_coding_name(syslib.model.codes.MqttIoItemType.PUBLISHER)