深圳市白山機(jī)電一體化技術(shù)有限公司
    當(dāng)前位置:
  • 首頁>
  • 產(chǎn)品中心>
  • 特殊功能補(bǔ)充協(xié)議>
  • ModBUS串口協(xié)議(ModB...

取消

清空記錄

歷史記錄

清空記錄

歷史記錄

清空記錄

歷史記錄

—— 產(chǎn)品中心 ——
PROJECTS
ModBUS串口協(xié)議(ModBUS Serial port protocol)

分享到微信

×
ModBUS串口協(xié)議
(ModBUS Serial port protocol)
產(chǎn)品詳情
資料下載

ModBUS串口協(xié)議

ModBUS Serial port protocol

 

1、通訊協(xié)議Communication protocol)

采用異步主從半雙工方式通訊,上位機(jī)作為主站,驅(qū)動器作為從站進(jìn)行工作,由主站發(fā)起詢問(發(fā)起通訊),從站在接到主站請求后作相應(yīng)的應(yīng)答,只有當(dāng)接收到的字節(jié)滿足協(xié)議要求時,驅(qū)動器才返回數(shù)據(jù),否則不應(yīng)答。主要協(xié)議如表1所示。Using asynchronous master semi-duplex communication, the upper machine as the main station, the drive as the slave station to work, by the master station to initiate inquiry (initiate communication), the slave station after receiving the request from the master station, only when the received bytes meet the protocol requirements, the drive will return data, otherwise do not answer. The main protocol is shown in Table Table 1.)

 

1驅(qū)動器通訊協(xié)議Table 1 The drive communication protocol)

 

名稱name)

內(nèi)容content)

說明explain)

接口joggle)

RS485


驅(qū)動器地址

Drive address)

0x01-0x1F(1-31)

數(shù)碼管BS19的設(shè)定值

Set value of the digital tube BS19)

波特率

Baud rate)

9600,19200,38400,115200

數(shù)碼管BS18的設(shè)定值

Set value of the digital tube BS18)

數(shù)據(jù)幀格式

data frame format

1位起始位,8位數(shù)據(jù)位,無奇偶校驗位,1位停止位,無控制流.

1 bit, 8 bit, no parity bit, 1 bit stop bit, no control flow.)


報文格式

message format)

命令字:0x03

Command word: 0x03)

讀取單寄存器數(shù)據(jù)命令

Read the single-register data command)

命令字:0x06

Command word: 0x06

寫入單寄存器數(shù)據(jù)命令

Write to a single-register data command)

命令字:0x10

Command word: 0x10

寫入多寄存器數(shù)據(jù)命令,控制電機(jī)直接運行。

Write the multi-register data command and control the motor to run directly.)

pour:)

1. 波特率更改后重新上電有效,否則默認(rèn)為剛上電時的波特率。當(dāng)串行口通訊不暢時,請降低通訊的波特率;1. After the port rate is changed, the power on is valid, otherwise the default is the wave rate when just power on. When the serial port communication is not smooth, please reduce the port rate of communication;)

2.同一串口線上的多臺驅(qū)動器地址不可重復(fù),否則會造成通訊錯誤,甚至損壞串口芯片。2. The addresses of multiple drives on the same serial port line cannot be repeated, otherwise it will cause communication errors and even damage the serial port chip.)

 

2、命令字:0x03 ,讀取單個寄存器命令2, the command word: 0x03, read a single register command),

該命令為讀取驅(qū)動器單個寄存器的命令,主機(jī)請求與驅(qū)動器返回格式如下This command is a command to read a single register of the drive, and the host request and drive return format are as follows:)

 

2主機(jī)請求數(shù)據(jù)(命令字0x03)Table 2 Host request data (command word 0x03)

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

數(shù)據(jù)長度

DL)

校驗碼

check code)

1字節(jié)

1 Bytes

1字節(jié)

1 Bytes

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

 

0x03

0x0000

0x0001

0x0002

(固定數(shù))

(Fixed number)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

pour:)

1. 寄存器地址定義如表4所示1. Register address is defined as shown in Table 4)

 

2. CRC校驗初值為0xFFFF,多項式為0xA001,低字節(jié)在前。2. The initial value of CRC check is 0xFFFF, the polynomial is 0 xA 001, and the low bytes are first.)

 

 

3驅(qū)動器返回的數(shù)據(jù)(命令字0x03)Table 3 Data returned by the drive (command word 0x03))

驅(qū)動器地址

Drive address)

命令字

CW)

字節(jié)長

Byte length)

參數(shù)值

parameter values)

校驗碼

check code

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(與收到的地址一致)

(Consistent with the address received)

0x03

02

(數(shù)據(jù)長度2字節(jié))

Data length: 2 bytes)

XXXX

(實際的寄存器參數(shù)值)

Actual register parameter value)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

 

4寄存器地址定義Table 4 Register address definitions)

 

寄存器地址

Register address)

地址定義

Address definition)

數(shù)值范圍(括號內(nèi)為十進(jìn)制數(shù))

Value range (decimal number in parentheses)

0x0000

驅(qū)動器工作電流(單位:mA)

Drive operating current (in mA))

0x01F4~0x1F40(500~8000)

0x0001

