LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 Generate,Acquire signal issue

Solved!
Go to solution

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

 

 

Download All
0 Kudos
Message 1 of 5
(3,297 Views)
Solution
Accepted by topic author VikashKumar23

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 5
(3,270 Views)

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 ?

 

0 Kudos
Message 3 of 5
(3,259 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 5
(3,250 Views)

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

0 Kudos
Message 5 of 5
(3,238 Views)