LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

why do labview programmers use 10.1Hz as the default frequency instead of an even 10.0?

Solved!
Go to solution
It was a question that was brought up during lab class and no one had an answer for.  Any ideas?
0 Kudos
Message 1 of 12
(3,771 Views)
What are you talking about? What lab class, and default for what?
0 Kudos
Message 2 of 12
(3,762 Views)

I don't think LabVIEW programmers ever use 10.1 Hz. I know I would never choose a 10.1 Hz frequency.

 

But I think he is talking about how the Simulate Signal defaults to a 10.1 Hz sine wave.

 

If I had to guess, that slight change in frequency gives the appearance of a moving sine wave when you send it to a waveform graph.  If the # of samples was an integral multiple of the frequency, then the sine wave would look static as you send it to a graphy.

Message 3 of 12
(3,752 Views)
I should have made it clearer.  Yes it was for setting up the signal in th VI, particularly when using the sine-wave signal.  The default frequency setting is 10.1Hz (which the Labview programmers gave), I did play around with it and set the frequency to 10.0 and the signal was static (not moving), then set it back to the 10.1 and it began moving again.  I just wanted to know what is causing this as I am new to using Labview.  Thanks
0 Kudos
Message 4 of 12
(3,749 Views)

Many Labview functions do have default values, but this value is not important. I suspect NI use default values so if you forget to wire data to some input. You will get something out rather than nothing and an error. It is you as a programmer who shall choose the input values. You may or may not use default values in your programming. Take a look at some of the filter VIs. The default values used here is not very useful.



Besides which, my opinion is that Express VIs Carthage must be destroyed deleted
(Sorry no Labview "brag list" so far)
0 Kudos
Message 5 of 12
(3,723 Views)

Pilot63 wrote:
[...] I just wanted to know what is causing this as I am new to using Labview.  [...]

This has nothing to do with LabVIEW at all.

 

If you sample a continuous, periodic signal with a continuous acquisition, you will get a "moving signal" if the number of samples multiplied with the sampling frequency does not match an integer number of periods of the signal sampled.  The default value in the "Simulate Signal" ExpressVI shows exactly this phenomena, showing that the simulation matches the real world.

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 6 of 12
(3,705 Views)
It most certainly does have everything to do with Labview.  It is programmed into LABVIEW, how else can it not have anything to do with LABVIEW?  It is part of the VI, the default frequency (if you don't change it) is 10.1Hz, simple.  My question was why not be an even 10.0Hz.  I did mention that I did play ith the settings so that I can try and figure out why it is and did notice that when you did use 10.0Hz the waveform on the VI wasn't moving, but the readings (data) was still being recorded.  I was just trying to understand why it is that the signal stopped with 10.0Hz on the VI.  I kind of understand that it is the way the software works, just want to know why.
0 Kudos
Message 7 of 12
(3,651 Views)

I think what Norbert meant by it not having anything to do with LV was that the value chosen has no significance to LV itself.  He was distinguishing between the value set into the control and the internal functioning of the software.  

 

If you did the same thing with a signal generator and an oscilloscope or programmed it in assembly language, you would see the same effect.

 

Why does the signal appear to move in the 10.1 case and remain stationary in the 10.0 case? If you display the data generated for the first 1.0000 seconds in the 10.0 Hz case you get exactly 10 cycles. One second later (t = 2.0000) you display the data for the time between t = 1 and t = 2 and you get exactly 10 cycles again, so they line up in phase and the waveform does not appear to move.  Change the frequency to 10.1.  At t = 1.0000 you will display 10.1 cycles of the waveform.  At t = 2.0000 you will also display 10.1 cycles, BUT they will start at a different phase, specifically 1/10 of a cycle (36 degrees) later.  Thus the waveform will appear to move across the display.  This is true of any display and any data generating mechanism.  If the length of the display is not an integral number of cycles,the waveform will move across the display.

 

Lynn 

Message 8 of 12
(3,642 Views)
Solution
Accepted by Pilot63

I call it the wagon wheel effect.

 

In old westerns, whenever a wagon with a big spoked wheel would ride by the camera, sometimes the wheel would look like it is slowly rolling forward, sometimes slowly rolling backwards, sometimes it would look like it was at a standstill.

 

It is a function of the frame rate of the camera vs. the cycle period of the spokes of the wheel.  If one spoke (or more) moved exactly the right distance between one frame of the movie and the next, it would look like the wheel hadn't moved at all.  If it moved a little further than the rotation distance of one spoke, it would look like it is slowly rolling forward.  If the wagon is a bit slower, then it would move less than the distance of one spoke and it would look like the wheel is rolling backwards.

 

Same thing with having a periodic waveform (each hump of the sine wave is a spoke of the wheel), and a # of samples and data acquistion rate equal to an integer number of that period (basically the frame rate of the camera.)  The wagon wheel is always rolling forward.  The sine wave is always oscillating.  But depending on the acquisition rate vs. the sine wave frequency gives different appearance to how that sine wave looks on the graph.

 

Experiment and give it a 9.9 Hz sine wave, you'll see it appears to move backwards.

 

So my guess (and it is only a guess) is that whoever designed the express VI gave it a default of 10.1 Hz to help visually simulate on the graph the motion of the sinewave.

 

It really doesn't matter what they picked as the default as it is up to you as the LabVIEW programmer to change that default setting (either in the express VI or wiring in a value) to something that makes sense for your application.

Message 9 of 12
(3,633 Views)
That's exactly it!  I know it was a trivial matter but it was asked during one of our lab sessions in class (while learning how to use Labview).  Thanks to all of you that had an input!
0 Kudos
Message 10 of 12
(3,624 Views)