LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

increase samples rate of a digital input

Hello,

 

I am quite new to Labview and my question is quite simple :

 

I would like to increase the sampling rate of my optical encoder (DAQ Assistant3). I use a while loop with a time delay of 0.001, but according to my lvm file it seems I can only have one measurement each 0.05 sec at the maximum sample rate.

 

The acquisition mode is '1 sample on demand', I wanted to try the other ones but when I try for example 'Continuous samples', the lvm file does not write anymore.

 

Please see attached my program.

 

Thank you for your help

0 Kudos
Message 1 of 6
(2,734 Views)

An image (if it's not a snippet) tells nothing about the hidden code inside a DAQ Assistant and you really need to provide the actual hardware you are using. Attach the actual VI or read the help on how to create a snippet.

0 Kudos
Message 2 of 6
(2,719 Views)

I am sorry about that.

I use the chassis NI cDAQ 9172.

DAQ Assistant 1 for the RPM: NI 9411

DAQ Assistant 2 for the pressure transducer voltage: NI 9205

DAQ Assistant 3 for the angular position: NI 9401

 

So I would like to increase the sample rate of the angular position.

 

Sorry for the inconvenience.

0 Kudos
Message 3 of 6
(2,714 Views)

First to directly answer you question, you don't control the acquistion speed by controling the while loop.  DAQ will count your encoder pulses, but what you have coded is limiting the data transfer and writing of that data.  Removet the time delay from your loop to catch all your pulses. 

 

That being said, the complete answer is that the VI you have attached is very unlikely to achieve what you want to in an easy manner.  What is the end result you are looking for?  Do you want to compare RPM, pressure, and angle against each other.  If so it would be much easier to do that in one data file.

 

I'll assume that is the case and recommend this:  Put all your code in a single while loop, and use a single Write to LVM.  In your DAQ assistants, try using N samples, with sample to read set to maybe 1000 or 5000.  This transfer 1000 data points at time vs your setup of transfering 1 data point at a time to the write VI.  You keep a time delay in the while loop (t=.010), but keep in mind, this essentially allow your computer to function effienciently, NOT controling any DAQ timing.  I don't use the espress assistants, so I'm not very familiar with them, but this should get you a little closer.

 

Lastly, this is a very raw and simplistic way of collecting this data.  The NI Example Find may have some better code for doing that which may be more effecient.

0 Kudos
Message 4 of 6
(2,695 Views)

Oh, yet, and the sampling rate of the DAQ assistant defaults to 100k Hz.  That should cover your 200ppm encoder and and engine running well above 5k rpm.

 

0 Kudos
Message 5 of 6
(2,691 Views)

Good Morning and thank you for your reply,

The purpose of this code is to create a PV diagram, that is why I need to acquire the voltage of the pressure transducer and the angle of the optical encoder at a high sampling rate. I could have done one with my previous code (and using Matlab), but only at low RPM, and the result was satisfactory. I would like to increase the engine speed now.

The ideal thing would be to acquire them exactly I the same time but until then I can't.

I tried what you recommended me. First I tried to use 'N samples' but the lvm file does not appear with this acquisition mode, I don't know why. And then with '1 sample on demand', I can get the voltage of the pressure transducer every 0.001 sec, but I get the angle of the optical encoder every 0,1 sec, wich is not enough, I don't know how to tackle this problem.

Once again, thank you for your help.

0 Kudos
Message 6 of 6
(2,676 Views)