9. MODBUS Communication Protocol
Streszczenie: Protokół MODBUS RTU w KE600: struktura ramek, kody funkcji 03H i 06H, CRC, adresy parametrów oraz rejestrów sterujących i statusowych, kody błędów komunikacji i parametry grupy Pd.
EN: KE600 MODBUS RTU protocol: frame structure, function codes 03H and 06H, CRC, parameter and control/status register addresses, communication error codes and group Pd parameters.
Dotyczy: falownik wektorowy z zamkniętą pętlą Micno KE600 (zasilanie 3AC 220 V, 3AC 380 V, 3AC 660 V; moce 1,5–630 kW)
Źródło: dokumentacja producenta (Micno KE600 Series Inverter User Manual); tabele przepisane z obrazów na tekst – opracowanie Multiprojekt
KE600 series inverter provides RS485 communication interface, and adopts MODBUS communication protocol. User can realize centralized monitoring through PC/PLC, host computer, and also can set inverter’s operating commands, modify or read function parameters, read operating status and fault information, etc.
9.1 About Protocol
This serial communication protocol defines the transmission information and use format in the series communication. It includes the formats of master-polling, broadcast and slave response frame, and master coding method with the content including slave address (or broadcast address), command, transmiting data and error checking. The response of slave adopts the same structure, including action confirmation, returning the data and error checking etc. If slave takes place the error while it is receiving the information or cannot finish the action demanded by master, it will send one fault signal to master as a response.
9.2 Application Method
The inverter could be connected into a “Single-master Multi-slave” PC/PLC control network with RS485 bus.
9.3 Bus Structure
(1) Interface mode
RS485
(2) Transmission mode
There provide asynchronous series and half-duplex transmission mode. At the same time, just one can send the data and the other only receives the data between master and slave. In the series asynchronous communication, the data is sent out frame by frame in the form of message.
(3) Topological structure
In Single-master Multi-slave system, the setup range of slave address is 0 to 247. 0 refers to broadcast communication address. The address of slave must be exclusive in the network. That is basic condition of MODBUS communication.
9.4 Protocol Description
KE600 series inverter communication protocol is a kind of asynchronous serial master-slave communication protocol. In the network, only one equipment (master) can build a protocol (Named as “Inquiry/Command”). Other equipments (slave) response “Inquiry/Command” of master only by providing the data, or doing the action according to the master’s “Inquiry/Command”. Here, master is Personnel Computer, Industrial control equipments or Programmable logical controller, and the slave is inverter or other communication equipments with the same communication protocol. Master not only can visit some slave separately for communication, but also sends the broadcast information to all the slaves. For the single “Inquiry/Command” of master, all of slaves will return a signal that is a response; for the broadcast information provided by master, slave needs not feedback a response to master.
9.5 Communication Data Structure
MODBUS protocol communication data format of KE600 series inverter is shown as following:
In RTU mode, the Modbus minimum idle time between frames should be no less than 3.5 bytes. The checksum adopts CRC-16 method. All data except checksum itself sent will be counted into the calculation.
Please refer to section: CRC Check for more information. Note that at least 3.5 bytes of Modbus idle time should be kept and the start and end idle time need not be summed up to it.
The entire message frame must be transmitted as a continuous data stream. If a idle time is more than 1.5 bytes before completion of the frame, the receiving device flushes the incomplete message and assumes that the next byte will be the address field of a new message. Similarly, if a new message begins earlier than 3.5 bytes interval following a previous message, the receiving device will consider it as a continuation of the previous message. Because of the frame’s confusion, at last the CRC value is incorrect and communication fault will occur.
RTU frame format:
| Frame field | Description |
|---|---|
| START | Transmission time of 3.5 bytes |
| Slave address | Communication address: 0 to 247 |
| Command code | 03H: read slave parameters 06H: write slave parameters |
| DATA (N-1), DATA (N-2), …, DATA0 | Data: function code parameter address, the number of function code parameters, function code parameter, etc. |
| CRC low byte, CRC high byte | Detection value: CRC value |
| END | Transmission time of 3.5 bytes |
9.6 Command Code and Communication Data Description
9.6.1 Command code:Code 03H,03H – Read N Words
Command code 03H reads N words.words (Thereup areto 12 characters can be read at themost).
For example: The inverter start address F002 of the slave 01 continuously reads two consecutive values
Master command information
Request frame (master → slave)
| Field | Value |
|---|---|
| Address | 01H |
| Command code | 03H |
| Start address high byte | F0H |
| Start address low byte | 02H |
| Register number high byte | 00H |
| Register number low byte | 02H |
| CRC low byte | 56H |
| CRC high byte | CBH |
Slave responding information
Response frame (slave → master)
| Field | Value |
|---|---|
| Address | 01H |
| Command code | 03H |
| Byte number | 04H |
| Data F002H high byte | 00H |
| Data F002H low byte | 00H |
| Data F003H high byte | 00H |
| Data F003H low byte | 01H |
| CRC low byte | 3BH |
| CRC high byte | F3H |
9.6.2 Command code:Code 06H,06H write– Write a word
Word
For example: Write 5000(1388H) into address F00AH, slave address 02H.
Master command information
Write frame – master command (06H)
| Field | Value |
|---|---|
| Address | 02H |
| Command code | 06H |
| Data address high byte | F0H |
| Data address low byte | 0AH |
| Data content high byte | 13H |
| Data content low byte | 88H |
| CRC low byte | 97H |
| CRC high byte | ADH |
Slave responding information
Write frame – slave response (06H, echo of the command)
| Field | Value |
|---|---|
| Address | 02H |
| Command code | 06H |
| Data address high byte | F0H |
| Data address low byte | 0AH |
| Data content high byte | 13H |
| Data content low byte | 88H |
| CRC low byte | 97H |
| CRC high byte | ADH |
9.6.3 CRC checking
Checking
In RTU mode, messages include an error-checking field that is based on a CRC method. The CRC field checks the contents of the entire message. The CRC field is two bytes, containing a 16-bit binary value.
The CRC value is calculated by the transmitting device, which appends the CRC to the message. The receiving device recalculates a CRC during receipt of the message, and compares the calculated value to the actual value received in the CRC field. If the two values are not equal, an error results.
The CRC is started by 0xFFFF. Then a process begins of applying successive eight-bit bytes of the message to the current contents of the register. Only the eight bits of data in each character are used for generating the CRC. Start and stop bits, and the parity bit, do not apply to the CRC.
During generation of the CRC, each eight-bit character is exclusive ORed with the register contents. Then the result is shifted in the direction of the least significant bit (LSB), with a zero filled into the most significant bit (MSB) position. The LSB is extracted and examined. If the LSB was a 1, the register is then exclusive ORed with a preset, fixed value. If the LSB was a 0, no exclusive OR takes place. This process is repeated until eight shifts have been performed. After the last (eighth) shift, the next eight-bit byte is exclusive ORed with the register's current value, and the process repeats for eight more shifts as described above. The final contents of the register, after all the bytes of the message have been applied, is the CRC value.
When the CRC is appended to the message, the low byte is appended first, followed by the high byte. The following are C language source code for CRC-16
unsigned int
crc_cal_value(unsignedchar *data_value, unsigned char data_length) { int i; unsigned int crc_value = 0xffff; while (data_length--) { crc_value ^= *data_value++; for (i = 0; i < 8; i++) { if (crc_value & 0x0001) crc_value = (crc_value >> 1) ^ 0xa001; else crc_value = crc_value >> 1; } } return (crc_value); }
9.6.4 Address definitionDefinition of communicationCommunication parameter
Parameter
Here is about address definition of communication parameter. It’s used to control the inverter operation, status and related parameter setting.
(1) The mark rules of function code parameters address:
The group number and mark of function code is the parameter address for indicating the rules.
P0~PF group parameter address:
High byte: F0 to FF, low byte: 00 to FF
A0 group parameter address:
High byte: A0, low byte: 00 to FF
U0 group parameter address:
High byte: 70H, low byte: 00 to FF
For example:
P3-12, address indicates to F30C
PC-05, address indicates to FC05
A0-01, address indicates to A001
U0-03, address indicates to 7003
Note:1.
- Group PF: Either the parameter cannot be read, nor be changed.
2. - Group U0: Only for reading parameter, cannot be changed parameters.
3. - Some parameters cannot be changed during operation; some parameters regardless of what kind of status the inverter in, the parameters cannot be changed. Change the function code parameters, pay attention to the scope of the parameters, units, and relative instructions.
Besides, due to EEPROM be frequently stored, it will reduce the lifetime of EEPROM. So in the communication mode, some function code needn’t be stored, only change the RAM value. To achieve this function, change high order P of the function code into zero.
Corresponding function code addresses are indicated below:
P0~PF group parameter address:
High byte: 00 to FF, low byte: 00 to FF
A0 group parameter address:
High byte: 40, low byte: 00 to FF
U0 group parameter address:
High byte: 70H, low byte: 00 to FF
For example:
P3-12, address indicates to 030C
PC-05, address indicates to 0C05
A0-01, address indicates to 4001
These addresses can only act writing RAM, it cannot act reading. When act reading, it is invalid address.
(2) Stop/start parameter address
| Parameter address | Parameter description |
|---|---|
| 1000 | * Communication setting value (-10000 to 10000) (decimal) |
| 1001 | Running frequency |
| 1002 | Bus voltage |
| 1003 | Output voltage |
| 1004 | Output current |
| 1005 | Output power |
| 1006 | Output torque |
| 1007 | Running speed |
| 1008 | DI input flag |
| 1009 | DO output status |
| 100A | AI1 voltage |
| 100B | AI2 voltage |
| 100C | Radiator temperature |
| 100D | Counting value input |
| 100E | Length value input |
| 100F | Load speed |
| Parameter address | Parameter description |
|---|---|
| 1010 | PID setting |
| 1011 | PID feedback |
| 1012 | PLC running process |
| 1013 | HDI input pulse frequency, unit is 0.01 kHz |
| 1014 | Feedback speed, unit is 0.1 Hz |
| 1015 | Remain running time |
| 1016 | AI1 voltage before calibration |
| 1017 | AI2 voltage before calibration |
| 1018 | Reserved |
| 1019 | Linear speed |
| 101A | Current power on time |
| 101B | Current running time |
| 101C | HDI input pulse frequency, unit is 1 Hz |
| 101D | Communication setting value |
| 101E | Actual feedback speed |
| 101F | Main frequency A display |
| 1020 | Auxiliary frequency B display |
Note:
Communication setting value is the percentage of relative value, and 10,000 corresponds to 100.00%, -10000 corresponds to -100.00%.
To the data of frequency, the percentage is the percentage of relative maximum frequency (P0-10).
To the data of torque, the percentage is P2-10 (torque upper limit).
(3) Control command input to inverter (write only)
| Command word address | Command function |
|---|---|
| 2000 | 0001: forward running 0002: reverse running 0003: forward jog 0004: reverse jog 0005: coast to stop 0006: deceleration to stop 0007: fault reset |
(4) Read inverter status: (read only)
| Status word address | Status word function |
|---|---|
| 3000 | 0001: forward running 0002: reverse running 0003: stop |
(5) Parameters locking password check: (If the return is 8888H, it means the password check passes.)
| Password address | Content of input password |
|---|---|
| 1F00 | ***** |
(6) Digital output terminal control: (write only)
| Command address | Command content |
|---|---|
| 2001 | BIT0: reserved BIT1: reserved BIT2: RELAY1 output control BIT3: RELAY2 output control BIT4: HDO open collector output control |
(7) Analog output AO1 control: (write only)
| Command address | Command content |
|---|---|
| 2002 | 0 ~ 7FFF refers to 0% ~ 100% |
(8) Analog output AO2 control: (write only)
| Command address | Command content |
|---|---|
| 2003 | 0 ~ 7FFF refers to 0% ~ 100% |
(9) Pulse output control: (write only)
| Command address | Command content |
|---|---|
| 2004 | 0 ~ 7FFF refers to 0% ~ 100% |
(10) Inverter fault code description:
| Inverter fault address | Inverter fault information |
|---|---|
| 8000 | 0000: No fault 0001: Reserved 0002: Over current when acceleration 0003: Over current when deceleration 0004: Over current when constant speed running 0005: Over voltage when acceleration 0006: Over voltage when deceleration 0007: Over voltage when constant speed running 0008: Reserved 0009: Under voltage fault 000A: Inverter overload 000B: Motor overload 000C: Input phase failure 000D: Output phase failure 000E: Module overheat 000F: External fault 0010: Communication fault 0011: Contactor fault 0012: Current detection fault 0013: Motor autotuning fault 0014: Encoder/PG card abnormal 0015: Parameter R/W fault 0016: Inverter hardware fault 0017: Motor short circuit to ground fault 0018: Reserved 0019: Reserved 001A: Running time arrival 001B: Customized fault 1 001C: Customized fault 2 001D: Power on time arrival 001E: Off load 001F: PID feedback lost when running 0028: Fast current limiting over time fault 0029: Reserved 002A: Speed deviation oversize 002B: Motor over speed |
9.6.5 Description dataData of communicationCommunication Fault Information (Fault Code)
| Communication fault | Fault |
|---|---|
| 8001 | 0000: No fault 0001: 0002: Command error0003: CRC check error |
9.7 PD Group Communication Parameter Description
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-00 | Baud rate | 6005 (as printed in the source; most likely 5 = 9600 BPS) | 0: 300 BPS 1: 600 BPS 2: 1200 BPS 3: 2400 BPS 4: 4800 BPS 5: 9600 BPS 6: 19200 BPS 7: 38400 BPS |
This parameter is used to set the data transmission rate between host computer and the inverter. Please note that baud rate of the host computer and inverter must be the same. Otherwise, the communication is impossible. The bigger baud rate is, the faster communication is.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-01 | Data format | 0 | 0: No check: data format <8,N,2> 1: Even parity check: data format <8,E,1> 2: Odd parity check: data format <8,O,1> 3: No check: data format <8,N,1> |
The setting data format of host computer and inverter must be the same; otherwise, the communication is impossible.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-02 | Local address | 1 | 1 ~ 247, 0 is broadcast address |
When the local address is set to be 0, that is broadcast address, it can realize the broadcast function of host computer.
Local address must be unique (except broadcast address). This is the base of point-to-point communication between host computer and inverter.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-03 | Response delay | 2 ms | 0 ~ 20 ms |
Response delay: It refers to the interval time from the inverter finishes receiving data to sending data to the host computer. If the response delay is less than system processing time, then the response delay is based on the system processing time. If the response delay is more than system processing time, after the system processing the data, it should be delayed to wait until the response delay time arrives, then sending data to host computer.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-04 | Communication timeout | 0.0 s | 0.0 s: invalid 0.1 ~ 60.0 s |
When the function code set to be 0.0 s, the communication timeout parameter is invalid.
When the function code set to be valid value, if the interval time between the communication and the next communication is beyond the communication timeout, the system will report communication failure error (Err16). At normal circumstances, it is set to be invalid. If in the continuous communication system, set the parameter, you can monitor the communication status.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-05 | Communication protocol selection | 1 | 0: Non-standard Modbus protocol 1: Standard Modbus protocol |
PD-05=1: Select standard MODBUS protocol
PD-05=0: When reading the command, the slave return is one byte than the standard MODBUS protocol’s, for details refer to communications Data Structure of this protocol.
| Parameter | Name | Factory default | Setting range |
|---|---|---|---|
| Pd-06 | Communication read current resolution | 0 | 0: 0.01 A 1: 0.1 A |
It is used to confirm the output current unit when communication reads output current.
Słowa kluczowe
Micno KE600, MODBUS RTU, RS485, ramka, frame, 03H, 06H, CRC, adres rejestru, register address, 2000H, 3000H, 8000H, Pd-00, prędkość transmisji, baud rate




















