11 - 463 11 - 463
MELSEC-Q
11 INSTRUCTIONS AND FUNCTIONS
ZSEND
Instruction
Z SEND
• Sends data from a communication port.
ZSEND #<channel number>,0,<control table>,<output element>
Syntax
channel number
• • • •
Specify the communication port that is used to send
the data.
control table
• • • •
Specify various parameters for sending the data.
output element
• • • •
Specify the data to be sent.
Examples
ZSEND #1,0,A%( ),"TEST
DATA"
• • • •
Sends "TEST DATA" under the conditions specified
by integer array elements A%(0) and A%(2) via CH1
(RS-232C) and assigns the number of bytes
transmitted to A%(1).
Description
• The ZRECEIVE instruction receives data from the communication port specified in
<channel number> according to the parameters specified in <control table> and stores it in
<input element>.
• 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)
Note that a communication port that sends data via the ZSEND instruction must be
opened using the ZOPEN instruction in advance. An error occurs if it is not opened.
• <control table> specifies the number of bytes of data to be transmitted and a timeout value.
In addition, the number of bytes of data actually transmitted is stored at the completion of
the transmission.
<control table> uses the following integer array variables:
%(0)
• • • •
Specifies the number of bytes requested to be sent.
%(1)
• • • •
Stores the number of bytes transmitted after the completion of the
transmission.
%(2)
• • • •
Specifies the timeout value.