change: 时间量上报单位 5ms→10ms
- 进场车间距 / 离场通过时间: misc_value = (差值)/2 - 内部时间戳保持 5ms 精度, 仅上报值转为 10ms - 更新注释和 devlog (V2.6)
This commit is contained in:
@@ -523,7 +523,7 @@ void vd1_task_per_channel(Loop154_Unit *unit)
|
||||
unit->flow_count++;
|
||||
unit->relay_count++;
|
||||
if (unit->last_exit_tick > 0) {
|
||||
unit->misc_value = g_loop_states.report_counter - unit->last_exit_tick;
|
||||
unit->misc_value = (g_loop_states.report_counter - unit->last_exit_tick) / 2;
|
||||
} else {
|
||||
unit->misc_value = 0; // 首次检测, 车间距为0
|
||||
}
|
||||
@@ -608,8 +608,8 @@ void vd1_task_per_channel(Loop154_Unit *unit)
|
||||
unit->flat_ok_cnt = 0;
|
||||
unit->exit_state = 0;
|
||||
|
||||
/* 主动上报: 计算通过时间 = 当前-进场时间戳 (5ms单位) */
|
||||
unit->misc_value = g_loop_states.report_counter - unit->passtime_start;
|
||||
/* 主动上报: 计算通过时间 = (当前-进场)/2 (10ms单位) */
|
||||
unit->misc_value = (g_loop_states.report_counter - unit->passtime_start) / 2;
|
||||
unit->last_exit_tick = g_loop_states.report_counter;
|
||||
unit->relay_count++; // 离开时继电器翻转
|
||||
}
|
||||
@@ -641,7 +641,7 @@ void vd1_task_per_channel(Loop154_Unit *unit)
|
||||
unit->loop_cnt_release = 0;
|
||||
|
||||
/* 主动上报: 通过时间 + 继电器 */
|
||||
unit->misc_value = g_loop_states.report_counter - unit->passtime_start;
|
||||
unit->misc_value = (g_loop_states.report_counter - unit->passtime_start) / 2;
|
||||
unit->last_exit_tick = g_loop_states.report_counter;
|
||||
unit->relay_count++;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user