驅(qū)動器鎖機(jī)值(單位:%)

Drive Lock Value (in%))

0x0005-0x0064(5~100)

0x0002

SM為高時的細(xì)分值(單位:脈沖/轉(zhuǎn),需能被10整除)

SM is subdivided at high value (unit: pulse / turn, must be divisible by 10)

0x00C8~0xEA60(200~60000)

0x0003

SM為低時的細(xì)分值(單位:脈沖/轉(zhuǎn),需能被10整除)

SM is low breakdown (pulse / turn, must be divisible by 10))

0x00C8~0xEA60(200~60000)

0x0004

驅(qū)動器脈沖工作方式:

0000:正/反轉(zhuǎn)脈沖控制模式,上升沿有效

0001:脈沖+方向控制模式,上升沿有效

0002:正/反轉(zhuǎn)脈沖控制模式,下降沿有效

0003:脈沖+方向控制模式,下降沿有效(默認(rèn))

其他數(shù)值詳見特殊工作模式。

Drive pulse operation mode:

0000: Positive / reverse pulse control mode, rising edge effective.

0001: Pulse + direction control mode, the rising edge is effective.

0002: Positive / reverse pulse control mode, effective edge effective.

0003: Pulse + direction control mode, descent valid (default).

Other values are shown in the special working mode.

0x0000~0x0028(0~40)

0x0005

PI控制時的Kp比例系數(shù)

Kp proportion coefficient for PI control)

0x0014~0x0960(20~2400)

0x0006

PI控制時的Ki積分系數(shù)

Ki integration coefficient during PI control)

0x0000~0x0050(0~80)

0x0007

驅(qū)動器自測模式及運行狀態(tài)。

Drive self-test mode and running status.)

1.寫入時 When writing)

0000:電機(jī)停止Motor stops)

0003:電機(jī)正轉(zhuǎn)Motor is turning)

0009:電機(jī)反轉(zhuǎn)Motor reversal)

3. 讀取時返回的參數(shù)定義如下 The parameters returned when reading are defined as follows)

8位High 8 bits)

00:表示驅(qū)動器無報警故障

00: It means that the drive has no alarm fault)

01:表示未檢測到電機(jī)故障

01: Indicates that no motor fault was detected)

02:表示驅(qū)動器過熱報警

02: indicates the drive overheating alarm

03:表示驅(qū)動器過流報警

03: indicates the drive overcurrent alarm)

8位Low 8 bits)

00:表示電機(jī)停止

00: indicates a motor stop)

01:表示電機(jī)正在正轉(zhuǎn)

01: It means that the motor is turning forward)

02:表示電機(jī)正在反轉(zhuǎn)

02: Indicates that the motor is reversing

寫命令:0x0003或0x0009

讀取時返回電機(jī)狀態(tài)

Write the command: 0x0003 or 0x0009;Return to the motor state when reading)

0x0008

電機(jī)延時時間。=X*62.5微秒

Motor time delay time.=X * 62.5 microseconds)

0000:無延時;

0000: no delay;)

0010:延時1ms

0010:1ms time delay)

當(dāng)BS04=0004或者0005時,內(nèi)部IO時電機(jī)加速度與此設(shè)置無關(guān)。

When either BS04=0004 or 0005,motor acceleration during internal IO is not related to this setting.)

0x0000~0x0BB8(0~3000)

0x000D

內(nèi)部脈沖時參數(shù)定義為電機(jī)啟動速度(轉(zhuǎn)/分),當(dāng)啟動速度高于運行速度時,自動默認(rèn)為運行速度。

The internal pulse parameter is defined as the motor starting speed (rpm), and when the starting speed is higher than the running speed.)

0x0000~0x0258(0~600)

0x000E

內(nèi)部脈沖時第一組細(xì)分時,SM=1時,參數(shù)定義為電機(jī)運行速度1.

In the first group of internal pulse subdivision, SM=1, the parameter is defined as the motor running speed 1.)

0x0001~0x0BB8(1~3000)

0x000F

內(nèi)部脈沖時第二組細(xì)分時,SM=0時,參數(shù)定義為電機(jī)運行速度2.

In the second group of internal pulse subdivision, SM=0, the parameter is defined as the motor running speed 2.

0x0001~0x0BB8(1~3000)

0x0010

內(nèi)部脈沖時,參數(shù)定義為實際轉(zhuǎn)動需要的脈沖個數(shù)低四位設(shè)定。

For the internal pulse, the parameter is defined as the four-lower number of pulses required for the actual rotation.)

0x0000~0x270F(0~9999)

0x0011

內(nèi)部脈沖時參數(shù)定義為實際轉(zhuǎn)動需要的脈沖個數(shù)高四位設(shè)定(十進(jìn)制,1代表十進(jìn)制的10000);

The internal pulse parameter is defined as the number of pulses required by actual rotation (decimal, 1 represents 10000 decimal);

9999:自動定義為連續(xù)運轉(zhuǎn),直至停止信號到來。

9999: It is automatically defined as a continuous operation until the stop signal arrives.)

0x0000~0x270F(0~9999)

0x0014

內(nèi)部IO運行時,設(shè)定電機(jī)的加速度大小.

