9.4.1 Command code: 03H, reading N words

Continuously reading a maximum of 16 words

The command code 03H is used by the master to read data from the VFD. The quantity of data to be read depends on the "data quantity" in the command. A maximum of 16 pieces of data can be read. The addresses of the read parameters must be contiguous. Each piece of data occupies 2 bytes, that is, one word. The command format is presented using the hexadecimal system (a number followed by "H" indicates a hexadecimal value). One hexadecimal value occupies one byte.

The 03H command is used to read information including the parameters and operation state of the VFD.

For example, starting from the data address of 0004H, to read two contiguous pieces of data (that is, to read content from the data addresses 0004H and 0005H), the structure of the frame is described in the following table.

RTU master command (transmitted by the master to the VFD)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR (address)

01H

CMD (command code)

03H

Most significant byte (MSB) of the start address

00H

Least significant byte (LSB) of the start address

04H

MSB of data quantity

00H

LSB of data quantity

02H

LSB of CRC

85H

MSB of CRC

CAH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

The value in START and END is "T1-T2-T3-T4 (transmission time of 3.5 bytes)", indicating that the RS485 needs to stay idle for at least the transmission time of 3.5 bytes. An idle time is required to distinguish on message from another to ensure that the two messages are not regarded as one.

The value of ADDR is 01H, indicating that the command is transmitted to the VFD whose address is 01H. The ADDR information occupies one byte.

The value of CMD is 03H, indicating that the command is used to read data from the VFD. The CMD information occupies one byte.

"Start address" indicates that data reading is started from this address. It occupies two bytes, with the MSB on the left and LSB on the right.

"Data quantity" indicates the quantity of data to be read (unit: word).

The value of "Start address" is 0004H, and that of "Data quantity" is 0002H, indicating that data is to be read from the data addresses of 0004H and 0005H.

CRC check occupies two bytes, with the LSB on the left, and MSB on the right.

RTU slave response (transmitted by the VFD to the master)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

01H

CMD

03H

Number of bytes

04H

MSB of data in 0004H

13H

LSB of data in 0004H

88H

MSB of data in 0005H

00H

LSB of data in 0005H

00H

LSB of CRC

7EH

MSB of CRC

9DH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

The definition of the response information is described as follows:

The value of ADDR is 01H, indicating that the message is transmitted by the VFD whose address is 01H. The ADDR information occupies one byte.

The value of CMD is 03H, indicating that the message is a response of the VFD to the 03H command of the master for reading data. The CMD information occupies one byte.

"Number of bytes" indicates the number of bytes between a byte (not included) and the CRC byte (not included). The value 04 indicates that there are four bytes of data between "Number of bytes" and "LSB of CRC", that is, "MSB of data in 0004H", "LSB of data in 0004H", "MSB of data in 0005H", and "LSB of data in 0005H".

A piece of data is two bytes, with the MSB on the left and LSB on the right. From the response, we can see that the data in 0004H is 1388H, and that in 0005H is 0000H.

CRC check occupies two bytes, with the LSB on the left, and MSB on the right.

9.4.2 Command code: 06H, writing a word

This command is used by the master to write data to the VFD. One command can be used to write only one piece of data. It is used to modify the parameters and operation mode of the VFD.

For example, to write 5000 (1388H) to 0004H of the VFD whose address is 02H, the structure of the frame is described in the following table.

RTU master command (transmitted by the master to the VFD)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

02H

CMD

06H

MSB of data writing address

00H

LSB of data writing address

04H

MSB of to-be-written data

13H

LSB of to-be-written data

88H

LSB of CRC

C5H

MSB of CRC

6EH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

RTU slave response (transmitted by the VFD to the master)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

02H

CMD

06H

MSB of data writing address

00H

LSB of data writing address

04H

MSB of to-be-written data

13H

LSB of to-be-written data

88H

LSB of CRC

C5H

MSB of CRC

6EH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

Note: The sections 9.4.1 and 9.4.2 mainly describes the command formats. For the detailed application, see the examples in section 9.4.8 "Read/Write operation example".

