03-22-2017 08:29 AM
Hi guys,
I just would like to ask a qestion about data Acquisation. Now I am using the NI PCI 6221 to acquire two voltage signals, one is from function gerenator with sine waveform and the other is the voltage between a capacitor. And also another signal from a interferometer. Now i am trying to save these threee signals and analyse the relationship between the voltage of capacitor and the sine waveform from fucntion generator, and the relationship between strain (signal from interferrometer).
(short explanation of experiment, voltage amplifier get the singal form fucntion generator and amplify the voltage to a electric circle, then the electric field will apply on the sample , under the influency of electric field, this sample will have a strain diffrence which will be detected by interferrometer)
My problem now is, when i use low frequency for this sine wave from this, the analog signal looks very good and seems like continous sgnal (see the picture 1), and if set the frequency of sine waveform at 300 Hz(see picture 2) the signal looks bad. Because the signal of interferrometer is acquired through the SubVI of the producer, not from the DAQ assistant, in order to make the signal of sine wave form and sgnal from interferrometer correspond to each other,the sample rate of DAQ Assistant is setted for one sample on demand. I think the problem is about the execution time of while loop, beacuse the sample rate is too slow to read more signals. can you guys help to increase the sample rate of the programm, and what is the quickest way to read signal and save signal?
(for saving data, i used the array to store all the data and then send it to the OriginPro through the SubVI of OriginPro.)
Solved! Go to Solution.
03-22-2017 08:33 AM - edited 03-22-2017 08:40 AM
Hi lai,
the sample rate of DAQ Assistant is setted for one sample on demand.
Don't do this! Use continuous acquisition!
Set a sample rate according to Nyquist and read sample block with size of ~1/10 of sample rate…
Other things:
- get rid of ExpressVIs to improve execution speed
- get rid of unneccessary functions (you don't need to set properties in each iteration!)
- decouple DAQ and data analysis by employing a producer-consumer-scheme
- is there a reason to set the font on some lables so small you can't read that label anymore?
- using AutoCleanup would improve your block diagram a lot!
03-22-2017
09:20 AM
- last edited on
05-12-2025
11:29 AM
by
Content Cleaner
Consider looking at the Help >> Find Examples and opening the Voltage - Continuous Input example. This should give you a general idea of what it takes to do HARDWARE TIMED acquisition of a channel. Note it can even read more than one channel without modifying the VI (For instance using something like "Dev0/ai0:1" might read physical channel 0 and 1).
Also, consider reviewing the M-series manual for learning about setting up timing:
For simultaneous, hardware-timed acquisition, all you really need is the tools in that example VI though.
As GerdW says, produce-consumer is probably a good idea in data acquisition / processing loops. Here is the white paper on that:
03-23-2017 05:46 AM
Hi,
Thanks for your instructions. I wonder now the problem is on the sychronization of data from the DAQ assistant and the data from interferrometer(which not belong to the NI instrument), the producer of this interferrometer provide us a SubVI to acquire the data from this sensor. See in picture below, in the block diagram it just connect to a dll file, this programm can run 10000 iterations for 26 second alone in a while loop, which i can understand as the sample rate is 0.0026s/sample. When I left only this SubVI in the while loop, the result looks better, now i can set the sinwave form to 200Hz(before was only up to 2 Hz).
I just want to ask, can we use Labview to speed up this SubVI, how can i detect the trigger time of this subVI in a while loop, is that possible? so i can set the trigger time of the signal in DAQ channel to match this signal at the same time point.
03-23-2017 06:44 AM - edited 03-23-2017 06:47 AM
Some hints:
03-23-2017 07:55 AM
Before you do any software mods to your VI, I think you should take a look at your hardware. IMHO it appears you a railing one of your inputs. You need to fix that first.
03-23-2017 08:35 AM
Do you have a link to the interferometer, preferably to the manual (is it this one: http://marketing.attocube.com/acton/attachment/4434/f-0006/0/-/-/-/-/FPS%20brochure.pdf)? To do the best possible synchronization, you want to leverage the hardware of the 6221. But it will require hardware signals from the interferometer to work. So we just need to know what the interferometer provides you.
To more directly answer your question, if the DLL function call can only run at ~400Hz in a while loop, there is no way to speed THAT SPECIFIC call up. But maybe there are settings or other functions (in the interferometer or its software) you could call for faster sampling.
Our goal should be for our DAQ card and the interferometer to communicate in some way so that they can acquire the data at the same time. Otherwise, you're stuck with software timing when you use the DLL function call which apparently is limited to 1/400 seconds. If that is fast enough is up to you.
03-23-2017 10:25 AM
Hi,:
Thanks again, yes this is the interferrometer, in the file that attached is the manual and SubVI for this machine. In the software of this interferrometer, the sample time can be adjusted to 80ns(see in picture), but in LabView i can not find a method to speed up the sample time. I just stuck on the problem, wheather i can bild a connection between NI card and this machine. I konw Timing and Trriger the key for the sychronization, but how to trigger and time the signal from this Interferrometer confused me. 😞
By the way the last two pictures show the realtionship between the voltage signal from the DAQ assitant and the signal from interfereomter LabVIEW Program, with 1Hz and 300Hz for the sine waveform (Electric field).
03-23-2017 11:15 AM
Perfect.
Your 6221 has something called a counter on it. And it can be setup to read QUADRATURE SIGNALS. Quadrature signals are ways of counting that allows you to increment OR decrement the counter digitally.
Now your interferometer has a quadrature output (this so called AquadB interface... see section IV.1.3 in your manual). So you can setup the clock and resolution of this interface and the DAQ card, when properly configured and connected, can keep track of the displacement all the time (as the counter is 32-bit, it will have a max displacment of up to 4 billion * your resolution. For for 1pm resolution, you can see like +/-2mm displacement I guess, larger for less resolution).
You then just need to sample (read) the counter at the same time you do your other sampling (of the voltages). This can be done quite fast. Thousands of times a second. Just need to do a buffered read (look for the finite samples acquisition examples).
Keep in mind you need your COUNTER base clock to be at least twice as fast as the Clock YOU CHOOSE in the interferometer. If you use the differential pairs, be sure to keep cabling equal length and short to avoid any issues.
Someone else might be able to better inform you how to specifically setup the configuration for the DAQ task, but there are examples for doing counter reads in Labview in the software.
Anyways, that is the BEST way to do it from what I see.
03-27-2017 06:11 AM
HI majoris,
Thakns for your solution and I am concentrating on your solution now. I dont have the cable to connect the HDMI port and the LaBVIEW channel box, so I am going to pruchase a HDMI to BNC convetor, that i can connect the BNC cable to the channel box.
And I dont know if this will cause a problem to the measurment?