Versions Compared

Key

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

Details about MQTT Clients connected to MQTT Distributor can be found in the Distributor Info folder in the MQTT Distributor tag provider.

Note

Distributor Info tags were expanded in v4.0.18


where:

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)

...

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 result for two connected clients

...