op_td_increment_int64()
摘要
按指定量递增 TDA 的 64 位整型值。
语法
op_td_increment_int64 (pkptr, tda_index, value)
| 参数 | 类型 | 说明 |
|---|---|---|
pkptr |
Packet* |
指向所关注数据包的指针 |
tda_index |
int |
所关注的传输数据属性的数字索引。该 TDA 必须是 64 位整型。 [该值是一个整数代码,指定要访问的传输数据属性。该参数的预定义值列于“Transmission Data Attribute“ 第 28 页。用户定义的传输信息可以从大于预定义属性所占最大索引的任意属性索引处获取(假设该属性此前已被赋值)。最大的预定义属性索引为 OPC_TDA_PT_MAX_INDEX(点对点管道)、OPC_TDA_BU_MAX_INDEX(总线管道)和 OPC_TDA_RA_MAX_INDEX(无线管道)。] |
value |
OpT_Int64 |
要加到当前 TDA 值上的值 |
返回类型
void
无返回值
示例
Opt_Int64 curr_colls;
/* Increment number of collisions in arriving packet. */
op_td_increment_int64 (pkptr_arriv, OPC_TDA_RA_NUM_COLLS, curr_colls);
详情
该函数将 value 参数加到当前 TDA 值上。如果该 TDA 不存在,该函数会创建一个新的自定义 TDA,其初始值为 value。
用途
在修改 TDA 值时,该函数提供了一种替代 op_td_get_int64() 和 op_td_set_int64() 的便捷方式。
错误
- 可恢复错误:
<type>类型的 TDA(<name>)无法使用 'op_td_increment_int64' 递增。 - 程序中止:段违例。(由于无效的数据包指针或格式错误的数据包)
- 程序中止:数据包指针为 NIL。
- 程序中止:数据包指针指向已销毁的数据包(
<pk_id>)。 - 程序中止:Tda 索引(
<tda_index>)超出数据包(<pk_id>)的范围。 - 程序中止:只读 Tda(
<tda_name>)无法在 pk(<pk_id>)中修改
参考
- 使用内核过程 op_td_increment_int() 递增 32 位整型传输数据属性的值
- 使用内核过程 op_td_increment_dbl() 递增 double 传输数据属性的值
- 使用内核过程 op_td_get_int() 或 op_td_get_int64() 获取整型传输数据属性的值
- 使用内核过程 op_td_set_int() 或 op_td_set_int64() 为整型传输数据属性赋值
- 使用内核过程 op_td_is_set() 判断传输数据属性是否已赋值