9.4.3 Command code: 08H, diagnosis

Sub-function code description

Sub-function code

Description

0000

Return data based on query requests

For example, to query about the circuit detection information about the VFD whose address is 01H, the query and return strings are the same, and the format is described in the following tables.

RTU master command

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

01H

CMD

08H

MSB of the sub-function code

00H

LSB of the sub-function code

00H

MSB of data

12H

LSB of data

ABH

LSB of CRC CHK

ADH

MSB of CRC CHK

14H

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

RTU slave response

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

01H

CMD

08H

MSB of the sub-function code

00H

LSB of the sub-function code

00H

MSB of data

12H

LSB of data

ABH

LSB of CRC CHK

ADH

MSB of CRC CHK

14H

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

9.4.4 Command code: 10H, continuous writing

The command code 10H is used by the master to write data to the VFD. The quantity of data to be written is determined by "Data quantity", and a maximum of 16 pieces of data can be written.

For example, to write 5000 (1388H) and 50 (0032H) respectively to 0004H and 0005H of the VFD whose slave address is 02H, the structure of the frame is described in the following table.

RTU master command (transmitted by the master to the VFD)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

02H

CMD

10H

MSB of data writing address

00H

LSB of data writing address

04H

MSB of data quantity

00H

LSB of data quantity

02H

Number of bytes

04H

MSB of data to be written to 0004H

13H

LSB of data to be written to 0004H

88H

MSB of data to be written to 0005H

00H

LSB of data to be written to 0005H

32H

LSB of CRC

C5H

MSB of CRC

6EH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

RTU slave response (transmitted by the VFD to the master)

START

T1-T2-T3-T4 (transmission time of 3.5 bytes)

ADDR

02H

CMD

10H

MSB of data writing address

00H

LSB of data writing address

04H

MSB of data quantity

00H

LSB of data quantity

02H

LSB of CRC

C5H

MSB of CRC

6EH

END

T1-T2-T3-T4 (transmission time of 3.5 bytes)

 

9.4.5 Data address definition

This section describes the address definition of communication data. The addresses are used for controlling the running, obtaining the state information, and setting related function parameters of the VFD.

9.4.5.1 Function code address representation rules

The address of a function code consists of two bytes, with the MSB on the left and LSB on the right. The MSB ranges from 00 to ffH, and the LSB also ranges from 00 to ffH. The MSB is the hexadecimal form of the group number before the dot mark, and LSB is that of the number behind the dot mark. Take P05.06 as an example, the group number is 05, that is, the MSB of the parameter address is the hexadecimal form of 05; and the number behind the dot mark is 06, that is, the LSB is the hexadecimal form of 06. Therefore, the function code address is 0506H in the hexadecimal form. For P10.01, the parameter address is 0A01H.

Function  code

Name

Detailed parameter description

Setting  range

Default  value

Modify

P10.00

Simple PLC mode

0: Stop after running once

1: Keep running in the final value after running once

2: Cyclic running

0-2

0

P10.01

Simple PLC memory selection

0: No memory after power down

1: Memory after power down

0-1

0

Note:

1.    The parameters in the P99 group are set by the manufacturer. They cannot be read or modified. Some parameters cannot be modified when the VFD is running; some cannot be modified regardless of the state of the VFD. Pay attention to the setting range, unit, and related description of a parameter when modifying it.

2.    The service life of the Electrically Erasable Programmable Read-Only Memory (EEPROM) may be reduced if it is frequently used for storage. For users, some function codes do not need to be stored during communication. The application requirements can be met by modifying the value of the on-chip RAM, that is, modifying the MSB of the corresponding function code address from 0 to 1. For example, if P00.07 is not to be stored in the EEPROM, you need only to modify the value of the RAM, that is, set the address to 8007H. The address can be used only for writing data to the on-chip RAM, and it is invalid when used for reading data.

9.4.5.2 Description of other function code addresses

In addition to modifying the parameters of the VFD, the master can also control the VFD, such as start and stop it, and monitor the operation state of the VFD. The following table describes other function parameters.

Function

Address

Data description

