LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Analog Voltage Read Setup

Hi All,

 

Gumby question today, but I am getting frustrated by error messages telling me that my program is trying to read data that isn't there, or trying to read data that is no longer available.

 

I am reading voltage outputs from 1-4 pressure transducers.  I would like to set up my code to read 10 samples at 10,000 samples/second, so that each read takes 1ms.  I would like to create the tasks, set up timing parameters, and start each task when I start each test.  After that, I would like to read 10 samples at 10,000 samples/second during each subsequent while loop iteration.

 

Seems simple, but like I said, I keep getting errors.

 

Any help would be greatly appreciated.


Thanks!

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 1 of 8
(2,878 Views)
I don't understand. You can only have a single analog in task. This should have all your channels. And, if you have selected continuous samples, processing and saving data may have to occur im a consumer loop.

A more precise answer would have been possible if you simply attached your code. You didn't even provide the error codes.y
0 Kudos
Message 2 of 8
(2,876 Views)

I didn't attach my error codes because I thought I was asking a very simple question.  Apologies if this is more complicated than I realized.

 

I just want to read 10 samples at 10K samples/second from all my AI channels on each iteration of a while loop, and I want the code to run as quickly as possible.  How should I write code to do that?

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 3 of 8
(2,873 Views)
You should write it better than you have.

Really, what kind of answer do you expect? There are countless ways to make mistakes. If you aren't using one of the examples, that would be mistake number 1.
0 Kudos
Message 4 of 8
(2,870 Views)

OK.  Let me start again.


Please consider me a rank, groveling LabVIEW novice.  I have searched the examples, but have not been able to find any code that shows me how to read analog voltage measurements in each iteration of a while loop, reading 10 samples on one channel at a rate of 10K samples/second during each iteration.  I would like to minimize the loop time, so I would like the code to run as quickly as possible.

 

If anyone can point me to suitable example code, or offer suggestions as to how I might begin writing such code, I would appreciate it greatly.

 

I have not written any significant code in this matter, because I don't know where to begin.

 

Thank you very much for your help.

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 5 of 8
(2,867 Views)

Although I really am treading in unknown waters here, I have tried to create some sample code showing what I want to do.

 

Here is a basic block of code.  Are there values I could plug into the controls shown which would result in my DAQ unit (USB 6211) taking 10 samples during each iteration of the while loop at 10K samples/second?  If so, please let me know what they are.  If not, please help me understand how I need to change my code.


Many thanks!

 

 

Forbes Black
Lapsed CLAD, LV 5 - LV 2022 (Yeah, I'm that old...)
0 Kudos
Message 6 of 8
(2,862 Views)
Simply entering 10 as the number of samples to read should work.

I'm off my pc now and I don't remember specific example names. I know that there is one very similar.
0 Kudos
Message 7 of 8
(2,855 Views)

Hi,

 

As long as your sample mode is set to "Continous Samples" then your while loop should measure the number of samples you specify on your read VI.

 

Also if you want continous sampling you should get rid of the wait VI in your while loop. 

 

-CC 

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


0 Kudos
Message 8 of 8
(2,844 Views)