You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

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

Distributor Info tags were expanded in v4.0.18 to provide information about each connected client


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)


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

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 from the Distributor Info > MQTT Clients above

>>>
MT-9bfd05ba-ddbb-4263 admin 127.0.0.1 False Fri Sep 22 10:54:23 CDT 2023 Fri Sep 22 10:54:39 CDT 2023
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 False Fri Sep 22 10:04:20 CDT 2023 Fri Sep 22 10:51:02 CDT 2023
MT-34fb9f47-e865-4ff6 admin 127.0.0.1 False Fri Sep 22 10:54:00 CDT 2023 Fri Sep 22 10:54:22 CDT 2023
MT-5d6c76ef-9ba3-4253 admin 127.0.0.1 True Fri Sep 22 10:55:16 CDT 2023 None
MT-99a2160a-2024-4efc admin 127.0.0.1 False Fri Sep 22 10:52:31 CDT 2023 Fri Sep 22 10:52:46 CDT 2023
MT-0f0f996c-3485-4a13 admin 127.0.0.1 False Fri Sep 22 10:54:23 CDT 2023 Fri Sep 22 10:54:39 CDT 2023
MT-164d6bdb-73ad-4bd5 admin 127.0.0.1 True Fri Sep 22 10:55:16 CDT 2023 None
MT-8f7c9989-71c1-44a3 admin 127.0.0.1 False Fri Sep 22 10:54:40 CDT 2023 Fri Sep 22 10:55:14 CDT 2023
MT-6e965a20-0618-4a4b admin 127.0.0.1 False Fri Sep 22 10:54:00 CDT 2023 Fri Sep 22 10:54:22 CDT 2023
MT-f84dea1d-4679-49ae admin 127.0.0.1 False Fri Sep 22 10:54:40 CDT 2023 Fri Sep 22 10:55:14 CDT 2023
MT-acea8aa2-8ef0-4c23 admin 127.0.0.1 False Fri Sep 22 10:53:54 CDT 2023 Fri Sep 22 10:53:58 CDT 2023
MT-RPC-73ecfe46-2a63-41 admin 127.0.0.1 True Fri Sep 22 10:55:15 CDT 2023 None
MT-99472916-0177-4d89 admin 127.0.0.1 False Fri Sep 22 10:52:47 CDT 2023 Fri Sep 22 10:53:58 CDT 2023
>>>


MQTT Engine Clients

MQTT Engine has two potential client connections.

One, with ClientId in the format ME-xxxxxxx-xxxx-xxxx, will publish the v3.0.0 Sparkplug™ B STATE message which will be initiated by default.

A second optional client, with ClientId in the format ME-LS-xxxxxxxx-xxxx-xx, is available to publish the legacy Sparkplug™ B STATE message and is disabled by default.

MQTT Transmission Clients

Each Sparkplug Edge Node Descriptor (which is the Group ID and Edge Node ID combination) will create an MQTT client.

For example, a single Transmitter configuration with the following Sparkplug Edge Node Descriptors will result in three Sparkplug MQTT clients:

Group1/EdgeNode1
Group1/EdgeNode2
Group2/EdgeNode1

A Transmission ClientId is in the format MT-xxxxxxxx-xxxx-xxxx

The MQTT Transmission Transmitters and Tag Trees document describes how transmitters and tag trees can be arranged, which in turn will define how many MQTT clients get created from a single Transmission instance.


In addition, MQTT Transmission supports an optional RPC Client, ClientId MT-RPC-xxxxxxxx-xxxx-xxxx, which is used when publishing from Ignition Python scripts. This is enabled by default.



Additional Resources





  • No labels