This procedure is an example of how to set up a Modbus Client connection in Automation1 2.5.0 using a WAGO I/O controller as the Modbus Server.

Test Equipment

  1. A PC with at least one Ethernet port.  
    1. This port (or entire Ethernet card) will be used only for Modbus and cannot be used for any other purpose (such as Internet access). Two or more Ethernet cards can be installed in the same PC, but one must be dedicated for real-time use with Modbus.
  2. WAGO Ethernet Settings software (see below for installation instructions)
  3. WAGO I/O Controller (IO-WAGO-750-842 in this case)
  4. End module (IO-WAGO-750-600)
  5. +24VDC Power Supply

Procedure

    1. The WAGO controller can have multiple input/output, analog/digital modules connected to it. At a minimum, the end module (IO-WAGO-750-600) must be connected to the WAGO controller.
    2. Connect a +24VDC power supply to WAGO controller
    3. Connect the WAGO controller to a dedicated Ethernet card or Ethernet port on the PC

    1. This will require the WAGO Ethernet Settings software, proprietary USB cable from WAGO, and WAGO USB driver.
    2. Refer to the following video to assign an IP address to the WAGO controller: Assign IP address of the PFC with Ethernet Settings

      1. The IP address and Subnet Mask must be on the same network as the PC Ethernet card or Ethernet port the WAGO is connected to. If you are unsure what IP address and Subnet Mask to use, see Setting IP Addresses, Subnet Masks, and Gateways.
        A standard network setting for example might be:

        WAGO Controller:
        IP Address: 198.162.1.22
        Subnet Mask: 255.255.0.0
        Default Gateway: 0.0.0.0

        PC Ethernet adapter:
        IP Address: 192.168.1.23
        Subnet Mask: 255.255.0.0
        Default Gateway: 0.0.0.0

    3. (Optional) Once the WAGO and PC network settings have been configured, ping the WAGO from the PC to ensure that communication is successful.
      1. Open Command Prompt
      2. Type ping <IP Address of the WAGO> 
      3. The WAGO controller will respond as follows:



    1. Open an Internet browser
    2. Navigate to the IP address that is configured for the WAGO. This will open the WAGO-I/O-System page as shown below.



    3. Click on Terminal Status at the bottom of the page. This will open the Terminal Status page as shown below.



    4. The Terminals info section shows each module connected to the WAGO controller. In the example above, we have:
      1. WAGO 750-459 - 4 channel analog input module
      2. WAGO 750-402 - 4 channel digital input module
      3. (x3) WAGO 750-504 - 4 channel digital output module 
      4. WAGO 750-459 - 4 channel analog input module 
    5. The Process image section shows the total number of I/O connected to the WAGO controller. In the example above, we have:
      1. 12 digital outputs
      2. 4 digital inputs
      3. 8 analog inputs
    6. Record this information as this will be needed to generate Modbus mappings

    1. For Windows 10:

      1. Open Device Manager and expand "Network adapters"



      2. Right click on the adapter that you wish to use for Modbus and select "Properties"



        1. If you are unsure which Ethernet adapter to select:

          1. Open Control Panel and click on "Network and Sharing Center"

          2. Click on "Change adapter settings"
          3. Disconnect or reconnect the WAGO to the Ethernet port on the PC. Note which one of the adapters changes its network status.

      3. On the "Details" tab, select "Hardware Ids" from the dropdown



      4. Record the 4 digit VEN and DEV numbers.

      5. Compare this to the list of compatible network interface cards on the Modbus TCP IP Overview page.



      6. If the card is listed, note the section under which it is listed (Intel Gigabit, Realtek Gigabit, Realtek 10/100 Mbps, etc.). This is the device driver for the Ethernet card.



      7. If the card is not listed, it is not compatible for use with Modbus in Automation1.

    1. Open INtime Device Manager (Start > All Programs > INtime > INtime Configuration). Then double click to open "INtime Device Manager".



    2. In the Windows devices tree, find your network adapter. Right-click your adapter and select "Pass to INtime using MSI"



    3. Click "File" and then "Save the Configuration". The card will now be listed under the INtime devices tree.



    4. Close INtime Device Manager and restart the PC

    1. Open INtime Node Management (Start > All Programs > INtime > INtime Configuration). Then double click on "INtime Node Management".



    2. Select the "Network" tab



    3. Confirm that the "Configuration > Start Automatically" is configured as "Yes" to make sure the network stack is opened automatically.
    4. To add a new NIC configuration to the list, click the three small dots in the right corner of the "NIC Configuration > NIC list" field.



    5. Select "Add" to configure the NIC



      1. Use the "Type" dropdown to configure the corresponding device driver (see Step 1 to determine the correct device driver).



      2. Configure the network card using a static network configuration. 
        1. Click "Add" to configure an IPv4 address. Automation1 currently supports IPv4 at the application layer.



        2. Use the dialog to configure the IPv4 Address and Net Mask.



        3. Click "OK" to apply the new IP networking configuration.
        4. Click "Save" to save the networking configuration
        5. Close INtime Node Management and restart the PC

    6. (Optional) Ping the WAGO under real-time control to verify communication
      1. Open Automation1 Studio. Connect and Start the controller.
      2. Open RT Application Loader (Start > All Programs > INtime > RT Application Loader)
      3. Navigate one level up to the network7 folder





      4. Select ping.rta in the network7 folder and enter the IP address of the WAGO in the Arguments field



      5. Click Open. A command prompt window will open and ping the IP address of the WAGO. This will look like:



      6. Use CTRL-C to stop the ping operation.
    1. Open Automation1 Studio
    2. Navigate to the Develop workspace



    3. On the Variables & I/O tab, select Industrial Ethernet



    4. Click Edit and select Yes to the prompt that appears about resetting the controller.



    5. Create an Industrial Ethernet connection

    6. Enter the connection details


      1. Name: The name of the connection. This name is informational only and is used to differentiate between Modbus Client connections within Automation1.
      2. Protocol: Modbus Client connection as the WAGO will act as the Modbus Server (slave device) in this example.
      3. ID: The Unit ID of the Modbus Client being connected to. This value is used by the Modbus protocol to differentiate between multiple Modbus Clients operating at the same IP address.
      4. IP Address: The IP address of the Modbus Client being connected to.
      5. Port: The port of the Modbus Client being connected to. The TCP/IP stack of Modbus connects over port 502.

    7. Click Add to add the connection

    1. Expand the new connection.



    2. On the WAGO, the I/O modules map to the Modbus registers as follows:
      1. OutputBits = Digital outputs
      2. InputBits = Digital inputs
      3. InputWords = Analog inputs
      4. OutputWords = Analog outputs
    3. Recall that this particular WAGO has the following modules, in order:
      1. WAGO 750-459 - 4 channel analog input module
      2. WAGO 750-402 - 4 channel digital input module
      3. (x3) WAGO 750-504 - 4 channel digital output module 
      4. WAGO 750-459 - 4 channel analog input module 
    4. To map the Analog Inputs, add an Input Words connection for each Analog Input available (4 in this example). Each Analog Input takes 16 bits. The WAGO unit automatically applies byte offsets so everything can be specified from byte 0.



    5. Alternatively, changing the Count to 4 will specify an array starting at byte 0 instead of separate variables:



    6. Add the Digital Inputs as InputBits and the Digital Outputs as OutputBits respectively. Each digital input or output takes 1 bit.



    7. Click Save to apply the configuration.
    1. Create a new AeroScript program in the Develop tab of Automation1 Studio.
    2. The Modbus I/O can be accessed using the following AeroScript syntax:
      1. $<variableName>
      2. $<variableName>[bit]
    3. For example, using the WAGO 750-842 in this example:



    4. This example sets the second Digital Output on the first Digital Output module to 1, then reads the value of the first Digital Input on the Digital Input module. I have wired this output and input together so the AeroScript variables should update accordingly, as shown below:

Error rendering macro 'contentbylabel'

parameters should not be empty