04-30-2014 05:00 AM
Hello,
I want to use PCI 6115 as a function generator. This Vi should generate the selected waveform continuously. It can be a simple waveform like DC, sinus, ramp and so on, or a modulated waveform( addition with a high frequence sinus waveform) . The idea was that it can changes the waveform on the fly responding to changing signal type, amplitude, offset, frequency, and phase settings and modulation on the front panel. And the waveform may come out quickly when the change occurs. The samplingrate is 1M Hz.
I worte a VI as shown in the picture. But the waveform doesn't change during output. Can you help me?
Thanks
Shi
04-30-2014 12:41 PM
You should be using non-regeneration like in this example to ensure phase-continuity when you update your parameters.
Even so, the 6115 is a special case as it has a very large buffer size (32 MS). Try lowering the output onboard buffer size using a DAQmx Buffer Property Node (I seem to recall this being supported on the 6115 though I don't have one available to test with--a simulated device doesn't seem to complain at least):
If that doesn't work you can try following something similar to this--the ethernet-based DAQ products also have this problem and don't have the option of configuring the buffer size through the API.
Best Regards,
04-30-2014 03:57 PM
Thanks for your help. I'll try it on Friday. I have one more question. How can I ensure phase-continuity? By using actual sample rate as sampling info of an output waveform ?
04-30-2014 04:09 PM
The problem with regenerating from the buffer (which is the default for analog output) and then subsequently writing new data to that buffer is that you will be reading/writing the same information simultaneously. This is a bad practice if you want to be 100% sure of the data that you are sending out (i.e. was it the old or the new data, or a mix of the two?).
In the non-regeneration case, the simulate signal sub VI keeps track of the phase for you (though if you are regenerating you need to ensure you write an exact integer number of periods of your signal). Assuming you don't need to modify the phase.
If you need to change the phase while the waveform is outputting, I attached an example of how one might do that here (look at the attachments section, the image doesn't include the phase updates).
Best Regards,