EtherNet/IP Socket Interface Application Technique, ENET .

Transcription

Application TechniqueOriginal InstructionsEtherNet/IP Socket Interface

Summary of ChangesThis publication contains the following new or updated information. This list includes substantive updates only and is not intended to reflectall changes.TopicAdded ControlLogix 5580 controllers, GuardLogix 5580 controllers,CompactLogix 5380 controllers, Compact GuardLogix 5380 controllers,Compact GuardLogix 5370 controllers, CompactLogix 5480 controllers,Added Disable the Socket Object With a MSG Instruction.2PageThroughout18Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Table of ContentsPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5Additional Resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5Chapter 1Socket Interface ArchitectureSocket Interface Architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Number and Type of Sockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8Typical Sequence of Transactions for a TCP Client . . . . . . . . . . 10Typical Sequence of Transactions for a TCP Server. . . . . . . . . . . 11Typical Sequence of Transactions for UDP withoutOpenConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12Typical Sequence of Transactions for UDP withOpenConnection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13Communicate with the Socket Object Via a MSG Instruction . . . . 14Service Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16MSG Instruction Timeouts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16Socket Instance Timeouts. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17Disable the Socket Object With a MSG Instruction . . . . . . . . . . . . . . 18Programming Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20TCP Connection Loss . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20ControlLogix Enhanced Redundancy . . . . . . . . . . . . . . . . . . . . . . . 20EtherNet/IP Module Reset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Change Controller Mode between Run and Program . . . . . . . . . 22Application Messages and TCP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22Application Messages and Inhibited Modules . . . . . . . . . . . . . . . . 23Partial Reads . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Partial Writes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24Performance Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25Chapter 2Socket Object ServicesSocket Create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .OpenConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .AcceptConnection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ReadSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Rockwell Automation Publication ENET-AT002D-EN-P - October 2020282829292930303131313232323333343

Table of ContentsMSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .WriteSocket . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DeleteSocket. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DeleteAllSockets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .ClearLog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .JoinMulticastAddress. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .DropMulticastAddress . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Source Length . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .MSG Destination Element . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242424343Chapter 3Socket AttributesAccess Socket Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45Socket Class Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46Socket Instance Attributes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47Chapter 4Troubleshoot Socket Applications Diagnostic Webpages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49Debugging Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50Error Codes for Socket Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51Knowledgebase Articles. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 534Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

PrefaceThis publication describes the socket interface that you can use to programMSG instructions to communicate between a Logix 5000 controller via anEtherNet/IP module and Ethernet devices that do not support theEtherNet/IP application protocol, such as barcode scanners, RFID readers, orother standard Ethernet devices.Additional ResourcesThese documents contain additional information concerning related productsfrom Rockwell Automation.ResourceDescriptionEthernet Design Considerations Reference Manual,publication ENET-RM002Provides a general description of the EtherNet/IP protocoland how to use an EtherNet/IP network.Embedded Switch Technology Reference ArchitecturesReference Manual, publication ENET-RM003Provides design recommendations for connecting devicelevel topologies to larger, switch networks comprised ofLayer 2 access switches.EtherNet/IP Network Devices User Manual, publicationENET-UM006Describes how you can use EtherNet/IP communicationmodules with your Logix 5000 controller andcommunicate with various devices on the Ethernetnetwork.Industrial Automation Wiring and GroundingGuidelines, publication 1770-4.1Provides general guidelines for installing a RockwellAutomation industrial system.Product Certifications website rok.auto/certifications.Provides declarations of conformity, certificates, andother certification details.You can view or download publications at rok.auto/literature.Rockwell Automation Publication ENET-AT002D-EN-P - October 20205

PrefaceNotes:6Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Chapter1Socket Interface ArchitectureTopicPageSocket Interface Architecture8Communicate with the Socket Object Via a MSG Instruction14Service Timeouts16MSG Instruction Timeouts16Socket Instance Timeouts17Disable the Socket Object With a MSG Instruction18Programming Considerations20Performance Considerations25The socket interface lets a Logix 5000 controller communicate via anEtherNet/IP module with Ethernet devices that do not support theEtherNet/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/IPcommunication modules 1756-EWEB and 1768-EWEB EtherNet/IP web server modulesIMPORTANTMicroLogix 1400 controllers also support socket capability, but theinformation in this document does not apply to those products. For detailson those products, see the MicroLogix 1400 Programmable ControllersReference Manual, publication 1766-RM001D.Rockwell Automation Publication ENET-AT002D-EN-P - October 20207

