Canopen standard data format CANopen标准数据格式

CANopen是标准协议,可以使用CAN调试工具发送报文下去来控制电机

CANopen is a standard protocol. CAN debugging tools can be used to send messages to control the motor.

CANopen是标准协议,操作SDO发送格式如下:

Operation send SDO format is as follows:

一、发送读取SDO报文格式如下:Upload SDO message format as follows

600+Node ID

CMD

Index

Sub index

00

00

00

00

读取SDO时,CMD统一为0x40。

When send the upload SDO message, the CMD is unified to 0x40.

举例:查询1号站点的当前速度,对象为6042,发送如下

For example:

Query the current speed of the 1# motor(Node ID=1).Send as follow

601 40 42 60 00 00 00 00 00 // 6042 means speed

如果读取成功,反馈回以下格式数据

If read success, the format of feedback data as follow

580+Node ID

CMD

Index

Sub index

data

data

data

data

       

DATA

581 4B 42 60 00 C8 00 00 00// 读到当前速度为200rpm

返回数据中的CMD数据则不同,会根据查询索引的长度有所变化。

The value of CMD in feedback is different, it varies according to the length of the index.

0x4F: 一个字节长度   //  1 byte data length

0x4B: 两个字节长度  //   2 byte data length

0x47: 三个字节长度  //   3 byte data length

0x43: 四个字节长度  //   4 byte data length

每个索引的具体长度详见相关说明手册。

The length of index and sub index can be found in relevant Technical Manual.

如果读取失败,则返回读取失败命令

580+Node ID

80

Index

Sub index

SDO abort code error

  二、发送写SDO报文格式如下:Download SDO message format as follows

600+Node ID

CMD

Index

Sub index

00

00

00

00

       

DATA

当发送写SDO报文时,CMD的数值会根据目标索引的长度有所变化。

When send the download SDO message, the value of CMD varies according to the length of the index.

0x2F: 一个字节长度   //  1 byte data length

0x2B: 两个字节长度  //   2 byte data length

0x27: 三个字节长度  //   3 byte data length

0x23: 四个字节长度  //   4 byte data length

 每个索引的具体长度详见相关说明手册。

The length of index and sub index can be found in relevant Technical Manual.

举例发送速度为200的指令:

601 2B 42 60 00 C8 00 00 00   // 6042=200

如果写入成功,则反馈如下格式报文

580+Node ID

60

Index

Sub index

00

00

00

00

       

DATA

若写入失败,则返回如下格式报文

580+Node ID

80

Index

Sub index

SDO abort code error


以nanotec motor 举例发送相关参数,进入速度模式运行,如下:

601 2B 60 60 00 02 00 00 00   //6060=2

601 2B 42 60 00 C8 00 00 00   //6042=200

601 2B 40 60 00 06 00 00 00   //6040=6

601 2B 40 60 00 06 00 00 00   // 6040=7

601 2B 40 60 00 0F 00 00 00   //6040=15

 常用的对象字典(SDO)如下:

(1) 位移模式

6060=1       //设置为位移模式

6081=100     //设置当前速度为100rpm

607a=2000    //设置运行位移为2000pps

6040=6

6040=7

6040=79

6040=95     //启动电机

 (2)速度模式

6060=2       //设置为速度模式

6042=100     //设置当前速度为100rpm

6040=6

6040=7

6040=15     //启动电机

星期五, 13 3月 2020 Posted in 常见问题