SOEM中的ec_salve从机结构体释义


SOEM中的ec_salve从机结构体释义

代码

/** for list of ethercat slaves detected */
typedef struct ec_slave
{
   /** state of slave */
   uint16           state;
   /** AL status code */
   uint16           ALstatuscode;
   /** Configured address */
   uint16           configadr;
   /** Alias address */
   uint16           aliasadr;
   /** Manufacturer from EEprom */
   uint32           eep_man;
   /** ID from EEprom */
   uint32           eep_id;
   /** revision from EEprom */
   uint32           eep_rev;
   /** Interface type */
   uint16           Itype;
   /** Device type */
   uint16           Dtype;
   /** output bits */
   uint16           Obits;
   /** output bytes, if Obits < 8 then Obytes = 0 */
   uint32           Obytes;
   /** output pointer in IOmap buffer */
   uint8            *outputs;
   /** startbit in first output byte */
   uint8            Ostartbit;
   /** input bits */
   uint16           Ibits;
   /** input bytes, if Ibits < 8 then Ibytes = 0 */
   uint32           Ibytes;
   /** input pointer in IOmap buffer */
   uint8            *inputs;
   /** startbit in first input byte */
   uint8            Istartbit;
   /** SM structure */
   ec_smt           SM[EC_MAXSM];
   /** SM type 0=unused 1=MbxWr 2=MbxRd 3=Outputs 4=Inputs */
   uint8            SMtype[EC_MAXSM];
   /** FMMU structure */
   ec_fmmut         FMMU[EC_MAXFMMU];
   /** FMMU0 function */
   uint8            FMMU0func;
   /** FMMU1 function */
   uint8            FMMU1func;
   /** FMMU2 function */
   uint8            FMMU2func;
   /** FMMU3 function */
   uint8            FMMU3func;
   /** length of write mailbox in bytes, if no mailbox then 0 */
   uint16           mbx_l;
   /** mailbox write offset */
   uint16           mbx_wo;
   /** length of read mailbox in bytes */
   uint16           mbx_rl;
   /** mailbox read offset */
   uint16           mbx_ro;
   /** mailbox supported protocols */
   uint16           mbx_proto;
   /** Counter value of mailbox link layer protocol 1..7 */
   uint8            mbx_cnt;
   /** has DC capability */
   boolean          hasdc;
   /** Physical type; Ebus, EtherNet combinations */
   uint8            ptype;
   /** topology: 1 to 3 links */
   uint8            topology;
   /** active ports bitmap : ....3210 , set if respective port is active **/
   uint8            activeports;
   /** consumed ports bitmap : ....3210, used for internal delay measurement **/
   uint8            consumedports;
   /** slave number for parent, 0=master */
   uint16           parent;
   /** port number on parent this slave is connected to **/
   uint8            parentport;
   /** port number on this slave the parent is connected to **/
   uint8            entryport;
   /** DC receivetimes on port A */
   int32            DCrtA;
   /** DC receivetimes on port B */
   int32            DCrtB;
   /** DC receivetimes on port C */
   int32            DCrtC;
   /** DC receivetimes on port D */
   int32            DCrtD;
   /** propagation delay */
   int32            pdelay;
   /** next DC slave */
   uint16           DCnext;
   /** previous DC slave */
   uint16           DCprevious;
   /** DC cycle time in ns */
   int32            DCcycle;
   /** DC shift from clock modulus boundary */
   int32            DCshift;
   /** DC sync activation, 0=off, 1=on */
   uint8            DCactive;
   /** link to config table */
   uint16           configindex;
   /** link to SII config */
   uint16           SIIindex;
   /** 1 = 8 bytes per read, 0 = 4 bytes per read */
   uint8            eep_8byte;
   /** 0 = eeprom to master , 1 = eeprom to PDI */
   uint8            eep_pdi;
   /** CoE details */
   uint8            CoEdetails;
   /** FoE details */
   uint8            FoEdetails;
   /** EoE details */
   uint8            EoEdetails;
   /** SoE details */
   uint8            SoEdetails;
   /** E-bus current */
   int16            Ebuscurrent;
   /** if >0 block use of LRW in processdata */
   uint8            blockLRW;
   /** group */
   uint8            group;
   /** first unused FMMU */
   uint8            FMMUunused;
   /** Boolean for tracking whether the slave is (not) responding, not used/set by the SOEM library */
   boolean          islost;
   /** registered configuration function PO->SO, (DEPRECATED)*/
   int              (*PO2SOconfig)(uint16 slave);
   /** registered configuration function PO->SO */
   int              (*PO2SOconfigx)(ecx_contextt * context, uint16 slave);
   /** readable name */
   char             name[EC_MAXNAME + 1];
} ec_slavet;