R/W

Communication-based control command

2000H

0001H: Forward running

R/W

0002H: Reverse running

0003H: Forward jogging

0004H: Reverse jogging

0005H: Stop

0006H: Coast to stop

0007H: Fault reset

0008H: Jogging to stop

Communication-based value setting

2001H

Communication-based frequency setting (0–Fmax, unit: 0.01 Hz)

R/W

2002H

PID setting, range (0–1000, 1000 corresponding to 100.0%)

2003H

PID feedback, range (0–1000, 1000 corresponding to 100.0%)

R/W

2004H

Torque setting (-3000–+3000, 1000 corresponding to 100.0% of the rated current of the motor)

R/W

2005H

Setting of the upper limit of the forward running frequency (0–Fmax, unit: 0.01 Hz)

R/W

2006H

Setting of the upper limit of the reverse running frequency (0–Fmax, unit: 0.01 Hz)

R/W

2007H

Upper limit of the electromotion torque (0–3000, 1000 corresponding to 100.0% of the rated current of the VFD)

R/W

2008H

Upper limit of the brake torque (0–3000, 1000 corresponding to 100.0% of the rated current of the motor)

R/W

2009H

Special control command word:

Bit1–0: =00: Motor 1   =01: Motor 2

        =10: Motor 3   =11: Motor 4

Bit2: =1 Torque control disabled =0: Torque control cannot be disabled

Bit3: =1 Power consumption reset to 0

=0: Power consumption not reset

Bit4: =1 Pre-excitation  =0: Pre-excitation disabled

Bit5: =1 DC brake  =0: DC brake disabled

R/W

200AH

Virtual input terminal command, range: 0x0000x3FF

Corresponding to S8/S7/S6/S5/HDIB/HDIA/S4/ S3/ S2/S1

R/W

200BH

Virtual output terminal command, range: 0x000x0F

Corresponding to local RO2/RO1/HDO/Y1

R/W

200CH

Voltage setting (used when V/F separation is implemented)

(0–1000, 1000 corresponding to 100.0% of the rated voltage of the motor)

R/W

200DH

AO output setting 1 (-1000–+1000, 1000 corresponding to 100.0%)

R/W

200EH

AO output setting 2 (-1000–+1000, 1000 corresponding to 100.0%)

R/W

VFD state word 1

2100H

0001H: Forward running

R

0002H: Reverse running

0003H: Stopped

0004H: Faulty

0005H: POFF

0006H: Pre-excited

VFD state word 2

29.4H

Bit0:  =0: Not ready to run  =1: Ready to run

Bi2–1: =00: Motor 1   =01: Motor 2

=10: Motor 3   =11: Motor 4

Bit3:   =0: Asynchronous machine  =1: Synchronous machine

Bit4: =0: No overload alarm =1: Overload alarm

Bit6–Bit5: =00: Keypad-based control   =01: Terminal-based control

=10: Communication-based control

Bit7reserved

Bit8:=0:speed control    =1:torque control

Bit9:=0:not for position control =1:position control

Bit19.40: =0:vector 0  =1:vector 1  =2: Closed-loop vector

=3:SVPWM

R

VFD fault code

2102H

See the description of fault types.

R

VFD identification code

2103H

GD350-----0x01A0

R

Running frequency

3000H

0–Fmax (unit: 0.01Hz)

Compatible with CHF100A and CHV100 communication addresses

R

Set frequency

3001H

0–Fmax (unit: 0.01Hz)

R

Bus voltage

3002H

0.0–2000.0 V (unit: 0.1V)

R

Output voltage

3003H

0–1200V (unit: 1V)

R

Output current

3004H

0.0–3000.0A (unit: 0.1A)

R

Rotating speed

3005H

0–65535 (unit: 1RPM)

R

Ouptut power

3006H

-300.0–+300.0% (unit: 0.1%)

R

Output torque

3007H

-250.0–+250.0% (unit: 0.1%)

R

Closed-loop setting

3008H

-100.0–+100.0% (unit: 0.1%)

R

Closed-loop feedback

3009H

