LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

2 simultanous AI reads

This is a follow on from a thread here
I am developing an application that needs to read two different AI cards.  The reads may be at the same time, but not always.  The reads are triggered by 2 photocells wired to DI card in slot 5.
Using  Labview 8.2 and cDaq 9172 with the Ni 9421 DI card(in slot 5) , NI 9233 in slot 1 and NI 9237 in slot 2.
 
I am trying to use Source Terminal: PFI0  as one start trigger and Source Terminal: PFI1 to trigger the 2nd read , but get error 89137, eg Specified route cannot be satisfied, because it requires resources that are currently in use by another route.  My data collection runs in 2 separate threads
 
Question, is there a limitation in my hardware that prevents more than 1 start trigger?
 
0 Kudos
Message 1 of 4
(2,919 Views)
Hi Tui,

The cDAQ-9172 chassis only has one analog input timing engine and can only execute one analog input task at a time.  This single timing engine can also only use a single start trigger.  While you are getting a triggering error, I think the fundamental problem is trying to create a second task; if you removed the trigger setup VI, your DAQmx Start VI would instead error since the first task is still running.

The 9233 and 9237 will run together in a single task, and will automatically synchronize.  You will either need to stop the first task and run a different task when you want to change between them, or run a single task acquiring data from both of them.  If it is important to correlate this data with your photocells, you could use correlated digital input to measure the photocells at the same time as the analog input samples are taken, and then post-process your data to return data points from each module according to your desired trigger conditions.

Note that correlated digital input functionality requires the 9421 to be placed in one of slots 1 through 4.

Regards,
Kyle
Message 2 of 4
(2,911 Views)

Thanks for a very good and clear answer Kyle.

Can you expand or point to an example showing correlated digital input?

 

0 Kudos
Message 3 of 4
(2,901 Views)
Hi Tui,

I'm glad that helped.  "Cont Read Dig Chan-Ext Clk.vi" should be the right example.  It looks a lot like your AI task, with a specified "external" sample clock.  In this case, the sample clock is external to the digital input section, but not the chassis--you'll want /cDAQ1/ai/SampleClock so that your digital and analog inputs are synchronized.  You'll have to think about your code a bit to make sure that your digital task starts before your analog task (so you don't miss any sample clocks), but it shouldn't be too difficult to code.

Regards,
Kyle
0 Kudos
Message 4 of 4
(2,894 Views)