This publication contains the following new or updated information. This list includes substantive updates only and is not intended to reflect
all changes.
4Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Preface
This publication describes the socket interface that you can use to program
MSG instructions to communicate between a Logix 5000™ controller via an
EtherNet/IP™ module and Ethernet devices that do not support the
EtherNet/IP application protocol, such as barcode scanners, RFID readers, or
other standard Ethernet devices.
Additional Resources
These documents contain additional information concerning related products
from Rockwell Automation.
EtherNet/IP Network Devices User Manual, publication
ENET-UM006
Industrial Automation Wiring and Grounding
Guidelines, publication 1770-4.1
Product Certifications website rok.auto/ce rtificati ons
You can view or download publications at rok.auto/literature
Provides a general description of the EtherNet/IP protocol
and how to use an EtherNet/IP network.
Provides design recommendations for connecti ng devicelevel topologies to larger, switch networks comprised of
Layer 2 access switches.
Describes how you can use EtherNet/IP communication
modules with your Logix 5000 controller and
communicate with various devices on the Ethernet
network.
Provides general guidelines for installing a Rockwell
Automation industrial system.
.Provides declarations of conformity, certificates, and
other certification details.
.
Rockwell Automation Publication ENET-AT002D-EN-P - October 20205
Preface
Notes:
6Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface Architecture
Top icPag e
Socket Interface Architecture8
Communicate with the Socket Object Via a MSG Instruction14
Service Timeouts16
MSG Instruction Timeouts16
Socket Instance Timeouts17
Disable the Socket Object With a MSG Instruction18
Programming Considerations20
Performance Considerations25
Chapter 1
The socket interface lets a Logix 5000™ controller communicate via an
EtherNet/IP™ module with Ethernet devices that do not support the
EtherNet/IP application protocol. Such devices include barcode scanners,
RFID readers, or other standard Ethernet devices.
Socket services are available with these modules:
• ControlLogix® 5580 and GuardLogix® 5580 controllers,
• CompactLogix™ 5380 and Compact GuardLogix 5380 controllers
• CompactLogix 5370 and Compact GuardLogix 5370 controllers
• CompactLogix 5480 controllers
• 1756-EN2x, 1756-EN3TR, and 1756-EN4TR EtherNet/IP
communication modules
• 1756-EWEB and 1768-EWEB EtherNet/IP web server modules
IMPORTANT MicroLogix™ 1400 controllers also support socket capability, but the
information in this document does not apply to those products. For details
on those products, see the MicroLogix 1400 Programmable Controllers
Reference Manual, publication 1766-RM001D
.
Rockwell Automation Publication ENET-AT002D-EN-P - October 20207
Chapter 1Socket Interface Architecture
Before you use the socket interface, make sure that you are familiar with these
concepts:
• Basic TCP/IP, UDP, and socket programming concepts
• How to write socket programs in a programming language, such as C or
Visual Basic
• How to use diagnostic tools, such as a network sniffer
• The application protocols of the devices and applications with which
the Logix 5000 controller communicates
• How to write ladder logic or Structured Text for a Logix 5000 controller
Socket Interface Architecture
The socket interface is implemented via the socket object in the EtherNet/IP
module. Logix 5000 controller programs communicate with the socket object
via MSG instructions. MSG requests to the socket object are similar to socket
API calls in most computer operating systems. The socket object services let
you open connections, accept incoming connections, send data, and receive
data.
To communicate with another device, you must understand the application
protocol of the device. The EtherNet/IP module has no application protocol
knowledge. The module makes only the socket services available to programs
in Logix 5000 controllers.
Number and Type of Sockets
Number of supported socket instances:
32 Socket Instances 20 Socket Instances
• ControlLogix 5580 controllers
• GuardLogix 5580 controllers
• CompactLogix 5480 controllers
• CompactLogix 5380 controllers
• Compact GuardLogix 5380 controllers
• CompactLogix 5370 controllers
• Compact GuardLogix 5370 controllers
• 1756-EN2x EtherNet/IP communication modules
• 1756-EN3TR EtherNet/IP communication module
• 1756-EN4TR EtherNet/IP communication module
• 1756-EWEB EtherNet/IP web server module
• 1768-EWEB EtherNet/IP web server module
Each instance can be one of these types:
• UDP socket—Sends and receives UDP datagrams.
• TCP client socket—The Logix 5000 program initiates the connection.
• TCP server socket—Another device initiates the connection to the
Logix 5000 program.
• TCP listen socket—Listens on a specified port number for incoming
connections.
8Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface ArchitectureChapter 1
These options are available for UDP and TCP send and receive services.
TypeCommunicationSend (Write)Receive (Read)
UDPUnicastYesYes
MulticastYesYes
BroadcastYesYes
TCPUni cas tYesYes
Multicast——
Broadcast——
You must have a listen socket for each TCP port number that accepts
connections. Multiple TCP server sockets can share a listen socket if the
connections are made to the same port number.
You can partition the available socket instances between UDP and TCP
sockets in these ways:
• Use all instances for client TCP connections.
• Use one instance to listen for incoming TCP connections and then
accept the remaining connections from other devices.
• Perform both TCP client and server operations.
• Perform both TCP and UDP operations.
These socket services are available.
Socket ServiceSocket InstancePage
Socket CreateServer or client28
OpenConnectionClient30
AcceptConnection• If you issue an AcceptConnection service, the instance is a listen type.
• If the AcceptConnection service returns an instance as a result of an
incoming connection request, the socket instance is a server type.
ReadSocketServer or client34
WriteSocketServer or client36
DeleteSocketServer or client38
DeleteAllSocketsServer or client39
ClearLogServer or client40
JoinMulticastAddressServer or client41
DropMulticastAddressServer or client42
32
Once you open a connection on a client socket instance, you cannot use the
same socket instance to accept incoming connections. Similarly, if you accept
connections on a socket instance, you cannot then use the instance to open
outgoing connections. This behavior is consistent with standard socket API
behavior.
Rockwell Automation Publication ENET-AT002D-EN-P - October 20209
Chapter 1Socket Interface Architecture
Controller
EtherNet/IP Module
192.168.1.10
Device
192.168.1.11
Accept Connec tion
Receive Data
Send Data
Open TCP
Connection
Data = abc
Data = xyz
The response is returne d to the controller as
soon as the data is sent.
Create Socket
Create Socket Response
Instance = 102
OpenConnection
"192.168.1.11?Port=49200"
OpenConnection Response
Write Data = abc
Write Response
Read
Read Response Data = xyz
Typical Sequence of Transactions for a TCP Client
The following diagram shows a typical sequence of socket interface
transactions with the Logix 5000 controller that acts as a TCP client. Each
transaction between the Logix 5000 controller and the EtherNet/IP module is
a message (MSG) instruction.
This example shows the Logix 5000 controller sending data to a device, and
then the device sending a response. This sequence of transactions is typical.
Depending on the application protocol, the device could instead initiate
sending data to the Logix 5000 controller once the connection is open.
Also, each write transaction does not require an application response or
acknowledgment. The application protocol determines the exact sequence of
application transactions.
10Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface ArchitectureChapter 1
Controller
EtherNet/IP Module
192.168.1.10
Device
192.168.1.11
Open Connection
Send Data
Receive Data
Open TCP Connection
Port=49100
Data = abc
Data = xyz
The response is returned to the
controller as soon as the data is sent.
Create Socket
Port = 49100
Create Socket Response
Instance = 102
AcceptConnection
Writ e
Data = xyz
Write Response
Read
Read Response
Data = abc
AcceptConnection Response
Typical Sequence of Transactions for a TCP Server
The following diagram shows a typical sequence of socket interface
transactions with the Logix 5000 controller as a TCP server. Each transaction
between the Logix 5000 controller and EtherNet/IP module is a MSG
instruction.
The following is a typical sequence of transactions. The exact sequence of
sending and receiving data depends on the application protocol.
Rockwell Automation Publication ENET-AT002D-EN-P - October 202011
Chapter 1Socket Interface Architecture
Controller
EtherNet/IP Module
192.168.1.10
Device
192.168.1.11
Create Socket
Port=49100
Create Socket Response
Instance = 102
Writ e
192.168.1.11?Port=49200
Data = abc
Write Response
Read
Read Response
192.168.1.11?Port=49200
Data = xyz
Send Data to
192.168.1.10, Port 49100
Receive Data from Port 49200
Data = abc
Data = xyz
The response is returned to the controller as
soon as the data is sent.
Typical Sequence of Transactions for UDP without OpenConnection
The following diagram shows a typical sequence of socket interface
transactions for UDP communication without using the OpenConnection
service to specify the destination address. In this case, the Logix 5000
controller specifies the destination for each datagram and receives the address
from the sender along with each datagram it receives. Each transaction
between the Logix 5000 controller and the EtherNet/IP module is a MSG
instruction.
This example shows the Logix 5000 controller sending data to a device, and
then the device sending a response. This sequence of transactions is atypical.
Depending on the application protocol, the device could instead initiate
sending data to the Logix 5000 controller. Also, each Write transaction does
not require an application response or acknowledgment. The application
protocol determines the exact sequence of application transactions.
12Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface ArchitectureChapter 1
Controller
EtherNet/IP Module
192.168.1.10
Device
192.168.1.11
Create Socket
Port=49100
Create Socket Response
Instance = 102
Open Connection
192.168.1.11?Port=49200
Open Connection Response
Read
Read Response
192.168.1.11?Port=49200
Data = xyz
Writ e
Data = abc
Write Response
Data = abc
Data = xyz
The response is returned to the controll er as
soon as the data is sent.
Send Data To
192.168.1.10, Port 49100
Receive Data from Port 49200
Typical Sequence of Transactions for UDP with OpenConnection
The following diagram shows a typical sequence of socket interface
transactions for UDP communication when using the OpenConnection
service to specify the destination address. Each transaction between the Logix
5000 controller and the EtherNet/IP module is a MSG instruction.
The following is a typical sequence of transactions. The exact sequence of
sending and receiving data depends on the application protocol.
Rockwell Automation Publication ENET-AT002D-EN-P - October 202013
Chapter 1Socket Interface Architecture
Communicate with the
Socket Object Via a MSG
Instruction
In a Logix 5000 controller program, use a CIP™ Generic MSG instruction to
request socket services.
IMPORTANT The MSG instruction must be sent to the EtherNet/IP module via backplane.
On the Configuration tab, configure the parameters as described in Ta b l e 1
.
Table 1 - Configuration Tab
FieldDescription
Message TypeChoose CIP Generic.
Service TypeChoose a socket service type. The software automatically completes the Service Code and Class
Service CodeType the unique service code that corresponds to the socket service you chose in the Service Type
ClassType 342 (hexadecimal) for the socket object.
InstanceType one of these values:
AttributeType an attribute value only when getting or setting an attribute, but not when using other
Source Element Choose the tag that contains the request parameters for the socket service. To define the request
Source LengthEnter the length of the source element.
Destination
Element
fields.
Choose Get Attributes Single or Set Attributes Single when getting or setting a Socket Object
attribute. For more information, see Access Socket Attributes on page 45
field.
• 0 for Socket Create, Delete All Sockets, and ClearLog services
• Instance number that is returned by Socket Create for other services
Use a relay ladder instruction or Structured Text statement to move the returned instance
number from a Socket Create service into the .Instance member of a MSG instruction.
services.
parameters, create a user-defined data type for the tag.
Choose the tag that contains the response data that is returned by the socket service. To define
the response data, create a user-defined data type for the tag.
.
14Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface ArchitectureChapter 1
On the Communication tab, configure the parameters that are described in
Ta b l e 2
.
IMPORTANT If you are using the front Ethernet port on a controller, you must use
unconnected MSG instructions.
Table 2 - Communication Tab
FieldDescription
PathEnter the communication path to the EtherNet/IP module. The module must be accesse d via
Large Connection• When using the controller’s built in Ethernet port, large messages are supported by
the backplane; you cannot access the module via the Ethernet port.
• For all controllers and communication modules, the path is 1, x. Where x is the slot
number of the communication module, or the slot number of a ControlLogix 5580
controller if the front Ethernet port is used.
• For all supported CompactLogix controllers, the slot is 0.
• For all CompactLogix 5370, CompactLogix 5380, Compact GuardLogix 5380,
CompactLogix 5480, ControlLogix 5580, and GuardLogix 5580 controllers with version
28.11 or later, you can also use a path of ‘THIS’.
default (they are also unconnected messages).
• When using an Ethernet module through the backplane, the Connected checkbox and
the Large Connection checkbox must be selected to use large messages. A large
connection is only available with connected MSG instructions. For information about
how to use the Connected or Cache Connections options, refer to the Logix 5000
Controllers Messages Programming Manual, publication 1756-PM012
• IMPORTANT: To use controller memory efficiently, use large connections only for
ReadSocket or WriteSocket services that require more than the standard connection size,
as shown in Tab le 3.
.
The maximum amount of data you can send or receive depends on how you
configure the MSG instruction, as shown in Ta b l e 3
. The size of the data
excludes the parameters in the ReadSocket and WriteSocket services.
Rockwell Automation Publication ENET-AT002D-EN-P - October 202015
Chapter 1Socket Interface Architecture
If a MSG requests more than the maximum packet size (standard or large), the
module can return a failure status and the MSG instruction can set the .ER bit:
• For TCP sockets, if the application data is larger than the maximum size,
you can issue multiple ReadSocket or WriteSocket services to receive or
send the entire application message.
• For UDP sockets, the size of application data cannot exceed the
maximum sizes for the ReadSocket and WriteSocket services.
Service Timeouts
MSG Instruction Timeouts
You must specify a timeout parameter in milliseconds for any service that does
not always complete immediately, such as OpenConnection,
AcceptConnection, ReadSocket, and WriteSocket services. The timeout tells
the socket object the maximum amount of time to wait when attempting to
complete the service. While waiting for the service to complete, the MSG
instruction is enabled.
If the requested service does not complete before the timeout period expires,
the socket object returns a response to the service request. See the service
descriptions in Chapter 2
IMPORTANT Make the value of the service timeout parameter is shorter than the MSG
instruction timeout. Otherwise, application data could be lost.
The default MSG instruction timeout is 30 seconds. The maximum MSG
timeout is approximately 35 minutes. Specify the MSG instruction timeout by
setting the appropriate member of the MSG tag:
• If the MSG is unconnected, set the UnconnectedTimeout member.
• If the MSG is connected, set the ConnectionRate and
TimeoutMultiplier member.
for the content of the response.
The MSG timeout is determined by multiplying the ConnectionRate by the
TimeoutMultiplier. A TimeoutMultiplier of 0 corresponds to multiplier of 4,
1 corresponds to multiplier of 8, and so on.
16Rockwell Automation Publication ENET-AT002D-EN-P - October 2020
Socket Interface ArchitectureChapter 1
Socket Instance Timeouts
Each socket instance has an inactivity timeout with a default of 5 minutes. If a
socket instance receives no service requests for the amount of time that is
specified by the inactivity timeout, the socket instance is deleted. If you then
try to use the socket instance, the MSG instruction receives the error class or
instance not supported.
You can change the timeout by setting the inactivity time-out attribute via the
Set Attribute service. See Socket Instance Attributes on page 47
If you put the controller in Program mode and then back into Run mode
before existing socket instances time out, you can receive errors when the
program tries to create socket instances. Eventually the socket instances time
out and you can create more instances.
IMPORTANT Make sure that the inactivity timeout is longer than the longest interval
between socket operations. If the inactivity timeout is too short, socket
instances can time out and result in MSG instruction errors.
.
Rockwell Automation Publication ENET-AT002D-EN-P - October 202017
Loading...
+ 39 hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.