Contents
Contents iv
Section 6: Serial I/O, SNP & RTU Protocols .......................................................................................... 135
6.1 Configuring Serial Ports Using COMMREQ Function 65520 .................................................. 135
6.1.1 COMMREQ Function Example ......................................................................................... 135
6.1.2 Timing ............................................................................................................................ 136
6.1.3 Sending Another COMMREQ to the Same Port ................................................................ 136
6.1.4 Invalid Port Configuration Combinations ........................................................................ 136
6.1.5 COMMREQ Command Block Parameter Values ............................................................... 136
6.1.6 Example COMMREQ Command Blocks for Serial Port Setup function .............................. 138
6.1.7 Example COMMREQ Command Block for Configuring SNP Protocol ................................ 138
6.1.8 Example COMMREQ Data Block for Configuring RTU Protocol ......................................... 139
6.1.9 Example COMMREQ Data Block for Configuring Serial I/O Protocol ................................. 140
6.2 Serial I/O Protocol ............................................................................................................ 141
6.2.1 Calling Serial I/O COMMREQs from the CPU Sweep ......................................................... 141
6.2.2 Compatibility .................................................................................................................. 141
6.2.3 Status Word for Serial I/O COMMREQs ............................................................................ 142
6.2.4 Serial I/O COMMREQ Commands .................................................................................... 144
6.2.5 Overlapping COMMREQs ................................................................................................ 144
6.2.6 Initialize Port Function (4300) ......................................................................................... 145
6.2.7 Set Up Input Buffer Function (4301) ................................................................................ 146
6.2.8 Flush Input Buffer Function (4302) .................................................................................. 147
6.2.9 Read Port Status Function (4303) .................................................................................... 147
6.2.10 Write Port Control Function (4304) ................................................................................ 150
6.2.11 Cancel COMMREQ Function (4399) ................................................................................ 151
6.2.12 Autodial Function (4400) ............................................................................................... 153
6.2.13 Write Bytes Function (4401) .......................................................................................... 154
6.2.14 Read Bytes Function (4402) ........................................................................................... 156
6.2.15 Read String Function (4403) .......................................................................................... 157
6.3 RTU Slave Protocol ........................................................................................................... 159
6.3.1 Message Format ............................................................................................................. 160
6.3.2 Cyclic Redundancy Check (CRC) ...................................................................................... 165
6.3.3 RTU Message Descriptions .............................................................................................. 170
6.3.4 RTU Scratch Pad ............................................................................................................. 187
6.3.5 Communication Errors .................................................................................................... 188
6.3.6 RTU Slave/SNP Slave Operation with Programmer Attached ........................................... 190
6.4 SNP Slave Protocol ........................................................................................................... 191
6.4.1 Permanent Datagrams .................................................................................................... 191
6.4.2 Communication Requests (COMMREQs) for SNP ............................................................ 192