LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing two analog inputs from two separate executable VIs?

Solved!
Go to solution

Hi Everyone,

 

I've got two separate executable VIs that need to simultaneously access different analog channels of the same PCI-6229 card.  However, it seems this is not possible with DAQ Assistants because of a resource conflict?  Does anyone know if this will work with the lower-level DAQmx blocks?  And if so, how?

 

If that's not a possibility, then if I configure one executable to do all the data capture, how might I transfer this data rapidly between two executables?

 

Thank you for your time!

 

-Yohan

Ramirez Kleinigger Consulting, LLC
http://www.thinkrkc.com/
0 Kudos
Message 1 of 6
(3,724 Views)

Yohan,

 

If you have two executables and use the lower level DAQmx blocks, you will still come across a resource conflict if you are tying to access the same type of channel (i.e. AI)  from both executables.

 

Can I ask why you need two executables to access the same PCI card? If you take all of the data in one executable, why would you need to transfer it between the two? One option could be to use global variables, but if I get a better understanding of what you are trying to do, I may be able to recommend a better solution.

Stephanie A.
Americas Marketing Manager
National Instruments
0 Kudos
Message 2 of 6
(3,708 Views)

Hi Yohan,

 

There is no way to acquire data from two separate VI's or executables at the same time. Only one task can reserve a ressource at the same time. Using global variables will not work too. You can't pass data between executables using global variabels.

The only approach I see is to use one executable for data acquisition and passing the data to another executable through some network protocol (e.g TCP/IP). I recommend you to have a look at the LV Simple Messaging Reference Library which makes it quite easy to pass data betweeen different executables.

Regards,
Luca
0 Kudos
Message 3 of 6
(3,697 Views)

Alright, that's what I needed to know, thanks!

 

The bigger problem is this: we have two computers performing different tasks for a wind tunnel.  One of them regulates the tunnel speed and the other performs specialized tests.  However, neither of them use many analog inputs.  Thus, in the event that one computer died, we'd like to be able to run both executable VIs (control and test) on a single computer.  However, while they don't use the same analog channels, as you've told me, they can't both use the same DAQ card.

 

I'll look into the data transfer methods you've described, thanks!  I suppose a more difficult problem might be the way in which the data is captured.  Am I correct in assuming that all analog channels must be treated the same way - same number of samples and same sampling rate?  If that's true then the way we capture data for tests and control is going to be in conflict...

 

Anyway, thanks again for all your help!

 

-Yohan

Ramirez Kleinigger Consulting, LLC
http://www.thinkrkc.com/
0 Kudos
Message 4 of 6
(3,688 Views)
Solution
Accepted by topic author YohanShminge

The advantage of using the SMP Library is that it works on different and/or local computers. In normal operation you've two PC's running each an executable -> Messaging through TCP/IP. If one PC dies, than you can just start both executables on the same PC and it works the same way. The only thing you've to change is of course the IP Adress used for the SMP communication and the the DAQ board which must be in the running PC.

 

I don't know what HW you're using, but most DAQ boards have "only" one timimng engine, which means that all channels are sampled at the same rate. This could be an issue for your control part.

 

One easy option to solve all this problems (without knowing what you mean with "not many analog inputs": Buy a second DAQ board!  :-

Yes, this costs you little more money for the HW, but it saves you development time, which in my region costs usually much more then a DAQ board for 1k$.

Regards,
Luca
0 Kudos
Message 5 of 6
(3,680 Views)

Sounds good, thanks!  The dual DAQ card solution sounds like the best bet to me.  Odds are if one computer goes down it won't be the DAQ card that dies and we can just pull it and stick it in the other machine.  Then it's just a matter of renaming the device.

 

Thanks!

-Yohan

Ramirez Kleinigger Consulting, LLC
http://www.thinkrkc.com/
0 Kudos
Message 6 of 6
(3,653 Views)