數(shù)值越大,加速度越大,數(shù)值越小,加速度越小,單位為:10轉(zhuǎn)/分/秒。最低為1,最高為5000

When the acceleration of the motor is set during the internal IO operation.The larger the value, the greater the acceleration, the smaller the value, the smaller the acceleration, in 10 rpm. The minimum was 1 and a maximum was 5000)

0x0000~0x1388(0~5000)

0x0015

內(nèi)部IO運行時,設(shè)定電機(jī)的減速度大小.

When the internal IO is running, set the deceleration size of the motor.

0x0000~0x1388(0~5000)

0x0016

設(shè)定驅(qū)動器將要堵轉(zhuǎn)時,瞬時電流的增大倍數(shù),范圍(10~30),=10時最大為1倍,即電流不增大。=30時電流最大增加為設(shè)定的3倍。

When the drive is about to block the rotation, set the increase multiple of the instantaneous current, range (10~30), = 1 times of the maximum of 10, that is, the current does not increase. The maximum increase in current is 3 times that set at =30.)

0x000A~0x001E(10~30)

0x0017

設(shè)定驅(qū)動器電流增大穩(wěn)定后,電流減小為設(shè)定值的速度,范圍(10~2048),數(shù)值越大,減小的速度越慢=2048時,電流增大后不再減小。

When the current of the drive increases and stabilizes, the current decreases to the speed of the set value, range (10~2048), the larger the value, the slower the speed =2048, the current will not decrease after increasing.)

0x000A~0x0800(10~2048)

0x0018

設(shè)置RDY和ALM信號的輸出電平。

Set the output level of the RDY and ALM signals.)

0000:RDY低電平有效,ALM低電平有效。

0000: RDY low level is effective, and ALM low level is effective.)

0001:RDY低電平有效,ALM高電平有效。

0001: RDY low level is effective, and ALM high level is effective.)

0002:RDY高電平有效,ALM低電平有效。

0002: RDY high level is effective, and ALM low level is effective.)

0003(默認(rèn)):RDY高電平有效,ALM高電平有效。驅(qū)動器準(zhǔn)備好時,RDY輸出高電平;驅(qū)動器報警時,ALM輸出高電平。

0003 (default): RDY high level, ALM high level. RDY output high level when the drive is ready; ALM output high level when the drive alarms.)

 

0x0000~0x0003(0~3)

例如for instance:)

收到的數(shù)據(jù):01 03 00 07 00 01 35 CB  :查詢驅(qū)動器狀態(tài)指令

Data received: 01 03 00 07 00 01 35 CB: Query the drive status instruction

返回的數(shù)據(jù):01 03 02 00 00 B8 44 :當(dāng)前驅(qū)動器無故障,電機(jī)處于停止?fàn)顟B(tài)

Data returned: 01 03 02 00 00 B8 44: current drive no fault, motor is in a stop state)

收到的數(shù)據(jù):01 03 00 07 00 01 35 CB :查詢驅(qū)動器狀態(tài)指令

Data received: 01 03 00 07 00 01 35 CB: Query the drive status instruction

返回的數(shù)據(jù):01 03 02 01 01 78 14:有故障,未檢測到電機(jī)。電機(jī)處于正轉(zhuǎn)狀態(tài)。

Data returned: 01 03 02 01 01 78 14: with fault, motor not detected. The motor is in positive state.)

3、命令字:0x06 ,寫入單個寄存器命令the command word: 0x06, write to a single register command)

該命令為寫入驅(qū)動器單個寄存器的命令,主機(jī)請求與驅(qū)動器返回格式如下This command is a command written to a single register of the drive. The host request and drive return format are as follows)

5主機(jī)請求數(shù)據(jù)(命令字0x06)

Table 5 Host request data (command word 0x06))

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

參數(shù)值

parameter values)

校驗碼

check code)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

0x06

0x0000

0x0001

XXXX

預(yù)設(shè)的參數(shù)值

Preset parameter values

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

注:寄存器地址定義如表4所示。

Note: Register address is defined in Table 4.)

 

6驅(qū)動器返回的數(shù)據(jù)(命令字0x06)

Table 6 Data returned by the drive (command word 0x06)

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

參數(shù)值

parameter values

校驗碼

check code

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(與收到的地址一致)

(Consistent with the address received))

0x06

(與收到的數(shù)據(jù)一致)

(Consistent with the data received)

XXXX

預(yù)設(shè)的參數(shù)值

Preset parameter values)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

 


4、命令字:0x10 ,直接控制電機(jī)運行的命令the command word: 0x10, the direct control of the motor operation command)

 

該命令為直接控制電機(jī)運行的命令,控制電機(jī)直接運行設(shè)定的脈沖數(shù),驅(qū)動器收到該命令后,直接按照設(shè)定的參數(shù)運行。需要將BS04設(shè)置為08的工作模式。當(dāng)按照設(shè)定的參數(shù)運行完畢后,驅(qū)動器不向上位機(jī)返回電機(jī)狀態(tài),需上位機(jī)發(fā)送查詢狀態(tài)命令后才返回數(shù)據(jù)。主機(jī)請求與驅(qū)動器返回格式如下:

