11 - 359 11 - 359
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
READ
Instruction
READ
• Reads a value defined by the DATA instruction and assigns it to a variable.
READ <variable name>[,<variable name>]…
Syntax
variable name
• • • •
Specify the variable to which the data defined by the
DATA instruction is to be assigned.
Examples
READ A,B,C$
• • • •
From the DATA sentence, the numeric values are
assigned to A and B and the character string is
assigned to C$.
READ
DATA
100 ,
200 , "ABCD"
A ,
B , C$
Description
• The READ instruction reads a value defined by the DATA instruction and assigns it to a
variable.
• The READ instruction must always be used together with the DATA instruction.
• Each variable in the READ instruction must be one-to-one correspondence to the value of
the DATA instruction.
• The variable type specified in the READ instruction can be either a numeric value or
character string. However, the types of the value to be read and the variable must match.
If the types do not match, a “Syntax error” occurs on the DATA instruction side and the
execution stops.
• One READ instruction can reference one or more DATA instructions in sequence.
• If the number of variables in the READ instruction exceeds the number of data specified in
the DATA instruction, the error message “Out of data” is displayed.
• If the number of variables is smaller than the number of data specified in the DATA
instruction, the READ instruction executed later will read the remaining values
sequentially.
If not enough READ instructions are executed, the remaining data are ignored.
Use the RESTORE instruction in order to read values in the DATA instruction from the
start again or from the specified position.
REMARK
See the DATA and RESTORE instructions, and Section 3.5.2.
Содержание A1SD51S
Страница 183: ...11 13 11 13 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS RUN Before swap A 0 H924 A 1 H1159 After swap A 0 H1159 A 1 H924 OK...
Страница 331: ...11 161 11 161 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CON ON OFF STOP and ZOPEN functions and Section 7 4...
Страница 557: ...11 387 11 387 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the CHR SPACE and SPC functions...
Страница 629: ...11 459 11 459 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZOPEN ZSEND and ZCNTL instructions and Section 7 3 4...
Страница 645: ...11 475 11 475 MELSEC Q 11 INSTRUCTIONS AND FUNCTIONS REMARK See the ZEVENT ZSIGNAL and DEF ZEVENT instructions...