Mitsubishi QD51 Programming Manual page 63

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

Advertisement

3 LET'S CREATE AND EXECUTE A PROGRAM
3 - 22
Use the RESTORE instruction in order to use values of the same DATA instruction
again. The following illustrates what happens when the RESTORE instruction is used.
10 DATA
7, 8
20 READ
A, B
30 RESTORE
40 READ C
Line numbers can be specified when using the RESTORE instruction. The following
illustrates what happens when a line number is specified.
10 DATA
7
20 DATA
8
30 READ
A, B
40 RESTORE 20
50 READ C
REMARK
The READ instruction can use arrays instead of variables that read data. The
following program is an example where data is assigned to A$(0) through A$(2). Try
executing this block.
10 DIM A$(2)
20 READ A$(0), A$(1), A$(2)
30 PRINT A$(0), A$(1), A$(2)
40 DATA 51H, PC, A
RUN
51H PC A
OK
A value in the DATA
A
B
C
instruction in line 10 is
7
8
7
used again by using the
RESTORE instruction.
A
B
C
The value of the DATA
instruction in line 20 is
7
8
8
used again by the
RESTORE instruction.
A$(0)
A$(1)
"51H"
"PC"
MELSEC-Q
A$(2)
"A"
3 - 22

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents