How Do I Perform a Frequency Sweep With NI-FGEN, Then Continuously Generate a Constant Frequency?

Updated Dec 1, 2023

Reported In

Driver

  • NI-FGEN

Issue Details

I can successfully perform a frequency sweep using the NI-FGEN software but I want to continue to generate an output at the top frequency once the sweep finishes. How can I accomplish this?

Solution

The solution will depend on both what hardware you are using and the requirements of your particular application:
  • Scripting using an SMC-based board
    If your Signal Generator is an SMC-based board that supports scripting, then writing a script to do this will be the easiest solution. Use the Fgen Arb Script.vi example in the NI Example Finder to help set up and run a script (Hardware Input and Output » Modular Instruments » NI-FGEN » Arbitrary Waveform Generation). When writing your script you can use the Repeat N or Repeat Forever instructions to repeat the final waveform for either a finite amount of time or indefinitey. For more information, please refer to the NI Signal Generators Help on script mode.
    If your board does not support scripting then you have a couple of options depending on what your requirements are.
 
  • Finite generation using non SMC-based board
    If you require the generation of the final frequency to be for a prolonged finite amount of time then you can just set the Duration input of the final frequency for the NI-FGEN Create Frequency List.vi to the maximum value as long as this duration is suitably high. Refer to the Specification document of your specific device to see what the maximum Step Duration is. If this is not long enough or you require the generation to be indefinite you will need to follow the next step below.
 
  • Infinite generation using devices that do not support scripting
    A true indefinite generation is not going to be possible as there is no Hold or Repeat function. It may however be possible for you to get the effect of an infinite generation. If for example you are using an NI-5402, it has a maximum step duration of 21 seconds. The maximum size of the frequency array input of the NI-FGEN Create Frequency List.vi is over 58000. This means that if you create the last 500 elements of your frequency array to be the final frequency and the final 500 elements of the duration array to the the max step duration, the duration the final frequency will run for will be nearly 3 hours. You can obviously make this length shorter or longer by changing the number of elements you specify in the arrays. This should give you the effect of an indefinite generation.