niscope module
Installation
As a prerequisite to using the niscope module, you must install the NI-SCOPE runtime on your system. Visit ni.com/downloads to download the driver runtime for your devices.
The nimi-python modules (i.e. for NI-SCOPE) can be installed with pip:
$ python -m pip install niscope~=1.4.9
Usage
The following is a basic example of using the niscope module to open a session to a High Speed Digitizer and capture a single record of 1000 points.
import niscope
with niscope.Session("Dev1") as session:
session.channels[0].configure_vertical(range=1.0, coupling=niscope.VerticalCoupling.AC)
session.channels[1].configure_vertical(range=10.0, coupling=niscope.VerticalCoupling.DC)
session.configure_horizontal_timing(min_sample_rate=50000000, min_num_pts=1000, ref_position=50.0, num_records=5, enforce_realtime=True)
with session.initiate():
waveforms = session.channels[0,1].fetch(num_records=5)
for wfm in waveforms:
print('Channel {}, record {} samples acquired: {:,}\n'.format(wfm.channel, wfm.record, len(wfm.samples)))
# Find all channel 1 records (Note channel name is always a string even if integers used in channel[])
chan1 = [wfm for wfm in waveforms if wfm.channel == '0']
# Find all record number 3
rec3 = [wfm for wfm in waveforms if wfm.record == 3]
If you need faster fetch performance, or to directly interface with SciPy, you can use the fetch_into() method instead of fetch(). See the fetch_into example.
API Reference
- Session
- Methods
- abort
- acquisition_status
- add_waveform_processing
- auto_setup
- clear_waveform_measurement_stats
- clear_waveform_processing
- close
- commit
- configure_chan_characteristics
- configure_equalization_filter_coefficients
- configure_horizontal_timing
- configure_trigger_digital
- configure_trigger_edge
- configure_trigger_hysteresis
- configure_trigger_immediate
- configure_trigger_software
- configure_trigger_video
- configure_trigger_window
- configure_vertical
- disable
- export_attribute_configuration_buffer
- export_attribute_configuration_file
- fetch
- fetch_array_measurement
- fetch_into
- fetch_measurement_stats
- get_channel_names
- get_equalization_filter_coefficients
- get_ext_cal_last_date_and_time
- get_ext_cal_last_temp
- get_self_cal_last_date_and_time
- get_self_cal_last_temp
- import_attribute_configuration_buffer
- import_attribute_configuration_file
- initiate
- lock
- probe_compensation_signal_start
- probe_compensation_signal_stop
- read
- reset
- reset_device
- reset_with_defaults
- self_cal
- self_test
- send_software_trigger_edge
- unlock
- Properties
- absolute_sample_clock_offset
- acquisition_start_time
- acquisition_type
- acq_arm_source
- advance_trigger_terminal_name
- adv_trig_src
- allow_more_records_than_memory
- arm_ref_trig_src
- backlog
- bandpass_filter_enabled
- binary_sample_width
- cable_sense_mode
- cable_sense_signal_enable
- cable_sense_voltage
- channel_count
- channel_enabled
- channel_terminal_configuration
- data_transfer_block_size
- data_transfer_maximum_bandwidth
- data_transfer_preferred_packet_size
- device_temperature
- enabled_channels
- enable_dc_restore
- enable_time_interleaved_sampling
- end_of_acquisition_event_output_terminal
- end_of_acquisition_event_terminal_name
- end_of_record_event_output_terminal
- end_of_record_event_terminal_name
- end_of_record_to_advance_trigger_holdoff
- equalization_filter_enabled
- equalization_num_coefficients
- exported_advance_trigger_output_terminal
- exported_ref_trigger_output_terminal
- exported_start_trigger_output_terminal
- flex_fir_antialias_filter_type
- fpga_bitfile_path
- glitch_condition
- glitch_polarity
- glitch_width
- high_pass_filter_frequency
- horz_enforce_realtime
- horz_min_num_pts
- horz_num_records
- horz_record_length
- horz_record_ref_position
- horz_sample_rate
- horz_time_per_record
- input_clock_source
- input_impedance
- instrument_firmware_revision
- instrument_manufacturer
- instrument_model
- interleaving_offset_correction_enabled
- io_resource_descriptor
- is_probe_comp_on
- logical_name
- master_enable
- max_input_frequency
- max_real_time_sampling_rate
- max_ris_rate
- meas_array_gain
- meas_array_offset
- meas_chan_high_ref_level
- meas_chan_low_ref_level
- meas_chan_mid_ref_level
- meas_filter_center_freq
- meas_filter_cutoff_freq
- meas_filter_order
- meas_filter_ripple
- meas_filter_taps
- meas_filter_transient_waveform_percent
- meas_filter_type
- meas_filter_width
- meas_fir_filter_window
- meas_high_ref
- meas_hysteresis_percent
- meas_interpolation_sampling_factor
- meas_last_acq_histogram_size
- meas_low_ref
- meas_mid_ref
- meas_other_channel
- meas_percentage_method
- meas_polynomial_interpolation_order
- meas_ref_level_units
- meas_time_histogram_high_time
- meas_time_histogram_high_volts
- meas_time_histogram_low_time
- meas_time_histogram_low_volts
- meas_time_histogram_size
- meas_voltage_histogram_high_volts
- meas_voltage_histogram_low_volts
- meas_voltage_histogram_size
- min_sample_rate
- onboard_memory_size
- output_clock_source
- pll_lock_status
- points_done
- poll_interval
- probe_attenuation
- ready_for_advance_event_output_terminal
- ready_for_advance_event_terminal_name
- ready_for_ref_event_output_terminal
- ready_for_ref_event_terminal_name
- ready_for_start_event_output_terminal
- ready_for_start_event_terminal_name
- records_done
- record_arm_source
- ref_clk_rate
- ref_trigger_detector_location
- ref_trigger_minimum_quiet_time
- ref_trigger_terminal_name
- ref_trig_tdc_enable
- resolution
- ris_in_auto_setup_enable
- ris_method
- ris_num_averages
- runt_high_threshold
- runt_low_threshold
- runt_polarity
- runt_time_condition
- runt_time_high_limit
- runt_time_low_limit
- sample_mode
- samp_clk_timebase_div
- sample_clock_timebase_multiplier
- samp_clk_timebase_rate
- samp_clk_timebase_src
- serial_number
- accessory_gain
- accessory_offset
- simulate
- specific_driver_description
- specific_driver_revision
- specific_driver_vendor
- start_to_ref_trigger_holdoff
- start_trigger_terminal_name
- supported_instrument_models
- trigger_auto_triggered
- trigger_coupling
- trigger_delay_time
- trigger_holdoff
- trigger_hysteresis
- trigger_impedance
- trigger_level
- trigger_modifier
- trigger_slope
- trigger_source
- trigger_type
- trigger_window_high_level
- trigger_window_low_level
- trigger_window_mode
- tv_trigger_event
- tv_trigger_line_number
- tv_trigger_polarity
- tv_trigger_signal_format
- use_spec_initial_x
- vertical_coupling
- vertical_offset
- vertical_range
- width_condition
- width_high_threshold
- width_low_threshold
- width_polarity
- NI-TClk Support
- Repeated Capabilities
- Enums
- AcquisitionStatus
- AcquisitionType
- ArrayMeasurement
ArrayMeasurementArrayMeasurement.NO_MEASUREMENTArrayMeasurement.LAST_ACQ_HISTOGRAMArrayMeasurement.FFT_PHASE_SPECTRUMArrayMeasurement.FFT_AMP_SPECTRUM_VOLTS_RMSArrayMeasurement.MULTI_ACQ_VOLTAGE_HISTOGRAMArrayMeasurement.MULTI_ACQ_TIME_HISTOGRAMArrayMeasurement.ARRAY_INTEGRALArrayMeasurement.DERIVATIVEArrayMeasurement.INVERSEArrayMeasurement.HANNING_WINDOWArrayMeasurement.FLAT_TOP_WINDOWArrayMeasurement.POLYNOMIAL_INTERPOLATIONArrayMeasurement.MULTIPLY_CHANNELSArrayMeasurement.ADD_CHANNELSArrayMeasurement.SUBTRACT_CHANNELSArrayMeasurement.DIVIDE_CHANNELSArrayMeasurement.MULTI_ACQ_AVERAGEArrayMeasurement.BUTTERWORTH_FILTERArrayMeasurement.CHEBYSHEV_FILTERArrayMeasurement.FFT_AMP_SPECTRUM_DBArrayMeasurement.HAMMING_WINDOWArrayMeasurement.WINDOWED_FIR_FILTERArrayMeasurement.BESSEL_FILTERArrayMeasurement.TRIANGLE_WINDOWArrayMeasurement.BLACKMAN_WINDOWArrayMeasurement.ARRAY_OFFSETArrayMeasurement.ARRAY_GAIN
- CableSenseMode
- ClearableMeasurement
ClearableMeasurementClearableMeasurement.ALL_MEASUREMENTSClearableMeasurement.MULTI_ACQ_VOLTAGE_HISTOGRAMClearableMeasurement.MULTI_ACQ_TIME_HISTOGRAMClearableMeasurement.MULTI_ACQ_AVERAGEClearableMeasurement.FREQUENCYClearableMeasurement.AVERAGE_FREQUENCYClearableMeasurement.FFT_FREQUENCYClearableMeasurement.PERIODClearableMeasurement.AVERAGE_PERIODClearableMeasurement.RISE_TIMEClearableMeasurement.FALL_TIMEClearableMeasurement.RISE_SLEW_RATEClearableMeasurement.FALL_SLEW_RATEClearableMeasurement.OVERSHOOTClearableMeasurement.PRESHOOTClearableMeasurement.VOLTAGE_RMSClearableMeasurement.VOLTAGE_CYCLE_RMSClearableMeasurement.AC_ESTIMATEClearableMeasurement.FFT_AMPLITUDEClearableMeasurement.VOLTAGE_AVERAGEClearableMeasurement.VOLTAGE_CYCLE_AVERAGEClearableMeasurement.DC_ESTIMATEClearableMeasurement.VOLTAGE_MAXClearableMeasurement.VOLTAGE_MINClearableMeasurement.VOLTAGE_PEAK_TO_PEAKClearableMeasurement.VOLTAGE_HIGHClearableMeasurement.VOLTAGE_LOWClearableMeasurement.AMPLITUDEClearableMeasurement.VOLTAGE_TOPClearableMeasurement.VOLTAGE_BASEClearableMeasurement.VOLTAGE_BASE_TO_TOPClearableMeasurement.WIDTH_NEGClearableMeasurement.WIDTH_POSClearableMeasurement.DUTY_CYCLE_NEGClearableMeasurement.DUTY_CYCLE_POSClearableMeasurement.INTEGRALClearableMeasurement.AREAClearableMeasurement.CYCLE_AREAClearableMeasurement.TIME_DELAYClearableMeasurement.PHASE_DELAYClearableMeasurement.LOW_REF_VOLTSClearableMeasurement.MID_REF_VOLTSClearableMeasurement.HIGH_REF_VOLTSClearableMeasurement.VOLTAGE_HISTOGRAM_MEANClearableMeasurement.VOLTAGE_HISTOGRAM_STDEVClearableMeasurement.VOLTAGE_HISTOGRAM_MEDIANClearableMeasurement.VOLTAGE_HISTOGRAM_MODEClearableMeasurement.VOLTAGE_HISTOGRAM_MAXClearableMeasurement.VOLTAGE_HISTOGRAM_MINClearableMeasurement.VOLTAGE_HISTOGRAM_PEAK_TO_PEAKClearableMeasurement.VOLTAGE_HISTOGRAM_MEAN_PLUS_STDEVClearableMeasurement.VOLTAGE_HISTOGRAM_MEAN_PLUS_2_STDEVClearableMeasurement.VOLTAGE_HISTOGRAM_MEAN_PLUS_3_STDEVClearableMeasurement.VOLTAGE_HISTOGRAM_HITSClearableMeasurement.VOLTAGE_HISTOGRAM_NEW_HITSClearableMeasurement.TIME_HISTOGRAM_MEANClearableMeasurement.TIME_HISTOGRAM_STDEVClearableMeasurement.TIME_HISTOGRAM_MEDIANClearableMeasurement.TIME_HISTOGRAM_MODEClearableMeasurement.TIME_HISTOGRAM_MAXClearableMeasurement.TIME_HISTOGRAM_MINClearableMeasurement.TIME_HISTOGRAM_PEAK_TO_PEAKClearableMeasurement.TIME_HISTOGRAM_MEAN_PLUS_STDEVClearableMeasurement.TIME_HISTOGRAM_MEAN_PLUS_2_STDEVClearableMeasurement.TIME_HISTOGRAM_MEAN_PLUS_3_STDEVClearableMeasurement.TIME_HISTOGRAM_HITSClearableMeasurement.TIME_HISTOGRAM_NEW_HITS
- FIRFilterWindow
- FetchRelativeTo
- FilterType
- FlexFIRAntialiasFilterType
- GlitchCondition
- GlitchPolarity
- Option
- PercentageMethod
- RISMethod
- RefLevelUnits
- RefTriggerDetectorLocation
- RuntPolarity
- RuntTimeCondition
- ScalarMeasurement
ScalarMeasurementScalarMeasurement.NO_MEASUREMENTScalarMeasurement.RISE_TIMEScalarMeasurement.FALL_TIMEScalarMeasurement.FREQUENCYScalarMeasurement.PERIODScalarMeasurement.VOLTAGE_RMSScalarMeasurement.VOLTAGE_PEAK_TO_PEAKScalarMeasurement.VOLTAGE_MAXScalarMeasurement.VOLTAGE_MINScalarMeasurement.VOLTAGE_HIGHScalarMeasurement.VOLTAGE_LOWScalarMeasurement.VOLTAGE_AVERAGEScalarMeasurement.WIDTH_NEGScalarMeasurement.WIDTH_POSScalarMeasurement.DUTY_CYCLE_NEGScalarMeasurement.DUTY_CYCLE_POSScalarMeasurement.AMPLITUDEScalarMeasurement.VOLTAGE_CYCLE_RMSScalarMeasurement.VOLTAGE_CYCLE_AVERAGEScalarMeasurement.OVERSHOOTScalarMeasurement.PRESHOOTScalarMeasurement.LOW_REF_VOLTSScalarMeasurement.MID_REF_VOLTSScalarMeasurement.HIGH_REF_VOLTSScalarMeasurement.AREAScalarMeasurement.CYCLE_AREAScalarMeasurement.INTEGRALScalarMeasurement.VOLTAGE_BASEScalarMeasurement.VOLTAGE_TOPScalarMeasurement.FFT_FREQUENCYScalarMeasurement.FFT_AMPLITUDEScalarMeasurement.RISE_SLEW_RATEScalarMeasurement.FALL_SLEW_RATEScalarMeasurement.AC_ESTIMATEScalarMeasurement.DC_ESTIMATEScalarMeasurement.TIME_DELAYScalarMeasurement.AVERAGE_PERIODScalarMeasurement.AVERAGE_FREQUENCYScalarMeasurement.VOLTAGE_BASE_TO_TOPScalarMeasurement.PHASE_DELAY
- TerminalConfiguration
- TriggerCoupling
- TriggerModifier
- TriggerSlope
- TriggerType
- TriggerWindowMode
- VerticalCoupling
- VideoPolarity
- VideoSignalFormat
VideoSignalFormatVideoSignalFormat.NTSCVideoSignalFormat.PALVideoSignalFormat.SECAMVideoSignalFormat.M_PALVideoSignalFormat.VIDEO_480I_59_94_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_480I_60_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_480P_59_94_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_480P_60_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_576I_50_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_576P_50_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_720P_50_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_720P_59_94_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_720P_60_FRAMES_PER_SECONDVideoSignalFormat.VIDEO_1080I_50_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_1080I_59_94_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_1080I_60_FIELDS_PER_SECONDVideoSignalFormat.VIDEO_1080P_24_FRAMES_PER_SECOND
- VideoTriggerEvent
- WhichTrigger
- WidthCondition
- WidthPolarity
- Exceptions and Warnings
- Examples
- gRPC Support