Chapter 6. Serial I/O, SNP & RTU Protocols
224 PACSystems* RX7i, RX3i and RSTi-EP CPU Reference Manual GFK-2222AD
6.2.15 Read String Function (4403)
This function causes characters to be read from the specified port until a specified terminating character
is received. The characters are read from the internal input buffer and placed in the specified input data
area.
The function returns both the number of characters retrieved and the number of unprocessed characters
still in the input buffer. If zero characters of input are requested, only the number of unprocessed
characters in the input buffer is returned.
If the terminating character is not in the input buffer, the status of the operation is not complete until
either the terminating character has been received or the time-out interval expires. In either of those
conditions, the port status indicates the reason for completion of the read operation.
If the time-out interval is set to zero, the COMMREQ remains pending until it has received the requested
string, terminated by the specified end character.
If this COMMREQ fails for any reason, no data is returned to the input data area. Any data that has not
been read from the internal input buffer remains, and it can be retrieved with a subsequent read request.
Example Command Block for the Read String Function