This command is the command that directly controls the operation of the motor and controls the number of pulses set by the motor to directly run. After receiving the command, the driver will directly run according to the set parameters. BS04 to 08. When the operation is completed according to the set parameters, the drive does not return to the motor status of the upper computer, and the upper computer needs to send the query status command before returning the data. Host request and drive return format is as follows:)

 

7主機(jī)請求數(shù)據(jù)(命令字0x10)

Table 7 Host request data (command word 0x10))

 

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址(十六進(jìn)制)

Register Address (Hex))

數(shù)據(jù)字長度

Data word length)

字節(jié)長度

Byte length)

參數(shù)值

parameter values)

校驗碼

check code)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

2 Bytes)

2字節(jié)

2 Bytes)

1字節(jié)

1 Bytes)

4字節(jié)

4 Bytes)

2字節(jié)(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

0x10

功能碼(寫入2個寄存器,控制電機(jī)直接運行)

Function code (write to 2 registers, control motor direct operation)

 

地址address)

0x1000:電機(jī)正轉(zhuǎn)脈沖數(shù)

0x1000: Number of motor forward rotating pulses)

0x2000:電機(jī)反轉(zhuǎn)脈沖數(shù)

0x2000: Number of motor reversal pulses)

0x 3000:電機(jī)緩?fù)?/span>

0x 3000: Motor shutdown

0x 4000:電機(jī)急停

0x 4000: Motor emergency stop

固定數(shù)0002,

表示寫入2個寄存器值

Fixed number of 0002,represents the writes of 2 register values)

固定數(shù)0004,表示寫入的字節(jié)數(shù)是4

Fixed number 0004, the number of bytes written is 4)

XXXXXXXX

運動的脈沖數(shù),32位數(shù)據(jù),高位在前。注意:高低不能混。

The number of pulses, 32 data, high in front. Note: the high and low can not be mixed.)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

Actual CRC data)

說明:寄存器地址為0x1000或0x2000時,只有電機(jī)停止且連續(xù)收到兩次相同的命令時電機(jī)才啟動,否則命令無效,命令無效時不返回數(shù)據(jù)。當(dāng)寄存器地址為0x 3000或0x 4000時,參數(shù)值可以為任意數(shù)據(jù)。

Note: When the register address is 0x1000 or 0x2000, the motor will only start when the motor stops and receives the same command twice continuously, otherwise the command is invalid and the data is not returned if the command is invalid. When the register address is 0x 3000 or 0x 4000, the parameter value can be arbitrary data.)

 

8驅(qū)動器返回的數(shù)據(jù)(命令字0x10)

Table 8 Data returned by the drive (command word 0x10))

地址address)

命令字CW)

寄存器地址

Register address)

數(shù)據(jù)字長度

Data word length)

校驗碼

check code)

1字節(jié)1 Bytes)

1字節(jié)1 Bytes)

2字節(jié)2 Bytes)

2字節(jié)2 Bytes)

2字節(jié)2 Bytes)

與接收到的地址一致

Consistent with the received address

固定值0x10

功能碼(寫入2個寄存器,控制電機(jī)直接運行)

Fixed value of 0x10,function code (write to 2 registers, control motor direct operation)

地址,與寫入的地址一致

Address, consistent with the written address)

固定數(shù)0002,表示寫入2個寄存器值

Fixed number 0002, indicating writing 2 register values

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

例如:(地址為01)

Example: (the address is 01))

 

收到:01 10 10 00 00 02 04 00 00 10 00 33 AF:電機(jī)正向前進(jìn)0x00001000(4096)個脈沖。

Received: 01 10 10 00 00 02 04 00 00 10 00 33 AF:The motor is forward 0x00001000 (4096) pulses.)

 

返回數(shù)據(jù)01 10 10 00 00 02 45 08

Return data: 01 10 10 00 00 02 45 08)

 

收到:01 10 20 00 00 02 04 00 01 00 00 3B AE :電機(jī)反向前進(jìn)0x00010000(65536)個脈沖

Received:01 10 20 00 00 02 04 00 01 00 00 3B AE :motor reverse forward 0x00010000 (65536) pulses

 

返回數(shù)據(jù)01 10 20 00 00 02 4A 08

Return data: 01 10 20 00 00 02 4A 08)

 

收到數(shù)據(jù)01 10 30 00 00 02 04 00 00 00 00 A7 AE 電機(jī)緩?fù)?/span>

Received:01 10 30 00 00 02 04 00 00 00 00 A7 AEmotor slow stop)

 

返回數(shù)據(jù)01 10 30 00 00 02 4E C8

Return data:01 10 30 00 00 02 4E C8)

 

收到數(shù)據(jù)01 10 40 00 00 02 04 00 00 00 00 C2 6C 電機(jī)急停

Received:01 10 40 00 00 02 04 00 00 00 00 C2 6C;electric emergency stop)

 

返回數(shù)據(jù)01 10 40 00 00 02 54 08

(Return data:01 10 40 00 00 02 54 08)

 


產(chǎn)品資料
大小
ModBUS通訊協(xié)議20250119.pdf
132.5KB
ModBUS串口協(xié)議(ModBUS Serial port protocol)

ModBUS串口協(xié)議(ModBUS Serial port protocol)

分享到微信

×
ModBUS串口協(xié)議
(ModBUS Serial port protocol)
產(chǎn)品詳情
資料下載

