01-25-2006 12:43 AM
01-25-2006 12:56 AM - edited 01-25-2006 12:56 AM
These values will determine the frequency at which you will generate the sine wave
Here is a brief explanation
To control the frequency, all you have to do is toy around with the update rate ( sample clock), cycles per buffer and the buffer length
For ex, if cycles per buffer = 10 and buffer length = 1000, effectively, each sinusoidal oscillation in the generated waveform will be represented by 100 points.
Now if update rate = 1000, then you will get a sine wave of frequency 10 hz on the selected AO channel.
in the same case, if you bring the update rate to 100, frequency of sine wave generated on Analog output becomes 1 Hz.
for going to higher sampling rates, take a larger buffer size, suitable update rate and increase number of cycles
Just keep in mind, lesser number of samples per cycle, poorer will the quality of your generated sine wave be.
so represent each sinusoidal cycle by suitable number of points.(practically i have observed that each sine wave represented by more that 20 points looks decent. but the fact is that more number of points, the better sine wave you get )
hope you get the idea.
so a buffer size of 10000, cycles per buffer 100 and update rate 10000 give a sine signal of frequency 100 hz.
regards
Dev
Message Edited by devchander on 01-25-2006 12:57 AM
01-25-2006 01:24 AM
Hi Dev,
I am tring now. For your information, i study in civil engineering. That's why labview is new for me. Thank you for helping me.
Best wishes. Chan
01-25-2006 01:36 AM
Its good to see a civil engineer using LabVIEW and DAQ for his projects.
The beauty of LabVIEW is the myraid of applications in which it can be used
All the best
Regards
Dev
01-25-2006 02:37 AM
01-25-2006 03:12 AM
Hi Dev,
I have download this program from ni homepage. The program can run and i can see the changes when i change the frequency but again not the amplitude. Can you please tell me why or do i have to modify the program? Thank you again.
Best wishes. Chan
01-25-2006 03:20 AM
01-25-2006 05:06 AM
Hi Chan,
Sorry could not get back to you earlier.
Gladto see that you found a way to do it.
All the best
Regards
Dev
02-24-2006 05:30 AM
Hi,
The vi i attach here is a example i downloaded from ni homepage. When i change the frequency of the waveform, the frequency of waveform generated change immediately. But, when i change the amplitude of the waveform, the amplitude of waveform generated change after about 10 seconds. This mean there is a delay in the update of the waveform. How can i reduce this delay time? Maybe to 2 seconds. Thanks.
Best wishes. Chan
02-27-2006 02:28 PM
Hi Chan,
What you are seeing is that the output buffer has to finish before a new buffer
is output in it's place. In your application you evidently want to
instantaneously update both the frequency and voltage levels.
I did a little playing around with this
example and created the attached VI. Essentially when you use this
example you can use one of the AO lines to serve as the source for your
external reference. Because of this ability you could actually change the
voltage of your output signal instantaneously while also changing your timing
on the fly.
Give it a try and let me know if it works for you or not. If you need
more help about connections or anything, then go to File > VI Properties
> Documentation and you should be able to get the help you need there.
If not, then just shoot me a question on the forums.
Also, if you want to integrate the whole thing together with changing frequency
and amplitude at any instant, then you will want to use a method like in this
example (Analog Output Frequency Sweep with NI-DAQmx) to change
the frequency and then use the method that I used below to change the actual
amplitude. It will take a little time, but should eventually work.
Regards,