App - 6 App - 6
MELSEC-Q
APPENDIX
Appendix 2 Precautions on Interrupt Processing
It is possible to activate an interrupt processing routine by the following causes in
AD51H-BASIC.
1) Starting up a subroutine due to an interrupt from one of the communication devices
connected to the various interfaces of the communication module (ON COM
GOSUB instruction)
2) Executing an error handling routine when an error occurs (ON ERROR GOTO
instruction)
Since the two types of interrupt processing routines above perform the processing
when an interrupt occurs due to the occurrence of their respective cause, it is
impossible to tell at which position in the program the interrupt processing routine is
executed.
Therefore, if an interrupt processing routine contains instructions to display characters
or the ZIDV and ZODV instructions that switch the console, the settings of the
character display position and the console switching may become disrupted as shown
in the example below.
Create the program in such a way that characters are not displayed or the console
switched during the interrupt processing routine.
Example
This example shows a case where characters are displayed during an interrupt
processing.
100 REM Interrupt processing
5 digits
Line 10
Program normal
5 digits
Line 10
Program normal
Line 20
An interrupt from the
RS-232C interface (1)"
Program normal
This is what
is displayed
normally.
The PRINT instruction in line 60 is executed
here due to the LOCATE instruction in line 110
and the PRINT instruction in line 120.
10 ON COM (1) GOSUB 100
20 COM (1) ON
50 LOCATE 5, 10
60 PRINT "Program normal"
90 GOTO 30
110 LOCATE 5, 20
120 PRINT "An interrupt from the RS-232C interface (1)"
130 RETURN
The execution restarts from
the instruction immediately
after the line where
the interrupt occurred.
Cause of
interrupt
Содержание 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...