ModBUS串口協(xié)議

ModBUS Serial port protocol

 

1、通訊協(xié)議Communication protocol)

采用異步主從半雙工方式通訊,上位機(jī)作為主站,驅(qū)動器作為從站進(jìn)行工作,由主站發(fā)起詢問(發(fā)起通訊),從站在接到主站請求后作相應(yīng)的應(yīng)答,只有當(dāng)接收到的字節(jié)滿足協(xié)議要求時,驅(qū)動器才返回數(shù)據(jù),否則不應(yīng)答。主要協(xié)議如表1所示。Using asynchronous master semi-duplex communication, the upper machine as the main station, the drive as the slave station to work, by the master station to initiate inquiry (initiate communication), the slave station after receiving the request from the master station, only when the received bytes meet the protocol requirements, the drive will return data, otherwise do not answer. The main protocol is shown in Table Table 1.)

 

1驅(qū)動器通訊協(xié)議Table 1 The drive communication protocol)

 

名稱name)

內(nèi)容content)

說明explain)

接口joggle)

RS485


驅(qū)動器地址

Drive address)

0x01-0x1F(1-31)

數(shù)碼管BS19的設(shè)定值

Set value of the digital tube BS19)

波特率

Baud rate)

9600,19200,38400,115200

數(shù)碼管BS18的設(shè)定值

Set value of the digital tube BS18)

數(shù)據(jù)幀格式

data frame format

1位起始位,8位數(shù)據(jù)位,無奇偶校驗位,1位停止位,無控制流.

1 bit, 8 bit, no parity bit, 1 bit stop bit, no control flow.)


報文格式

message format)

命令字:0x03

Command word: 0x03)

讀取單寄存器數(shù)據(jù)命令

Read the single-register data command)

命令字:0x06

Command word: 0x06

寫入單寄存器數(shù)據(jù)命令

Write to a single-register data command)

命令字:0x10

Command word: 0x10

寫入多寄存器數(shù)據(jù)命令,控制電機(jī)直接運行。

Write the multi-register data command and control the motor to run directly.)

pour:)

1. 波特率更改后重新上電有效,否則默認(rèn)為剛上電時的波特率。當(dāng)串行口通訊不暢時,請降低通訊的波特率;1. After the port rate is changed, the power on is valid, otherwise the default is the wave rate when just power on. When the serial port communication is not smooth, please reduce the port rate of communication;)

2.同一串口線上的多臺驅(qū)動器地址不可重復(fù),否則會造成通訊錯誤,甚至損壞串口芯片。2. The addresses of multiple drives on the same serial port line cannot be repeated, otherwise it will cause communication errors and even damage the serial port chip.)

 

2、命令字:0x03 ,讀取單個寄存器命令2, the command word: 0x03, read a single register command),

該命令為讀取驅(qū)動器單個寄存器的命令,主機(jī)請求與驅(qū)動器返回格式如下This command is a command to read a single register of the drive, and the host request and drive return format are as follows:)

 

2主機(jī)請求數(shù)據(jù)(命令字0x03)Table 2 Host request data (command word 0x03)

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

數(shù)據(jù)長度

DL)

校驗碼

check code)

1字節(jié)

1 Bytes

1字節(jié)

1 Bytes

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

 

0x03

0x0000

0x0001

0x0002

(固定數(shù))

(Fixed number)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

pour:)

1. 寄存器地址定義如表4所示1. Register address is defined as shown in Table 4);

 

2. CRC校驗初值為0xFFFF,多項式為0xA001,低字節(jié)在前。2. The initial value of CRC check is 0xFFFF, the polynomial is 0 xA 001, and the low bytes are first.)

 

 

3驅(qū)動器返回的數(shù)據(jù)(命令字0x03)Table 3 Data returned by the drive (command word 0x03))

驅(qū)動器地址

Drive address)

命令字

CW)

字節(jié)長

Byte length)

參數(shù)值

parameter values)

校驗碼

check code

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(與收到的地址一致)

(Consistent with the address received)

0x03

02

(數(shù)據(jù)長度2字節(jié))

Data length: 2 bytes)

XXXX

(實際的寄存器參數(shù)值)

Actual register parameter value)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

 

4寄存器地址定義Table 4 Register address definitions)

 

寄存器地址

Register address)

地址定義

Address definition)

數(shù)值范圍(括號內(nèi)為十進(jìn)制數(shù))

Value range (decimal number in parentheses)

0x0000

驅(qū)動器工作電流(單位:mA)

Drive operating current (in mA))

0x01F4~0x1F40(500~8000)

0x0001

驅(qū)動器鎖機(jī)值(單位:%)

Drive Lock Value (in%))

0x0005-0x0064(5~100)

0x0002

SM為高時的細(xì)分值(單位:脈沖/轉(zhuǎn),需能被10整除)

SM is subdivided at high value (unit: pulse / turn, must be divisible by 10)

0x00C8~0xEA60(200~60000)

0x0003

SM為低時的細(xì)分值(單位:脈沖/轉(zhuǎn),需能被10整除)

SM is low breakdown (pulse / turn, must be divisible by 10))

0x00C8~0xEA60(200~60000)

0x0004

驅(qū)動器脈沖工作方式:

