nifgen module
Installation
As a prerequisite to using the nifgen module, you must install the NI-FGEN runtime on your system. Visit ni.com/downloads 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
Usage
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():
time.sleep(5)
API Reference
- Session
- Methods
- abort
- allocate_named_waveform
- allocate_waveform
- clear_arb_memory
- clear_arb_sequence
- clear_freq_list
- clear_user_standard_waveform
- close
- commit
- configure_arb_sequence
- configure_arb_waveform
- configure_freq_list
- configure_standard_waveform
- create_advanced_arb_sequence
- create_arb_sequence
- create_freq_list
- create_waveform_from_file_f64
- create_waveform_from_file_i16
- create_waveform_numpy
- define_user_standard_waveform
- delete_script
- delete_waveform
- disable
- export_attribute_configuration_buffer
- export_attribute_configuration_file
- get_channel_name
- get_ext_cal_last_date_and_time
- get_ext_cal_last_temp
- get_ext_cal_recommended_interval
- get_hardware_state
- get_self_cal_last_date_and_time
- get_self_cal_last_temp
- get_self_cal_supported
- import_attribute_configuration_buffer
- import_attribute_configuration_file
- initiate
- is_done
- lock
- query_arb_seq_capabilities
- query_arb_wfm_capabilities
- query_freq_list_capabilities
- read_current_temperature
- reset
- reset_device
- reset_with_defaults
- self_cal
- self_test
- send_software_edge_trigger
- set_next_write_position
- unlock
- wait_until_done
- write_script
- write_waveform
- Properties
- absolute_delay
- all_marker_events_latched_status
- all_marker_events_live_status
- analog_data_mask
- analog_filter_enabled
- analog_path
- analog_static_value
- arb_gain
- arb_marker_position
- arb_offset
- arb_repeat_count
- arb_sample_rate
- arb_sequence_handle
- arb_waveform_handle
- aux_power_enabled
- bus_type
- channel_delay
- clock_mode
- common_mode_offset
- data_marker_events_count
- data_marker_event_data_bit_number
- data_marker_event_level_polarity
- data_marker_event_output_terminal
- data_transfer_block_size
- data_transfer_maximum_bandwidth
- data_transfer_maximum_in_flight_reads
- data_transfer_preferred_packet_size
- digital_data_mask
- digital_edge_script_trigger_edge
- digital_edge_script_trigger_source
- digital_edge_start_trigger_edge
- digital_edge_start_trigger_source
- digital_filter_enabled
- digital_filter_interpolation_factor
- digital_gain
- digital_pattern_enabled
- digital_static_value
- done_event_output_terminal
- done_event_pulse_width
- done_event_pulse_width_units
- driver_setup
- exported_onboard_reference_clock_output_terminal
- exported_reference_clock_output_terminal
- exported_sample_clock_divisor
- exported_sample_clock_output_terminal
- exported_sample_clock_timebase_divisor
- exported_sample_clock_timebase_output_terminal
- exported_script_trigger_output_terminal
- exported_start_trigger_output_terminal
- external_clock_delay_binary_value
- external_sample_clock_multiplier
- file_transfer_block_size
- filter_correction_frequency
- flatness_correction_enabled
- fpga_bitfile_path
- freq_list_duration_quantum
- freq_list_handle
- func_amplitude
- func_buffer_size
- func_dc_offset
- func_duty_cycle_high
- func_frequency
- func_max_buffer_size
- func_start_phase
- func_waveform
- idle_behavior
- idle_value
- instrument_firmware_revision
- instrument_manufacturer
- instrument_model
- io_resource_descriptor
- load_impedance
- logical_name
- marker_events_count
- marker_event_output_terminal
- marker_event_pulse_width
- marker_event_pulse_width_units
- max_freq_list_duration
- max_freq_list_length
- max_loop_count
- max_num_freq_lists
- max_num_sequences
- max_num_waveforms
- max_sequence_length
- max_waveform_size
- memory_size
- min_freq_list_duration
- min_freq_list_length
- min_sequence_length
- min_waveform_size
- module_revision
- channel_count
- output_enabled
- output_impedance
- output_mode
- ready_for_start_event_output_terminal
- reference_clock_source
- ref_clock_frequency
- sample_clock_source
- sample_clock_timebase_rate
- sample_clock_timebase_source
- script_to_generate
- script_triggers_count
- script_trigger_type
- serial_number
- simulate
- specific_driver_description
- major_version
- minor_version
- specific_driver_revision
- specific_driver_vendor
- started_event_output_terminal
- started_event_pulse_width
- started_event_pulse_width_units
- start_trigger_type
- streaming_space_available_in_waveform
- streaming_waveform_handle
- streaming_waveform_name
- streaming_write_timeout
- supported_instrument_models
- terminal_configuration
- trigger_mode
- wait_behavior
- wait_value
- waveform_quantum
- NI-TClk Support
- Repeated Capabilities
- Enums
- AnalogPath
- BusType
- ByteOrder
- ClockMode
- DataMarkerEventLevelPolarity
- EventPulseWidthUnits
- HardwareState
- IdleBehavior
- OutputMode
- ReferenceClockSource
- RelativeTo
- SampleClockSource
SampleClockSource
SampleClockSource.CLOCK_IN
SampleClockSource.DDC_CLOCK_IN
SampleClockSource.ONBOARD_CLOCK
SampleClockSource.PXI_STAR_LINE
SampleClockSource.PXI_TRIGGER_LINE_0_RTSI_0
SampleClockSource.PXI_TRIGGER_LINE_1_RTSI_1
SampleClockSource.PXI_TRIGGER_LINE_2_RTSI_2
SampleClockSource.PXI_TRIGGER_LINE_3_RTSI_3
SampleClockSource.PXI_TRIGGER_LINE_4_RTSI_4
SampleClockSource.PXI_TRIGGER_LINE_5_RTSI_5
SampleClockSource.PXI_TRIGGER_LINE_6_RTSI_6
SampleClockSource.PXI_TRIGGER_LINE_7_RTSI_7
- SampleClockTimebaseSource
- ScriptTriggerDigitalEdgeEdge
- ScriptTriggerType
- StartTriggerDigitalEdgeEdge
- StartTriggerType
- TerminalConfiguration
- Trigger
- TriggerMode
- WaitBehavior
- Waveform
- Exceptions and Warnings
- Examples
- gRPC Support