11 - 157 11 - 157
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
ON COM GOSUB
Instruction
ON COMmunication GO to SUBroutine
• Defines the starting line of the processing routine to be branched to when an interrupt
occurs from a communication line.
ON COM(<channel number>) GOSUB <line number>
channel number
• • • •
Specify the communication line to generate the
interrupt.
Syntax
line number
• • • •
Specify the line number to be processed after the
interrupt.
Examples
ON COM (1) GOSUB 1000
• • • •
Branches to line 1000 if an input interrupt is
generated from the communication line CH1 (RS-
232C).
Description
• The ON COM GOSUB instruction defines the starting line of the processing routine to be
branched to when an interrupt is generated from a communication line.
• The following values can be specified as <channel number>.
1 • • • • CH1 (RS-232C)
2 • • • • CH2 (RS-232C)
3 • • • • CH3 (RS-422/485)
• If the command currently being executed involves waiting for external input, such as the
INPUT instruction, the branch processing will not be executed until the current command
is finished, even if an input interrupt occurs from a communication line.
• In the same way as usual subroutines, the returning from the processing routine is carried
out by using the RETURN instruction. If RETURN is entered alone, the execution starts
from the instruction next to the ON COM GOSUB instruction. If RETURN is entered along
with a line number, the execution starts from the specified line.
Содержание 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...