Chapter 1Socket Interface ArchitectureBefore you use the socket interface, make sure that you are familiar with theseconcepts: Basic TCP/IP, UDP, and socket programming concepts How to write socket programs in a programming language, such as C orVisual Basic How to use diagnostic tools, such as a network sniffer The application protocols of the devices and applications with whichthe Logix 5000 controller communicates How to write ladder logic or Structured Text for a Logix 5000 controllerSocket Interface ArchitectureThe socket interface is implemented via the socket object in the EtherNet/IPmodule. Logix 5000 controller programs communicate with the socket objectvia MSG instructions. MSG requests to the socket object are similar to socketAPI calls in most computer operating systems. The socket object services letyou open connections, accept incoming connections, send data, and receivedata.To communicate with another device, you must understand the applicationprotocol of the device. The EtherNet/IP module has no application protocolknowledge. The module makes only the socket services available to programsin Logix 5000 controllers.Number and Type of SocketsNumber of supported socket instances:32 Socket Instances20 Socket Instances 1756-EWEB EtherNet/IP web server module 1768-EWEB EtherNet/IP web server moduleControlLogix 5580 controllersGuardLogix 5580 controllersCompactLogix 5480 controllersCompactLogix 5380 controllersCompact GuardLogix 5380 controllersCompactLogix 5370 controllersCompact GuardLogix 5370 controllers1756-EN2x EtherNet/IP communication modules1756-EN3TR EtherNet/IP communication module1756-EN4TR EtherNet/IP communication moduleEach 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 theLogix 5000 program. TCP listen socket—Listens on a specified port number for incomingconnections.8Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface ArchitectureChapter 1These options are available for UDP and TCP send and receive services.TypeCommunicationSend (Write)Receive u must have a listen socket for each TCP port number that acceptsconnections. Multiple TCP server sockets can share a listen socket if theconnections are made to the same port number.You can partition the available socket instances between UDP and TCPsockets in these ways: Use all instances for client TCP connections. Use one instance to listen for incoming TCP connections and thenaccept 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 InstancePageSocket CreateServer or client28OpenConnectionClient30AcceptConnection If you issue an AcceptConnection service, the instance is a listen type. If the AcceptConnection service returns an instance as a result of anincoming connection request, the socket instance is a server type.32ReadSocketServer or client34WriteSocketServer or client36DeleteSocketServer or client38DeleteAllSocketsServer or client39ClearLogServer or client40JoinMulticastAddressServer or client41DropMulticastAddressServer or client42Once you open a connection on a client socket instance, you cannot use thesame socket instance to accept incoming connections. Similarly, if you acceptconnections on a socket instance, you cannot then use the instance to openoutgoing connections. This behavior is consistent with standard socket APIbehavior.Rockwell Automation Publication ENET-AT002D-EN-P - October 20209

Chapter 1Socket Interface ArchitectureTypical Sequence of Transactions for a TCP ClientThe following diagram shows a typical sequence of socket interfacetransactions with the Logix 5000 controller that acts as a TCP client. Eachtransaction between the Logix 5000 controller and the EtherNet/IP module isa message (MSG) instruction.This example shows the Logix 5000 controller sending data to a device, andthen the device sending a response. This sequence of transactions is typical.Depending on the application protocol, the device could instead initiatesending data to the Logix 5000 controller once the connection is open.Also, each write transaction does not require an application response oracknowledgment. The application protocol determines the exact sequence ofapplication transactions.EtherNet/IP te SocketCreate Socket ResponseInstance 102OpenConnection"192.168.1.11?Port 49200"Open TCPConnectionAccept ConnectionOpenConnection ResponseWrite Data abcData abcReceive DataWrite ResponseThe response is returned to the controller assoon as the data is sent.ReadData xyzRead Response Data xyz10Rockwell Automation Publication ENET-AT002D-EN-P - October 2020Send Data

Socket Interface ArchitectureChapter 1Typical Sequence of Transactions for a TCP ServerThe following diagram shows a typical sequence of socket interfacetransactions with the Logix 5000 controller as a TCP server. Each transactionbetween the Logix 5000 controller and EtherNet/IP module is a MSGinstruction.The following is a typical sequence of transactions. The exact sequence ofsending and receiving data depends on the application protocol.EtherNet/IP te SocketPort 49100Create Socket ResponseInstance 102AcceptConnectionOpen TCP ConnectionPort 49100AcceptConnection ResponseData abcOpen ConnectionSend DataReadRead ResponseData abcWriteData xyzData xyzReceive DataWrite ResponseThe response is returned to thecontroller as soon as the data is sent.Rockwell Automation Publication ENET-AT002D-EN-P - October 202011

