LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

concurrent analogue reading

Dear all,

 

I am desperately in need for some help.

 

I am doing a project where 4 batteries can be tested simultaneously.,

 

right now, I have the program coded as shown in the Vi attached below. But when I try to run it it shows NI-DAQmx Error -50103 "The Specified Resource is Reserved" error.

 

I came to know that the error was caused when I was trying to read multiple tasks at the same time. what are your thoughts on this. the program works when just one channel si read, but not when more than 1 is read simultaneously.

 

Thanks,

 

Labmat

Download All
0 Kudos
Message 1 of 19
(3,587 Views)

It is pretty clear what you need to do.  You need to combine the reading of all 4 channels into a single task.  I would make that its own loop and pass the values of each channel off to the various state machine loops as a notifier.

 

(PS:  Check the spelling on your front panel.  It should be "dissipated".)

0 Kudos
Message 2 of 19
(3,580 Views)

Hi,

thanks for the spelling update and also for the reply.

 

I read it in the knowledge base that if we wire 4 of the Create Channel Vi in series followed with a Start task vi, we could do combine all 4 of them into one channel. But after doing that, where do we read the single values from the channels? do we read it inside the loop or outside it?

 

thanks,

 

Labmat

0 Kudos
Message 3 of 19
(3,578 Views)

I looked at the code and you can't read analog input channels from the same device at different locations. You can read multiple channels from the same device at one location/vi. If you need to read multiple channels at the same time in different VIs, you can use global variables or shared variables to pass analog input data from one analog input read VI.

0 Kudos
Message 4 of 19
(3,575 Views)

Hi SumTom,

 

thanks for getting back to me. Is there any way yourself or anyone could demonstrate this on my Vi as im a bit lost with the last comment

 

thanks,

 

Labmat

0 Kudos
Message 5 of 19
(3,568 Views)

One task.  Have 4 channels entered into the channel constant for the Create Task.

 

Use Read N channels, 1 sample for your Analog Read.  Then you can use Index Array to break out the individual channels from the array.

 

Search LabVIEW examples (Example Finder in the help menu) for numerous DAQmx examples.

 

Also search the forums for "error 50103"  (drop the negative sign since that interferes with the search engine), where this question has come up thousands of times before with messages on how to fix the problem.

0 Kudos
Message 6 of 19
(3,564 Views)

Ok.

as you can see in the code, I am doing the analogue read within each loop. So, this is how I got it set up now.

 

Multiple channels: One task ------->>> DAQMx Start task.vi ------->>> Loop1(analogue read - N channels, 1 sample) ------>>> clear task

 

Is this how you meant it?

 

thanks,

 

Labmat

0 Kudos
Message 7 of 19
(3,554 Views)

I made some changes to your code showing an example of how you can implement the analog input reads. I am using local variables to transfer the data between the parallel loops (just be aware of the race conditions and performance problems of local/global variables.) In this case, your VI is not too complicated so I don't see harm in using local variables to pass information.

Message 8 of 19
(3,542 Views)

@LABMAT wrote:

Ok.

as you can see in the code, I am doing the analogue read within each loop. So, this is how I got it set up now.

 

Multiple channels: One task ------->>> DAQMx Start task.vi ------->>> Loop1(analogue read - N channels, 1 sample) ------>>> clear task

 

Is this how you meant it?

 


No, that is not at all what I meant.

SumTumWong shows in his VI what I meant.

 

By the way, you don't need two create channels.  You can get by with one if you put "Dev1/ai0:1" into the channel constant.  (meaning Dev 1 analog input channels 0 through 1".  If you click on the channel constant and choose Browse, it will let you select multiple channels.

 

0 Kudos
Message 9 of 19
(3,532 Views)

Hi Sumtong,

 

Can you please upload the file in 2011 format as I dont have the 2012 verson with me.

 

thanks,

 

Labmat

0 Kudos
Message 10 of 19
(3,519 Views)