11 - 354 11 - 354
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
• Specify a variable or similar that stores the data to be written to buffer memory, etc. for
<storage area for data to be written>. In addition, it is necessary that the specified variable
stores more data than the amount specified by <offset> and <number of bytes>.
An array used as <storage area for data to be written> must always be defined with the DIM
instruction, even if the number of elements used is 10 or less.
Only the part of the data defined by the DIM instruction can be written at the execution
of the PUTMEM instruction.
• If a character variable or character array variable is specified for <storage area for data to
be written>, the character codes corresponding to the characters to be written are stored
in the write destination.
Specify the offset value with respect to the address/device specified in <write destination>
in <offset 1> in byte units.
• Specify which part of the data in variables, etc. specified in <storage area for data to be
written> in <offset 2> should be written first, in byte units.
When an integer variable is specified
%
1
0
An integer variable contains 2 bytes (= 16 bits)
per one variable. Specify 0 to specify the lower
byte and 1 to specify the higher byte.
When an integer array variable name is specified
%(0)
1
0
3
2
5
4
%(1)
%(2)
An integer array contains 2 bytes (= 16 bytes)
per one element, thus the offset value should be
specified as follows:
• When specifying the lower byte of element
number n
<offset> = n 2
• When specifying the higher byte of element
number n
<offset> = n 2 + 1
When a character variable or character array variable is specified
$
$(n)
1
2
3
4
5
0
1
2
3
4
5
0
One half-byte character in a variable is 1 byte
for a character variable and character array
variable. Specify as follows when the nth
character in a variable is specified as the
starting data:
<offset> = n 1