Mitsubishi QD51 Programming Manual page 170

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

Advertisement

10 Program Debugging
10- 3
(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)
20 FOR I%=0 TO 2
30 INPUT IN$(I%)
40 NEXT I%
50 STOP
60 FOR I%=0 TO 2
70 PRINT IN$(I%)
80 NEXT I%
90 END
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.
MELSEC-Q
RUN
? MITUBISHI
? MELSEC
? AD51H
Break in 50
OK
PRINT IN$(0)
MITUBISHI
OK
IN$(0) = "Mitsubishi"
OK
PRINT IN$(2)
AD51H
OK
IN$(2)="BASIC"
OK
CONT
Mitsubishi
MELSEC
BASIC
OK
10- 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents