TH Modbus English Manual
TH Modbus English Manual
Servo driver has RS-485 serial communication interface, which can control servo system, change
parameters and monitor servo system status through MODBUS protocol. Wiring instructions of
communication port CN3 are as follows:
The communication port of L20/L30 driver uses three-digit terminals, and the shape and pin
Special note: RS485 communication port can also be connected through CN1 40/41/42. See the
2 Communication parameters
Default
Range Unit
P-181 Communication ID number of drive value
-1~32 -1
When using RS-485 communication, the upper controller is the master and the servo driver is the
slave. The communication address of servo driver needs to be set to different communication station
numbers by this parameter. The setting range of station number address is -1 ~ 32. The default value is-1,
which means that the communication function is closed, and the setting value greater than 0 means that
the communication function is open. Before using the communication function, this parameter must be
set to the required station number, which represents the absolute address of this driver in the
communication network. Only one station number can be set for a group of servo drivers. If the station
number is set repeatedly, normal communication will be impossible.
Default
Range Unit
P-182 MODBUS Communication baud rate value
0~3 2
Select the baud rate of RS-485 communication through this parameter. Different values correspond
to different baud rates. The selected baud rate should be consistent with that of the upper controller. The
specific setting values are as follows:
1
Parameter meaning:
0:Baud rate is 4800bps
1:Baud rate is 9600bps
2:Baud rate is 19200bps
3:Baud rate is 38400bps
MODBUS Communication data Default
Range Unit
P-183 mode selection (RTU data format is value
only supported for the time being) 0~5 1
Select the data mode of RS-485 communication through this parameter, and
the selected data mode should be consistent with the communication
protocol of the upper controller. The specific parameter values have the
following meanings:
0:Data bits -8 bits Parity bit-none Stop bit -1 bit
1:Data bits -8 bits Parity bit-even check(Even)Stop bit -1 bit
2:Data bits -8 bits Parity bit-odd check(Odd) Stop bit -1 bit
3:Data bits -8 bits Parity bit-none Stop bit -2 bit
4:Data bits -8 bits Parity bit-even check(Even)Stop bit -2 bit
5:Data bits -8 bits Parity bit-odd check(Odd) Stop bit -2 bit
RTU Mode:
MODBUS takes the address field as the beginning of the frame, and the content of the address field
is the effective address value (0 ~ 247). The master sets the slave address value in the address field of
2
the request information to determine the receiver of the request information. After the qualified slave
receives the information and completes the corresponding processing, it sets its own address value in
the address field of the response information, so that the master knows which slave sent the response .
The address field is followed by a function code, which indicates what operation the slave will
complete. The function code is followed by a data field, which contains the parameters of request
and response. The format, length and meaning of the data field are different according to the
Check codes are used to verify the validity of information and ensure the reliability of information
In RTU mode, every 8 bits of data in an information frame are sent according to two 4-bit
hexadecimal codes, for example, 1byte data 64H。
RTU mode is a bit-oriented transmission mode, which starts with an idle time of not less than 3.5
characters, and then sends an address field. the network equipment monitors the communication bus.
after continuously monitoring the idle time of 3.5 characters, it can receive address field information.
when it is judged that the received address field information is valid, it continues to receive subsequent
information, and then performs corresponding operations according to function codes and additional
information. if response information is required, it encapsulates the response information and sends it to
the host. The last byte sent indicates the end of the information frame after an idle time of about 3.5
characters, and a new information frame can be sent. RTU mode keeps frame synchronization by
simulating synchronization information, and the whole information frame must be transmitted as a
continuous data stream at one time. If a continuous data stream is transmitted, the receiving device
detects that there are more than 1.5 character intervals, then it is considered that one frame of data has
been received, and the next received character is taken as the beginning of the next frame. Under normal
circumstances, the interval time between information frames is at least 3.5 characters, that is, after one
frame of data has been sent, it will take at least 3.5 characters of idle time to send the next frame of data.
3
The format of information frame in RTU mode is:
START Address function Data field(DATA) Check code END
field code (CRC)
(ADR) (CMD)
T1-T2-T3-T4 8 bits 8 bits n*8 bits 16 bits T1-T2-T3-T4
Note: T1-T2-T3-T4 indicates that the minimum time interval with the previous frame is 3.5
characters。
Start bit Data bit (lower bit first) parity Stop bit
1 bit 8 bits 1 bit or no bit 1 bit or 2 bits
character structure:
verification)
(8 bit data+no check +1 stop bit)
11bits character box (for 8bit character plus
check)
(8-bit data+even check +1 stop
bit)
(8-bit data+odd check +1 stop bit)
The entries in the format box of communication information frame are described as follows:
START(communication start)
RTU mode: the minimum time interval from the previous frame is 3.5 characters。
ADR(Mailing address)
The legal communication address ranges from 1 to 32, as shown below: communicate with the servo
Command code 04H: read the running state of the driver (such as the variable values of motor
RTU mode adopts CRC(Cyclical Redundancy Check) frame check, and the calculation of
Step 5 .
Step 5: Repeat Step 2 to Step 4 for the next byte of the command information until all bytes
have completed the above processing, at which time the content of CRC register is CRC frame check.
Note: After the CRC frame check is calculated, the low bit of CRC must be filled in the command
information first, and then the high bit of CRC. Please refer to the following example.
For example, read the 0-segment 05 parameter of servo driver with station number 01H. The
last content of CRC register calculated from ADR to the last byte of data is 3794H, so its command
information is as follows. It should be noted that byte 94H should be transmitted before byte 37H.
ADR 01H
CMD 03H
Start data 00H (High byte)
Position 05H (Low byte)
Number of 00H (High byte)
data 02H (Low byte)
CRC Low 94H (High byte)
CRC High 37H (Low byte)
END(End of communication)
:
RTU mode: the minimum time interval with the next frame is 3.5 characters.
function code(CMD):
5
(HEX) specification
03H Read the parameter value of the drive Read Holding Register
(multiple parameters can be read
simultaneously)
04H Read Input Register
Read the running state of the driver
same time)
Various exceptions and errors may occur during communication. In order to make these exceptions
and errors recognized by the host, the corresponding exception codes are defined, as shown in
the following table. When the slave receives the information from the host and finds an error
or fails to complete the normal response, the slave will send an error response frame to the host,
that is, the highest position of the function code byte is 1, and the corresponding exception
All the parameters described in the parameter section can be read through communication, but
only some parameters are open and allowed to be modified and written by users. The parameters
listed in the commissioning manual are allowed to be modified and written. Other unspecified
parameters are reserved parameters of servo drive (users cannot write reserved parameters,
otherwise it may cause abnormal operation of servo drive). If users need to modify other
The state quantity inside the servo driver can be read through RS-485 communication port,
and the writing operation is invalid. The state quantity is stored as 16-bit data, and 40 state
variables from 0 to 39 are provided. The reading of the state quantity can be realized by the
7
0x000B:Instantaneous current of motor, in "0.1a" (12: real-time current of motor 1.2A);
0x000C:Peak current of motor, in "0.1a" (152: the maximum current in 1s is 15.2A);
0x000D:Pulse frequency of position instruction, in "0.1 kHz" (3000: 300kHz);
0x000E:Speed instruction in "r/min";
0x000F:Torque command in "%";<15>
0x0010:Speed analog command voltage, in "mV";
0x0011:Torque analog command voltage, in "mV";
0x0012:Input terminal DI status, [Note 1];
0x0013:Output terminal DO status, [note 2];
0x0014:The absolute position (pulse) of the motor encoder per turn is 16bit lower;<20>
0x0015:The absolute position (pulse) of motor encoder per turn is 16bit high;
0x0016 : Multi-turn position of motor encoder (when there is no multi-turn information, read 0
value);
0x0017:Regenerative braking load rate, unit "%";
0x0018:Average load rate in "%";
0x0019:Output voltage in "%";<25>
0x001A:Alarm code;
0x001B:Motor speed, in "0.1r/min";
0x001C:The second encoder position (pulse) is 16bit lower;
0x001D:The position (pulse) of the second encoder is 16bit high;
0x001E:Keep < 30 > DC bus voltage
0x001F : The absolute position of the motor is lower by 16 bits (32-bit absolute position of
multi-turn+single-turn data splicing)
0x0020 : The absolute position of the motor is 16 bits higher (32-bit absolute position of
multi-turn+single-turn data splicing)
0x0021:reserve
0x0022:reserve
0x0023:reserve <35>
0x0024:reserve
0x0025:reserve
0x0026:reserve
0x0027:reserve <39>
The function code (03H) reads the address (hexadecimal) of the status quantity as follows:
0x1000:Motor speed, in "r/min";
0x1001:Original position command (input pulse) is 16bit lower;
0x1002:Original position command (input pulse) is 16bit high;
0x1003:Position command (pulse) low 16bit;
0x1004:Position command (pulse) is 16bit high;
0x1005:Current motor position (pulse) is 16bit lower;
0x1006:Current motor position (pulse) is 16bit high;
0x1007:Position deviation (pulse) is 16bit low;
0x1008:Position deviation (pulse) is 16bit high;
0x1009:Motor torque in "%"(percentage of rated torque);
8
0x100A:Peak torque in "%"(peak torque within %”(1s);<10>
0x100B:Instantaneous current of motor, in "0.1a" (12: real-time current of motor 1.2A);
0x100C:Peak current of motor, in "0.1a" (152: the maximum current in 1s is 15.2A);
0x100D:Pulse frequency of position instruction, in "0.1 kHz" (3000: 300kHz);
0x100E:Speed command, in "r/min";
0x100F:Torque command in "%";<15>
0x1010:Speed analog command voltage, in "mV";
0x1011:Torque analog command voltage, in "mV";
0x1012:Input terminal DI status, [Note 1];
0x1013:Output terminal DO status, [note 2];
0x1014:The absolute position (pulse) of the motor encoder per turn is 16bit lower;<20>
0x1015:The absolute position (pulse) of motor encoder per turn is 16bit high;
0x1016 : Multi-turn position of motor encoder (when there is no multi-turn information, read 0
value);
0x1017:Regenerative braking load rate, unit "%";
0x1018:Average load rate in "%";
0x1019:Output voltage in "%";<25>
0x101A:Alarm code;
0x101B:Motor speed, in "0.1r/min";
0x101C:The second encoder position (pulse) is 16bit lower;
0x101D:The position (pulse) of the second encoder is 16bit high;
0x101E:Keep < 30 > DC bus voltage
0x101F : The absolute position of the motor is lower by 16 bits (32-bit absolute position of
multi-turn+single-turn data splicing)
0x1020 : The absolute position of the motor is 16 bits higher (32-bit absolute position of
multi-turn+single-turn data splicing)
0x1021:reserve
0x1022:reserve
0x1023:reserve <35>
0x1024:reserve
0x1025:reserve
0x1026:reserve
0x1027:reserve <39>
[Note 1]: The data read from this address is 16bit, in which bit5~bit0 correspond to the input states of
DI6 ~ DI1 respectively, "1" means input high level, and "0" means input low level; Bit15 ~ bit6 are
reserved bits.
[Note 2]: The data bits read at this address are 16bit, in which bit5~bit0 represent the output status of
DO6~DO1, "1" represents the output high level, and "0" represents the output low level; Bit15~bit6 are
reserved bits.
9
6 Communication instance
BYTE_NUM:Number of bytes occupied by read status (for example, RNUM is 2, that is, two 16-bit data,
DATAX: the status value read back, where x represents the serial number, DATA1 is the first data, and
DATA2 is the second data
10
In this example, STADDR = 0x0001 and RNUM = 0x02 in the transmission frame indicate that two status
data are read from the start address 0x0001 (i.e., two status values with addresses 0x0001 and 0x0002
11
6.2 Read parameter(CMD=03H)
All parameters in the drive can be read by using the read parameter function code (03H). The format of
communication frame is described as follows:
Note: the maximum number of parameters to be read at a time is 8。
The request frame format is as follows:
Address function Start address value2 Number of reading CRCCheck code
field1 byte code1 bytes,High byte first parameters 2 bytes, 2 bytes,Low byte first
byte high byte first
0x01 0x03 0x00,0x00 0x00,0x01(N) CRC_Lo, CRC_Hi
Normal response:
Address function Number of bytes Parameter value , 2N CRCCheck code
field1 byte code1 occupied by bytes,high byte first 2 bytes,Low byte first
byte parameters1byte
0x01 0x03 0x02(2N) 0xXX,0xXX,…… CRC_Lo, CRC_Hi
Abnormal response:
Address function Exception code1byte CRCCheck code
field1 byte code1 2 bytes,Low byte first
byte
0x01 0x83 0x01 or 02 or 03 or 04 CRC_Lo, CRC_Hi
BYTE_NUM:Number of bytes occupied by the read parameters (for example, RNUM is 2, that is, two
16-bit data, then BYTE_NUM is 2*2 = 4)
DATAX:The parameter value read back, x represents the serial number, DATA1 is the first parameter,
and DATA2 is the second parameter
In this example, STADDR = 0x01 and RNUM = 0x02 in the transmission frame indicate that two
parameters are read from the start address 1 (i.e., two parameters P-001 and P-002 with addresses 0x01
12
BYTE_NUM = 0x04 in the response frame means that the two parameter values read take up 4 bytes,
followed by DATA1 and DATA2, which are the parameter values with addresses 0x01 and 0x02.
13
6.3 Write a single parameter(CMD=06H)
The parameters listed in the debugging manual can be written by using the write parameter function code
(06H). The format of communication frame is described as follows:
Note: The function code 06H can only write one parameter at a time. Before writing the parameters,
please refer to the parameter specification to confirm the specific meaning of the parameters. Writing the
parameter values incorrectly may cause abnormal operation of the servo driver!
The request frame format is as follows:
Address function Parameter number2 Parameter values CRCCheck code
field1 byte code1 bytes,高字节在前 written2 bytes, High 2 bytes,Low byte first
byte byte first
0x01 0x06 0x00,0x00 0x00,0x64 CRC_Lo, CRC_Hi
Normal response:
Address function Parameter number 2 Parameter CRCCheck code
values
field 1 code 1 bytes,高字节在前 written 2 bytes,High 2 bytes,Low byte first
byte byte byte first
0x01 0x06 0x00,0x00 0x00,0x64 CRC_Lo, CRC_Hi
Abnormal response:
Address function Exception code1byte CRCCheck code
field 1 code 1 2 bytes,Low byte first
byte byte
0x01 0x86 0x01 or 02 or 03 or 04 CRC_Lo, CRC_Hi
In this example, ADDR = 0x01 and VALUE = 0x0102 in the sending frame indicate that the value 0x0102
14
6.4 Write multiple parameters(CMD=10H)
The parameters listed in the debugging manual can be written by using the write
parameter function code (10H). The format of communication frame is described as
follows:
Note: The function code 10H can write multiple parameters at a time (the maximum number of
parameters written at a time is 10). Before writing the parameters, please refer to the parameter
specification to confirm the specific meaning of the parameters. Writing the parameter values incorrectly
SADR:Write parameter start address SADRH (high byte) SADRL (low byte)
WNUM:Number of written parameters WNUMH (high byte) WNUML (low byte)
WNUMB:Number of bytes of written parameters (for example, WNUM is 2, that is, two 16-bit data, then
15
WNUMB is 2*2 = 4)
D1_H:The high byte value of the first parameter written
D1_L:The low byte value of the first parameter written
D2_H:The high byte value of the second parameter written
D2_L:The low byte value of the second parameter written
In this example, SADR = 0x01 and WNUM = 0x02 in the transmission frame
indicate that two parameters (i.e., two parameters P-001 and P-002 with
addresses 0x01 and 0x02) are written from the start address 1.
16
6.5 Diagnostic function(CMD=08H)
After the master sends a diagnostic frame, the slave (servo driver) will respond to the same data
Tip: the diagnostic function can be used to determine whether MODBUS communication is normal or not
Host sends frame:
ADDR CODE DATA_H DATA_L CRC_L CRC_H
0x01 0x08 0x12 0x34 0xXX 0xXX
Slave response frame:
ADDR CODE DATA_H DATA_L CRC_L CRC_H
0x01 0x08 0x12 0x34 0xXX 0xXX
The slave response frame data of the diagnostic command should be exactly the same as the frame data
sent by the master, so whether the communication is normal can be detected by the diagnostic command.
DATA can be arbitrary custom data. For example, if the master sends 0xABCD, the slave responds with
0xABCD.
The function code of saving parameters (41H) can be used to store the parameters of the drive into
Note: After sending this command, the servo driver needs some time to save the parameters to
EEPROM It is suggested that after sending this command, wait for more than 5S before performing other
operations.
17
6.7 Servo enable/power off(CMD=42H)
Request/normal response:
Request/normal response:
Address function CRCCheck code
field 1 code 1 2 bytes,Low byte first
byte byte
0x01 0x43 CRC_Lo, CRC_Hi
Abnormal response:
1. Address function Exception code1byte CRCCheck code
field 1 code 1 2 bytes,Low byte first
byte byte
0x01 0xC3 0x01 or 02 or 03 or 04 CRC_Lo, CRC_Hi
18