10- 3 10- 3
MELSEC-Q
10 Program Debugging
(3) PRINT instruction and LET instruction
The targets of these instructions are the values of variables and arrays used in a
program at the time it was paused by the above-mentioned STOP instruction.
Execute the PRINT instruction to display the values of variables etc. on the
screen while the program is paused.
Execute the LET instruction to forcefully change the values of variables etc. while
the program is paused.
10 DIM IN$(2)
RUN
20 FOR I%=0 TO 2
? MITUBISHI
30 INPUT IN$(I%)
? MELSEC
40 NEXT I%
? AD51H
50 STOP
Break in 50
60 FOR I%=0 TO 2
OK
70 PRINT IN$(I%)
PRINT IN$(0)
80 NEXT I%
MITUBISHI
90 END
OK
IN$(0) = "Mitsubishi"
OK
PRINT IN$(2)
AD51H
OK
IN$(2)="BASIC"
OK
CONT
Mitsubishi
MELSEC
BASIC
OK
Use the following instructions in a BASIC program to make debugging easier.
• ON ERROR GOTO and RESUME instructions
Use these instructions to prevent the program from being stopped due to error
occurrence.
• ERROR instruction
Use this instruction to generate an error to check whether or not the flow of the
program execution is correct.
• ERR and ERL functions
Use these instructions to check the error code of an error that just occurred
and the line number where the error occurred, respectively.
Содержание 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...