Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Routing analog input software triggers through RTSI in MATLAB

Solved!
Go to solution

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

 

 

 

 

 

 

 

0 Kudos
Message 1 of 6
(4,248 Views)

Hi Hanno,

 

At first glance, what you're doing looks right -- I assume the RTSI cable is wired up Smiley Happy

 

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

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 2 of 6
(4,221 Views)

Oh -- wait -- did you start "vid"?  You have to start it before it will look for triggers....

 

-Rob

-----
Rob Purser
Manager, Test and Measurement
MathWorks
rob.purser@mathworks.com
0 Kudos
Message 3 of 6
(4,220 Views)

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

0 Kudos
Message 4 of 6
(4,216 Views)
Solution
Accepted by topic author chinakoch

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

0 Kudos
Message 5 of 6
(4,195 Views)

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

0 Kudos
Message 6 of 6
(4,156 Views)