Unable to start video objects again with hardware triggering

1 view (last 30 days)
I've complete a hardware trigger device, which is a hand press button that can determine the circuit be opened or not, and connect to both of my frame grabbers. I'm using an opto-isolated trigger on my frame grabber. But sometime I get a long waiting time or unable to start when I start the video object again to take another shot. Below is part of my MATLAB code:
if true
obj1 = videoinput('matrox',1,'Hardware_trigger.dcf');
obj2 = videoinput('matrox',2,'Hardware_trigger.dcf');
set(obj1,'FramesPerTrigger',1)
% set(obj1,'TriggerRepeat',Inf)
set(obj2,'FramesPerTrigger',1)
% set(obj2,'TriggerRepeat',Inf)
triggerconfig(obj1, 'hardware','risingEdge','opto0-HD44')
triggerconfig(obj2, 'hardware','risingEdge','opto0-HD44')
% start the cameras
start(obj1);start(obj2);
[img1, time1, metadata1] = getdata(obj1);
[img2, time2, metadata2] = getdata(obj2);
figure;imshow(img1);
figure;imshow(img2);
flushdata(obj1);flushdata(obj2)
stop(obj1);stop(obj2);
delete(obj1);
delete(obj2);
clear obj1 obj2;
end

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!