11 - 30 11 - 30
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
COM ON/OFF/STOP
Instruction
COMmunication ON/OFF/STOP
• Controls to enable, prohibit, and stop the interrupt from the communication line.
COM ( <channel number> ) ON
COM ( <channel number> ) OFF
COM ( <channel number> ) STOP
Syntax
channel number
• • • •
Specify the communication port to be controlled for
the interrupt from the communication line.
Examples
COM (1) ON
• • • •
Enables interrupt from CH1(RS-232C).
Description
• The COM ON/OFF/STOP instruction declares whether the interrupt, which occurs by the
communication input from the outside to the communication port (RS-232C/422), is
enabled (ON), prohibited (OFF), or stopped (STOP).
• <channel number> specifies the communication port to be interrupted from the
communication port.
Correspondence of <channel number> and the communication port is as follows:
1 • • • • CH1 (RS-232C)
2 • • • • CH2 (RS-232C)
3 • • • • CH3 (RS-422)
• <channel number> may be omitted. If omitted, it is assumed both RS-232C and 422 ports
are specified.
• An interrupt is enabled immediately after the COM ON instruction is executed. After this
instruction is executed, the interrupt is executed every time there is an input to the
communication port specified by <channel number>, and the execution branches to the
processing routine of the line number specified by the ON COM GOSUB instruction.
• The COM OFF instruction prohibits the interrupt. After this instruction is executed, a branch
to the processing routine does not occur even if there is an input to the communication
port.
• The COM STOP instruction stops the interrupt. After this instruction is executed, the input
to the communication port is recorded but no branching to the processing routine occurs.
When COM ON enables the interrupt later, however, a branching to the processing routine
occurs.
• Set the communication port to the COM OFF state when the program is completed.
• While multitask processing is being performed, access from only one program is valid to a
port.
REMARK
See the ON COM GOSUB and ZOPEN instructions, Section 7.4, and Appendix 2.