From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

NI-FGEN: Changing Arbitrary Waveform on the Fly

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit


  • Modular Instrumentation


  • LabVIEW


  • Other

Code and Documents



This VI allows  to change the parameters of the arbitrary waveform or output a new waveform.



To change the parameters of the arbitrary waveform or output a new waveform you will need to use the following steps:
1. Abort the generation by using the niFGEN Abort
2. Before you load the new arbitrary waveform to memory you will need to clear the old information using the niFGEN Clear Arbitrary
3. Load the new waveform. The picture below uses the niFGEN Util Create Waveform to create the waveform and the niFGEN Create Waveform (DBL).vi to load the waveform into the arbitrary waveform generator's memory.
4. If needed, create a new arbitrary sequence.
5. Configure the arbitrary sequence.
6. Use the niFGEN Initiate to restart the generation.




  Labview 2013 (or compatible)

  NI-FGEN driver which is compatible with your hardware and version of LabVIEW


  NI-FGEN Device


Steps to Implement or Execute Code

1. Select the name of your FGEN device
2. Run the VI


Additional Information or References

 Block Diagram


**This document has been updated to meet the current required format for the NI Code Exchange.**


Sara Lewandroski
Applications Engineer | National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.