I am experimenting with interfacing a data acquisition device through its ActiveX controls. There is external software coming with the device that operates as kind of an oscilloscope, and on which you can set units, sampling rate (up to 240Hz combined) and enable/disable channels etc. The software runs in the background and the labview code exists to manipulate whatever data is observed and log it. Eventually, I will add more hardware elements etc, but the signal I will be observing will be coming out of a lock in amplifier.
For testing purposes, I disabled all but one channels so I'm sampling at a rate of 240Samples/singleChannel/second. I connected the output of a signal generator and have obtained data for frequencies ranging from 1Hz to 200Hz. I wasn't expecting anything above 80Hz maximum to even work -I was reading about the Nyquist theorem- , but I find myself puzzled on 2 fronts:
1) even on low frequencies (as low as 20Hz), the graph doesn't represent the true signal. Very few graphs in LV give out the true period (ex. the 1Hz), even when the software displays the correct data. At 240Hz sampling rate, should I have issues like that (and/or partially reconstructed waveforms that look 'broken') ?
2) the LV code array datapoints seem to contain an ubnormally large amount of data. Keeping in mind that the way i understand it information is stored in the shift registers, RAM will eventually flood.
I have attached a vi sniplet as well as several pictures showing the issues for varying frequencies, accompanied by the software equivalent pictures. I'm thinking I am either producing a timestamp in the wrong way, or I have misunderstood the way the XY graph matches data points (it also looks as in the higher frequencies data is obtained only on edge points). An express vi with the same time as x axis produces equally unmatched graphs.
Any advice would be appreciated,
Solved! Go to Solution.
The incorrect waveforms are probably because you are only getting a single data point every time your while loop runs. At 240Hz you only have 4.17ms between points. If your while loop takes longer than that amount of time to run, you are going to miss some samples.