On Error Goto ( Branch To An Error Handling Routine If An Error Occurs ) - Mitsubishi QD51 Programming Manual

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

Advertisement

11 INSTRUCTIONS AND FUNCTIONS
ON ERROR GOTO
• Enables interrupt processing if an error occurs and moves the execution to the starting line
of an error handling routine.
ON ERROR GOTO <line number>
Syntax
line number
ON ERROR GOTO 100
Examples
• The ON ERROR GOTO instruction enables interrupt processing if an error occurs and
Description
moves the execution to the start line of an error handling routine.
• A label name can be specified instead of a line number for <line number>.
• If the specified <line number> does not exist, an "Undefined line number" error occurs.
• Do not display characters or switch ports via the ZIDV or ZODV instruction in the error
handling routine.
Character display and input/output processing may not be performed correctly upon
returning to the main program, depending on the execution timing of the error handling
routine.
• Specify 0 for the value in <line number> before executing the program in order to disable a
previously enabled interrupt at error generation.
Then, if the program detects an error, it displays the error message and stops the
execution of the program.
• If "ON ERROR GOTO 0" is present in an error handling routine, the errors that have
occurred are displayed and the execution of the program stops.
• It is recommended to specify "ON ERROR GOTO 0" if an error that is not handled explicitly
in the error handling routine is detected.
• Use the RESUME instruction to return from the error handling routine.
• If an error occurs during the execution of an error handling routine, BASIC displays the
corresponding error message and the execution of the program stops.
11 - 162
Instruction
ON ERROR GOTO
• • • •
• • • •
Specify the starting line number or label of the error
handling routine of the program that will be executed
if an error occurs.
Moves the execution to line 100 if an error occurs.
MELSEC-Q
11 - 162

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents