11 - 456 11 - 456
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
(1) When an integer variable is specified, it is possible to receive one integer data
value. One integer data value is treated as 2 bytes; therefore, specify 2 bytes for
the number of bytes requested to be received.
Reception
[Request to receive 2 bytes]
760
Integer data
%
7 6 0
2 bytes
(2) When an integer array name is specified, it is possible to receive as many integer
data values as the number specified by the number of bytes requested to be
received. One integer data value is treated as 2 bytes; therefore, specify (number
of integer data to be received x 2) for the number of bytes requested to be
received.
Reception
[Request to receive 8 bytes]
1654
3238
16
137
Integer data
%(0)
%(1)
%(2)
%(3)
1 6 5 4
3 2 3 8
1 6
1 3 7
2 bytes
2 bytes
2 bytes
2 bytes
(3) When a character variable or character array variable is specified, it is possible to
receive as many characters of data as specified by the number of bytes
requested to be received. One data character is treated as 1 byte; therefore,
specify the same number for the number of bytes requested to be received as
the number of characters of data to be received. Note, however, that if full-byte
characters (Kanji) are included among the data to be received, each full-byte
character is treated as 2 characters. Moreover, use Shift JIS code as the Kanji
code on the transmission side. Other codes cannot be treated as Kanji.
Reception
[Request to receive 9 bytes]
A
B
@
@
1
2
3
4
5
6
7
8
E
F
G
9
$
$(n)
"AB@EF@G"
• The channel numbers that have not been opened by the ZOPEN instruction cannot
be specified. An error occurs if such a channel is specified.
• If the amount of data specified by the number of bytes requested to be received
cannot be stored in the variable or array specified as <input element>, an error
occurs and the instruction is not executed.
• If a break character specified by the ZCNTL instruction is detected while receiving
data, the data reception is stopped. At this point, the number of bytes of data
received before the reception of the break character is stored in %(1) of control
table and the data received before the reception of the break character is stored in
<input element>.