Abstract
This document describes setting up a connection that allows two Red Lion devices to communicate via Generic MQTT
Products
DA10, DA30, FlexEdge(DA50D, DA70D, DA50A and DA70A) and CR3000 or Graphite HMI/Graphite Edge Controller
Use Case
Establishing Communication between two Red Lion devices via Generic MQTT using Mosquitto Broker.
Required Software
Crimson 3.1 and Crimson 3.2
Introduction
There are four different methods to get two Red Lion devices to communicate. They are Modbus TCP/IP, OPC Proxy TCP/IP Master, OPC UA and Generic MQTT . This tech note will talk about how to use Generic MQTT to get two Red Lion devices to communicate.
Two Red Lion devices used in this example are DA50A and CR3000 HMI
IP Address of DA50A : 192.168.0.22
IP Address of CR3000 HMI : 192.168.0.181
IP Address of Mosquitto Broker running on Laptop: 192.168.0.85
Crimson 3.1 CR3000 Configuration:
1. Go to Communications -> Network -> Ethernet 1 and set up the IP Address of CR3000 HMI as shown in Figure 1.
Figure 1
2. Go to Connectors -> Generic MQTT -> service tab and set it up as shown in Figure 2.
Figure 2
3. Create two internal tags - Tag1 and Tag2 as shown in Figure 3.
Figure 3
4. Set up Tag set 1 as seen in Figure 4.
Figure 4
5. Set up Tag set 2 as seen in Figure 5.
Figure 5
Crimson 3.2 DA50A Configuration:
1. Go to Device Configuration -> system configuration -> Network -> Interfaces -> Ethernet 1 and set up the IP Address as shown in Figure 6.
Figure 6
2. Go to communications-> Connector -> Generic MQTT -> service tab and set it up as seen in Figure 7.
Figure 7
3. Create two internal tags - Tag1 and Tag2 as shown in Figure 8.
Figure 8
4. Set up Tag set 1 as seen in Figure 9.
Figure 9
5. Set up Tag set 2 as seen in Figure 10.
Figure 10
6. Go to display pages -> Pages -> Global actions -> On Tick and enter Tag2++ to get Tag 2 to increment every second as shown in Figure 11
Using Mosquitto
Install Mosquitto
Download and install Mosquitto from http://mosquitto.org/download/
Running Mosquitto
1. Start the broker, referring to Figure 12, open a command prompt and make sure you run as administrator.
Note: You absolutely need to make sure you run CMD as administrator and make sure you don’t have more than one instance of CMD open.
Figure 12
2. Navigate to the Mosquitto root folder, such as C:\Program Files (x86)\mosquito by doing CD C:\Program Files (x86)\mosquitto
3. Start the Mosquitto service by running the command: net start mosquitto, refer to Figure 13.
Figure 13
You should get the message The Mosquitto Broker service was started successfully.
Notes:
Data Transfer from DA50A to CR3000 HMI:
Tag 2 is updating once a second in DA50A unit. This is done via display pages -> Pages -> Global Actions - > On Tick and by doing Tag 2++. This data is being published by setting up publication topic dev1 under Tag set 1 in Crimson 3.2 database while CR3000 is subscribing to topic via subscription topic dev1 in order to receive this data in Tag 2 under Tag set 2 in Crimson 3.1 database.
Data Transfer from DA50A to CR3000 HMI:
Data from Tag 1 on the CR3000 HMI is manually entered from touch screen which is then published via publication Topic dev2 under Tag set 1 in Crimson 3.1 database. Flexedge DA50A is subscribed to this topic via subscription topic dev2 in order to receive this data in Tag 1 under Tag set 2 in Crimson 3.2 database.
Monitoring Values:
Figure 14. showing DA50A sending data via Tag 2 and Receiving data via Tag 1
Figure 14
Figure 15. showing CR3000 HMI sending data via Tag1 and receiving data via Tag2
Figure 15
Disclaimer
It is the customer's responsibility to review the advice provided herein and its applicability to the system. Red Lion makes no representation about specific knowledge of the customer's system or the specific performance of the system. Red Lion is not responsible for any damage to equipment or connected systems. The use of this document is at your own risk. Red Lion standard product warranty applies.
Red Lion Technical Support
If you have any questions or trouble contact Red Lion Technical Support by clicking here or calling 1-877-432-9908.
For more information: http://www.redlion.net/support/policies-statements/warranty-statement