-100.0–+100.0% (unit: 0.1%)

R

Input state

300AH

000–3F

Corresponding to the local HDIB/ HDIA/S4/S3/S2/S1

R

Output state

300BH

000–0F

Corresponding to the local RO2/RO1/HDO/Y1

R

Analog input 1

300CH

0.00–10.00V (unit: 0.01V)

R

Analog input 2

300DH

0.00–10.00V (unit: 0.01V)

R

Analog input 3

300EH

-10.00–10.00V (unit: 0.01V)

R

Analog input 4

300FH


R

Read input of high-speed pulse 1

3010H

0.00–50.00kHz (unit: 0.01Hz)

R

Read input of high-speed pulse 2

3011H


R

Read current step of multi-step speed

3012H

0–15

R

External length

3013H

0–65535

R

External count value

3014H

0–65535

R

Torque setting

3015H

-300.0–+300.0% (unit: 0.1%)

R

Identification code

3016H


R

Fault code

5000H


R

The Read/Write (R/W) characteristics indicate whether a function can be read and written. For example, "Communication-based control command" can be written, and therefore the command code 6H is used to control the VFD. The R characteristic indicates that a function can only be read, and W indicates that a function can only be written.

Note: Some parameters in the preceding table are valid only after they are enabled. Take the running and stop operations as examples, you need to set "Running command channel" (P00.01) to "Communication", and set "Communication running command channel" (P00.02) to the Modbus communication channel. For another example, when modifying "PID setting", you need to set "PID reference source" (P09.00) to Modbus communication.

The following table describes the encoding rules of device codes (corresponding to the identification code 2103H of the VFD).

8 MSBs

Meaning

8 LSBs

Meaning

01

GD

0x08

GD35 vector VFD

0x09

GD35-H1 vector VFD

0x0a

GD300 vector VFD

0xa0

GD350 vector VFD

 

9.4.6 Fieldbus scale

In practical applications, communication data is represented in the hexadecimal form, but hexadecimal values cannot represent decimals. For example, 50.12 Hz cannot be represented in the hexadecimal form. In such cases, we can multiply 50.12 by 100 to obtain an integer 5012, and then 50.12 can be represented as 1394H (5012 in the decimal form) in the hexadecimal form.

In the process of multiplying a non-integer by a multiple to obtain an integer, the multiple is referred to as a fieldbus scale.

The fieldbus scale depends on the number of decimals in the value specified in "Detailed parameter description" or "Default value". If there are n decimals in the value, the fieldbus scale m is the nth-power of 10. Take the following table as an example, m is 10.

Function code

Name

Detailed parameter description

Default value

P01.20

Wake-up-from-sleep delay

0.0–3600.0s (valid when P09.49 is 2)

0.0s

P01.21

Restart after power cut

0: Restart is disabled

1: Restart is enabled

0

The value specified in "Detailed parameter description" or "Default value" contains one decimal, so the fieldbus scale is 10. If the value received by the upper computer is 50, the value of "Wake-up-from-sleep delay" of the VFD is 5.0 (5.0=50/10).

To set the "Wake-up-from-sleep delay" to 5.0s through Modbus communication, you need first to multiply 5.0 by 10 according to the scale to obtain an integer 50, that is, 32H in the hexadecimal form, and then transmit the following write command:                                             image.png

After receiving the command, the VFD converts 50 into 5.0 based on the fieldbus scale, and then sets "Wake-up-from-sleep delay" to 5.0s.

For another example, after the upper computer transmits the "Wake-up-from-sleep delay" parameter read command, the master receives the following response from the VFD:

image.png

The parameter data is 0032H, that is, 50, so 5.0 is obtained based on the fieldbus scale (50/10=5.0). In this case, the master identifies that the "Wake-up-from-sleep delay" is 5.0s.

9.4.7 Error message response

Operation errors may occur in communication-based control. For example, some parameters can only be read, but a write command is transmitted. In this case, the VFD returns an error message response.

Error message responses are transmitted by the VFD to the master. The following table describes the codes and definitions of the error message responses.

Code

Name

