CP1L-EL - EM Modbus TCP Client Socket Services PDF
CP1L-EL - EM Modbus TCP Client Socket Services PDF
myKnowledge
Select by category Go
Search
Print E-mail
English
The CP1L-EL/EM-type CPU units are programmable controllers with built-in Ethernet ports enabling low-cost Ethernet connection and
designed to meet a wide variety of Ethernet connectivity needs in a wide range of fields.
The ability to send and receive messages means it is possible for a host computer to monitor the status of controllers and also receive
feedback from the controllers about any onsite abnormalities they detect. The controllers also feature socket communications capability
meaning it is possible to connect them with a wide variety of Ethernet-enabled control equipment.
This article explains how to setup a Modbus TCP communication using Function Blocks.
Functional Details
Modbus TCP
https://www.myomron.com/index.php?action=kb&article=1478 1/7
13/02/2020 myOMRON Europe: Services & Support
Configuration Example
Program flow Example
References
Functional Details
1. Ethernet
Socket Services
The socket services allows the CP1L-E* to send and receive data using either the UDP or TCP protocol.
2. Configuration
Auto-IP
- MAC ID based identification of a new controller in CX-P and will find all of the CP1L-EL/EM PLCs physically connected within the same
network with minimal IP configuration. Displays MAC ID and IP address for further configuration.
LNK/ACT
3. Programming
Independent FB Capacity
CP1L-EL/EM series PLCs have an extra 10K steps FB capacity on top of normal program memory.
The restrictions for the Send / receive Data Address is the H Area above 511.
For the use of the Function Blocks it is needed to change the Allocation in another Area e.g. HR000 or AR448 (see Table 1 for addresses
that can be used).
https://www.myomron.com/index.php?action=kb&article=1478 2/7
13/02/2020 myOMRON Europe: Services & Support
NOTE:
When closing a socket the socket cannot be used for 120 seconds. This is because the timeout (2MSL) is started while changing from state
TIME WAIT to CLOSED.
Modbus TCP
Modbus TCP/IP or Modbus TCP — this is a Modbus variant used for communications over TCP/IP networks, connecting over port 502. It
does not require a checksum calculation as lower layers already provide checksum protection.
Configuration Example
https://www.myomron.com/index.php?action=kb&article=1478 3/7
13/02/2020 myOMRON Europe: Services & Support
In case of single communication the socket is opened, data is send and/or received and then the socket is closed.
NOTE: When using single communication remember the socket closing timeout of 120 seconds (see TCP Status transition).
Continuous communication typically is used when the connected Modbus device (server) requires to be serviced periodically. Typically the
socket is opened once and data is send are received continuously. Socket is only closed in case of communication anomalies.
The Open Socket function Block opens a Socket (1 to 3) that is available and outputs the opened Socket number. The Socket Output can be
used as Socket Input variable for all of the other Function Blocks.
The ‘Done’ output of a Function Block can be used as a trigger for the next Function Block (Continue communication).
https://www.myomron.com/index.php?action=kb&article=1478 4/7
13/02/2020 myOMRON Europe: Services & Support
The individual Function Blocks and detailed information can be found in References.
Move the Function Block file together with the Function Block documentation file into the Library location. Then the Help is available.
https://www.myomron.com/index.php?action=kb&article=1478 5/7
13/02/2020 myOMRON Europe: Services & Support
References
https://www.myomron.com/index.php?action=kb&article=1478 6/7
13/02/2020 myOMRON Europe: Services & Support
Attachments
CP1L-E_Modbus_TCP_Client_Socket_Services_FBs.zip - Size: 744302
comment
Nice example!
Theo [2012-05-16]
Related Articles
Search Glossary
https://www.myomron.com/index.php?action=kb&article=1478 7/7