01-02-2014 08:39 AM
I am a new user and I would like to ask a question. I am using this VI (which is attached) and I would like to control the number of cycles of the generated wave (sine, sawtooth, square, Triangle).
How can I modify the VI to do this task?
Best Regards
Fasial
Solved! Go to Solution.
01-02-2014 09:37 AM
First start by renaming the vi!
(don't go modifying the shipping examples themselves- you may need them intact someday. BETTER: write protect the example folder)
Second you have a control for Frequency (Hz) AKA Cycles per Second. You also have control over Samples per second and number of samples.
Some quick math: Multiply sample rate by 1/Freq by desired cycles to get "number of samples to generate Xcycles at any freq
Since the example is multi channel the sample rate and the number of samples must be must be the same for all chanels so , all channels must have the same frequency as well.
01-02-2014 10:09 AM
You could also count zero crossings (assuming your signal crosses zero) or slope reversals and stop your loop when you have enough. (Okay, the last won't work with square waves, but he's got to have something to work on.)
Cameron
01-08-2014 03:41 PM
thanks, but I want the VI to stop after this number of samples.
For instance I would like to have 3 cycles at 5 Hz. If I did your simple math (sampling rate*1/Freq*wanted number of cycles = 1000 * 1/5 * 3 = 600).
First question where should I enter this 600 in my VI?
Second after the end of required cycles the VI will not stop. I want the VI to stop after the specified number of cycles, How can I do that?
Thaks again sir for your time and efforts
01-09-2014 01:55 PM
Hi FaisalF,
It sounds like you are more interested in outputting a finite amount of data. There is an example VI shipped with LabVIEW that has this functionality called Voltage - Finite Output.vi. You will then just need to create an array that will hold your 600 samples for 3 cycles of a 5 Hz wave and input that array to the DAQmx Write function in that VI.
01-15-2014 01:49 PM
Thank you very much sir
I would like to ask how can I know and control the minimum triggering voltage that can trigger the VI? for instance I am goign to have a small voltage signal (mV) from a TTL. Is it enough to trigger the VI?
The other thing When I run the VI and I dont send a triggering signal I face a timeout error.
Error -200560 occurred at DAQmx Wait Until Done.vi:3580001
Possible reason(s):
Wait Until Done did not indicate that the task was done within the specified timeout.
Increase the timeout, check the program, and make sure connections for external timing and triggering are in place.
Task Name: _unnamedTask<1>
How can I increase the time out ?
Many thanks again for all of your generous help
01-16-2014 02:32 AM