op_intrpt_esys_interface()
摘要
获取与调用进程当前中断相关联的 esys 接口 ID。
语法
op_intrpt_esys_interface ()
| 参数 | 类型 | 说明 |
|---|---|---|
| 无参数 |
返回类型
int
与当前中断相关联的 esys 接口 ID。
示例
/* Determine whether the event is an esys interface interrupt, and */
/* if so, obtain the esys interface ID and then the value on the */
/* output esys interface. */
if (op_intrpt_type() == OPC_INTRPT_ESYS_INTERFACE)
{
result_interface_id = op_intrpt_esys_interface();
op_esys_interface_value_get (result_interface_id, &result_value, 0);
}
详情
该内核过程仅在某个与 esys 接口上到达的数据相关联的中断之后调用时才会产生有效结果。
用途
对于 esys 接口中断,该内核过程确定值正在到达的 esys 接口(该信息用于识别应从中提取值的 esys 接口)。
错误
- 程序中止:内核过程需要进程上下文。
- 可恢复错误:当前事件不是 esys 接口中断。
参考
- 使用内核过程 op_intrpt_type() 确定当前中断的类型
- 使用内核过程 op_intrpt_code() 确定与当前中断相关联的数字代码
- 使用内核过程 op_esys_interface_value_get() 从 esys 接口检索一个值
- 使用内核过程 op_esys_interface_array_get() 和 op_esys_interface_vector_get() 从向量接口检索多个值