Xinje XD Series User Manual page 238

Hide thumbs Also See for XD Series:
Table of Contents

Advertisement

03H
Read register
04H
Read input register
05H
Write single coil
06H
Write single register
10H
Write multiple
registers
0FH
Write multiple coils
Take 06H function code(write single register)as example, and introduce data format
(other functions are similar to this):
E.g.:upper computer write data K5000(H1388) to PLC H0002 (D2).
ASCII mode:
Start mark
ID
Function code
Register ID high byte
Register ID low byte
Data content high byte
Data content low byte
LRC
End mark
Description:
1. address is PLC station number.
2. Function code is Modbus-ASCII protocol read/write code.
3. Register ID is the PLC modbus communication ID, please see chapter 7-2-2.
4. Data content is the value in D2.
5. LRC CHECK Low / CRC CHECK High is low and high bit of CRC check value.
If two pieces of Xinje XD3 PLC communicate with each other, write K5000 to D2.
M0
M0 is trigger condition (rising edge). When Xinje PLC communicates by Modbus, if
communication fails, the instruction will try twice. If the third time communication fails, then
communication ends.
The relationship between REGW and ASCII protocol (other instructions are similar to this):
REGW
K1
H0002
REGR
INRR
COLW
REGW
MRGW
MCLW
3AH
30H
31H
30H
36H
30H
30H
30H
32H
31H
33H
38H
38H
35H
43H
0DH
0AH
REGW K1 H0002 K5000 K2
Function code 06H
Station number
Modbus ID
237

Advertisement

Table of Contents
loading

This manual is also suitable for:

Xl seriesXd3Xd5

Table of Contents