You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
Version 1
Next »
Details about the MQTT Clients connected from Transmission can be found in the Transmission Info > Transmitters folder in the MQTT Transmission tag provider.
Each Sparkplug Edge Node Descriptor (which is the Group ID and Edge Node ID combination) will create an MQTT client and a single Transmitter configuration with multiple Sparkplug Edge Node Descriptors will result in multiple Sparkplug MQTT clients.
An MQTT Client folder is available for each MQTT Transmission transmitter:

where:
Name | Data Type | Description |
|---|
| Command Latency (ms) | Long | The amount of time for a test MQTT command message to be sent and received back by the MQTT Client |
| Enable Latency Check | Boolean | Writeable tag to enable command latency checking for each MQTT Client |
| MQTT Client ID | String | The Client ID for the MQTT Client |
| Offline DateTime | DateTime | The last time at which the MQTT Client successfully disconnected from the MQTT Server |
| Online | Boolean | A read-only tag showing the connection status of the MQTT Client |
| OnlineDateTime | DateTime | The last time at which the MQTT Client successfully connected to the MQTT Server |
| Primary Host ID | String | The Primary Host ID configured for this MQTT Client |
| Target Server URL | String | The URL of the target MQTT Server to connect to |
Executing the code below in the Ignition script Console will print out the values in the MQTT Client folder for review:
clients = system.tag.browseTags(parentPath="[MQTT Transmission]Transmission Info", tagPath="*MQTT Client", recursive=True)
index = 0
print ("Number of MQTT Clients: " + str(len(clients)))
while index < len(clients):
data = []
tagPath = str(clients[index]).split("/")
data.append(["Sparkplug EdgeNode Descriptor",tagPath[len(tagPath)-3],tagPath[len(tagPath)-2]])
data.append(["MQTT Client ID", system.tag.readBlocking(str(clients[index]) + "/MQTT Client ID")[0].value])
data.append(["Online", system.tag.readBlocking(str(clients[index]) + "/Online")[0].value])
data.append(["Online DateTime", system.tag.readBlocking(str(clients[index]) + "/Online DateTime")[0].value])
data.append(["Primary Host ID", system.tag.readBlocking(str(clients[index]) + "/Primary Host ID")[0].value])
data.append(["Target Server URL", system.tag.readBlocking(str(clients[index]) + "/Target Server URL")[0].value])
data.append(["Offline DateTime", system.tag.readBlocking(str(clients[index]) + "/Offline DateTime")[0].value])
print data
index = index + 1
Example result from the Transmission > Info > Transmitters above
>>>
Number of MQTT Clients: 2
[['Sparkplug EdgeNode Descriptor', 'G1', 'E1'], ['MQTT Client ID', u'MT-233770ec-fa46-46f2'], ['Online', True], ['Online DateTime', Fri Sep 22 11:56:17 CDT 2023], ['Primary Host ID', u'IamHost'], ['Target Server URL', u'tcp://localhost:1883'], ['Offline DateTime', None]]
[['Sparkplug EdgeNode Descriptor', 'MyGroup', 'MyEdgeNode'], ['MQTT Client ID', u'MT-c53831be-ce8d-43f4'], ['Online', True], ['Online DateTime', Fri Sep 22 11:56:17 CDT 2023], ['Primary Host ID', u'IamHost'], ['Target Server URL', u'tcp://localhost:1883'], ['Offline DateTime', None]]
>>>
Error rendering macro 'excerpt-include'
No link could be created for 'FAQ: Ignition Modules'.