Contents
iv PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual GFK-2222AD
Chapter 6 Serial I/O, SNP & RTU Protocols ............................................................................... 201
6.1 Configuring Serial Ports Using COMMREQ Function 65520 ....................................... 202
6.1.1 COMMREQ Function Example .................................................................................................................................... 202
6.1.2 Timing .................................................................................................................................................................................... 202
6.1.3 Sending Another COMMREQ to the Same Port ................................................................................................. 202
6.1.4 Invalid Port Configuration Combinations ............................................................................................................. 203
6.1.5 COMMREQ Command Block Parameter Values ................................................................................................ 204
6.1.6 Example COMMREQ Command Blocks for Serial Port Setup function ................................................... 205
6.2 Serial I/O Protocol ............................................................................................................. 208
6.2.1 Calling Serial I/O COMMREQs from the CPU Sweep ........................................................................................ 208
6.2.2 Compatibility ...................................................................................................................................................................... 208
6.2.3 Status Word for Serial I/O COMMREQs ................................................................................................................. 208
6.2.4 Serial I/O COMMREQ Commands ............................................................................................................................. 210
6.2.5 Overlapping COMMREQs .............................................................................................................................................. 211
6.2.6 Initialize Port Function (4300) .................................................................................................................................... 212
6.2.7 Set Up Input Buffer Function (4301) ....................................................................................................................... 213
6.2.8 Flush Input Buffer Function (4302) .......................................................................................................................... 214
6.2.9 Read Port Status Function (4303) ............................................................................................................................ 215
6.2.10 Write Port Control Function (4304) ......................................................................................................................... 217
6.2.11 Cancel COMMREQ Function (4399) ......................................................................................................................... 218
6.2.12 Autodial Function (4400) .............................................................................................................................................. 219
6.2.13 Write Bytes Function (4401) ....................................................................................................................................... 221
6.2.14 Read Bytes Function (4402) ........................................................................................................................................ 222
6.2.15 Read String Function (4403) ....................................................................................................................................... 224
6.3 RTU Slave Protocol ........................................................................................................... 226
6.3.1 Message Format ............................................................................................................................................................... 227
6.3.2 Cyclic Redundancy Check (CRC) ................................................................................................................................ 232
6.3.3 RTU Message Descriptions .......................................................................................................................................... 236
6.3.4 RTU Scratch Pad ............................................................................................................................................................... 252
6.3.5 Communication Errors .................................................................................................................................................. 253
6.3.6 RTU Slave/SNP Slave Operation with Programmer Attached ..................................................................... 256
6.4 SNP Slave Protocol ........................................................................................................... 257
6.4.1 Permanent Datagrams .................................................................................................................................................. 257
6.4.2 Communication Requests (COMMREQs) for SNP ............................................................................................. 257
Appendix A Performance Data ........................................................................................................... 259
A-1 Boolean Execution Times ............................................................................................................. 260
A-1.1 Boolean Execution Measurements (ms per 1000 Boolean executions) ................................................. 260
A-2 Instruction Timing ......................................................................................................................... 261
A-2.1 Overview .............................................................................................................................................................................. 261
A-2.2 PLC Version Information ............................................................................................................................................... 262