---
title: Use the Status Register to Connect a PLC
slug: manufacturing-connect-edge/use-the-status-register-to-connect-a-plc
docTags: 
createdAt: 2023-04-12T14:35:54.000Z
---

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.&#x20;

# 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.&#x20;

# Set Up and Use the Status Register Option

Complete the following tasks to use the status register option.&#x20;

## 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](https://www.modbustools.com/download.html).

## Step 1: Set up Modbus Simulator

**To set up the Modbus slave simulator:&#x20;**

1. Open Modbus slave simulator.&#x20;
2. Navigate to **Setup&#x20;**> **Slave Definition...**
3. Configure the following parameters.
   **Slave ID**: 1
   **Function**: 03 Holding Register (4x)
   **Address**: 0
   **Quantity**: 10
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/a7JBxIn3Auyh7J5gNPX33_slave-definition.png" size="50" width="402" height="339" caption="Slave Definition dialog box" position="center" showCaption="true"}
4. Click **OK**.&#x20;
5. Navigate to **Connection&#x20;**> **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.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/vdS2B3mGsNRoHup9jQWqF_connect.png" size="50" width="407" height="422" caption="Connection Setup dialog box" position="center" showCaption="true"}
7. Click **OK**.&#x20;

The simulator successfully connects.&#x20;

## Step 2: Connect Modbus Device in Manufacturing Connect Edge

You can now follow the steps to [Connect a Device](docId:3eyAfPpweuVmBLCEy17sq).&#x20;

Configure the following parameters:&#x20;

**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.&#x20;

**Network Port**: 502

**Station ID**: This is the Slave ID configured in the Slave Definition in the Modbus slave simulator. Enter **1**.&#x20;

After adding the device, the device shows a successful connection to the slave simulator.&#x20;

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/_w6CZTSbJ6sHxxxzkRfla_image.png" size="60" width="449" height="347" caption="Successful connection to slave simulator" position="center" showCaption="true"}

Now that the device is successfully connected, you can test the status register function.&#x20;

## 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.&#x20;

**To update the slave definition function:**

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

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

::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/j1yyReaL_H5fh6wfsH2bh_image.png" size="60" width="449" height="347" caption="Disconnected status for device" position="center" showCaption="true"}

## 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.&#x20;

**To configure the status register in Manufacturing Connect Edge:**

1. In Manufacturing Connect Edge, click the **Action menu** for the device and select **Edit**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/vgQhjRHRtkGPgSuxJb1Hx_edit-iconmce.png" size="60" width="558" height="346" caption="Edit icon" position="center" showCaption="true"}
2. Select the **Status Register&#x20;**&#x63;heck box.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/r9DNtHZBLfWcQ802Jj6O-_status-registermce.png" size="80" width="965" height="613" position="center" showCaption="false"}
3. Configure the following parameters.&#x20;
   - **Name**: I - Analog Input Registers
   - **Value Type**: int32
4. Click **Update Device**.&#x20;

The device now shows a successful connection again based on the status register configuration.&#x20;

## 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.&#x20;

You will do the following:

1. Create a tag in Manufacturing Connect Edge.&#x20;
2. Update register values for the connected device in Modbus slave simulator.&#x20;
3. Use [Analytics](docId\:FGJKbOQwGVGgd2nuQgRo5) to read the tag values and confirm the tags are successfully configured.&#x20;

**To test the tags for the device:&#x20;**

1. In Manufacturing Connect Edge, navigate to DeviceHub > Tags.
2. Select the Modbus TCP device.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/p1fgWFderz7x4lcKzxjCr_select-modbus-tcp-devicemce.png" size="80" width="1551" height="691" caption="Select Modbus TCP device" position="center" showCaption="true"}
3. Click the **Add Tag** icon and select **Add a Tag**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/cvV6qZGSuZ9FGNY7xtYtq_add-tagmce.png" size="80" width="1551" height="691" caption="Add Tag icon" position="center" showCaption="true"}
4. Configure the following parameters.&#x20;
   - **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**.&#x20;
   - **Address**: The register that the tag will start reading data. Enter **1**.&#x20;
   - **Count**: The number of registers that that the tag will read. Enter **5**.&#x20;
5. Click **Add Tag**.
6. Click the **Copy&#x20;**&#x69;con for the tag's RAW Topic. You will refer to this later.
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/d4OYetRC1po27OomUIS9R_copy-raw-topicmce.png" size="80" width="1550" height="482" caption="Copy icon for tag" position="center" showCaption="true"}
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**.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/x_JvBMV25vfWrdp__ZKP2_register-tags.png" size="80" width="946" height="483" caption="Modbus slave simulator register tag values" position="center" showCaption="true"}
8. In Manufacturing Connect Edge, navigate to **Analytics**.&#x20;
9. Click **Add a processor**.&#x20;

   The *Create a Processor* dialog box opens.&#x20;
   ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/aTDgHB6KjzxHnBBYywW9n_add-processormce.png" size="80" width="1279" height="616" caption="The Add a processor option" position="center" showCaption="true"}
10. Select **DataHub Subscribe**.&#x20;
11. In the **Topic&#x20;**&#x66;ield, paste the tag's RAW topic that you copied earlier from step 6.&#x20;
12. Click **Save**.&#x20;
13. Click the **View&#x20;**&#x69;con for the processor.&#x20;
    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/cOXdwGlm-6CZBHz2ETlS2_datahub-subscribemce.png" size="80" width="1157" height="463" caption="The View icon" position="center" showCaption="true"}
14. Under Instance Messages, verify that success displays **true&#x20;**&#x61;nd value displays the five values you configured in the Modbus slave simulator (**5**,**11**,**22**,**44**,**66**).&#x20;
    ::Image[]{src="https://api.archbee.com/api/optimize/SSUUxKZUk9bFTEPNn_6Zo/l2kZUrdVj1i4jVE6G9a4n_tag-messagesmce.png" size="80" width="1389" height="309" caption="Instance messages for tag" position="center" showCaption="true"}

