Project Conversion on the Example of EtherNet/IP

Initial state:
In this example, an e!COCKPIT project consisting of a PFC200 (750-8212) and a coupler (750-363) connected via EtherNet/IP is converted. An analog input module, a digital input module and a digital output module are plugged into the coupler; this yields an input data size of six bytes and an output data size of one byte. Variables corresponding to these data sizes have been created in the lower area of the Data Point Configurator. In the fieldbus configurator, the variables have been mapped to data points.
Important: A global variable list has been created in e!COCKPIT for the input/output data so the data will be retained in CODESYS throughout the update (Program Structure > right-click on “Application” > “Global Variable List”).

EtherNet/IP Project in e!COCKPIT
EtherNet/IP Project in e!COCKPIT

In brief:
In the following description, you perform the following steps in CODESYS: You update the device and create an Ethernet fieldbus under the device. You attach an EtherNet/IP scanner to it and the EtherNet/IP device below it. You adjust the EtherNet/IP connection and the length of the input/output data. Then you assign the address for each variable according to the hardware, and you can continue using your project.

  1. First delete the slave device (in this case: 750-363). It contains no data you will need.
  2. Right-click on the PFC200 and select Update Device ....
  3. Select your device (in this case: 750-8212) and click [Update Device].
  4. EtherNet/IP is removed from the tree. However, the variables you saved globally in e!COCKPIT are still available.
  5. Global Variables
  6. Now recreate the master and the slave. To do so, right-click on the PFC200 and select Insert Device ....
  7. Leave the dialog open for the next three steps and click [Insert Device] to insert the “Ethernet” fieldbus, as well as the master and the slave inserted below it:
    - First select the “Ethernet” fieldbus in the dialog.
    - Click on the new “Ethernet” element in the device tree and select the “EtherNet/IP Scanner” in the dialog under “EtherNet/IP.”
    - Click the new “EtherNet_IP_Scanner (EtherNet/IP Scanner)” element in the device tree and select the EtherNet/IP device 750-363 in the dialog under “EtherNet/IP Remote Adapter.”
    If you do not see the EtherNet/IP device in the list of selections, then you must first install the corresponding device description; see Installing WAGO Device Descriptions separately.
  8. This procedure creates the following structure in the device tree:
  9. EtherNet/IP Scanner and Adapter
  10. Double-click the EtherNet/IP adapter to make further settings:
  11. To enter the IP address of the device, open the “General” tab.
  12. To adjust the EtherNet/IP connection, open the “Connections” tab.
  13. Double-click on the connection that was automatically created before and enter the data length of your input/output data:
    • Scanner to target (output) = data length of the output modules (in this case: one byte)
    • Target to scanner (input) = data length of the input modules (in this case: six bytes)
  14. Entering the Input/Output Data Size of the Connection
  15. Click [OK] to confirm.
  16. Under “EtherNet/IP I/O Mapping,“ you can now see the input/output variables that have been created with the required size. No variables for the respective input/output data of the I/O modules are assigned here yet. You will perform the mapping in what follows.
  17. Input/Output Variables That Have Been Created
  18. First take a look at your hardware configuration to see which I/O module is the first I/O module to be addressed at the node and what data length it occupies. The representation of the node in WAGO I/O-CHECK can be helpful for this purpose.
  19. Representation of the Node in WAGO I/O-CHECK
  20. Switch to the global variables (cf. item 3).
  21. Click on a variable and press [Shift] + [F2]. This opens the variable declaration dialog.
  22. Now enter the addresses for the input/output variables of the I/O modules in order according to your hardware structure:
    In this example:
    • Analog input starting from byte 1 – address %IB1 → occupies two bytes
    • Analog output starting from byte 3 – address %IB3 → occupies two bytes
    • Digital input starting from byte 5 – address %IB5 → occupies one byte
    • Status byte starting from byte 6 – address %IB6 → occupies one byte
    • Digital output starting from byte 0 – address %QB0 → occupies one byte
  23. Hardware Addressing
  24. Represent your hardware in this way.
  1. The full scope of the program can then be used.