07 Domain methods 域操作方法

/**01 Registers a bunch of PDO entries for a domain.
 *为一个域注册一堆PDO条目。
 * This method has to be called in non-realtime context before
 * ecrt_master_activate().
 *这个方法必须在非实时环境中在ecrt master activate()之前被调用。
 * \see ecrt_slave_config_reg_pdo_entry()
 *
 * \attention The registration array has to be terminated with an empty
 *            structure, or one with the \a index field set to zero!
 *注册数组必须以一个空结构结束,或者一个\a index字段设置为零!
 * \return 0 on success, else non-zero.0成功,其他非0
 */
int ecrt_domain_reg_pdo_entry_list(
        ec_domain_t *domain, /**< Domain. 域*/
        const ec_pdo_entry_reg_t *pdo_entry_regs /**< Array of PDO
                                                   registrations.PDO注册数组 */
        );

/**02 Returns the current size of the domain's process data.
 *返回域进程数据的当前大小。
 * \return Size of the process data image, or a negative error code.
 */
size_t ecrt_domain_size(
        const ec_domain_t *domain /**< Domain. */
        );
/**04 Returns the domain's process data.
 *返回域的进程数据。
 * - In kernel context: If external memory was provided with
 * ecrt_domain_external_memory(), the returned pointer will contain the
 * address of that memory. Otherwise it will point to the internally allocated
 * memory. In the latter case, this method may not be called before
 * ecrt_master_activate().
 *—在内核上下文中:如果提供了外部内存Ecrt域外部内存(),返回的指针将包含该内存的地址。
 否则,它将指向内部分配的内存。在后一种情况下,这个方法不能被调用在主站激活前。
 * - In userspace context: This method has to be called after
 * ecrt_master_activate() to get the mapped domain process data memory.
 *-In用户空间上下文:这个方法必须在之后调用'ecrt master activate()来获取映射的域进程数据内存。
 * \return Pointer to the process data memory.
 */
uint8_t *ecrt_domain_data(
        ec_domain_t *domain /**< Domain. */
        );

/**05 Determines the states of the domain's datagrams.
 *
 * Evaluates the working counters of the received datagrams and outputs
 * statistics, if necessary. This must be called after ecrt_master_receive()
 * is expected to receive the domain datagrams in order to make
 * ecrt_domain_state() return the result of the last process data exchange.
 */
void ecrt_domain_process(
        ec_domain_t *domain /**< Domain. */
        );

/**06 (Re-)queues all domain datagrams in the master's datagram queue.
 *
 * Call this function to mark the domain's datagrams for exchanging at the
 * next call of ecrt_master_send().
 */
void ecrt_domain_queue(
        ec_domain_t *domain /**< Domain. */
        );

/**07 Reads the state of a domain.
 *读取域状态
 * Stores the domain state in the given \a state structure.
 *
 * Using this method, the process data exchange can be monitored in realtime.
 */
void ecrt_domain_state(
        const ec_domain_t *domain, /**< Domain. */
        ec_domain_state_t *state /**< Pointer to a state object to store the
                                   information. */
        );

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值