Matrox代码监测是否有丢帧
1、监测是否有丢帧
Case1:
MIL_INT FrameMissed = 0;
MdigInquire(MilDigitizer, M_PROCESS_FRAME_MISSED, &FrameMissed);
MosPrintf(MIL_TEXT("FrameMissed number is: %1d \n"), FrameMissed);
Case2:
MIL_INT GrabFrameMissed = 0;
MdigInquire(MilDigitizer, M_GRAB_FRAME_MISSED, &GrabFrameMissed);
MosPrintf(MIL_TEXT("GrabFrameMissed number is: %1d \n"), GrabFrameMissed);
2、检测是否有Timer信号的丢失(丢行)
MIL_INT TimerTriggerMissed = 0;
MdigControl(MilDigitizer, M_TIMER_TRIGGER_MISSED + M_TIMER1, M_ENABLE);//开启Timer1的丢信号计数功能
MdigGetHookInfo(HookId, M_TIMER_TRIGGER_MISSED + M_TIMER1, &TimerTriggerMissed);//查询Timer1是否有信号丢失
MosPrintf(MIL_TEXT("Processing frame #%d, trigger missed: %d\r"), UserHookDataPtr->ProcessedImageCount, TimerTriggerMissed);//输出丢失信号数量
3、监测接收到的编码器信号的数量
MIL_INT RotaryEncoderPosition;
MdigControl(MilDigitizer, M_ROTARY_ENCODER_POSITION + M_ROTARY_ENCODER1, 0);//重置计数器
MdigInquire(MilDigitizer, M_ROTARY_ENCODER_POSITION + M_ROTARY_ENCODER1, &RotaryEncoderPosition);//获取M_ROTARY_ENCODER1的计数
MosPrintf(MIL_TEXT("ENCODER COUNTER is: %1d \n"), RotaryEncoderPosition);//输出编码器计数统计值
4、TriggerOverLap的作用,与此类似还有TimerTriggerOverlap
TriggerOverLap的有三种使能:主要是针对当前信号没有处理完时新来的信号怎么处理
OFF:当前信号没有处理完时忽略新来的信号
RESET:接收当前信号立即开始新的一帧的采集舍弃原来的帧
LATCH:指定在抓取过程中接收到的触发器将被锁存(存储)。
MdigControl(MilDigitizer, M_GRAB_TRIGGER_OVERLAP, M_RESET);
MIL_INT GrabTriggerOverlap;
MdigInquire(MilDigitizer, M_GRAB_TRIGGER_OVERLAP, &GrabTriggerOverlap);