Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Can DAQ module input be read by two or more LabVIEW vi at same time%3F

Solved!
Go to solution

I am using the DAQ palette in LabVIEW to read  virtual channels from DAQ input module. I have made many VI that read many inputs of three simulated modules. The problem appears when i run two or more VI´s that read inputs from the same virtual module (e.g.. first.VI reads module 1 input ai0 and second.VI reads module 1 input ai0), when this happen the next errors are showed:

 

Error -50103

 

NI Platform Services:  The specified resource is reserved. The operation could not be completed as specified.

 

and

 

Error -200022

 

Resource requested by this task has already been reserved by a different task.

 

This is worrying because i want to get DAQ chassis and some modules, however if this problem is present with physical equipment my application could be useless. It means that module input only can be read once at time?

 

0 Kudos
Message 1 of 11
(4,532 Views)
You can't have more than one task in the same VI either. This error has been discussed numerous times. You can have a master VI that does all the acquisition and share the data to other VIs.
0 Kudos
Message 2 of 11
(4,529 Views)

Ok, then if i read using two different Vi´s the same input it is not ok... The main problem is when i read different inputs from same module using different VI´s i have the same errors...

0 Kudos
Message 3 of 11
(4,524 Views)
Yes, the same restriction applies.
0 Kudos
Message 4 of 11
(4,518 Views)

@Dennis_Knutson wrote:
You can't have more than one task in the same VI either. This error has been discussed numerous times. You can have a master VI that does all the acquisition and share the data to other VIs.

You can have more than one task in a VI, but you can't have multiple tasks attempting to acquire or generate data on the same channel. In that case, you will need to share the data in some way. The master VI will definitely work, but if the VIs need to run independantly, you can also take advantage of queues to pass the data around.

0 Kudos
Message 5 of 11
(4,488 Views)

A queue should only be read in one place. If you have multiple destinations for your data, you would need a queue for each destination. This might be a situation were a Functional Global Variable might be a good choice.

 

Lynn

0 Kudos
Message 6 of 11
(4,474 Views)

I have a master VI who calls 6 subVI´s at same time, those make the read from different channels of three simulated input modules... The problem was when one subVI reads an input from first module and other subVI reads an input from the same module (not neccesary the same input) erros appeared. I solved this cleaning the task after the read, now i have the issue that this solution causes that sometimes the reads become ceros, not in all times, but it is not desirable at all for my application... 

 

I trying to solve this and any advice will be welcome...

0 Kudos
Message 7 of 11
(4,461 Views)
And have you tried a functional global or even a shared variable where you only have a single VI doing a single DAQmx Read?
0 Kudos
Message 8 of 11
(4,458 Views)
Solution
Accepted by topic author andcp360

I´m using global variables in each subVI to share data with main VI, however i found the solution by different way... I just change the read mode to single channel and sample dbl, so i don´t need to clean the reading task in my subVI´s, the zeros problem isn´t there anymore, and the six subVI´s work simultaneously!

 

Thanks for the advices!

0 Kudos
Message 9 of 11
(4,452 Views)
Just be aware that you are now using software timed acquisition which is slow and subject to quite a bit of jitter.
0 Kudos
Message 10 of 11
(4,447 Views)