How to Connect to CODESYS using a Remote I/O and an HMI
This tutorial will demonstrate how to connect an iR-ETN40R Remote I/O and a cMT device using CODESYS while communicating via Modbus.
Software Required
Hardware Required
- cMT3152Xv2 – Other cMT Devices can be used.
Network Design
ETHERNET CONFIGURATION
LAN1:CODESYS to Switch
LAN2: cMT Device to Switch
iR-ETN40R to Switch
PC Application to Switch
Remote I/O Configuration (iR-ETN40R)
Launch EasyRemote IO and click [Scan] to find the iR-ETN40R’s IP settings. Then click [OK] to open EasyRemote IO’s main menu.
Go to [Online] >> [Start Monitoring] to go online with the iR-ETN40R.
Go to [File] >> [Export PLCopenXML] to export the xml file to be used in CODESYS.
CODESYS Ethernet and Modbus Configuration
Launch CODESYS and add an Ethernet Device. Right click on [Device] and click [Add Device]. Click the [+] on Fieldbuses. Click the [+] on Ethernet Adapter. Check [Display all versions]. Select [Ethernet 3.5.10.0]. Click [Add Device].
Enter the CODESYS IP address, Subnet Mask and Gateway.
Right click on [Ethernet] and click [Add Device]. Click [+] Modbus. Click [+] Modbus TCP Master. Check off [Display all versions]. Select [Modbus TCP Master 3.5.10.0]. Click [Add Device].
Select the [Modbus TCP Master] device. Click on [Project] and click [Import PLCopenXML]. The iR-ETN40R’s Modbus TCP Slave device and IP address is populated.
Select the Device.
The Modbus TCP Slave device populates.
CODESYS Online
To go online in CODESYS go to [Online] >> [Login]
CODESYS has established Modbus connection and is now online and displaying in RUN mode.
Sample Project
The project shown above was designed for the specific hardware mentioned at the beginning of the tutorial and is intended to provide you guidance when programming your unit. If you are using models other than the ones specified in this sample project, similar steps can be duplicated within your own project.
Download CODESYS Sample Project
Download EasyRemote IO Sample Project
Download EBPro Sample Project
Resources & Documentation
CODESYS Resources
- Connecting HMI & CODESYS to iR-ETN40R
- iR-ETN40R User Manual
- Activate CODESYS on cMT Models
- How to use Built-in CODESYS with later version of the CODESYS IDE
- CODESYS Quick Start Guide
- EasyRemote IO User Manual
- EBPro Quick Start Guide
More
See our Support Center for a complete list of Quick Start and Installation Guides