7 - 13 7 - 13
MELSEC-Q
7 COMMUNICATION WITH EXTERNAL DEVICES
(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.
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.
ZRECEIVE # <channel number>, 0, <control table>, <input element>
(b) Define the variables and arrays for storing the received data as follows:
To store the received data in a character variabl $=SPACE$(255)
To store the received data in an integer %=0
To store the received data in an array
DIM (n)
(c) Execute the ZRECEIVE instruction.
• 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>)
n is the maximum number of
elements used.
• 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.
Содержание 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...