Chapter 6. Serial I/O, SNP & RTU Protocols
GFK-2222AD
April 2018
205
6.1.6
Example COMMREQ Command Blocks for Serial Port Setup function
The following COMMREQ command blocks provide examples for configuring the various protocols. All
values are in decimal unless followed by an H indicating hexadecimal.
Note that an example is not provided for Message Mode, but it can be setup with a command block
similar to the one for Serial I/O, with a value of 7 for the protocol selector.
Example COMMREQ Command Block for Configuring SNP Protocol
Values
Meaning
Address
16
Data Block Length
A 1
0 = No Wait (WAIT mode not supported)
WAIT/NOWAIT Flag
A 2
0008 = %R, register memory
Status Word Pointer Memory
Type
A 3
Zero-based number that gives the address of the COMMREQ
status word (for example, a value of 99 gives an address of
100 for the status word)
Status Word Pointer Offset
A 4
not used
Idle Timeout Value
A 5
not used
Maximum Communication Time
A 6
FFF0H
Command Word (serial port
setup)
A 7
1 = SNP
Protocol
A 8
0 = Slave
Port Mode
A 9
See
COMMREQ Command Block Parameter Values
Data Rate
A 10
0 = None, 1 = Odd, 2 = Even
Parity
A 11
not used (SNP always chooses NONE by default)
Flow Control
A 12
0 = None, 1 = 10ms, 2 = 100ms, 3 = 500ms
Turnaround Delay
A 13
0 = Long, 1 = Medium, 2 = Short, 3 = None
Timeout
A 14
not used (SNP always chooses 8 bits by default)
Bits Per Character
A 15
0 = 1 Stop Bit, 1 = 2 Stop bits
Stop Bits
A 16
not used
Interface
A 17
not used (SNP always chooses 4-wire mode by default)
Duplex Mode
A 18
user-provided
82
Device identifier bytes 1 and 2
A 19
user-provided
82
Device identifier bytes 3 and 4
A 20
user-provided
82
Device identifier bytes 5 and 6
A 21
user-provided
82
Device identifier bytes 7 and 8
82
The device identifier for SNP Slave ports is packed into words with the least significant character in the least significant byte
of the word. For example, if the first t
wo characters are “A” and “B,” the A 18 will contain the hex value
4241.