释义

state: 从设备的状态。这个成员可能包含表示从设备当前状态的代码,如在线、离线、错误等。
ALstatuscode: AL(Application Layer)状态码。用于表示从设备在应用层上的状态或错误信息。
configadr: 配置地址。这是从设备在EtherCAT网络中的配置地址,用于识别和管理设备。
aliasadr: 别名地址。可能用于网络中的特定配置或路由目的。
eep_man, eep_id, eep_rev: 分别代表从设备EEPROM中的制造商信息、设备ID和设备修订版本。
Itype, Dtype: 分别表示接口类型和设备类型。这些类型码用于区分不同类型的从设备和接口。
Obits, Obytes, outputs, Ostartbit: 这些成员与从设备的输出数据相关。Obits表示输出位的数量,Obytes表示输出数据的字节数(如果Obits小于8,则Obytes为0),outputs是指向输出数据的指针,Ostartbit表示输出数据在第一个输出字节中的起始位。
Ibits, Ibytes, inputs, Istartbit: 类似地,这些成员与从设备的输入数据相关。
SM[EC_MAXSM], SMtype[EC_MAXSM]: 这两个数组分别存储同步管理器(SM)的结构和类型。SM用于管理和同步从设备的数据交换。
FMMU[EC_MAXFMMU]: 存储现场数据映射单元(FMMU)的结构。FMMU用于将从设备的数据映射到EtherCAT网络中的特定位置。
FMMU0func, FMMU1func, FMMU2func, FMMU3func: 分别指定前四个FMMU的功能。
mbx_l, mbx_wo, mbx_rl, mbx_ro, mbx_proto, mbx_cnt: 这些成员与从设备的邮箱功能相关,包括邮箱的长度、写/读偏移量、支持的协议和计数器。
hasdc: 表示从设备是否支持分布式时钟(DC)功能。
ptype, topology: 分别表示从设备的物理类型和拓扑结构。
activeports, consumedports: 分别表示活动的端口和已使用的端口。
parent, parentport, entryport: 分别表示父从设备的编号、连接到父从设备的端口号以及本从设备上连接父从设备的端口号。
DCrtA, DCrtB, DCrtC, DCrtD: 分别表示端口A、B、C、D上的DC接收时间。
pdelay: 传播延迟。
DCnext, DCprevious: 分别表示在DC链中的下一个和上一个从设备。
DCcycle, DCshift: 分别表示DC循环时间和从时钟模数边界的偏移。
DCactive: 表示DC同步是否激活。
configindex, SIIindex: 分别链接到配置表和SII(Service Interface Identifier)配置的索引。
eep_8byte: 表示EEPROM读取时是否使用8字节模式。
eep_pdi: 表示EEPROM数据是发送到主站还是PDI(Process Data Interface)。
CoEdetails, FoEdetails, EoEdetails, SoEdetails: 分别与EtherCAT的各种扩展协议(如CoE, FoE, EoE, SoE)相关的详细信息。
Ebuscurrent: E-bus电流。

  • 14
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值