From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Data Acquisition

Hey Everybody,

 

First off, I've been reading through Data Acquisition posts all morning, and I'm going to attempt to implement queing for the data writes, so if that is the right track, please let me know.

 

A little background on my needs:

 

I have a Piezo actuator running at 100Hz, with a Laser Displacement sensor that is running at 1000 Hz (can operate at up to 50000Hz) which is 5 times over the Nyquist requirement. The laser outputs +/- 10 Volts, which correlates to +/- 5mm. I am attempting to read the laser voltage output at 20000Hz, again to satisfy Nyquist), but the data I get is clearly aliased. The DAQ is also tasked with counting cycles from the Function Generator (the FG operates an IGBT that "drives" the Piezo).

 

My TDMS shows 3 to 4 cycles elapsing between displacement measurements being written. That said, if nothing else, I would be happy to collect data every 3-4 cycles if I knew that I was collecting peaks and valleys, for example, just something I can track to monitor degredation. Is the express "Write to Measurement File" bringing me down? Should I be running the measurement in a queue?

 

In addition to reading two sets of data, I am also using the DAQ to send a programming voltage between 0-2.5 Volts to the power supply that linearly drives the powersupply between 0-10 Volts, but I do not need this data.

 

I am using a USB-6221, and my computer is running Win7 (x86), Intel Pentium D @ 3.2GHz, and 2GB of RAM.

 

I'm relatively familiar with LabView, but when it comes to problem solving, I'm a novice. Live UI output is not a hard requirement, but it would be nice.

 

I thank you all in advance for your future input and guidance.

 

----

Lyric Rosatti

Montana State University

Download All
0 Kudos
Message 1 of 2
(1,947 Views)

 

Doing queued acquisition (such as producer consumer structure) will be beneficial, but there are some things you can try first in your current code. First off, it looks like you are setting up a virtual channel each time you go through the loop for your analog input. This will definitely cause the task to slow down since you are essentially stopping it and starting it each time. Also, you have it the input set to only take one sample each loop iteration, so change this to multiple samples, and set the number of samples equal to your "samples per channel" value like shown below:

Maverickous_mod.jpg

 

 

Try to use this type of structure for your DAQmx programming. Namely, where you setup the task/channel outside of the loop, acquire data within the loop, and clear the task after the loop. This should allow to actually acquire data at the rate you are specifying. I hope this helps!

 

-Nathan H

 

 

 

 

Software Developer
National Instruments
0 Kudos
Message 2 of 2
(1,908 Views)