Rockwell Automation EtherNet/IP Original Instructions

Rockwell Automation EtherNet/IP Original Instructions

Application Technique

Original Instructions

EtherNet/IP Socket Interface

Summary of Changes

This publication contains the following new or updated information. This list includes substantive updates only and is not intended to reflect all changes.

Topic

Page

Added ControlLogix® 5580 controllers, GuardLogix® 5580 controllers,

CompactLogix™ 5380 controllers, Compact GuardLogix 5380 controllers, Throughout

Compact GuardLogix 5370 controllers, CompactLogix 5480 controllers,

Added Disable the Socket Object With a MSG Instruction.

18

2

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5

Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

 

Chapter 1

 

Socket Interface Architecture

Socket Interface Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

. 8

 

Number and Type of Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

8

 

Typical Sequence of Transactions for a TCP Client . . . . . . . . . .

10

 

Typical Sequence of Transactions for a TCP Server. . . . . . . . . . .

11

 

Typical Sequence of Transactions for UDP without

 

 

OpenConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

12

 

Typical Sequence of Transactions for UDP with

 

 

OpenConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

13

 

Communicate with the Socket Object Via a MSG Instruction . . . .

14

 

Service Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

 

MSG Instruction Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

16

 

Socket Instance Timeouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

17

 

Disable the Socket Object With a MSG Instruction . . . . . . . . . . . . . .

18

 

Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

 

TCP Connection Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

20

 

ControlLogix Enhanced Redundancy . . . . . . . . . . . . . . . . . . . . . . .

20

 

EtherNet/IP Module Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

21

 

Change Controller Mode between Run and Program . . . . . . . . .

22

 

Application Messages and TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

22

 

Application Messages and Inhibited Modules . . . . . . . . . . . . . . . .

23

 

Partial Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

23

 

Partial Writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

24

 

Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

25

 

Chapter 2

 

Socket Object Services

Socket Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

28

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

 

Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

29

 

OpenConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

30

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

 

Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

31

 

AcceptConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

32

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33

 

Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

33

 

ReadSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

3

Table of Contents

 

 

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

34

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

35

 

WriteSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

36

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

37

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

37

 

DeleteSocket. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

 

Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

38

 

DeleteAllSockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

 

Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

39

 

ClearLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

40

 

JoinMulticastAddress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

41

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42

 

DropMulticastAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42

 

MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

42

 

MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

43

 

MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

43

 

Chapter 3

 

Socket Attributes

Access Socket Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

45

 

Socket Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

46

 

Socket Instance Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

47

 

Chapter 4

 

Troubleshoot Socket Applications

Diagnostic Webpages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

49

 

Debugging Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

50

 

Error Codes for Socket Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

51

 

Knowledgebase Articles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

52

 

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

53

4

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Preface

Additional Resources

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.

These documents contain additional information concerning related products from Rockwell Automation.

Resource

Description

 

 

Ethernet Design Considerations Reference Manual,

Provides a general description of the EtherNet/IP protocol

publication ENET-RM002

and how to use an EtherNet/IP network.

 

 

Embedded Switch Technology Reference Architectures

Provides design recommendations for connecting device-

Reference Manual, publication ENET-RM003

level topologies to larger, switch networks comprised of

 

Layer 2 access switches.

 

 

EtherNet/IP Network Devices User Manual, publication

Describes how you can use EtherNet/IP communication

ENET-UM006

modules with your Logix 5000 controller and

 

communicate with various devices on the Ethernet

 

network.

 

 

Industrial Automation Wiring and Grounding

Provides general guidelines for installing a Rockwell

Guidelines, publication 1770-4.1

Automation industrial system.

 

 

Product Certifications website rok.auto/certifications.

Provides declarations of conformity, certificates, and

 

other certification details.

 

 

You can view or download publications at rok.auto/literature.

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

5

Preface

Notes:

6

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Chapter 1

Socket Interface Architecture

Topic

Page

 

 

Socket Interface Architecture

8

 

 

Communicate with the Socket Object Via a MSG Instruction

14

 

 

Service Timeouts

16

 

 

MSG Instruction Timeouts

16

 

 

Socket Instance Timeouts

17

 

 

Disable the Socket Object With a MSG Instruction

18

 

 

Programming Considerations

20

 

 

Performance Considerations

25

 

 

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 2020

7

Chapter 1 Socket 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

1756-EWEB EtherNet/IP web server module

GuardLogix 5580 controllers

1768-EWEB EtherNet/IP web server module

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

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.

8

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface Architecture

Chapter 1

 

 

These options are available for UDP and TCP send and receive services.

Type

Communication

Send (Write)

Receive (Read)

 

 

 

 

UDP

Unicast

Yes

Yes

 

 

 

 

 

Multicast

Yes

Yes

 

 

 

 

 

Broadcast

Yes

Yes

 

 

 

 

TCP

Unicast

Yes

Yes

 

 

 

 

 

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 Service

Socket Instance

Page

 

 

 

Socket Create

Server or client

28

 

 

 

OpenConnection

Client

