The Concept Of Error Handling; Definition Of Error Handling - Mitsubishi QD51 Programming Manual

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

Advertisement

9 THE CONCEPT OF ERROR HANDLING

9 THE CONCEPT OF ERROR HANDLING

9.1 Definition of Error Handling

9
9 - 1
If an error occurs while running the BASIC program, an error message is displayed
and the program stops running.
If an error occurs,
the program no
longer runs
Although the program is usually created to generate a minimal amount of errors taking
as many potential causes into consideration as possible, errors may occur due to
causes that are normally difficult to foresee.
Creating an "error handling routine" in BASIC to deal with these kinds of errors will
allow the program to continue running without stopping and displaying an error
message.
Error handling routine is a routine performed when an error occurs. It is defined using
the ON ERROR GOTO instruction. By specifying a line number or label after the ON
ERROR GOTO instruction, the routine begins executing from the line specified by this
line number or label once an error occurs.
ON ERROR GOTO
In the error handling routine, appropriate corrective action for the error can be taken
using BASIC instructions.
Once the error handling is completed, normal processing can be resumed using the
RESUME instruction.
Once the error handling is completed, always return to normal processing using
the RESUME instruction. The error handling will not be performed if an error occurs
again in case the processing is resumed using an instruction such as GOTO.
REMARK
• To disable an error handling routine that has been defined, set ON ERROR GOTO
to 0. After this, an error message is displayed and the program stops if an error
occurs.
RESUME
Normal processing routine
Error handling routine
MELSEC-Q
9 - 1

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents