Mitsubishi QD51 Programming Manual page 144

Logic controller
Hide thumbs Also See for QD51:
Table of Contents

Advertisement

7 COMMUNICATION WITH EXTERNAL DEVICES
7 - 13
(2) To receive data • • • Use the ZRECEIVE instruction or INPUT$
function.
1) Open the interface and specify the communication parameters according
to the external device to be used.
ZOPEN # <channel number>, <control table>
ZCNTL # <channel number>, 0, <control table>
2) Follow the steps below to use the ZRECEIVE instruction:
(a) Specify the number of bytes of transmission data and the timeout in the control table used
for the ZRECEIVE instruction.
(b) Define the variables and arrays for storing the received data as follows:
To store the received data in a character variabl
To store the received data in an integer
To store the received data in an array
(c) Execute the ZRECEIVE instruction.
ZRECEIVE # <channel number>, 0, <control table>, <input element>
• When the execution of the ZRECEIVE instruction is completed, the number of bytes
of received data is stored in the control table used for the ZRECEIVE instruction.
• The reception process is terminated if the data specified as a break character is detected
while receiving data.
2) INPUT$ function is used in the following format:
<variable where the received data is stored> = INPUT$ (<number of input characters>,
%<board number>, <timeout>)
3) An error occurs if the data was not received normally. In this case, check the condition
of the communication line, the communication parameters of the interface,
the contents of the control table, etc.
• The RS (RTS)/ER (DTR) signal can be turned ON or OFF using the ZCNTL instruction during
the data communication with the external device.
See the description of the ZCNTL instruction for the details.
• When the ZRECEIVE instruction is used, the Kanji code conversion using the ZCNTL and KMODE
instructions cannot be performed.
MELSEC-Q
$=SPACE$(255)
%=0
n is the maximum number of
DIM
(n)
elements used.
7 - 13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ad51h-s3Qd51-r24A1sd51s

Table of Contents