Chapter 1Socket Interface ArchitectureTypical Sequence of Transactions for UDP without OpenConnectionThe following diagram shows a typical sequence of socket interfacetransactions for UDP communication without using the OpenConnectionservice to specify the destination address. In this case, the Logix 5000controller specifies the destination for each datagram and receives the addressfrom the sender along with each datagram it receives. Each transactionbetween the Logix 5000 controller and the EtherNet/IP module is a MSGinstruction.This example shows the Logix 5000 controller sending data to a device, andthen the device sending a response. This sequence of transactions is atypical.Depending on the application protocol, the device could instead initiatesending data to the Logix 5000 controller. Also, each Write transaction doesnot require an application response or acknowledgment. The applicationprotocol determines the exact sequence of application transactions.EtherNet/IP te SocketPort 49100Create Socket ResponseInstance 102Write192.168.1.11?Port 49200Data abcData abcReceive Data from Port 49200The response is returned to the controller assoon as the data is sent.Write ResponseReadData xyzRead Response192.168.1.11?Port 49200Data xyz12Rockwell Automation Publication ENET-AT002D-EN-P - October 2020Send Data to192.168.1.10, Port 49100

Socket Interface ArchitectureChapter 1Typical Sequence of Transactions for UDP with OpenConnectionThe following diagram shows a typical sequence of socket interfacetransactions for UDP communication when using the OpenConnectionservice to specify the destination address. Each transaction between the Logix5000 controller and the EtherNet/IP module is a MSG instruction.The following is a typical sequence of transactions. The exact sequence ofsending and receiving data depends on the application protocol.EtherNet/IP te SocketPort 49100Create Socket ResponseInstance 102Open Connection192.168.1.11?Port 49200Open Connection ResponseWriteData abcData abcWrite ResponseThe response is returned to the controller assoon as the data is sent.ReadReceive Data from Port 49200Send Data To192.168.1.10, Port 49100Data xyzRead Response192.168.1.11?Port 49200Data xyzRockwell Automation Publication ENET-AT002D-EN-P - October 202013

Chapter 1Socket Interface ArchitectureCommunicate with theSocket Object Via a MSGInstructionIn a Logix 5000 controller program, use a CIP Generic MSG instruction torequest socket services.IMPORTANTThe 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 TabFieldDescriptionMessage TypeChoose CIP Generic.Service TypeChoose a socket service type. The software automatically completes the Service Code and Classfields.Choose Get Attributes Single or Set Attributes Single when getting or setting a Socket Objectattribute. For more information, see Access Socket Attributes on page 45.Service CodeType the unique service code that corresponds to the socket service you chose in the Service Typefield.ClassType 342 (hexadecimal) for the socket object.InstanceType one of these values: 0 for Socket Create, Delete All Sockets, and ClearLog services Instance number that is returned by Socket Create for other servicesUse a relay ladder instruction or Structured Text statement to move the returned instancenumber from a Socket Create service into the .Instance member of a MSG instruction.AttributeType an attribute value only when getting or setting an attribute, but not when using otherservices.Source Element Choose the tag that contains the request parameters for the socket service. To define the requestparameters, create a user-defined data type for the tag.14Source LengthEnter the length of the source element.DestinationElementChoose the tag that contains the response data that is returned by the socket service. To definethe response data, create a user-defined data type for the tag.Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface ArchitectureChapter 1On the Communication tab, configure the parameters that are described inTable 2.IMPORTANTIf you are using the front Ethernet port on a controller, you must useunconnected MSG instructions.Table 2 - Communication TabFieldDescriptionPathEnter the communication path to the EtherNet/IP module. The module must be accessed viathe 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 slotnumber of the communication module, or the slot number of a ControlLogix 5580controller 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 version28.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 bydefault (they are also unconnected messages). When using an Ethernet module through the backplane, the Connected checkbox andthe Large Connection checkbox must be selected to use large messages. A largeconnection is only available with connected MSG instructions. For information abouthow to use the Connected or Cache Connections options, refer to the Logix 5000Controllers Messages Programming Manual, publication 1756-PM012. IMPORTANT: To use controller memory efficiently, use large connections only forReadSocket 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 youconfigure the MSG instruction, as shown in Table 3. The size of the dataexcludes the parameters in the ReadSocket and WriteSocket services.Table 3 - Maximum Packet SizesServiceUnconnected SizeStandard Connection SizeLarge Connection SizeReadSocket484 bytes484 bytes3984 bytesWriteSocket462 bytes472 bytes3972 bytesRockwell Automation Publication ENET-AT002D-EN-P - October 202015

