Sunteți pe pagina 1din 7

13/02/2020 myOMRON Europe: Services & Support

myKnowledge

Main > Product Type > Automation Systems > PLCs

Select by category Go
Search

Print E-mail
English

CP1L-EL/EM Modbus TCP Client Socket Services

CP1L-EL/EM Modbus TCP Client Socket Services

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

For detailed information see CP1L-EM/EL CPU Unit Manual (W516-E1).

1. Ethernet

Socket Services

The socket services allows the CP1L-E* to send and receive data using either the UDP or TCP protocol.

The CP1L-E* provides


- 3 user sockets in total for TCP/IP and UDP/IP (socket 1, socket 2 and socket 3)
- many new Auxiliary words/bits associated with sockets (A566 to A572). Also an “automatic clock adjustment bit” in there too.
- new Auxiliary words put into reserved areas of other CP1Ls so no addressing conflicts.
- size of received data accumulated in the reception buffer is now stored and a Data Received Flag has been added to simplify
programming.

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

- Valid Ethernet link and activity indicator

3. Programming

The CP1L-E* requires CX-Programmer Ver. 9.40 or higher (CX-One V4.25).

Independent FB Capacity

CP1L-EL/EM series PLCs have an extra 10K steps FB capacity on top of normal program memory.

Send/Receive Data Address

The following specifications can be used.

Table 1. Memory locations

Note: EM types 32 Kwords: D0 to D32767


EL types 10 Kwords: D0 to D9999 and D32000 to D32767

Function Block Memory Allocation

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

TCP Status Transitions

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

Program Flow Example (single or continue)

Function blocks can be used for single or continuous communication.

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

CP1L-EL/EM: TCP Active Open Socket Function Block

CP1L-EL/EM: Fn03 Read Register (Modbus/TCP) Function Block

CP1L-EL/EM: Fn04 Read Input Register (Modbus/TCP) Function Block

CP1L-EL/EM: Fn05 Force Single Coil (Modbus/TCP) Function Block

CP1L-EL/EM: Fn06 Write Register (Modbus/TCP) Function Block

https://www.myomron.com/index.php?action=kb&article=1478 6/7
13/02/2020 myOMRON Europe: Services & Support

CP1L-EL/EM: Close Socket Function Block

Attachments
CP1L-E_Modbus_TCP_Client_Socket_Services_FBs.zip - Size: 744302

Comments (View All Comments / Add Comment)

comment
Nice example!
Theo [2012-05-16]

Related Articles

No related articles found.


Created 2012-04-17
Modified 2013-11-21
Views 56046

Search Glossary

You are not logged in.

https://www.myomron.com/index.php?action=kb&article=1478 7/7

S-ar putea să vă placă și