Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Name

Data Type

Description

Connected ClientsIntegerThe number of the MQTT Clients currently connected
Keep Inactive ClientsBooleanA writeable tag that controls whether to include inactive clients in Distributor Info tags (available 4.0.18 onward)
MQTT Clients

Dataset

String Array

String Array

String Array

Boolean Array

DateTime Array

DateTime Array

A dataset containing information about each connected client (available 4.0.18 onward). The following Column Names are included the dataset:

ClientId 

Username 

IP Address

Connected

Last Connect Time

Last Disconnect Time

Total ClientsIntegerThe total number of clients that have connected since the last MQTT Distributor restart (available 4.0.18 onward)


Executing the code below in the Ignition Script Console will print out the to pull out the values in the MQTT Clients dataset for review:

Code Block
languagepy
clients = system.dataset.toPyDataSet(system.tag.readBlocking("[MQTT Distributor]Distributor Info/MQTT Clients")[0].value)       
for row in clients:
    clientId = row[0]
    userName = row["Username"]
    ipAddress = row["IP Address"]
    connected = row["Connected"]
    lastConnectTime = row["Last Connect Time"]
    lastDisconnectTime = row["Last Disconnect Time"]
    print clientId, userName, ipAddress, connected, lastConnectTime, lastDisconnectTime

Example Result for two connected clients

Code Block
languagepy
>>>
ME-d631ab45-4466-42f0 admin 127.0.0.1 True Fri Sep 22 09:45:03 CDT 2023 None
MT-1693f8e5-014a-4609 admin 127.0.0.1 True Fri Sep 22 10:04:20 CDT 2023 None
>>>


MQTT Engine Clients

MQTT Engine has two potential client connections.

...