Mitsubishi QD51 Programming Manual page 529

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
READ
Instruction
• Reads a value defined by the DATA instruction and assigns it to a variable.
READ <variable name>[,<variable name>]...
Syntax
variable name
READ A,B,C$
Examples
• The READ instruction reads a value defined by the DATA instruction and assigns it to a
Description
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.
11 - 359
READ
• • • •
• • • •
READ
DATA
REMARK
See the DATA and RESTORE instructions, and Section 3.5.2.
Specify the variable to which the data defined by the
DATA instruction is to be assigned.
From the DATA sentence, the numeric values are
assigned to A and B and the character string is
assigned to C$.
A ,
B , C$
100 , 200 , "ABCD"
MELSEC-Q
11 - 359

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents