MATLAB: Does Image Acquisition Toolbox not always honor the TriggerFrameDelay setting when using manual triggering

Image Acquisition Toolbox

I am trying to use the Image Acquisition Toolbox's TriggerFrameDelay property with manual triggering. Most of the time this works correctly and the first acquired frame occurrs the specified number of frames after the trigger. However, sometimes the first acquired frame is captured immediately after the trigger and it is the second frame that delays the specified number of frames

Best Answer

This is caused by a limitation in how the toolbox handles manual triggering. Occasionally the first frame is acquired immediately after the manual trigger is issued. In these cases, it is actually the second frame that is delayed by the amount specified in TriggerFrameDelay. It is possible to detect this by examining the timestamps of the returned frames:
vid = videoinput('winvideo', 1);
triggerconfig(vid, 'manual');
set(vid, 'TriggerFrameDelay', 100);
start(vid);
trigger(vid);
wait(vid);
[data time] = getdata(vid);
In this case time(1) will be very close to zero, but time(2) will correspond to a time 100 frames after the trigger.