LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a smooth signal on my waveform chart? Can someone please help? Mr. Altenbach, RTLSVU, Paul, GERDW? Anyone? I have attached my BD.

Solved!
Go to solution

I do not want square signal. I am using analog input to read the signal, but somehow I kept getting square wave looking signal. I tried to play with scaling; I kept getting same results.

 

This below is what I am getting:

GRCK5000_0-1649436582078.png

I want curvy/smooth signal similar to this one below:

GRCK5000_1-1649436748690.png

 

Thanks in advance for your help guys!

 

0 Kudos
Message 1 of 7
(1,744 Views)

Right click on the plot then in visible items select plot legend, then right click on the plot legend and select common plots and select one that shows the points. 

 

Then you can see where all the samples are. You can also adjust the interpolation style from the plot legend menu. 

 

 

______________________________________________________________
Have a pleasant day and be sure to learn Python for success and prosperity.
0 Kudos
Message 2 of 7
(1,739 Views)

We cannot know how things are hooked up and how the signal actually looks like. These steps are so small that you are probably looking at the digitizer quantization.

 

(Sorry, I don't have your drivers. Do you have documentation? What MCC device do you use for AI?)

 

Your code has still glaring problems:

  • No need to hammer property nodes with every iteration if the property never changes.
  • Don't make your windows oversized
  • No need to branch the empty arrays to the loop boundary
  • "Index array" is resizeable
  • Converting a DBL to a formatted string and immediately back to DBL seems quite pointless.
  • Do you know the difference between a graph and a chart? Growing arrays in a feedback node and wiring that ever-growing array to a chart is pure madness. Just wire the scaled scalar to the chart! No need for arrays!
  • Your stop button still has the wrong mechanical action.
  • ...
Message 3 of 7
(1,729 Views)
Solution
Accepted by GRCK5000

I believe I pointed this out before. I don't believe this will work the way you think it will.

You will probably have a race condition between which VI will run first Set duty cycle or Digital read...

Because as I said the Arduino is neither multi threading nor multitasking.

TFCapture.PNG

Try this:

TF2Capture.PNG

Since your program is one big loop you are speed limited by the slowest part of that loop.

 

An Arduino running Linx has loop rate somewhere around 200 loops per second maybe even lower depending on Linx code complexity.

 

You can't expect 200Hz sampling to make a smooth sinewave graph unless the signal frequency is < 20Hz.

 

See Nyquist–Shannon sampling theorem  and Aliasing

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 7
(1,707 Views)

Can you leave all that arduino stuff out and create a simple program using only the MCC device. Can you create a waveform manually somehow and use it as input?

0 Kudos
Message 5 of 7
(1,693 Views)