nifgen module


As a prerequisite to using the nifgen module, you must install the NI-FGEN runtime on your system. Visit to download the driver runtime for your devices.

The nimi-python modules (i.e. for NI-FGEN) can be installed with pip:

$ python -m pip install nifgen~=1.4.5


The following is a basic example of using the nifgen module to open a session to a Function Generator and generate a sine wave for 5 seconds.

import nifgen
import time
with nifgen.Session("Dev1") as session:
    session.output_mode = nifgen.OutputMode.FUNC
    session.configure_standard_waveform(waveform=nifgen.Waveform.SINE, amplitude=1.0, frequency=10000000, dc_offset=0.0, start_phase=0.0)
    with session.initiate():

Other usage examples can be found on GitHub.

API Reference