LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Arbitrary Waveform Generation w/o FGen Board? Dynamically changeable Amp, Offset, & Frequency on the fly...

Greetings,

I have an application that uses the Basic Function Generator.vi to output an AO voltage command to control the motion of a motor sinusoidally.  The function generator's amplitude and offset are controlled by PID loops and therefore must dynamically update on the fly.  Since I need to modify the sine waveform on the fly, I set the AO regen mode property to 'Do not allow regeneration' and recreate the output waveform each cycle through my AO loop process.  This works well.

 

I now need to create an arbitrary waveform that I can modify on the fly via the output of a PID plant.   I know that by 'allowing regeneration' and pushing an arbitrary waveform onto the AO buffer I can create nearly any output waveform shape, but I'm not able to modify the waveform while the AO is running.  I.e. the AO must be stopped, the waveform recreated and sent to the AO buffer, and then restarted for changes to be made to Amplitude, Offset, or Frequency.

 

My main questions are:

1.  Has anyone done this without an NI Function Generator board?

2.  Is this possible with an NI Fgen board?

 

Conceptually I can envision a way to do this is software, by creating an arbitrary waveform generator (similar to the NI base function generator VI's) but the coding seems involved and not accommodating to my schedule.

 

Any suggestions are appreciated!

Happy New Year.

 

 

0 Kudos
Message 1 of 2
(2,956 Views)

Hi Steve,

 

Your options for changing frequencies using an arbitrary waveform generator are waveform sequences, frequency list mode, and script mode.  You can find information about all of these in the NI Signal Generators Help installed with NI FGEN.  However none of these methods will be able to adjust your frequency on the fly.  If you take a look at the example program Fgen Arbitrary Waveform.vi, you can see what it takes to adjust the frequency of the arb.   If you try to adjust the frequency without stopping the generation, you will get the following error:

arb error.JPG

Regards,
Jim Schwartz
0 Kudos
Message 2 of 2
(2,930 Views)