LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

update amplitude while running labview

Hi Otis,
 
I have try to modify the vi using the instruction recommend like i increase the sampling buffer. Then error doesn't occur but the amplitude still can be changed. Please tell me what is the sample clock and sample buffer value. Thanks.
 
Best wishes. Chan
0 Kudos
Message 11 of 26
(1,648 Views)

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

Message 12 of 26
(1,644 Views)

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

0 Kudos
Message 13 of 26
(1,642 Views)

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

0 Kudos
Message 14 of 26
(1,639 Views)
Hi Dev or Anyone,
 
I have tried my best but i still can't get it. (Dev) I understand your explaination about the calculation of Frequency. Can Dev or anyone help me to run this program using PCI 6120. I attach the program sending by Devchander.
 
Problem: When the program is running the first loop, no error occur, but when it try to run the second loop, error 200290 occur. I have try all the suggestion and i manage to run it using (sample buffer 1 million). This doesn't mean i can get the update amplitude when i change it in front panel. Besides, the sine waveform generate is not stable like "not continuous".
 
Please do help me. I appreaciate your help. Thank you.
 
Best wishes. Chan  
0 Kudos
Message 15 of 26
(1,636 Views)

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

 

0 Kudos
Message 16 of 26
(1,634 Views)
Hi Dev,
 
I have manage to run it. I can change the amplitude and frequency. Thank you a lot for all the help.
 
Best wishes.
0 Kudos
Message 17 of 26
(1,636 Views)

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

 

0 Kudos
Message 18 of 26
(1,633 Views)

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

0 Kudos
Message 19 of 26
(1,580 Views)

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,

Message 20 of 26
(1,554 Views)