Definition

01H

Invalid command

The command code received by the upper computer is not allowed to be executed. The possible causes are as follows:

  • The function code is applicable only on new devices and is not implemented on this device.

  • The slave is in the faulty state when processing this request.

02H

Invalid data address

For the VFD, the data address in the request of the upper computer is not allowed. In particular, the combination of the register address and the number of the to-be-transmitted bytes is invalid.

03H

Invalid data bit

The received data domain contains a value that is not allowed. The value indicates the error of the remaining structure in the combined request.

Note: It does not mean that the data item submitted for storage in the register includes a value unexpected by the program.

04H

Operation failure

The parameter is set to an invalid value in the write operation. For example, a function input terminal cannot be set repeatedly.

05H

Password error

The password entered in the password verification address is different from that set in P03.00.

06H

Data frame error

The length of the data frame transmitted by the upper computer is incorrect, or in the RTU format, the value of the CRC check bit is inconsistent with the CRC value calculated by the lower computer

07H

Parameter read-only

The parameter to be modified in the write operation of the upper computer is a read-only parameter.

08H

Parameter cannot be modified in running

The parameter to be modified in the write operation of the upper computer cannot be modified during the running of the VFD.

09H

Password protection

A user password is set, and the upper computer does not provide the password to unlock the system when performing a read or write operation. The error of "system locked" is reported.

When returning a response, the device uses a function code domain and fault address to indicate whether it is a normal response (no error) or exception response (some errors occur). In a normal response, the device returns the corresponding function code and data address or sub-function code. In an exception response, the device returns a code that is equal to a normal code, but the first bit is logic 1.

For example, if the master device transmits a request message to a slave device for reading a group of function code address data, the code is generated as follows:

0 0 0 0 0 0 9.4 (03H in the hexadecimal form)

For a normal response, the same code is returned.

For an exception response, the following code is returned:

1 0 0 0 0 0 9.4 (83H in the hexadecimal form)

In addition to the modification of the code, the slave returns a byte of exception code that describes the cause of the exception. After receiving the exception response, the typical processing of the master device is to transmit the request message again or modify the command based on the fault information.

For example, to set the "Running command channel" (P00.01, the parameter address is 0001H) of the VFD whose address is 01H to 03, the command is as follows:

image.png

But the setting range of the "Running command channel" is 0 to 2. The value 3 exceeds the setting range. In this case, the VFD returns an error message response as shown in the following:

image.png

The exception response code 86H (generated based on the MSB "1" of the write command 06H) indicates that it is an exception response to the write command (06H). The error code is 04H. From the preceding table, we can see that it indicates the error "Operation failure", which means "The parameter is set to an invalid value in the write operation".

9.4.8 Read/Write operation example

For the formats of the read and write commands, see sections 9.4.1 and 9.4.2.

9.4.8.1 Read command 03H examples

Example 1: Read state word 1 of the VFD whose address is 01H. From the table of other function parameters, we can see that the parameter address of state word 1 of the VFD is 2100H.

The read command transmitted to the VFD is as follows:

image.png

Assume that the following response is returned:

image.png

The data content returned by the VFD is 0003H, which indicates that the VFD is in the stopped state.

Example 2: View information about the VFD whose address is 03H, including "Type of current fault" (P07.27) to "Type of last but four fault" (P07.32) of which the parameter addresses are 071BH to 0720H (contiguous 6 parameter addresses starting from 071BH).

The command transmitted to the VFD is as follows:

image.png

Assume that the following response is returned:

image.png

From the returned data, we can see that all the fault types are 0023H, that is, 35 in the decimal form, which means the maladjustment fault (STo)

9.4.8.2 Write command 06H examples

Example 1: Set the VFD whose address is 03H to be forward running. Refer to the table of other function parameters, the address of "Communication-based control command" is 2000H, and 0001H indicates forward running, as shown in the following figure.

Function

Address

Data description

R/W

Communication-based control command

2000H

0001H: Forward running

R/W

0002H: Reverse running

0003H: Forward jogging

0004H: Reverse jogging

0005H: Stop

