LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple DAQ Cards, Multiple While Loops

I'm writing a code to support 3 small test stands that each have the same outputs and inputs as the others. I'm running them all off of an 8-slot DAQ. Each test stand has its own dedicated RTD Card and Analog Out card, but they all share a 32-channel Analog Input card.

I'd like to decouple the 3 test stands as much as possible - if I have to take out an RTD card or Analog Output card, I don't want the entire LabVIEW program to stop running. I want to be able to keep running and logging data on the other two test stands if I were working on the other test stand. Is there a way to do this with only 1 cDAQ? Is it simply a matter of creating separate, independent while loops for each test stand? If so, would LabVIEW have issues with each while loop writing its own measurement file in parallel with the others?


Thank You.

0 Kudos
Message 1 of 3
(2,567 Views)

Is it safe to assume you've been running the three tests?  Some of your post makes it sound like you've run them coupled while other parts make it sound like you haven't successfully had all three tests running simultaneously.

 

If you aren't running them, are you using hardware timing (counters) for your tasks?  If you're looking to use counters, you're only using one per task, correct?  The cDAQ will only have four counters total to be shared between your loops.

 

I can't remember off the top of my head if it is the task or the computer that reserves a cDAQ chassis.  I want to say it's the computer so you can run multiple tasks from the same cDAQ.  But, you'd still need to choose ctr0, ctr1, ctr2, etc in each task so that you don't share these resources between tasks.

 

Are you looking to pull the shared module out frequently?  If not, are you gaining enough functionality to justify buying two redundant modules to gain decoupling?

0 Kudos
Message 2 of 3
(2,546 Views)

Since you have at least some shared hardware resources, you must plan your program to accomodate sharing. I would probably create a subVI for each module (or the smallest subset which can run an independent task). Set each subVI to run independently from the VIs which handles the test stands. Design the subVIs to handle the disconnection and reconnection of the modules automatically. 

 

For communication between the DAQ subVIs and the test stand VIs I would consider something like a publisher/subscriber architecture where the DAQ VIs let the system know they are there and the test stand VIs seek out the data they want. Both types of VIs need robust error handling to manage loss of communications.

 

Lynn

0 Kudos
Message 3 of 3
(2,515 Views)