EasyManua.ls Logo

Inovance H3U Series - Page 300

Inovance H3U Series
737 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
299
4
4 Instructions 4.11.1 Communication Instructions
Function
The RS instruction is used for data sending/reception during communication. The data of a designated
register area is automatically sent to serial ports in sequence, and then the data received by serial ports
is stored in a designated area. This achieves the effect of allowing the user program to directly access
the communication buffer. Communication can be conducted using custom protocols by allowing the user
program to process the sent/received data buffer.
Whether the RS instruction works in half-duplex or full-duplex mode is determined by bit 10 of D8120.
Multiple RS instructions can be compiled by the user program, but only one instruction can be driven at a
time. M8122 must be set before the RS instruction is driven.
Example
X1
S D
ǒRS D200 K5 D500 K4Ǔ
m n
02 01
04
03
00
05
D200
D201
D202
Higher
bytes
Lower
bytes
Higher
bytes
Lower
bytes
12 11
14
13
D500
D501
S
D
m
n
For the H2U series PLC, the RS instruction is
only applicable to the COM1 port. COM0 port
does not support this instruction.
The figure on the right shows the storage of
sent/received data after instruction execution
when X1 = ON.
For example, the sent data
is 01, 02, 03, 04, and 05.
For example, the received
data is 11, 12, 13, and 14.
Conguration and preparation of serial communication must be completed during programming so that
communication can be conducted based on requirements. Related tasks include conguring the data
sending/receiving mode of serial ports, baud rate, bits, parity bit, software protocols, and timeout conditions;
preparing data for the sent/received data buffer; processing sending/reception labels. The preceding
statement is used as an example. A complete RS communication conguration program is as follows:
M8002
ǒMOV H87 D8120Ǔ
ǒMOV H10 D8126Ǔ
ǒSET M8122Ǔ
X10
ǒRS D200 K5 D500 K4Ǔ
Placed in the
first line of the
program
ĂĂ
ǒMOV K10 D8129Ǔ
The data to be sent is written to D200 to D203
X1
ǒRST M8123Ǔ
M8123
ǒRST M8123Ǔ
Reset marker, transition to the reception wait state
Processing of received data
COM1set to 9600, in 8E1 communication format
COM1 set to RS communication mode
Communication timeout time set to 100 ms
Data sending preparation
Communication request setting
Reception preparation
Sending
The data of D500 to D503 in the reception
buffer is processed

Table of Contents

Other manuals for Inovance H3U Series

Related product manuals