LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two DAQ assistants to read data

In my program, I am using two ports from my DAQ to acquire data from thermocouples, then comparing them.


But for acquiring signals, I see that an error pops up when I am trying to use two DAQ assistants to gather data in the same program. the following error is shown.

 

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

 

Adding the next DAQ inside a sub vi also does not help.

 

1. Quick fix: In this case, I can just take two ports from one DAQ assistant, and split the data before comparing them. How do I do the split?

2. Long run: Eventually, my code has to take readings from a lot of thermcouples and manipulate them, which involves placing a lot of these assistants in different loops. So is there a way I can use multiple DAQs in the same code for acquiring without showing the error?

 

Thanks.

0 Kudos
Message 1 of 9
(5,085 Views)

This means you cannot create two seperate task for a single DAQ card. So whatever the DAQ assistant runs first takes the resource and the second one gets the error so create a single task and read it in the same DAQ assistant as an array and then compare. I am not able to open the vi as I am using 2009 you may also look into the LabVIEW examples.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 9
(5,080 Views)

You really should be using a single task for all of the analog inputs, especially if they are acquiring at the same rate.  If you insist on using the DAQ Assistant, you can use the Split Signals to get your individual values out.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 9
(5,076 Views)

Thanks for the reply.

What if I have several analog inputs acquiring at different rates? The inputs are supposed to control different valves. Can't I have the same program take in multiple analog readings in different while loops?

 

0 Kudos
Message 4 of 9
(5,066 Views)
No. If you have a multi-function DAQ device, the inputs are muxed and there is a single convert clock. You cannot acquire at multiple rates and the number of loops is irrelevant.

This error has been discussed hundreds of times and the answer is always the same.
Message 5 of 9
(5,063 Views)

Thanks for the replies. I realized that the problem can be fixed by using an assortment of flat sequence structures so that each task is running separately.

 

0 Kudos
Message 6 of 9
(5,051 Views)

No wrong until you close one task you cannot run the other. Sequence structure is not the right option

-----

The best solution is the one you find it by yourself
0 Kudos
Message 7 of 9
(5,044 Views)

what?

 

could you post your code please? i see that you have a liking to the flat sequences.

i want to see how you solved this issue.

 

from what i understand, you are acquiring data from each channel is a series. so, first channel at one rate, clear the task, start a new task, acquire second channel at another rate.. right?

 

there should be a better approach. you could instead acquire all the channels at the highest rate you need and then decimate the data from each channel to the actual number of samples you need.

 

using flat sequence everywhere might not be the solution. you could use producer consumer architecture instead.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 8 of 9
(5,043 Views)

Yes, you are right. I put a DAQ helper in each of the frames, running them in series. So no two of them runs at the same time.

 

The problem with using a single DAQ to take all readings is, my program needs to continuously acquire data from several inputs simultaneously, and different channels have different running times(few ms to few minutes) and number of samples. If I read in data at the highest rate, the program will run out of memory.

 

So, now getting back to the original question:

Adding frames seems to be a quick fix, because in some instances, I still have to read data from two ports simultaneously in the same program, but at different rates.

If I have two DAQ cards, can I run two DAQ assistants simultaneously?

 

0 Kudos
Message 9 of 9
(5,014 Views)