01-19-2011 08:35 AM
Hi,
I would like to trigger a PCI-1424 framegrabber, when a certain threshold is reached at the analog input channel of my PCI-6259 DAQ board using the corresponding toolboxes in MATLAB. Is it possible to route a software trigger at the analog input of the DAQ board through RTSI, so that the framegrabber is triggered via the RTSI pulse? Unfortunately, when using the following code,
% Create analog input, set software trigger and RTSI line
ai=analoginput('nidaq','Dev1'); ch=addchannel(ai,0); set(ai,'TriggerType','Software') set(ai,'TriggerCondition','Rising') set(ai,'TriggerconditionValue',1) set(ai,'ExternalTriggerDriveLine','RTSI0') % Create video object and set trigger to RTSI line
vid=videoinput('ni', 'img0'); triggerconfig(vid, 'hardware', 'risingEdge', 'rtsi0')
the RTSI pulse is sent, when the analog input object is started with
start(ai)
, but the software trigger has no effect on the RTSI line. Help or a workaround would be very much apreciated.
Cheers,
Hanno
Solved! Go to Solution.
01-20-2011 07:33 AM
Hi Hanno,
At first glance, what you're doing looks right -- I assume the RTSI cable is wired up ![]()
I'd recommend contacting MathWorks customer support or posting to the comp.soft-sys.matlab newsgroup if you don't get a good answer.
All the best,
-Rob
01-20-2011 07:34 AM
Oh -- wait -- did you start "vid"? You have to start it before it will look for triggers....
-Rob
01-20-2011 08:12 AM
Hi Rob,
thanks for the answer. Sorry, that I didn't explain myself clearly. Actually I have started the video object 'vid' and it is waiting for triggers on the RTSI line. But the only trigger pulse that arrives on the RTSI line is, when I start the analog input object 'ai'. Further software triggers (values over a certain threshold), trigger 'ai' to acquire data, but are not passed through the RTSI line to 'vid'. Consequently 'vid' only acquires images once, namely when 'ai' is started ('TriggerRepeat' property is set to 'inf' for both objects).
Cheers,
Hanno
01-20-2011 01:48 PM - edited 01-20-2011 01:50 PM
I have solved the problem via using hardware triggers:
...
set(ai,'TriggerType', 'HWAnalogChannel') set(ai,'TriggerCondition', 'AboveHighValue')
...
Still, software triggers do not seem to be forwarded by the RTSI bus.
Cheers,
Hanno
01-24-2011 02:32 AM - edited 01-24-2011 02:33 AM
Hi Hanno,
that´s right, a Software Trigger cannot be exported on M-Series DAQ-Cards. The SCOPES for instance could do that, but on your PCI-6259, you can only export
Hardwar-Triggers.
Marco Brauner
NI Germany