取消
显示结果 
搜索替代 
您的意思是: 

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 项奖励
1 条消息(共 9 条)
5,648 次查看

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 项奖励
2 条消息(共 9 条)
5,643 次查看

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 项奖励
3 条消息(共 9 条)
5,639 次查看

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 项奖励
4 条消息(共 9 条)
5,629 次查看
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.
5 条消息(共 9 条)
5,626 次查看

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 项奖励
6 条消息(共 9 条)
5,614 次查看

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 项奖励
7 条消息(共 9 条)
5,607 次查看

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 项奖励
8 条消息(共 9 条)
5,606 次查看

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 项奖励
9 条消息(共 9 条)
5,577 次查看