0000:正/反轉(zhuǎn)脈沖控制模式,上升沿有效

0001:脈沖+方向控制模式,上升沿有效

0002:正/反轉(zhuǎn)脈沖控制模式,下降沿有效

0003:脈沖+方向控制模式,下降沿有效(默認(rèn))

其他數(shù)值詳見特殊工作模式。

Drive pulse operation mode:

0000: Positive / reverse pulse control mode, rising edge effective.

0001: Pulse + direction control mode, the rising edge is effective.

0002: Positive / reverse pulse control mode, effective edge effective.

0003: Pulse + direction control mode, descent valid (default).

Other values are shown in the special working mode.

0x0000~0x0028(0~40)

0x0005

PI控制時的Kp比例系數(shù)

Kp proportion coefficient for PI control)

0x0014~0x0960(20~2400)

0x0006

PI控制時的Ki積分系數(shù)

Ki integration coefficient during PI control)

0x0000~0x0050(0~80)

0x0007

驅(qū)動器自測模式及運行狀態(tài)。

Drive self-test mode and running status.)

1.寫入時 When writing)

0000:電機(jī)停止Motor stops)

0003:電機(jī)正轉(zhuǎn)Motor is turning)

0009:電機(jī)反轉(zhuǎn)Motor reversal)

3. 讀取時返回的參數(shù)定義如下 The parameters returned when reading are defined as follows)

8位High 8 bits)

00:表示驅(qū)動器無報警故障

00: It means that the drive has no alarm fault)

01:表示未檢測到電機(jī)故障

01: Indicates that no motor fault was detected)

02:表示驅(qū)動器過熱報警

02: indicates the drive overheating alarm

03:表示驅(qū)動器過流報警

03: indicates the drive overcurrent alarm)

8位Low 8 bits)

00:表示電機(jī)停止

00: indicates a motor stop)

01:表示電機(jī)正在正轉(zhuǎn)

01: It means that the motor is turning forward)

02:表示電機(jī)正在反轉(zhuǎn)

02: Indicates that the motor is reversing

寫命令:0x0003或0x0009

讀取時返回電機(jī)狀態(tài)

Write the command: 0x0003 or 0x0009;Return to the motor state when reading)

0x0008

電機(jī)延時時間。=X*62.5微秒

Motor time delay time.=X * 62.5 microseconds)

0000:無延時;

0000: no delay;)

0010:延時1ms

0010:1ms time delay)

當(dāng)BS04=0004或者0005時,內(nèi)部IO時電機(jī)加速度與此設(shè)置無關(guān)。

When either BS04=0004 or 0005,motor acceleration during internal IO is not related to this setting.)

0x0000~0x0BB8(0~3000)

0x000D

內(nèi)部脈沖時參數(shù)定義為電機(jī)啟動速度(轉(zhuǎn)/分),當(dāng)啟動速度高于運行速度時,自動默認(rèn)為運行速度。

The internal pulse parameter is defined as the motor starting speed (rpm), and when the starting speed is higher than the running speed.)

0x0000~0x0258(0~600)

0x000E

內(nèi)部脈沖時第一組細(xì)分時,SM=1時,參數(shù)定義為電機(jī)運行速度1.

In the first group of internal pulse subdivision, SM=1, the parameter is defined as the motor running speed 1.)

0x0001~0x0BB8(1~3000)

0x000F

內(nèi)部脈沖時第二組細(xì)分時,SM=0時,參數(shù)定義為電機(jī)運行速度2.

In the second group of internal pulse subdivision, SM=0, the parameter is defined as the motor running speed 2.

0x0001~0x0BB8(1~3000)

0x0010

內(nèi)部脈沖時,參數(shù)定義為實際轉(zhuǎn)動需要的脈沖個數(shù)低四位設(shè)定。

For the internal pulse, the parameter is defined as the four-lower number of pulses required for the actual rotation.)

0x0000~0x270F(0~9999)

0x0011

內(nèi)部脈沖時參數(shù)定義為實際轉(zhuǎn)動需要的脈沖個數(shù)高四位設(shè)定(十進(jìn)制,1代表十進(jìn)制的10000);

The internal pulse parameter is defined as the number of pulses required by actual rotation (decimal, 1 represents 10000 decimal);

9999:自動定義為連續(xù)運轉(zhuǎn),直至停止信號到來。

9999: It is automatically defined as a continuous operation until the stop signal arrives.)

0x0000~0x270F(0~9999)

0x0014

內(nèi)部IO運行時,設(shè)定電機(jī)的加速度大小.

數(shù)值越大,加速度越大,數(shù)值越小,加速度越小,單位為:10轉(zhuǎn)/分/秒。最低為1,最高為5000

When the acceleration of the motor is set during the internal IO operation.The larger the value, the greater the acceleration, the smaller the value, the smaller the acceleration, in 10 rpm. The minimum was 1 and a maximum was 5000)

0x0000~0x1388(0~5000)

0x0015

內(nèi)部IO運行時,設(shè)定電機(jī)的減速度大小.

When the internal IO is running, set the deceleration size of the motor.

0x0000~0x1388(0~5000)

0x0016

