03-21-2012 12:25 PM
I have been using Traditional DAQ for my programs (without errors) and now I am trying to upgrade all the vis to DAQmx (but I keep getting the error mentioned).
This is my current setup:
DAQ Card: NI PCI-6023E
The program at fault is used to obtain 3 analog inputs (on aio, ai1, and ai2). However our current setup requires that we run an aditional instance of the program that also acquires 3 analog inputs (but on ai3, ai4, and ai6). So we run identical programs with identical code at the same time (only differing in the title of the file name which determines which channels each program is responsible for) Previously, when I was using Traditional DAQ this wasn't an issue, you could open up both programs at the same time and you would have no resource errors.
I have read http://digital.ni.com/public.nsf/allkb/485201B6479
"Case 6: Concurrently running two or more analog input or analog output tasks. This error can also be thrown when a program explicitly calls multiple tasks performing the same type of operation at the same time. As with the other two cases, this produces a situation where multiple independent tasks are concurrently attempting to access the same resource. Even though the tasks might be using different channels, this is still a conflict because they require use of the same analog to digital converter and sample clock. To resolve this issue, combine all operations of the same type into the same task. For DAQmx 7.3 and later, it is possible to do this even with multiple types of analog input if you use multiple DAQmx Create Channel VIs."
I am not really sure how to do this when I have to run two programs at the same time (this was the way it was coded originally and I took over the code). Is there a way to setup the Sample Clock vi differently so it doesn't complain if accessed by multiple programs? I also read something about a Convert Clock allowing multiple analog inputs for NI-DAQmx but not sure how to set that up either.
Thanks for any suggestions!
03-21-2012 01:12 PM
You could have a single program that acquires data from all 6 channels and publish it so that two separate programs would extract just the pertinent channels for their instance. What programming language are you using?
03-21-2012 01:21 PM - edited 03-21-2012 01:24 PM
It's all written in labview.
Here is an image of the vi that gets called multiple times by each program (the channels are different for each program)
03-21-2012 01:52 PM
You can use a single acquisition VI and publish to sharted variables, network streams, etc. If you are running in the development environment, you could use semaphores to prevent the acquisition VI being called simultaneously. This should work since you are starting and stopping the task inside the subVI.