Chapter 1Socket Interface ArchitectureIf a MSG requests more than the maximum packet size (standard or large), themodule 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 orsend the entire application message. For UDP sockets, the size of application data cannot exceed themaximum sizes for the ReadSocket and WriteSocket services.Service TimeoutsYou must specify a timeout parameter in milliseconds for any service that doesnot always complete immediately, such as OpenConnection,AcceptConnection, ReadSocket, and WriteSocket services. The timeout tellsthe socket object the maximum amount of time to wait when attempting tocomplete the service. While waiting for the service to complete, the MSGinstruction 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 servicedescriptions in Chapter 2 for the content of the response.IMPORTANTMSG Instruction TimeoutsMake the value of the service timeout parameter is shorter than the MSGinstruction timeout. Otherwise, application data could be lost.The default MSG instruction timeout is 30 seconds. The maximum MSGtimeout is approximately 35 minutes. Specify the MSG instruction timeout bysetting the appropriate member of the MSG tag: If the MSG is unconnected, set the UnconnectedTimeout member. If the MSG is connected, set the ConnectionRate andTimeoutMultiplier member.The MSG timeout is determined by multiplying the ConnectionRate by theTimeoutMultiplier. 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 ArchitectureSocket Instance TimeoutsChapter 1Each socket instance has an inactivity timeout with a default of 5 minutes. If asocket instance receives no service requests for the amount of time that isspecified by the inactivity timeout, the socket instance is deleted. If you thentry to use the socket instance, the MSG instruction receives the error class orinstance not supported.You can change the timeout by setting the inactivity time-out attribute via theSet Attribute service. See Socket Instance Attributes on page 47.If you put the controller in Program mode and then back into Run modebefore existing socket instances time out, you can receive errors when theprogram tries to create socket instances. Eventually the socket instances timeout and you can create more instances.IMPORTANTMake sure that the inactivity timeout is longer than the longest intervalbetween socket operations. If the inactivity timeout is too short, socketinstances can time out and result in MSG instruction errors.Rockwell Automation Publication ENET-AT002D-EN-P - October 202017

Chapter 1Socket Interface ArchitectureDisable the Socket ObjectWith a MSG InstructionThe socket object is enabled by default. You can use a CIP Generic MSGinstruction to disable the socket object.After you disable the socket object: All object-specific services and all instance attributes are unavailable forwriting and reading. The Object Enable attribute is read-only. TCP/IP Socket Object is disabled, and a factory reset is needed toenable it again. IMPORTANTThe 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 4 - Configuration TabFieldDescriptionMessage TypeChoose CIP Generic.Service TypeChoose Set Attributes Single.Service Code10 (hex)Class342 (hex)Instance0Attribute9 (hex)Source Element Choose the SINT tag that contains the value of zero.18Source Length1DestinationElementNot required.Rockwell Automation Publication ENET-AT002D-EN-P - October 2020

Socket Interface ArchitectureChapter 1On the Communication tab, configure the parameters that are described inTable 2.IMPORTANTIf you are using the front Ethernet port on a controller, you must useunconnected MSG instructions.Table 5 - Communication TabFieldDescriptionPathEnter the communication path to the EtherNet/IP module. The module must be accessed viathe 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 slotnumber of the communication module, or the slot number of a ControlLogix 5580controller 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 version28.11 or later, you can also use a path of ‘THIS’.Rockwell Automation Publication ENET-AT002D-EN-P - October 202019

Chapter 1Socket Interface ArchitectureProgramming ConsiderationsObserve these programming considerations.TCP Connection LossYour application program can encounter conditions that result in TCPconnection loss. For example, a network cable can be unplugged, or a targetdevice can be turned off.Your application program detects the loss of TCP connections and handlesthose events appropriately. You can detect connection loss when one of thefollowing occurs: The ReadSocket service returns with an error. The WriteSocket service returns an extended error code other than16#0000 0046. See Error Codes for Socket Services on page 51.Depending on the application, try these actions: Try to re-establish the connection, such as in the case of a clientconnection. Wait for another incoming connection to be established, such as in thecase of a server connection.If you want to re-establish communication with the other device, completethese actions: Delete the socket instance for the lost connection. If the connection is a client connection, create a socket instance andissue an OpenConnection service to the target device. If the connection is a server connection, issue an AcceptConnectionservice to wait for another connection from the remote device.IMPORTANTUser code must manage messages so that only one message to a socketinstance is active at a time. For example, the read and write socketinstructions for a given socket should be interlocked so that only oneexecutes at a time. This is on a per socket basis.ControlLogix Enhanced RedundancyIMPORTANTSocket instances that are created in EtherNet/IP modules are notcrossloaded in an enhanced redundan

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 applica