設(shè)定驅(qū)動器將要堵轉(zhuǎn)時,瞬時電流的增大倍數(shù),范圍(10~30),=10時最大為1倍,即電流不增大。=30時電流最大增加為設(shè)定的3倍。

When the drive is about to block the rotation, set the increase multiple of the instantaneous current, range (10~30), = 1 times of the maximum of 10, that is, the current does not increase. The maximum increase in current is 3 times that set at =30.)

0x000A~0x001E(10~30)

0x0017

設(shè)定驅(qū)動器電流增大穩(wěn)定后,電流減小為設(shè)定值的速度,范圍(10~2048),數(shù)值越大,減小的速度越慢=2048時,電流增大后不再減小。

When the current of the drive increases and stabilizes, the current decreases to the speed of the set value, range (10~2048), the larger the value, the slower the speed =2048, the current will not decrease after increasing.)

0x000A~0x0800(10~2048)

0x0018

設(shè)置RDY和ALM信號的輸出電平。

Set the output level of the RDY and ALM signals.)

0000:RDY低電平有效,ALM低電平有效。

0000: RDY low level is effective, and ALM low level is effective.)

0001:RDY低電平有效,ALM高電平有效。

0001: RDY low level is effective, and ALM high level is effective.)

0002:RDY高電平有效,ALM低電平有效。

0002: RDY high level is effective, and ALM low level is effective.)

0003(默認(rèn)):RDY高電平有效,ALM高電平有效。驅(qū)動器準(zhǔn)備好時,RDY輸出高電平;驅(qū)動器報警時,ALM輸出高電平

0003 (default): RDY high level, ALM high level. RDY output high level when the drive is ready; ALM output high level when the drive alarms.)

 

0x0000~0x0003(0~3)

例如for instance:)

收到的數(shù)據(jù):01 03 00 07 00 01 35 CB  :查詢驅(qū)動器狀態(tài)指令

Data received: 01 03 00 07 00 01 35 CB: Query the drive status instruction

返回的數(shù)據(jù):01 03 02 00 00 B8 44 :當(dāng)前驅(qū)動器無故障,電機(jī)處于停止?fàn)顟B(tài)

Data returned: 01 03 02 00 00 B8 44: current drive no fault, motor is in a stop state)

收到的數(shù)據(jù):01 03 00 07 00 01 35 CB :查詢驅(qū)動器狀態(tài)指令

Data received: 01 03 00 07 00 01 35 CB: Query the drive status instruction

返回的數(shù)據(jù):01 03 02 01 01 78 14:有故障,未檢測到電機(jī)。電機(jī)處于正轉(zhuǎn)狀態(tài)。

Data returned: 01 03 02 01 01 78 14: with fault, motor not detected. The motor is in positive state.)

3、命令字:0x06 ,寫入單個寄存器命令the command word: 0x06, write to a single register command)

該命令為寫入驅(qū)動器單個寄存器的命令,主機(jī)請求與驅(qū)動器返回格式如下This command is a command written to a single register of the drive. The host request and drive return format are as follows)

5主機(jī)請求數(shù)據(jù)(命令字0x06)

Table 5 Host request data (command word 0x06))

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

參數(shù)值

parameter values)

校驗碼

check code)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

0x06

0x0000

0x0001

XXXX

預(yù)設(shè)的參數(shù)值

Preset parameter values

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

注:寄存器地址定義如表4所示。

Note: Register address is defined in Table 4.)

 

6驅(qū)動器返回的數(shù)據(jù)(命令字0x06)

Table 6 Data returned by the drive (command word 0x06)

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址

Register address)

參數(shù)值

parameter values

校驗碼

check code

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(高位在前)

2 Bytes;High in front)

2字節(jié)

(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(與收到的地址一致)

(Consistent with the address received))

0x06

(與收到的數(shù)據(jù)一致)

(Consistent with the data received)

XXXX

預(yù)設(shè)的參數(shù)值

Preset parameter values)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

 


4、命令字:0x10 ,直接控制電機(jī)運行的命令the command word: 0x10, the direct control of the motor operation command)

 

該命令為直接控制電機(jī)運行的命令,控制電機(jī)直接運行設(shè)定的脈沖數(shù),驅(qū)動器收到該命令后,直接按照設(shè)定的參數(shù)運行。需要將BS04設(shè)置為08的工作模式。當(dāng)按照設(shè)定的參數(shù)運行完畢后,驅(qū)動器不向上位機(jī)返回電機(jī)狀態(tài),需上位機(jī)發(fā)送查詢狀態(tài)命令后才返回數(shù)據(jù)。主機(jī)請求與驅(qū)動器返回格式如下:

This command is the command that directly controls the operation of the motor and controls the number of pulses set by the motor to directly run. After receiving the command, the driver will directly run according to the set parameters. BS04 to 08. When the operation is completed according to the set parameters, the drive does not return to the motor status of the upper computer, and the upper computer needs to send the query status command before returning the data. Host request and drive return format is as follows:)

 

7主機(jī)請求數(shù)據(jù)(命令字0x10)

Table 7 Host request data (command word 0x10))

 

驅(qū)動器地址

Drive address)

命令字

CW)

寄存器地址(十六進(jìn)制)

Register Address (Hex))

數(shù)據(jù)字長度

Data word length)

字節(jié)長度

