IGH(ethercat)引用头文件ecrt.h说明(example)

本文档介绍了`ec_master_state_t`结构体,它用于表示以太网主站的状态。主要包含响应奴隶的数量、从站应用层状态(如初始化、预操作、安全操作和操作状态)以及网络链接是否正常等关键信息,这些信息是`ecrt_master_state()`函数的输出参数。
摘要由CSDN通过智能技术生成

在使用一个库的时候,可以先了解相关变量的定义,函数。

/**  *主站状态
 *函数ecrt_master_state()的输出参数
 * \see ecrt_master_state().
 */
typedef struct {
    unsigned int slaves_responding; /**所有以太网设备上响应slave的总数。 */
    unsigned int al_states : 4; /**所有从站应用层状态
                                  状态使用低4位编码
                                 如果一位被置位,意味着至少1个
                                  总线上的从站在响应。
                                  state:
                                  - Bit 0: \a INIT初始化
                                  - Bit 1: \a PREOP预操作
                                  - Bit 2: \a SAFEOP安全操作
                                  - Bit 3: \a OP */操作
    unsigned int link_up : 1; /**< \为真,则至少一个网络连接上
                                up. */
} ec_master_state_t;

/** Master state.
 *主站状态
 * This is used for the output parameter of ecrt_master_state().
 *函数ecrt_master_state()的输出参数
 * \see ecrt_master_state().
 */
typedef struct {
    unsigned int slaves_responding; /**< Sum of responding slaves on all
                                      Ethernet devices.所有以太网设备上响应slave的总数。 */
    unsigned int al_states : 4; /**< Application-layer states of all slaves.所有从站应用层状态
                                  The states are coded in the lower 4 bits.状态使用低4位编码
                                  If a bit is set, it means that at least one如果一位被置位,意味着至少1个
                                  slave in the bus is in the corresponding总线上的从站在响应。
                                  state:
                                  - Bit 0: \a INIT初始化
                                  - Bit 1: \a PREOP预操作
                                  - Bit 2: \a SAFEOP安全操作
                                  - Bit 3: \a OP */操作
    unsigned int link_up : 1; /**< \a true, if at least one Ethernet link is为真,则至少一个网络连接上
                                up. */
} ec_master_state_t;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值