11 - 452 11 - 452
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
ZOPEN
Instruction
Z OPEN
• Opens a communication channel of a communication port in preparation for performing
communication with an external device.
ZOPEN [#]<channel number>[<,control table>]
Syntax
channel number
• • • •
Specify the communication port that communicates
with the external device.
control table
• • • •
Specify various parameters for the communication
with the external device.
Examples
ZOPEN #1,A%( )
• • • •
Opens CH1 (RS-232C) of the communication
module with the parameters specified by the integer
array A%( ).
ZOPEN #4
• • • •
Opens the parallel interface port of the
communication module.
Description
• The ZOPEN instruction is used to open a communication port to enable communication
with an external device.
• Specify which communication port of the communication module should be used in
<channel number>. The correspondence between channel numbers and communication
ports are as follows.
Channel number
Communication port
1
2
3
4
• • • •
• • • •
• • • •
• • • •
CH1 (RS-232C)
CH2 (RS-232C)
CH3 (RS-422/485)
CH4 (PARALLEL)
• Specify various parameters for communication in <control table>. Note that it is not
necessary to specify <control table> for channel number 4 (parallel); in this case, <control
table> should be omitted.
• Specify the data using an integer array variable in <control table> as follows.
%(0)
• • • •
Specify the baud rate.
%(1)
• • • •
Specify the parity bit in the higher byte and the character length in the
lower byte.
%(2)
• • • •
Specify the stop bit.
Always define an array used in <control table> by the DIM instruction, even though only three array
elements are used.
If the array is not defined using the DIM instruction, an error occurs at the execution of the ZOPEN
instruction (usually, an array with 10 or fewer elements can be used without defining it using
the DIM instruction).