Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can two sepparate executable files access the same task using DAQmx for reading and writing?

Hi,

 

Can anyone confirm if DAQmx allows you to access the same task across different executable files? The current setup I have is to use two sepparate programs to read a total of 6 channels of analog input. The first program reads on channels ai0,ai1, and ai2, while the second program reads on channels ai3,ai4, and ai5. These two programs would run at the same time and they'd be "competing" for the same task but never the same channels. There is no overlap in the channels, but for some reason I can't seem to be able access the same task at the same time, not even for reading.

 

I know Traditional DAQ allowed this without any issues, and I cannot figure out why I can't replicate the same setup with DAQmx.

0 Kudos
Message 1 of 6
(3,624 Views)

Forgot to add: DAQ card used is PCI 6023E

0 Kudos
Message 2 of 6
(3,604 Views)

Hi Vlad,

 

I believe you'd be able to set up one task and use two separate executable files. I could see there being some issues with them ran at the same time though. This could be due to starting the task multiple times, and you'd probably get an error saying that the resource is reserved. Are you getting an error for this, or how are you telling that there is an issue?

 

I'd be interested in seeing a screenshot of how the task is configured in MAX as well as how the VIs are set-up. Are you able to run the executables by themselves? If so, is there any way you can combine the two into one .exe?

 

Lea D.
Applications Engineering
National Instruments
0 Kudos
Message 3 of 6
(3,582 Views)

Hi Lea,

Yes I'm seeing the resource is reserved error quite often when both executables are running. I tried many different things including setting up case statements to stagger each executable. I also tried setting up a task in MAX instead of the VI itself. So my aquisition vi is now incredibly simple (since the task exists in MAX), it just consists of a DAQmx Read vi. It just seems like it's not possible to straight up access the DAQ card at the same time from multiple executable files even if I'm looking at different channels with each program (I'm using a PCI 6023E DAQ). What bugs me is that this didn't seem to be an issue with Traditional DAQ (it seemed like both programs were accessing the same device at the same time). I guess the architecture of Traditional DAQ and DAQmx is just totally different and DAQmx got rid of this functionality.

I'm thinking now of just using a different approach and run a single program that constantly aquires data from 6 channels prior to launching the two executables that try to read 3 channels each from the DAQ. What I'd like to know if there is a way in LabView programming or MAX to share the results of a task (ie: 6 double values from analog input voltage channels) across different executables? Would shared variables work? This way, only one program is accessing the DAQ card and reads all 6 channels, while the other two executables access shared results and take 3 channel results each without directly accessing the DAQ.

 

Thanks

0 Kudos
Message 4 of 6
(3,562 Views)
The first time you asked this question, I told you that it was not possible unless you did some synchronization to prevent one program from running while the other was using DAQ or to use a single program. Why did you continue to pursue a path that was not possible? The traditional DAQ was a single threaded process so it never really ran simultaneously.
0 Kudos
Message 5 of 6
(3,554 Views)

I guess I didn't want to accept the fact that I need to make a "middle-man" program instead of being able to directly access any task I want as in the good old times.

0 Kudos
Message 6 of 6
(3,544 Views)