Chapter 6. Serial I/O, SNP & RTU Protocols
GFK-2222AD
April 2018
213
6.2.7
Set Up Input Buffer Function (4301)
This function is provided for compatibility with legacy Serial I/O applications. In PACSystems releases
5.70 and later, the internal input buffer is always set to 2097 bytes. In earlier PACSystems
implementations, the internal input buffer is set to 2K bytes.
The Set Up Input Buffer function returns a success status to the COMMREQ status word, regardless of
the buffer length specified in the command block.
As data is received from the serial port it is placed in the input buffer. If the buffer becomes full, any
additional data received from the serial port is discarded and the Overflow Error bit in the Port Status
word (See Read Port Status Function) is set.
Retrieving Data from the Buffer
Data can be retrieved from the buffer using the Read String or Read Bytes function. It is not directly
accessible from the application program.
If data is not retrieved from the buffer in a timely fashion, some characters may be lost.
Example Command Block for the Set Up Input Buffer Function
VALUE
(decimal)
VALUE
(hexadecimal)
MEANING
Address
0002
0002
Data block length
A1
0000
0000
NOWAIT mode
A2
0008
0008
Status word memory type (%R)
A3
0000
0000
Status word address minus 1 (%R0001)
A4
0000
0000
Not used
A5
0000
0000
Not used
A6
4301
10CD
Setup input buffer command
A7
0064
0040
Buffer length (in words)