30

 

 

 

AcceptConnection

• If you issue an AcceptConnection service, the instance is a listen type.

32

 

• If the AcceptConnection service returns an instance as a result of an

 

 

incoming connection request, the socket instance is a server type.

 

 

 

 

ReadSocket

Server or client

34

 

 

 

WriteSocket

Server or client

36

 

 

 

DeleteSocket

Server or client

38

 

 

 

DeleteAllSockets

Server or client

39

 

 

 

ClearLog

Server or client

40

 

 

 

JoinMulticastAddress

Server or client

41

 

 

 

DropMulticastAddress

Server or client

42

 

 

 

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 2020

9

Chapter 1 Socket Interface Architecture

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.

Controller

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

EtherNet/IP Module

Device

192.168.1.10

192.168.1.11

Open TCP

Connection

Data = abc

The response is returned to the controller as soon as the data is sent.

Data = xyz

Accept Connection

Receive Data

Send Data

10

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface Architecture

Chapter 1

 

 

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.

 

 

 

Controller

EtherNet/IP Module

Device

 

 

 

192.168.1.10

 

192.168.1.11

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Create Socket

 

 

 

 

 

 

 

 

Port = 49100

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Create Socket Response

 

 

 

 

 

 

 

 

Instance = 102

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

AcceptConnection

 

 

 

 

Open Connection

 

Open TCP Connection

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Port=49100

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Send Data

 

 

 

 

 

AcceptConnection Response

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Data = abc

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Read

 

 

 

 

 

Read Response

Data = abc

Write

Data = xyz

Data = xyz

Receive Data

Write Response

The response is returned to the controller as soon as the data is sent.

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

11

Chapter 1 Socket Interface Architecture

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.

Controller

Create Socket

Port=49100

Create Socket Response

Instance = 102

Write 192.168.1.11?Port=49200 Data = abc

Write Response

Read

Read Response 192.168.1.11?Port=49200 Data = xyz

EtherNet/IP Module

Device

192.168.1.10

192.168.1.11

Data = abc

The response is returned to the controller as soon as the data is sent.

Data = xyz

Receive Data from Port 49200

Send Data to 192.168.1.10, Port 49100

12

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface Architecture

Chapter 1

 

 

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.

Controller

Create Socket

Port=49100

Create Socket Response

Instance = 102

Open Connection 192.168.1.11?Port=49200

Open Connection Response

Write

Data = abc

Write Response

Read

Read Response 192.168.1.11?Port=49200 Data = xyz

EtherNet/IP Module

Device

192.168.1.10

192.168.1.11

Data = abc

The response is returned to the controller as soon as the data is sent.

Data = xyz

Receive Data from Port 49200

Send Data To

192.168.1.10, Port 49100

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

13

Chapter 1 Socket 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 Table 1.

Table 1 - Configuration Tab

Field

Description

 

 

Message Type

Choose CIP Generic.

 

 

Service Type

Choose a socket service type. The software automatically completes the Service Code and Class

 

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.

 

 

Service Code

Type the unique service code that corresponds to the socket service you chose in the Service Type

 

field.

 

 

Class

Type 342 (hexadecimal) for the socket object.

 

 

Instance

Type one of these values:

 

• 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.

 

 

Attribute

Type an attribute value only when getting or setting an attribute, but not when using other

 

services.

 

 

Source Element

Choose the tag that contains the request parameters for the socket service. To define the request

 

parameters, create a user-defined data type for the tag.

 

 

Source Length

Enter the length of the source element.

 

 

Destination

Choose the tag that contains the response data that is returned by the socket service. To define

Element

the response data, create a user-defined data type for the tag.

 

 

14

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface Architecture

Chapter 1

 

 

On the Communication tab, configure the parameters that are described in

Table 2.

IMPORTANT If you are using the front Ethernet port on a controller, you must use unconnected MSG instructions.

Table 2 - Communication Tab

Field

Description

 

 

Path

Enter the communication path to the EtherNet/IP module. The module must be accessed via

 

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’.

 

 

Large Connection

• When using the controller’s built in Ethernet port, large messages are supported by

 

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 Table 3.

 

 

The maximum amount of data you can send or receive depends on how you configure the MSG instruction, as shown in Table 3. The size of the data excludes the parameters in the ReadSocket and WriteSocket services.

Table 3 - Maximum Packet Sizes

Service

Unconnected Size

Standard Connection Size

Large Connection Size

 

 

 

 

ReadSocket

484 bytes

484 bytes

3984 bytes

 

 

 

 

WriteSocket

462 bytes

472 bytes

3972 bytes

 

 

 

 

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

15

Chapter 1 Socket Interface Architecture

Service Timeouts

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.

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 for the content of the response.

IMPORTANT Make the value of the service timeout parameter is shorter than the MSG instruction timeout. Otherwise, application data could be lost.

MSG Instruction Timeouts

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.

 

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.

16

Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

 

Socket Interface Architecture Chapter 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 2020

17

Loading...
+ 39 hidden pages