Byte length)

參數(shù)值

parameter values)

校驗碼

check code)

1字節(jié)

1 Bytes)

1字節(jié)

1 Bytes)

2字節(jié)

2 Bytes)

2字節(jié)

2 Bytes)

1字節(jié)

1 Bytes)

4字節(jié)

4 Bytes)

2字節(jié)(低位在前)

2 Bytes;Low in front)

0x01-0x1F

(數(shù)碼管BS19的設(shè)定值)

(Set value of digital tube BS19)

0x10

功能碼(寫入2個寄存器,控制電機(jī)直接運行)

Function code (write to 2 registers, control motor direct operation)

 

地址address)

0x1000:電機(jī)正轉(zhuǎn)脈沖數(shù)

0x1000: Number of motor forward rotating pulses)

0x2000:電機(jī)反轉(zhuǎn)脈沖數(shù)

0x2000: Number of motor reversal pulses)

0x 3000:電機(jī)緩?fù)?/span>

0x 3000: Motor shutdown

0x 4000:電機(jī)急停

0x 4000: Motor emergency stop

固定數(shù)0002,

表示寫入2個寄存器值

Fixed number of 0002,represents the writes of 2 register values)

固定數(shù)0004,表示寫入的字節(jié)數(shù)是4

Fixed number 0004, the number of bytes written is 4)

XXXXXXXX

運動的脈沖數(shù),32位數(shù)據(jù),高位在前。注意:高低不能混。

The number of pulses, 32 data, high in front. Note: the high and low can not be mixed.)

CRCL,CRCH

(實際的CRC數(shù)據(jù))

Actual CRC data)

說明:寄存器地址為0x1000或0x2000時,只有電機(jī)停止且連續(xù)收到兩次相同的命令時電機(jī)才啟動,否則命令無效,命令無效時不返回數(shù)據(jù)。當(dāng)寄存器地址為0x 3000或0x 4000時,參數(shù)值可以為任意數(shù)據(jù)。

Note: When the register address is 0x1000 or 0x2000, the motor will only start when the motor stops and receives the same command twice continuously, otherwise the command is invalid and the data is not returned if the command is invalid. When the register address is 0x 3000 or 0x 4000, the parameter value can be arbitrary data.)

 

8驅(qū)動器返回的數(shù)據(jù)(命令字0x10)

Table 8 Data returned by the drive (command word 0x10))

地址address)

命令字CW)

寄存器地址

Register address)

數(shù)據(jù)字長度

Data word length)

校驗碼

check code)

1字節(jié)1 Bytes)

1字節(jié)1 Bytes)

2字節(jié)2 Bytes)

2字節(jié)2 Bytes)

2字節(jié)2 Bytes)

與接收到的地址一致

Consistent with the received address

固定值0x10

功能碼(寫入2個寄存器,控制電機(jī)直接運行)

Fixed value of 0x10,function code (write to 2 registers, control motor direct operation)

地址,與寫入的地址一致

Address, consistent with the written address)

固定數(shù)0002,表示寫入2個寄存器值

Fixed number 0002, indicating writing 2 register values

CRCL,CRCH

(實際的CRC數(shù)據(jù))

(Actual CRC data)

例如:(地址為01)

Example: (the address is 01))

 

收到:01 10 10 00 00 02 04 00 00 10 00 33 AF:電機(jī)正向前進(jìn)0x00001000(4096)個脈沖。

Received: 01 10 10 00 00 02 04 00 00 10 00 33 AF:The motor is forward 0x00001000 (4096) pulses.)

 

返回數(shù)據(jù)01 10 10 00 00 02 45 08

Return data: 01 10 10 00 00 02 45 08)

 

收到:01 10 20 00 00 02 04 00 01 00 00 3B AE :電機(jī)反向前進(jìn)0x00010000(65536)個脈沖

Received:01 10 20 00 00 02 04 00 01 00 00 3B AE :motor reverse forward 0x00010000 (65536) pulses

 

返回數(shù)據(jù)01 10 20 00 00 02 4A 08

Return data: 01 10 20 00 00 02 4A 08)

 

收到數(shù)據(jù)01 10 30 00 00 02 04 00 00 00 00 A7 AE 電機(jī)緩?fù)?/span>

Received:01 10 30 00 00 02 04 00 00 00 00 A7 AE;motor slow stop)

 

返回數(shù)據(jù)01 10 30 00 00 02 4E C8

Return data:01 10 30 00 00 02 4E C8)

 

收到數(shù)據(jù)01 10 40 00 00 02 04 00 00 00 00 C2 6C 電機(jī)急停

Received:01 10 40 00 00 02 04 00 00 00 00 C2 6C;electric emergency stop)

 

返回數(shù)據(jù)01 10 40 00 00 02 54 08

(Return data:01 10 40 00 00 02 54 08)

 


產(chǎn)品資料
大小
更新日期
ModBUS通訊協(xié)議20250119.pdf
132.5KB
2025-06-18 16:50:50
選擇區(qū)號

瀏覽器自帶分享功能也很好用哦~

?

復(fù)制成功

×
中文字幕HD人妻在线视频,拍国产真实乱人偷精品,国产在线精品一区二区夜色,久久亚洲AV无码精品老牛