EtherCAT xml配置文件编写和DSP程序适配,以 ET1100与DSP28335为例(3)

本文详细介绍了TwinCAT3主站通过TxPdo接收来自28335的数据过程,包括6个数字量和2个模拟量的具体配置方法,以及如何在xml文件中进行必要的修改来实现数据的正确接收。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

TxPdo 部分
目的:
TwinCAT3 主站接收(28335发送 )
6个数字量:
故障 正常
IPM_Err :ipm故障 1 0
Over_A:过流故障 1 0
Hall_Err :霍尔故障 1 0
Over_V :过压 1 0
State:运行状态 0 1
F_Dire :反馈电机方向 , 1 电机正转,逆时针: 0 电机反转,顺时针。

2个模拟量:
F_V input :反馈电压值
F_A input :反馈电流值
F_Speed input :反馈速度值

更改xml中 TxPdo 数字量部分 (左图,上图为 未改前;右图,下图为 改后图)
位置
ethercatinfo --> descriptions --> devices --> device --> TxPdo
在这里插入图片描述
绿箭头: sm选择3
红箭头: 对齐用,1+1+1+1+1+1+10=16bit
红圈:name
Index: #x1a00

el9800appl.h 文件
dsp 程序对应 1a00 datatype 改动
程序1
在这里插入图片描述
没有变动
程序2
在这里插入图片描述
没变动。

修改#x1a00
位置 1:
ethercatinfo --> descriptions --> devices --> device --> profile --> dictionary --> datatypes --> datatype --> DT1A00
在这里插入图片描述
这里 没有DT1A00,因为下面object #x1a00 是用的是 DT1601 格式,所以 这里无需变动,如强迫症,可以参考DT1601 添加出DT1A00.

位置 2:
ethercatinfo --> descriptions --> devices --> device --> profile --> dictionary --> objectss --> object --> #x1a00
在这里插入图片描述
绿箭头 红箭头 注意相应更改。
蓝箭头:
01060006含义
01:1bit
06:第6
0006: 6000 反写,为后面的#x6000.
右下绿箭头 是 对齐位。

程序3
在这里插入图片描述照图更改
程序4
在这里插入图片描述

DT 1A00 xml,dsp程序 更改完毕。

改 #x6000
位置 1:
ethercatinfo --> descriptions --> devices --> device --> profile --> dictionary --> datatypes --> datatype --> DT6000
在这里插入图片描述
绿圈 不用动;
红箭头 22=1+21
篮圈:name

程序1:
在这里插入图片描述
照图更改
程序2
在这里插入图片描述
照图更改。
在这里插入图片描述

位置 2:
ethercatinfo --> descriptions --> devices --> device --> profile --> dictionary --> objects --> object --> #x6000
在这里插入图片描述
做相应更改即可。
程序:
在这里插入图片描述
#x6000 xml dsp 程序 更改完毕
main.c 更改
在这里插入图片描述
el9800hw.h 宏定义更改一下
在这里插入图片描述

至此 TxPdo xml dsp程序 数字量更改完毕!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值