3 - 22 3 - 22
MELSEC-Q
3 LET'S CREATE AND EXECUTE A PROGRAM
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.
A value in the DATA
instruction in line 10 is
used again by using the
RESTORE instruction.
7
A
8
B
7
C
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.
The value of the DATA
instruction in line 20 is
used again by the
RESTORE instruction.
7
A
8
B
8
C
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
"51H"
A$(0)
"PC"
A$(1)
"A"
A$(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...