NI PXI-5404 Generating a Clock Signal (Square Wave)

NI Signal Generator

NI PXI-5404
Generating a Clock Signal (Square Wave)


  1. Initialize an NI-FGEN session for the appropriate device (niFgen Initialize VI or niFgen_init function).
  2. Set the appropriate standard function properties or attributes for the desired generation.


    PropertiesAttribute Value
    Waveform NIFGEN_ATTR_FUNC_WAVEFORM NIFGEN_VAL_WFM_SQUARE
    FrequencyNIFGEN_ATTR_FUNC_FREQUENCY the desired frequency (Hz), 0 MHz to 105 MHz
    AmplitudeNIFGEN_ATTR_FUNC_AMPLITUDE the desired amplitude (Vpk-pk into a high impedance load), 1.8 V, 3.3 V, or 5 V
    Duty Cycle HighNIFGEN_ATTR_FUNC_DUTY_CYCLE_HIGH The desired duty cycle (%), legal values vary by the frequency


  3. Initiate the generation (niFgen_InitiateGeneration). The square wave should be generated at CLOCK out.
  4. If you want to stop the generation, do so by disabling the output (niFgen Output Enable VI or niFgen_ConfigureOutputEnabled function) and/or aborting the generation (niFgen Abort Generation VI or niFgen_AbortGeneration function).
  5. Close the NI-FGEN session (niFgen Close VI or niFgen_close function).

The following table lists the NI-FGEN clock signal (square wave) example for various ADEs.



ADE Path
LabVIEW <LabVIEW>\examples\instr\niFgen\niFgen_5404_Clock_Generation_Example.vi
LabWindows/CVI <CVI>\Samples\niFgen\ClockGeneration5404.prj
C++ <MeasurementStudio>\VC\Examples\niFgen\niFgen_5404_Clock_Generation_Example.dsw
Visual Basic <MeasurementStudio>\VB\Samples\niFgen\5404_Clock_Example.vbp
Standard C <Program Files>\IVI\Drivers\niFgen\Examples\c\ClockGeneration5404.c