Connecting PLCs, sensors, I/Os & BMS to MQTT
Learn how to connect and test your MQTT connections effectively, optimizing your IoT devices' communication process.
MQTT (Message Queuing Telemetry Transport) is a lightweight messaging protocol ideal for low-bandwidth networks, commonly used in IIoT. This guide will help you use SIA Connect with MQTT Explorer to test connections via a public MQTT endpoint. You'll learn to set up MQTT Explorer, configure SIA Connect, and monitor data exchange, with clear steps for both PLC and simulator setups.
This article will cover the following steps:
- Video guide
- Connecting SIA Connect to a broker
- Setting the correct parameters in MQTT explorer and connect to that same broker
- Send data from SIA Connect to a broker and monitor the data
Video
Connecting SIA Connect to a broker
You can learn more about setting up MQTT instances on the following link
Create an instance and fill in the required information, outlined below
Parameter | Value |
---|---|
Name | Choose a fitting name |
Address | mqtt://test.mosquitto.org |
Port | 1883 |
Ssl Version | None |
Verify Server Ca | No |

Click “Save Instance”
Create a new item with the following parameters
Parameter | Name |
---|---|
Name | Choose a fitting name |
Topic | SIA/[YOUR COMPANY NAME]/test The topic can be anything you choose. Using your company name or any other unique identifiers will ensure that you only subscribe to your own messages |
Retain | False |
Input template |
More information on SIA Connect variables can be found on this link |

Click “save item”
Setting the correct parameters in MQTT Explorer and connect to the same broker
Installing MQTT Explorer
The required installation files can be found on the following link
In the left-hand menu, choose the option “test.mosquitto.org”. From there, click “Advanced”

From the “Advanced” menu, input the same topic as the one used in the previous step. Click “Add” and “Back”

Click “Connect”

Now that you are connected to the endpoint using MQTT Explorer, you are ready to monitor data sent from SIA Connect to the endpoint.
Sending data from SIA Connect to a broker and monitoring the data
If you have a PLC to test with
Set up your PLC Instance and items
If you have a PLC instance already, skip this step
All documentation regarding creating PLC instances can be found on this link
Create a mapping between the PLC and the MQTT Item
When you have your PLC instances and items, you need to create a mapping between a PLC item and the MQTT item, created in a previous step.
This is done from the inside the instance. From here, click on “New mapping”

From the popup menu, fill out the necessary information
Parameter | Value | |
---|---|---|
1 | Sender item - Instance | Your PLC Instance |
2 | Sender item - Item | The item you want to send from the PLC to MQTT. More than one item can be selected for this |
3 | Receiver item - Instance | You MQTT instance |
4 | Receiver item - Item | Your MQTT item |

Click “Save mapping”
Make sure data is sending
SIA Connect will only execute a mapping, when the sender item updates - in this case, the sender item is the PLC item.
If the PLC does not update the value of the item through the program, we can force the update to take place. This is done by modifying the trigger behavior of the item. Changing the trigger behavior to “All” will update the item and trigger any associated mappings, even when the value does not update

If you do not have a PLC to test with
If you do not have a PLC to test with, SIA Connect offers another option - the Simulator Connector. This connector will allow you to create instance, which will generate data as was it a PLC.
Installing the connector
On the SIA Connect web-interface, navigate to the “Connectors” menu. From here, use the search function
- Navigate to the “Connectors” menu
- Use the search function to search for “Simulator”
- Click “Download & Install Simulator”

Creating the instance and item
Navigate to the “Instances” menu and click “Add new Instance”.
Select the Simulator Connector from the drop-down menu and give it a fitting name. No other parameters are needed for this instance

Next we add a new item:
- Click “New Item”
- Give the item a fitting name
- Set Min & Max to values you seem fit - we will be using 0 and 50 for this test
- Click “Save Item”

You now have an item generating data for you, and is ready to be sent to your MQTT endpoint
Create a mapping
Click on “New Mapping”. From here, fill out the needed information and click “Save mapping”
Parameter | Value | |
---|---|---|
1 | Sender item - Instance | Your Simulator Instance |
2 | Sender item - Item | The item you want to send from the Simulator to MQTT. More than one item can be selected for this |
3 | Receiver item - Instance | You MQTT instance |
4 | Receiver item - Item | Your MQTT item |

Validating the data exchange
With items and mappings created, data should now be streaming to your MQTT endpoint.
To validate that data is in fact coming in, navigate to MQTT Explorer. When connected to the endpoint, you should see that data is coming in

Conclusion
Using SIA Connect and MQTT Explorer to test connections via a public MQTT endpoint is a straightforward process. By following the steps outlined in this guide, you can ensure that your MQTT client applications are correctly configured and capable of communicating with an MQTT broker. This setup is invaluable for developing and testing IIoT applications, ensuring reliable and efficient data transmission.