From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CST Friday, Feb 14th - 6:30 PM CST Saturday, Feb 15th, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-30-2014 12:27 PM
How do I make the sawtooth waveform vi to generate only a single cycle no matter what the frequency is adjusted to?
11-30-2014 12:31 PM
Hi AntZ,
using a loop when you want something to happen only once is kind of silly…
To generate just a single pulse/period of your signal you need to adjust the sampling info. Please read the help for the singal generation function - all the help on all those inputs…
11-30-2014 01:18 PM
The Help Window doesn't explain much. But if I'm not mistaken, sampling frequency is the frequency at which the wave is being sampled whereas the number of samples is simply...what it says. To generate a single cycle all I need to do is to set the sampling frequency really high and the number of samples as small as possible. Too much samples would construct the structure of the wave beyond a single cycle on the graph. Correct me if I'm wrong. Kudos if I get it right...joking.
12-01-2014 01:54 AM
Hi AntZ,
To generate a single cycle all I need to do is to set the sampling frequency really high and the number of samples as small as possible.
Well, you're half way…
Simple math: #samples = period time * sampling frequency
12-01-2014 02:56 AM
AntZ(TW),
> To generate a single cycle all I need to do is to set the sampling frequency really high and
> the number of samples as small as possible
> Correct me if I'm wrong. Kudos if I get it right...
You have the right idea, but an arbitrarily "high" sampling frequency is probably not the best solution.
The rule of thumb is to sample at 4 times the frequency of your signal.
But it depends on what you want to do with the resulting signal.
In the attached vi (LV 2013) you can play with the Sample Rate Multiplier and see the impact of different sample rates.
Note the Sample Rate Multiplier must be greater than or equal to 2 (this was set in the properties dialog).
steve
12-02-2014 10:11 AM
Hi Everyone,
I'm an Applications Engineer with NI and I've picked up stevem181's code and made a small change to it to make sure it only outputs one wave, whatever the sampling rate or frequency, I hope this helps.
I've added an event structure to wait for input from the user before outputting the sawtooth, one cycle at a time. To make sure it doesn't get stuck if the code is used as a subVI, I've configured it to output a cycle every two seconds if no input is detected.
Best Regards
12-02-2014 11:34 AM
This is one of those rare times when an express vi can help.
Playing with the rate, freq and # of samples and seeing the graphed signal can be valuable timesavers.
@VSenior The OP Posted in 2013.0 and likely cannot open the 2014 mod you uploaded
12-02-2014 11:56 AM - edited 12-02-2014 11:57 AM
Hi Jeff,
Thanks for the prompt, you're quite right, I posted in the wrong version of LabVIEW.
Here's the 2013 version...
Best regards