How-To Guides
DeviceHub Guides

Use the PLC-Status Topic to Verify Connection Status

4min

Notes:

  • You need to follow the following guidelines for topic names: Subject-Based Messaging.
  • When publishing structured data such as JSON, you must convert to a byte array (string) first. To do this in a flow, you can use the json node.

The PLC-status topic is used to verify the connection of DeviceHub devices.

Video



User Scenario

You'd like to verify the connection status of a PLC to Litmus Edge from a remote location.

Set up and Use the PLC-Status Topic

To set up and use the PLC-status topic:

  1. Follow the steps to Connect a Device. For this user scenario, a Simulator Generator device is used.
  2. Navigate to DeviceHub.
  3. In the Generator device tile, click the Display Copy Options icon and select the PLC status topic. This will copy the PLC status topic. You will refer to this topic later on.

    Copy the PLC status topic
    Copy the PLC status topic
    
  4. Navigate to Flows Manager.
  5. For a Flows Manager, click the Go To Flow Definition icon. The Flow canvas opens in a new browser tab.

    Go To Flow Definition icon
    Go To Flow Definition icon
    
  6. On the Flow canvas, drag the Datahub Subscribe node and debug node onto the canvas. Then, connect the two nodes.

    Nodes needed for PLC status
    Nodes needed for PLC status
    
  7. Double-click the DataHub Subscribe node. The Edit DataHub Subscribe node dialog box appears.
    • In the Topic field, paste the PLC status topic you copied in step 3.
    • If needed, configure the Datahub Subscribe connection. See the Step 3: Configure Connector Nodes section in Create a Flow to learn more.
    • Click Done, and then click Deploy.
  8. Expand the message window beneath the flow.

    The message window
    The message window
    
  9. Click the Debug icon to view debug messages.

    The Debug icon
    The Debug icon
    
  10. Confirm the Debug node is activated.

    The activate debug button
    The activate debug button
    
  11. The debug window displays a "success": true message, which means the device is successfully connected to Litmus Edge. If the device is not connected, did not respond in time, or is not properly configured in Litmus Edge, "success": false will display.

    Success true message
    Success true message
    

The rest of the payload displays the following information from the device:

  • Data type: The data type used to verify the PLC status.
  • Value: The bit value that displays the status of the device. The value 0 means the device is on/connected.
  • Device Name: The device name you configured in Litmus Edge.
  • Timestamp: Date and time data for the PLC status message.
  • Device ID: The device ID for the DeviceHub device generated in Litmus Edge.
  • Description: The default description for the PLC status topic (Poll Register).