Xinje XD Series User Manual page 234

Hide thumbs Also See for XD Series:
Table of Contents

Advertisement

0FH
Write multi-coil
(1) Take 06H function code as example (single register write), and introduce data
format.
E.g.: upper computer write data to PLC H0002 (D2).
RTU mode:
Asking format
ID
Function code
Register ID
Data content
CRC CHECK High 25H
CRC CHECK Low
Explanation:
1. Address is PLC station no.
2. Function code is Modbus-RTU protocol read/write code.
3. Register address is the PLC modbus address, please see chapter 6-2-3.
4. Data content is the value in D2.
5. CRC CHECK High / CRC CHECK Low is high and low bit of CRC check value.
If 2 pieces of Xinje XD3 series PLC communicate with the other one, write K5000 to D2.
M0 is trigger condition (Rising edge). If communication fails, the instruction will try twice. If
the third time communication fails, then communication ends.
The relationship between REGW and Modbus RTU protocol (other instructions are the same)
REGW
K1
H0002
K5000
K2
The complete communication datum are: 01H 06H 00H 02H 13H 88H (system take CRC
checking automatically)
If monitor the serial port2 data by serial port debugging tool, the datum are: 01 06 00 02 13
88 25 5C
Note: The instruction doesn't distinguish decimal, hex, binary, octal etc. For example,
B10000, K16 and H10 are the same value, so the following instructions are the same.
REGW K1 B111110100 D1 K2
REGW K1 K500
REGW K1 H1F4
(2) Function code 01H/02H: read coil/read input coil
Eg. Read coil address 6000H (Y0). At this time, Y0 and Y1 are ON.
MCLW
Response format
01H
ID
06H
Function code
00H
Register ID
02H
13H
Data contents
88H
CRC CHECK High
5CH
CRC CHECK Low
Function code 06H
Station no.
Modbus address
Data contents 1388H
PLC serial port
D1 K2
D1 K2
233
01H
06H
00H
02H
13H
88H
25H
5CH

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xl seriesXd3Xd5

Table of Contents