0006H: Coast to stop

0007H: Fault reset

0008H: Jogging to stop

The command transmitted by the master is as follows:

image.png

If the operation is successful, the following response is returned (same as the command transmitted by the master):

image.png

Example 2: Set the "Max. output frequency" of the VFD whose address is 03H to 100 Hz.

Function code

Name

Detailed parameter description

Default value

Modify

P00.03

Max. output frequency

Used to set the max. output frequency of the VFD. It is the basis of frequency setup and the acceleration/deceleration.

Setting range: Max (P00.04, 10.00) –630.00Hz

50.00Hz

From the number of decimals, we can see that the fieldbus scale of the "Max. output frequency" (P00.03) is 100. Multiply 100 Hz by 100. The value 10000 is obtained, and it is 2710H in the hexadecimal form.

The command transmitted by the master is as follows:

image.png

If the operation is successful, the following response is returned (same as the command transmitted by the master):

image.png

Note: In the preceding command description, spaces are added to a command just for explanatory purposes. In practical applications, no space is required in the commands. 

9.4.8.3 Continuously write command 10H examples

Example 1: Set the VFD whose address is 01H to be forward running at the frequency of 10 Hz. Refer to the table of other function parameters, the address of "Communication-based control command" is 2000H, 0001H indicates forward running, and the address of "Communication-based value setting" is 2001H, as shown in the following figure. 10 Hz is 03E8H in the hexadecimal form.

Function

Address

Data description

R/W

Communication-based control command

2000H

0001H: Forward running

R/W

0002H: Reverse running

0003H: Forward jogging

0004H: Reverse jogging

0005H: Stop

0006H: Coast to stop

0007H: Fault reset

0008H: Jogging to stop

Communication-based value setting

2001H

Communication-based frequency setting (0–Fmax, unit: 0.01 Hz)

R/W

2002H

PID setting, range (0–1000, 1000 corresponding to 100.0%)

In the actual operation, set P00.01 to 2 and P00.06 to 8.

The command transmitted by the master is as follows:

image.png

If the operation is successful, the following response is returned:

image.png

Example 2: Set "Acceleration time" of the VFD whose address is 01H to 10s, and "Deceleration time" to 20s.

Function code

Name

Detailed parameter  description

Default value

Modify

P00.11

Acceleration  
  time 1

Setting range of P00.11 and P00.12: 0.0–3600.0s

Depends on model

P00.12

Deceleration  
  time 1

Depends on model

The address of P00.11 is 000B, 10s is 0064H in the hexadecimal form, and 20s is 00C8H in the hexadecimal form.

The command transmitted by the master is as follows:

image.png

If the operation is successful, the following response is returned:

image.png

Note: In the preceding command description, spaces are added to a command just for explanatory purposes. In practical applications, no space is required in the commands.

9.4.8.4 Modbus communication commissioning example

A PC is used as the host, an RS232-RS485 converter is used for signal conversion, and the PC serial port used by the converter is COM1 (an RS232 port). The upper computer commissioning software is the serial port commissioning assistant Commix, which can be downloaded from the Internet. Download a version that can automatically execute the CRC check function. The following figure shows the interface of Commix.

image.png

First, set the serial port to COM1. Then, set the baud rate consistently with P14.01. The data bits, check bits, and end bits must be set consistently with P14.02. If the RTU mode is selected, you need to select the hexadecimal form Input HEX. To set the software to automatically execute the CRC function, you need to select ModbusRTU, select CRC16 (MODBU SRTU), and set the start byte to 1. After the auto CRC check function is enabled, do not enter CRC information in commands. Otherwise, command errors may occur due to repeated CRC check.

The commissioning command to set the VFD whose address is 03H to be forward running is as follows:

image.png

Note:

1.    Set the address (P14.00) of the VFD to 03.

2.    Set "Channel of running commands" (P00.01) to "Communication", and set "Communication channel of running commands" (P00.02) to the Modbus communication channel.

3.    Click Send. If the line configuration and settings are correct, a response transmitted by the VFD is received as follows:


上一章节 下一章节