External trigger not working for VideoDevice but is working for videoinput?
조회 수: 5 (최근 30일)
이전 댓글 표시
I am using an allied vision technologies manta camera. I would like it to acquire a frame every time the camera is externally triggered. Using vid= videoinput('gentl',1) I can get the trigger to work. But using vid = imaq.VideoDevice('gentl',1); I get this error
"Warning: The videoinput object is not configured for hardware trigger, therefore FrameStartTriggerMode is being set to 'Off'."
This leads me to think that the way I'm configuring the video objects trigger is the problem. For videoinput I use "triggerconfig(vid, 'hardware', 'DeviceSpecific', 'DeviceSpecific');" but for imaq.VideoDevice I use
"handles.vid1.HardwareTriggering = 'On';" and "handles.vid1.TriggerConfiguration = 'DeviceSpecific/DeviceSpecific';". But I can't find any additional trigger options.
Thanks, Andy
For reference
The code that doesn't work is:
imaqreset;
handles.vid1 = imaq.VideoDevice('gentl',1);
handles.vid1.DeviceProperties.AcquisitionRecordTriggerSource = 'Line1';
handles.vid1.DeviceProperties.AcquisitionRecordTriggerMode = 'On';
handles.vid1.DeviceProperties.FrameStartTriggerMode = 'On';
handles.vid1.DeviceProperties.FrameStartTriggerSource = 'Line1';
handles.vid1.DeviceProperties.AcquisitionEndTriggerMode = 'off'; %keep taking frames with each tirgger
handles.vid1.DeviceProperties.AcquisitionEndTriggerSource = 'Line1';
handles.vid1.DeviceProperties.AcquisitionEndTriggerActivation = 'FallingEdge';
handles.vid1.DeviceProperties.AcquisitionStartTriggerMode = 'On';
handles.vid1.DeviceProperties.AcquisitionStartTriggerSource = 'Line1';
handles.vid1.HardwareTriggering = 'On';
handles.vid1.TriggerConfiguration = 'DeviceSpecific/DeviceSpecific';
preview(handles.vid1);
The code that works is:
imaqreset;
handles.vid1 = videoinput('gentl',1,'Mono12');
handles.vid1.FramesPerTrigger = 1;
src = getselectedsource(handles.vid1);
src.AcquisitionRecordTriggerSource = 'Line1';
src.AcquisitionRecordTriggerMode = 'On';
src.FrameStartTriggerMode = 'On';
src.FrameStartTriggerSource = 'Line1';
% src.AcquisitionEndTriggerMode = 'On'; %one frame and end
src.AcquisitionEndTriggerMode = 'Off'; %keep taking frames with each tirgger
src.AcquisitionEndTriggerSource = 'Line1';
src.AcquisitionEndTriggerActivation = 'FallingEdge';
src.AcquisitionStartTriggerMode = 'On';
src.AcquisitionStartTriggerSource = 'line1';
triggerconfig(handles.vid1, 'hardware', 'DeviceSpecific', 'DeviceSpecific');
handles.vid1.TriggerRepeat = 0;
handles.vid1.FramesAcquired
preview(handles.vid1);
댓글 수: 0
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Acquisition Using Any Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!