13.07.2015 Views

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

1766-RM001A-EN-P MicroLogix 1400 Programmable Controllers ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

490 Socket Interface Using CIP Generic MessagingChange Controller Mode Between Executing and Non-ExecutingExecuting mode includes Run, Remote Run, Test Continuous Scan, andTest Single Scan modes. Any others are Non-Executing modes.If the <strong>MicroLogix</strong> controller transitions from Executing to Non-executingmode while socket requests are active, all connections are closed and allinstances are deleted. This is forced by the controller. You can experiencethe error code NO_SOCKET from MSG instructions. See Possible ErrorCodes for Socket Services on page 508.In RSLogix500, you can also set the MGx:y.TO bit for any outstandingsocket-related MSG instruction. This causes the MSG instruction totimeout and set the MGx:y.ER bit.Application Messages and TCPA TCP connection is a byte stream between two application entities. Theapplication protocol determines the message formats. Messages can befixed size or variable size.If an application sends variable size messages, a common strategy is tofirst send a fixed size 'header' containing the size of the message,followed by the message. The receiving device can first issue a Read ofthe fixed size header to determine the remaining size, and then issue asubsequent Read to receive the remaining data.Partial ReadsIt is possible for a Read service to return a BufLen that is less than therequested amount of data. For example, your program may request 100bytes of data. Because TCP is a byte stream and not a datagram protocol,you can receive less than 100 bytes when the Read service returns.Depending on the application protocol, you can issue additional Readrequests to receive all the data. If the application protocol dictates that allmessages are 100 bytes, then you must issue additional Reads until youreceive 100 bytes. If the application protocol uses variable size messages,your program needs additional logic to handle variable message sizes asdefined by the application protocol.Publication <strong>1766</strong>-<strong>RM001A</strong>-<strong>EN</strong>-P - October 2008

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!