How-To Guides
DeviceHub Guides

Use the Status Register to Connect a PLC

9min

The status register option in device configurations allows you to set up a connection with a PLC device that won't successfully connect using the default connection configuration between Manufacturing Connect Edge and the device.

User Scenario

The default configuration for a PLC in your production environment can't connect to Manufacturing Connect Edge. You will therefore use the status register option to create a custom configuration to connect the PLC to Manufacturing Connect Edge.

Set Up and Use the Status Register Option

Complete the following tasks to use the status register option.

Before You Begin

For this user scenario, the Modbus slave simulator is used. To complete these steps, you will need to download the Modbus slave simulator.

Step 1: Set up Modbus Simulator

To set up the Modbus slave simulator:

  1. Open Modbus slave simulator.
  2. Navigate to Setup > Slave Definition...
  3. Configure the following parameters. Slave ID: 1 Function: 03 Holding Register (4x) Address: 0 Quantity: 10

    Slave Definition dialog box
    Slave Definition dialog box
    
  4. Click OK.
  5. Navigate to Connection > Connect...
  6. Configure the following parameters. Connection: Modbus TCP/IP IP Address: Enter the IPv4 address for your computer. If needed, use the ipconfig command in the command prompt window and copy the IPv4 Address. Port: 502 IPv4: Select this option.

    Connection Setup dialog box
    Connection Setup dialog box
    
  7. Click OK.

The simulator successfully connects.

Step 2: Connect Modbus Device in Manufacturing Connect Edge

You can now follow the steps to Connect a Device.

Configure the following parameters:

Device Type: Modbus

Driver Name: Modbus TCP

Name: Enter a name for the Modbus TCP Ethernet Driver.

Network Address: Enter the IP address you configured in the Modbus slave simulator.

Network Port: 502

Station ID: This is the Slave ID configured in the Slave Definition in the Modbus slave simulator. Enter 1.

After adding the device, the device shows a successful connection to the slave simulator.

Successful connection to slave simulator
Successful connection to slave simulator


Now that the device is successfully connected, you can test the status register function.

Step 3: Update Slave Definition Function

To test the status register function, you will need to update the function parameter in the slave definition of the slave simulator. This simulates a PLC device with a default configuration that can't connect to Manufacturing Connect Edge.

To update the slave definition function:

  1. In the Modbus slave simulator, navigate to Connection > Disconnect.
  2. Navigate to Setup > Slave Definition...
  3. Update the Function to 04 Input Register (3x).
  4. Click OK.
  5. Navigate to Connection > Connect... and click OK.

The Manufacturing Connect Edge device you created should now show a disconnected status due to the change in function from the slave simulator.

Disconnected status for device
Disconnected status for device


Step 4: Configure Status Register in Manufacturing Connect Edge

You can now set up the status register option in the device configuration to successfully connect to the slave simulator.

To configure the status register in Manufacturing Connect Edge:

  1. In Manufacturing Connect Edge, click the Action menu for the device and select Edit.

    Edit icon
    Edit icon
    
  2. Select the Status Register check box.

    Document image
    
  3. Configure the following parameters.
    • Name: I - Analog Input Registers
    • Value Type: int32
  4. Click Update Device.

The device now shows a successful connection again based on the status register configuration.

Step 5: Test Tags

Now that the device is successfully connected using status register, you can now test that tags in the device can be read.

You will do the following:

  1. Create a tag in Manufacturing Connect Edge.
  2. Update register values for the connected device in Modbus slave simulator.
  3. Use Analytics to read the tag values and confirm the tags are successfully configured.

To test the tags for the device:

  1. In Manufacturing Connect Edge, navigate to DeviceHub > Tags.
  2. Select the Modbus TCP device.

    Select Modbus TCP device
    Select Modbus TCP device
    
  3. Click the Add Tag icon and select Add a Tag.

    Add Tag icon
    Add Tag icon
    
  4. Configure the following parameters.
    • Name: This needs to be the same register as used in the Modbus slave simulator. Select I - Analog Input Registers.
    • Tag Name: Enter a name for the Modbus TCP Ethernet Driver tag.
    • Value Type: int16
    • Polling Interval: The interval in seconds that the tag will poll for data. Enter 1.
    • Address: The register that the tag will start reading data. Enter 1.
    • Count: The number of registers that that the tag will read. Enter 5.
  5. Click Add Tag.
  6. Click the Copy icon for the tag's RAW Topic. You will refer to this later.

    Copy icon for tag
    Copy icon for tag
    
  7. In Modbus slave simulator, double-click the cell in column 00000 and row 1. This is the cell that the tag you created will start reading from (Address parameter). Enter the value 5 and click OK. Do the same for row 2 to 5 and enter the following values: 11, 22, 44, 66.

    Modbus slave simulator register tag values
    Modbus slave simulator register tag values
    
  8. In Manufacturing Connect Edge, navigate to Analytics.
  9. Click Add a processor.

    The Create a Processor dialog box opens.

    The Add a processor option
    The Add a processor option
    
  10. Select DataHub Subscribe.
  11. In the Topic field, paste the tag's RAW topic that you copied earlier from step 6.
  12. Click Save.
  13. Click the View icon for the processor.

    The View icon
    The View icon
    
  14. Under Instance Messages, verify that success displays true and value displays the five values you configured in the Modbus slave simulator (5,11,22,44,66).

    Instance messages for tag
    Instance messages for tag