11 - 78 11 - 78
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
• Specify the variable, etc. where the data read from the buffer memory is stored in <read
data store area>.
Store dummy data of <number of bytes> or more to the variable specified as <read data
store area> before executing the GETMEM instruction. An error occurs during the
execution of the GETMEM instruction if the dummy data is not stored.
Integer variable
character variable
%=0
$=SPACE$(255)
• Always use the DIM instruction to define the area used as <read data store area> even if
the number of used elements is 10 or less. If it is not defined by the DIM instruction, data
can be stored only in the area that was defined by the DIM instruction when the GETMEM
instruction is executed.
In addition, store the dummy data for <number of bytes> or more as follows, when a
character array variable is used:
$(n)=SPACE$(255)
• In <offset 1>, specify in bytes which part of data of variables specified by <read data store
area> will be stored at the beginning.
In <offset 2>, specify in bytes which part of data of variables specified by <read source> to
be read at the beginning.
When an integer variable is specified:
%
1
0
Specify 0 to specify the lower byte, or 1 to specify
the higher byte, since the integer variable
consists of two bytes (=16 bits) per variable.
When an integer array variable name is specified:
%(0)
1
0
3
2
5
4
%(1)
%(2)
The offset values are as follows, since an integer
array consists of two bytes (=16 bits) per element:
• To specify the lower byte of element number n
<offset> = n 2
• To specify the higher byte of element number n
<offset> = n 2+1
When a character variable or a character array variable is specified:
$
$(n)
1
2
3
4
5
0
1
2
3
4
5
0
For the character variable and character array
variable, specify
<offset> = n-1
to specify the nth character in the variable as the
starting data, since a half-byte character in the
variable is one byte.