LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

daq sampling issue

I was having issues in capturing my pressure signal which goes from 0 to 32psi in 80ms. I started with having just one while loop where I capture the data on the fly, scale it and calculated the flowrate by capturing two instant in time one at 5psi and one at 32psi. I didn't get a consistent flow rate which I should. Then I started using producer-consumer architecture where one loop is using daq read with continuous sampling and putting the raw data on the queue and other while loop reads data out the queue to do scaling, calculating flow rate and comparision in a state machine. I still don't have consistent flow rate. My question is

1) I created a task using create virtual channel.vi to read analog input channel 0:59(I have 60 analog inputs from different pressure sensors but only two channels at a time will change) from my usb-6225 but I need samples from just two channels at a time. I didn't know a way to change the channel that I need to read on the fly without putting the "create channel and daq timing vi inside the while loop". But for continuous sampling I thought it should be outside the loop and created a property to read my channel of interest. Is this the right way to do it.

2) I tried to get the queue statues on the 2nd while loop. If I have wait 5ms on the second loop the remaining element on my second queue is always 200 +-30. It fills and it drains. If I dont have any delay in the while loop and just let it drain as soon as some data in the queue my flow rate has a lot of variation. Please need some help to solve this issue.

 

Thanks

Download All
0 Kudos
Message 1 of 5
(3,138 Views)

Please need some help.

 

Thanks

0 Kudos
Message 2 of 5
(3,111 Views)

I havnt looked at your code yet, but you said you were trying to sample 60 channels with only 2 active channels at a time...

 

Are you accounting for settling time issue between sampled channels?  One of the problems with  using multifuncition/multiplexed input daq cards is that there is some effective capacitance on the input of the A/D output of mux.  This means there is a related settling time when sampling between channels.  When you actually get into very fast sampling, it can actually look like a charge injection problem where the voltage from the channel sampled before can look like it is on the next sampled channel.  This causes all sorts of problems in terms of measurement integrity. 

 

I havnt had to make presure measurements.. is the impedance of the sensors idealy below 1-10K Ohm?  The lower the better..

Signal conditioning is important when making measurement fast.  You do have the other option of slowing everything down.  Try taking many more samples on a single channel and taking mean value.   

 

I can explain more if this sounds like your issue..

 

0 Kudos
Message 3 of 5
(3,106 Views)

Ive been thinking a little more on this.  If you dont want to fix using hardware, you can create channel string either using traditional or DAQmx to only sample channels with voltages that are close in amplitude.  The signals will still bleed into each other, but it will be less apparent.  What I do if I want to sample just several of alot of possible channels, is use an array with the global channel names that you could possibly want to sample.  The via user input of which channels you want to sample, you build a global virtual channel string... i.e 

"Global Virtual Channel 1, Global Virtual Channel 2"

or a traditional channel string... i.e

"ai0, ai1, ai2"

remember that there is no comma at the end of your string if you are concatinating this string in a for loop.

With that string, you can feed that directly into initialize Task in DAQ mx.

Good Luck

0 Kudos
Message 4 of 5
(3,073 Views)
Thankyou so much for your reply. That fixed my issue.Smiley Happy
0 Kudos
Message 5 of 5
(3,023 Views)