08-16-2017 04:40 AM - edited 08-16-2017 05:07 AM
Hi,
I have attached the vi file of the GenerateAcquire signals using USB-6211.
I have generated a 1Khz signal of square wave with ampliture 2.5 and offset 2.5
The analog OUT and IN DAQ assistant is created and I have used a wire on the USB6211 terminal to loop back from AO0 to AI1.
I have attached the image and vi where the generated signal shows 1Khz but acquired signal only shows 30Hz approx.
Can I please know why I am not getting 1KHz. Where I have done the mistake.
Regards,
Vikash
Solved! Go to Solution.
08-16-2017 05:37 AM
Nyquist–Shannon sampling theorem
You cannot read a 1kHz signal by sampling at 1kHz. Per Nyquist, you need a sample rate of at least 2kHz (assuming a sine wave). I usually aim to sample at 5-10x my desired signal.
08-16-2017 06:26 AM
Hi.
Thanks for your reply.
I did some changes to my samples to read as 1K and rate(Hz) as 20K.
Attached screen shot is what I got as output
I think still i need to do some tuning on the sample to read and rate (hz) values.
On the daq assistant write what does samples to write and rate represent ?
08-16-2017 06:47 AM
Hi Vikash,
I think still i need to do some tuning on the sample to read and rate (hz) values.
I think you need to get rid of ExpressVIs here…
What does your VI do?
- it creates a waveform (SimulateSignal)
- it outputs this waveform using the first DAQAssistent
- it reads another waveform using the 2nd DAQAssistent
All this is done sequentially: you will never measure any input signal at the same time you output your signal…
Using plain DAQmx functions you can setup AI and AO task to start in parallel.
And well: LabVIEW comes with example VIS explaining how to do this!
08-16-2017 07:16 AM
In addition to the excellent suggestions by Crossrulz and GerdW, I'd like to make an observation based on the data you show, which is of a 1KHz square wave riding on a large 50 Hz sinusoid being sampled at around 10 KHz. I'm guessing you are taking "real measurements" and are sampling "single-ended" (as opposed to differential) from a location where the AC Power is delivered at 50 Hz. Your "noise" (I'm counting interference from the AC Mains as noise) is larger than your signal -- you need to learn a few principles about measuring voltages in a clean manner. I recall that there is some discussion in LabVIEW documentation of DAQ hardware on how to make voltage measurements, including proper grounding ...
Bob Schor