Chức năng MQTT của bộ điều khiển WISE

Trang chủ » SCADA - IIoT » Chức năng MQTT của bộ điều khiển WISE
17/03/2020 SCADA - IIoT 253 viewed

WISE-75xx, WISE-52xx and WISE-224x provide MQTT Client function. WISE-75xx can connect to one MQTT Broker, and WISE-52xx/WISE-224x can connect with two (Maximum) MQTT Brokers concurrently. In order to enable the MQTT Client function, user has to complete the setting of Publish Topic and its message content with the MQTT Brokers, and also the setting of Subscribe Topics. In addition, WISE-52xx/WISE-224x supports to connect with the MQTT Broker the requires SSL/TLS encryption, and provides the “Topic Import/Export” function. It will help user to organize the MQTT topics from different MQTT devices in an easy way.

MQTT Setting

WISE-75xx

WISE-75xx provides the MQTT Client function. It allows WISE-75xx to publish I/O channel status to the specified Broker, and automatically subscribe the topics to control the output channels and internal registers from MQTT messages. The configuration page for MQTT Setting is shown as below:

Follow the following steps:

    1. Select “Enable” in the “Function Status” field to enable the MQTT function.

    2. Enter the Broker IP address (or domain name) in the “Address” field.

    3. Enter the Broker Port number in the “Port” field.

    4. The value in “Keep Alive Time” field defines the maximum time that should pass without communication between the WISE-75xx and the Broker.

    5. The value in “Periodical Publish Interval” field defines the time interval which all Publish Topics with the “Periodical Publish” attribute will be sent automatically periodically. If the value of the “Periodical Publish Interval” field is 0, it means to disable the “Periodical Publish” operation. The unit of the value is second.

    6. In the “Digital Value” field, users can specify that the message content of digital channel values are published as OFF/ON or 0/1.

    7. In the “QoS” field, users can specify the QoS(Quality of Service) for publish and subscription.

    8. If the Broker requires account and password validation, please select the “Authentication” checkbox, and enter the login ID and password in the “ID” and “Password” fields to login into the Broker. If the Broker doesn’t need account and password validation, uncheck the “Authentication” checkbox and go directly to next step.

    9. Click the “Last Will” checkbox will let the Broker to send the alarm Topic to others MQTT client devices when WISE-75xx is in Network disconnection status with the Broker. After click the “Last Will” checkbox, user has to complete the setting of Last Will Topic and Message content.

    10. The table in the lower half area of the MQTT Setting Page is about the Publish Topic setting. Users can edit the topic string and publish timing of all I/O channels and enabled Internal Registers. Users can also select “User-Defined” tag in the table to edit the Publish Topic and its binding message by the free style editing interface. Click “Add Message” to create a new User-Defined topic, and click the “X” button in front of the message to remove it. The user interface is shown as below.

      11. Edit the topics of all messages in the “Topic” field. Besides “User-defined” Topic, a Prefix will be added in front of all topics. Users can edit the Prefix at will, or press the buttons “Use Model Name”, “Use Model Name + IP”, and “Use Model Name + MAC” to use the default Prefixes. Press the “Preview” button to check the complete Topics.

     12. There are two options as “Periodical” and “Change” in the “Publish Timing” field for the timing to publish topic. If user selects “Enable” in the “Periodical” field, it means the topic will be published at periodic time schedule base on the value in “Periodical Publish Interval” field at Step v. If user selects “Enable” in the “Change” field, it means user has to enter the difference value in the “Difference” field, and the system will automatically publish the topic when the I/O channel value change takes place and it is exceeds the difference value (The Change option is not supported in the “User-Defined” message). WISE-75xx can also publish a MQTT Topic to the Broker when an IF event is triggered.

     13. After all MQTT settings are completed, click “Save” button to save the changes.

MQTT Rule Setting

    • Broker Connection Status Condtion:

Identify the connection status to be “Offline” or “Online”. If the connection status of the Broker match the evaluation criteria, the Action will be executed.

Broker Connection Status Operator Description Condition Statements
Broker Connection Status of index N Offine Identify if the state of Broker Connection is Offine continue to be TRUE when the status matches the criteria
Online Identify if the state of Broker Connection is Online
      • MQTT Broker Connection Status only for WISE-52xx/WISE-224x.
    • Subscribe Topic Condtion:

Identify the value of Subscribe Topic to be equal to, greater than, less than, equal to or greater than, equal to or less than the “Variable”, if the result matches the evaluation criteria, the Action will be executed.

Subscribe Topic Operator Variable Description Condition Statements
Subscribe Topic Message of index N =
>
<

User-Defined Value Using a user-defined value to compare with the Subscribe Topic Message of index N. continue to be TRUE when the status matches the criteria
Internal Register Using the internal register value to compare with the Subscribe Topic Message of index N.
AI Channel Value Using AI channel values of module to compare with the Subscribe Topic Message of index N.
AO Channel Value Using AO channel values of module to compare with the Subscribe Topic Message of index N.
Input Register Value Using input register values of module to compare with the Subscribe Topic Message of index N.
Holding Register Value Using holding register values of module to compare with the Subscribe Topic Message of index N.
      • MQTT Subscribe Topic only for WISE-52xx/WISE-224x.
    • Broker Function Status Action:

Change the Broker Function status to specified status. The status can be set as “Enable” or “Disable”.

Broker Function Status Action Description Execution Type
Broker Function Status of index N Enable Change the Broker Function status to be Enable One Time
Disable Change the Broker Function status to be Disable
      • MQTT Broker Function Status only for WISE-52xx/WISE-224x.
    • Publish Message Action:

Users can publish a MQTT Topic to the Broker when executing a Action statement.

Publish Message Action Description Execution Type
Publish Topic Message of index N Publish Publish Topic message One Time

MQTT Application Example

Scenario Example Document

Assume a factory has two automation production lines located in different areas. Each production line equips a counter module which is used to count the total number of finished goods. If the total number of finished goods is changed, the module will publish the MQTT Message with the total number of finished goods to the MQTT Broker. The counter modules also subscribe the “Stop production” Topic from Broker to stop the operation of production line. There is a WISE-5231 controller which is used to subscribe the Topic of the total number of finished goods of each production line from the MQTT Broker. After WISE-5231 get the total number of finished goods, and verify the number reach 5000, WISE will Publish the “Stop production” Topic to the MQTT Broker, and then the production line will stop the production operation by receiving the “Stop production” Topic. Following is the diagram about the MQTT Publish Topic and MQTT Subscribe Topic of the system.

WISE-52xx

Graphic Illustration

Chia sẻ:
Tags:
TOP HOME