11 - 63 11 - 63
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
ERL
Function
ERror Line
• Returns the line number where an error was detected.
Syntax
ERL
Examples
E=ERL
• • • •
Stores the line number where the error was detected
to E.
Description
• The ERL function returns the line number where the error was detected when an error has
occurred.
• The ERL function is used in the error processing routine so that the processing branches
depending on the line where the error occurred.
• If the instruction that caused the error was being executed in the direct mode, the ERL
function returns 65535.
• The ERL function has a limited purpose and it cannot be specified on the left side of the
equal sign in the LET instruction and some other places.
Program Example
10 ' Displays the line number where the error occurred
20 ON ERROR GOTO 100
:
' Branches to line 100 when an error occurs
50 ERROR 10
:
' <-- Error occurs at this line
60 END
100 PRINT "ERROR LINE =";ERL
:
' Displays the line number where the error
occurred
110 RESUME 60
RUN
ERROR LINE = 50
OK
REMARK
See the ON ERROR GOTO and RESUME instructions, ERR function, and Chapter 9.
Содержание 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...