07-17-2010 11:09 AM
Hi all ,
I am trying to generate the continuous sine wave from the analog output of the DAQ card. I want to change the amplitude of the sine wave during run time but i am not completely successful in doing this.
Moreover, my block diagram has three main parts
1) Initialization portion
2) Sinewave generation portion
3) termination portion
These three portions are in the while loop, due to some time taken initialization portion and termination portion , the response in the oscilloscope is like
...... straight line ... sinewave..... straight line..... sinewave..... straight line .... and so on.
How can i generate the sine wave continuosly such that whenever i change the amplitude , it should change smoothly without any distortion. I am stuck, plz reply.
Any help will be greatly appreciated.
07-17-2010 11:47 AM
Look at the shipping exam[le called Cont Gen Voltage Wfm-Int Clk-Non Regeneration where the waveform typte, amplitude, and frequency are all settable.
07-17-2010 12:34 PM
I use labview 8.2 and I cant find this example in the NI Example finder ,Plz tell me its location or directory.
07-17-2010 12:39 PM
Hardware Input and Output>DAQmx>Analog Generation.
07-17-2010 01:36 PM
In my version of labview "Analog generation" is not present.
Please tell me the simple logic of doing this . The amplitude control is in the Inintialization portion.
07-17-2010 03:10 PM
Nevermind. Found out you are not using an NI DAQ card. Ihave no idea how your cardbworks and you have not even posted your code.
07-18-2010 01:38 AM
I am using advantech PCI card and the code is also attached. Please read the problem in the First message.
and also convert this VI in labview v8.2
Thanks for your help in advance.
07-18-2010 01:47 PM
Please anyone reply. I am stuck.
07-19-2010 12:39 PM
Most of us here are familiar with NI cards. I don't know a thing about your card so I can't say much. Your subvi's are missing, which makes it even harder for me or anyone to give you advice. But I can say this. Usually you will use some subvi to setup the card parameters, like timing, triggering, frequency, amplitude, etc. If you want to change the frequency on the fly, you need to use the subvi that handles this function. First you must stop the session (or task), reconfigure the parameter (frequency), then start the task again. You have what looks like subvi's to setup the card inside the loop. You only have to put the one that sets the parameter you want to change (frequency) inside the loop. No need to set amplitude and triggering, and everything else over and over again.
To change the frequency on the fly, you should use an event structure. Create a numeric control called Frequency. Create a Frequency Value Change event. Inside the event, stop the task, reconfigure the frequency, start the task again. Then you could add a Stop button and create an event case for it. Inside the stop event, stop the task and do whatever clean up is necessary (turining off power, etc). Send a boolean to stop the loop from the Stop event.
07-19-2010 01:05 PM
Hi tbob
Thanks for the reply, for viewing the VI completely , plz install Advantech PCI-1712 driver. Since i am a labview novice, therefore i am facing this problem. Attached are the some of the VIs which contains case structure and events that i have tried but they are not working properly. How to eliminate the delay in between sine waves thats what i want to do. Plz look into the following VIs and tell me my mistake . Thanks