12.4.12
Read Bytes Function (4402)
This function causes one or more characters to be read from the specified port. 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 insufficient characters are available to satisfy the request and a non-zero value is
specified for the number of characters to read, the status of the operation is not complete
until either sufficient characters have 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. The status word is not updated until the read operation is complete (either due
to timeout or when all the data has been received).
If the time-out interval is set to zero, the COMMREQ remains pending until it has
received the requested amount of data, or until it is cancelled.
If this COMMREQ fails for any reason, no data is returned to the buffer. Any data that
was already in the buffer remains, and can be retrieved with a subsequent read request.
12.4.12.1
Example Command Block for the Read Bytes
Function
VALUE
(decimal)
VALUE
(hexadeci-
mal)
MEANING
address
0005
0005
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
4402
1132
Read bytes command
a7
0030
001E
Read time-out (30 seconds)
a8
0005
0005
Number of bytes to read
a9
0008
0008
Input data memory type (%R).
a10
0100
0064
Input data memory address (%R0100)
246
GFK-1503E
VersaMax PLC User Manual
For public disclosure
Summary of Contents for VersaMax PLC
Page 16: ...Notes 16 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 38: ...Notes 38 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 50: ...Notes 50 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 92: ...Notes 92 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 112: ...Notes 112 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 224: ...Notes 224 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 292: ...Notes 292 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 316: ...Notes 316 GFK 1503E VersaMax PLC User Manual For public disclosure ...
Page 317: ......