niscope.Session methods¶
-
niscope.Session.
abort
()¶ Aborts an acquisition and returns the digitizer to the Idle state. Call this method if the digitizer times out waiting for a trigger.
-
niscope.Session.
acquisition_status
()¶ Returns status information about the acquisition to the status output parameter.
Return type: niscope.AcquisitionStatus
Returns: Returns whether the acquisition is complete, in progress, or unknown. Defined Values
-
niscope.Session.
auto_setup
()¶ Automatically configures the instrument. When you call this method, the digitizer senses the input signal and automatically configures many of the instrument settings. If a signal is detected on a channel, the driver chooses the smallest available vertical range that is larger than the signal range. For example, if the signal is a 1.2 Vpk-pk sine wave, and the device supports 1 V and 2 V vertical ranges, the driver will choose the 2 V vertical range for that channel.
If no signal is found on any analog input channel, a warning is returned, and all channels are enabled. A channel is considered to have a signal present if the signal is at least 10% of the smallest vertical range available for that channel.
The following settings are changed:
General Acquisition mode Normal Reference clock Internal Vertical Vertical coupling AC (DC for NI 5621) Vertical bandwidth Full Vertical range Changed by auto setup Vertical offset 0 V Probe attenuation Unchanged by auto setup Input impedance Unchanged by auto setup Horizontal Sample rate Changed by auto setup Min record length Changed by auto setup Enforce realtime True Number of Records Changed to 1 Triggering Trigger type Edge if signal present, otherwise immediate Trigger channel Lowest numbered channel with a signal present Trigger slope Positive Trigger coupling DC Reference position 50% Trigger level 50% of signal on trigger channel Trigger delay 0 Trigger holdoff 0 Trigger output None
-
niscope.Session.
commit
()¶ Commits to hardware all the parameter settings associated with the task. Use this method if you want a parameter change to be immediately reflected in the hardware. This method is not supported for Traditional NI-DAQ (Legacy) devices.
-
niscope.Session.
configure_chan_characteristics
(input_impedance, max_input_frequency)¶ Configures the properties that control the electrical characteristics of the channel—the input impedance and the bandwidth.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].configure_chan_characteristics(input_impedance, max_input_frequency)
Parameters: - input_impedance (float) – The input impedance for the channel; NI-SCOPE sets
niscope.Session.input_impedance
to this value. - max_input_frequency (float) – The bandwidth for the channel; NI-SCOPE sets
niscope.Session.max_input_frequency
to this value. Pass 0 for this value to use the hardware default bandwidth. Pass –1 for this value to achieve full bandwidth.
- input_impedance (float) – The input impedance for the channel; NI-SCOPE sets
-
niscope.Session.
configure_equalization_filter_coefficients
(coefficients)¶ Configures the custom coefficients for the equalization FIR filter on the device. This filter is designed to compensate the input signal for artifacts introduced to the signal outside of the digitizer. Because this filter is a generic FIR filter, any coefficients are valid. Coefficient values should be between +1 and –1.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].configure_equalization_filter_coefficients(coefficients)
Parameters: coefficients (list of float) – The custom coefficients for the equalization FIR filter on the device. These coefficients should be between +1 and –1. You can obtain the number of coefficients from the :py:data:`niscope.Session.equalization_num_coefficients <cvi:py:data:niscope.Session.equalization_num_coefficients.html>`__ property. The :py:data:`niscope.Session.equalization_filter_enabled <cvi:py:data:niscope.Session.equalization_filter_enabled.html>`__ property must be set to TRUE to enable the filter.
-
niscope.Session.
configure_horizontal_timing
(min_sample_rate, min_num_pts, ref_position, num_records, enforce_realtime)¶ Configures the common properties of the horizontal subsystem for a multirecord acquisition in terms of minimum sample rate.
Parameters: - min_sample_rate (float) – The sampling rate for the acquisition. Refer to
niscope.Session.min_sample_rate
for more information. - min_num_pts (int) –
The minimum number of points you need in the record for each channel; call
niscope.Session.ActualRecordLength()
to obtain the actual record length used.Valid Values: Greater than 1; limited by available memory
Note
One or more of the referenced methods are not in the Python API for this driver.
- ref_position (float) – The position of the Reference Event in the waveform record specified as a percentage.
- num_records (int) – The number of records to acquire
- enforce_realtime (bool) –
Indicates whether the digitizer enforces real-time measurements or allows equivalent-time (RIS) measurements; not all digitizers support RIS—refer to Features Supported by Device for more information.
Default value: True
Defined Values
True—Allow real-time acquisitions only
False—Allow real-time and equivalent-time acquisitions
- min_sample_rate (float) – The sampling rate for the acquisition. Refer to
-
niscope.Session.
configure_trigger_digital
(trigger_source, slope=niscope.TriggerSlope.POSITIVE, holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures the common properties of a digital trigger.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
(Start Trigger Source) property. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.Note
For multirecord acquisitions, all records after the first record are started by using the Advance Trigger Source. The default is immediate.
You can adjust the amount of pre-trigger and post-trigger samples using the reference position parameter on the
niscope.Session.configure_horizontal_timing()
method. The default is half of the record length.Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Digital triggering is not supported in RIS mode.
Parameters: - trigger_source (str) – Specifies the trigger source. Refer to
niscope.Session.trigger_source
for defined values. - slope (
niscope.TriggerSlope
) – Specifies whether you want a rising edge or a falling edge to trigger the digitizer. Refer toniscope.Session.trigger_slope
for more information. - holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- trigger_source (str) – Specifies the trigger source. Refer to
-
niscope.Session.
configure_trigger_edge
(trigger_source, trigger_coupling, level=0.0, slope=niscope.TriggerSlope.POSITIVE, holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures common properties for analog edge triggering.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
(Start Trigger Source) property. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.Note
Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Parameters: - trigger_source (str) – Specifies the trigger source. Refer to
niscope.Session.trigger_source
for defined values. - trigger_coupling (
niscope.TriggerCoupling
) – Applies coupling and filtering options to the trigger signal. Refer toniscope.Session.trigger_coupling
for more information. - level (float) – The voltage threshold for the trigger. Refer to
niscope.Session.trigger_level
for more information. - slope (
niscope.TriggerSlope
) – Specifies whether you want a rising edge or a falling edge to trigger the digitizer. Refer toniscope.Session.trigger_slope
for more information. - holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- trigger_source (str) – Specifies the trigger source. Refer to
-
niscope.Session.
configure_trigger_hysteresis
(trigger_source, trigger_coupling, level=0.0, hysteresis=0.05, slope=niscope.TriggerSlope.POSITIVE, holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures common properties for analog hysteresis triggering. This kind of trigger specifies an additional value, specified in the hysteresis parameter, that a signal must pass through before a trigger can occur. This additional value acts as a kind of buffer zone that keeps noise from triggering an acquisition.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.Note
Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Parameters: - trigger_source (str) – Specifies the trigger source. Refer to
niscope.Session.trigger_source
for defined values. - trigger_coupling (
niscope.TriggerCoupling
) – Applies coupling and filtering options to the trigger signal. Refer toniscope.Session.trigger_coupling
for more information. - level (float) – The voltage threshold for the trigger. Refer to
niscope.Session.trigger_level
for more information. - hysteresis (float) – The size of the hysteresis window on either side of the level in
volts; the digitizer triggers when the trigger signal passes through the
hysteresis value you specify with this parameter, has the slope you
specify with slope, and passes through the level. Refer to
niscope.Session.trigger_hysteresis
for defined values. - slope (
niscope.TriggerSlope
) – Specifies whether you want a rising edge or a falling edge to trigger the digitizer. Refer toniscope.Session.trigger_slope
for more information. - holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- trigger_source (str) – Specifies the trigger source. Refer to
-
niscope.Session.
configure_trigger_immediate
()¶ Configures common properties for immediate triggering. Immediate triggering means the digitizer triggers itself.
When you initiate an acquisition, the digitizer waits for a trigger. You specify the type of trigger that the digitizer waits for with a Configure Trigger method, such as
niscope.Session.configure_trigger_immediate()
.
-
niscope.Session.
configure_trigger_software
(holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures common properties for software triggering.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
(Start Trigger Source) property. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.To trigger the acquisition, use
niscope.Session.send_software_trigger_edge()
.Note
Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Parameters: - holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
-
niscope.Session.
configure_trigger_video
(trigger_source, signal_format, event, polarity, trigger_coupling, enable_dc_restore=False, line_number=1, holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures the common properties for video triggering, including the signal format, TV event, line number, polarity, and enable DC restore. A video trigger occurs when the digitizer finds a valid video signal sync.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
(Start Trigger Source) property. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.Note
Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Parameters: - trigger_source (str) – Specifies the trigger source. Refer to
niscope.Session.trigger_source
for defined values. - signal_format (
niscope.VideoSignalFormat
) – Specifies the type of video signal sync the digitizer should look for. Refer toniscope.Session.tv_trigger_signal_format
for more information. - event (
niscope.VideoTriggerEvent
) – Specifies the TV event you want to trigger on. You can trigger on a specific or on the next coming line or field of the signal. - polarity (
niscope.VideoPolarity
) – Specifies the polarity of the video signal sync. - trigger_coupling (
niscope.TriggerCoupling
) – Applies coupling and filtering options to the trigger signal. Refer toniscope.Session.trigger_coupling
for more information. - enable_dc_restore (bool) – Offsets each video line so the clamping level (the portion of the video
line between the end of the color burst and the beginning of the active
image) is moved to zero volt. Refer to
niscope.Session.enable_dc_restore
for defined values. - line_number (int) –
Selects the line number to trigger on. The line number range covers an entire frame and is referenced as shown on Vertical Blanking and Synchronization Signal. Refer to
niscope.Session.tv_trigger_line_number
for more information.Default value: 1
- holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- trigger_source (str) – Specifies the trigger source. Refer to
-
niscope.Session.
configure_trigger_window
(trigger_source, low_level, high_level, window_mode, trigger_coupling, holdoff=datetime.timedelta(seconds=0.0), delay=datetime.timedelta(seconds=0.0))¶ Configures common properties for analog window triggering. A window trigger occurs when a signal enters or leaves a window you specify with the high level or low level parameters.
When you initiate an acquisition, the digitizer waits for the start trigger, which is configured through the
niscope.Session.acq_arm_source
(Start Trigger Source) property. The default is immediate. Upon receiving the start trigger the digitizer begins sampling pretrigger points. After the digitizer finishes sampling pretrigger points, the digitizer waits for a reference (stop) trigger that you specify with a method such as this one. Upon receiving the reference trigger the digitizer finishes the acquisition after completing posttrigger sampling. With each Configure Trigger method, you specify configuration parameters such as the trigger source and the amount of trigger delay.To trigger the acquisition, use
niscope.Session.send_software_trigger_edge()
.Note
Some features are not supported by all digitizers. Refer to Features Supported by Device for more information.
Parameters: - trigger_source (str) – Specifies the trigger source. Refer to
niscope.Session.trigger_source
for defined values. - low_level (float) – Passes the voltage threshold you want the digitizer to use for low triggering.
- high_level (float) – Passes the voltage threshold you want the digitizer to use for high triggering.
- window_mode (
niscope.TriggerWindowMode
) – Specifies whether you want the trigger to occur when the signal enters or leaves a window. - trigger_coupling (
niscope.TriggerCoupling
) – Applies coupling and filtering options to the trigger signal. Refer toniscope.Session.trigger_coupling
for more information. - holdoff (float in seconds or datetime.timedelta) – The length of time the digitizer waits after detecting a trigger before
enabling NI-SCOPE to detect another trigger. Refer to
niscope.Session.trigger_holdoff
for more information. - delay (float in seconds or datetime.timedelta) – How long the digitizer waits after receiving the trigger to start
acquiring data. Refer to
niscope.Session.trigger_delay_time
for more information.
- trigger_source (str) – Specifies the trigger source. Refer to
-
niscope.Session.
configure_vertical
(range, coupling, offset=0.0, probe_attenuation=1.0, enabled=True)¶ Configures the most commonly configured properties of the digitizer vertical subsystem, such as the range, offset, coupling, probe attenuation, and the channel.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].configure_vertical(range, coupling, offset=0.0, probe_attenuation=1.0, enabled=True)
Parameters: - range (float) – Specifies the vertical range Refer to
niscope.Session.vertical_range
for more information. - coupling (
niscope.VerticalCoupling
) – Specifies how to couple the input signal. Refer toniscope.Session.vertical_coupling
for more information. - offset (float) – Specifies the vertical offset. Refer to
niscope.Session.vertical_offset
for more information. - probe_attenuation (float) – Specifies the probe attenuation. Refer to
niscope.Session.probe_attenuation
for valid values. - enabled (bool) – Specifies whether the channel is enabled for acquisition. Refer to
niscope.Session.channel_enabled
for more information.
- range (float) – Specifies the vertical range Refer to
-
niscope.Session.
disable
()¶ Aborts any current operation, opens data channel relays, and releases RTSI and PFI lines.
-
niscope.Session.
export_signal
(signal, output_terminal, signal_identifier="None")¶ Configures the digitizer to generate a signal that other devices can detect when configured for digital triggering or sharing clocks. The signal parameter specifies what condition causes the digitizer to generate the signal. The outputTerminal parameter specifies where to send the signal on the hardware (such as a PFI connector or RTSI line).
In cases where multiple instances of a particular signal exist, use the signalIdentifier input to specify which instance to control. For normal signals, only one instance exists and you should leave this parameter set to the empty string. You can call this method multiple times and set each available line to a different signal.
To unprogram a specific line on device, call this method with the signal you no longer want to export and set outputTerminal to
NISCOPE_VAL_NONE
.Note
This method replaces
niscope.Session.ConfigureTriggerOutput()
.Note
One or more of the referenced methods are not in the Python API for this driver.
Note
One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.
Parameters: - signal (
niscope.ExportableSignals
) –signal (clock, trigger, or event) to export.
Defined Values
REF_TRIGGER
Generate a pulse when detecting the Stop/Reference trigger. START_TRIGGER
Generate a pulse when detecting a Start trigger. END_OF_ACQUISITION_EVENT
Generate a pulse when the acquisition finishes. END_OF_RECORD_EVENT
Generate a pulse at the end of the record. ADVANCE_TRIGGER
Generate a pulse when detecting an Advance trigger. READY_FOR_ADVANCE_EVENT
Asserts when the digitizer is ready to advance to the next record. READY_FOR_START_EVENT
Asserts when the digitizer is initiated and ready to accept a Start trigger and begin sampling. READY_FOR_REF_EVENT
Asserts when the digitizer is ready to accept a Reference trigger. REF_CLOCK
Export the Reference clock for the digitizer to the specified terminal. SAMPLE_CLOCK
Export the Sample clock for the digitizer to the specified terminal. FIVE_V_OUT
Exports a 5 V power supply. - output_terminal (str) –
Identifies the hardware signal line on which the digital pulse is generated.
Defined Values
NISCOPE_VAL_RTSI_0
(“VAL_RTSI_0”) NISCOPE_VAL_RTSI_1
(“VAL_RTSI_1”) NISCOPE_VAL_RTSI_2
(“VAL_RTSI_2”) NISCOPE_VAL_RTSI_3
(“VAL_RTSI_3”) NISCOPE_VAL_RTSI_4
(“VAL_RTSI_4”) NISCOPE_VAL_RTSI_5
(“VAL_RTSI_5”) NISCOPE_VAL_RTSI_6
(“VAL_RTSI_6”) NISCOPE_VAL_RTSI_7
(“VAL_RTSI_7”) NISCOPE_VAL_PXI_STAR
(“VAL_PXI_STAR”) NISCOPE_VAL_PFI_0
(“VAL_PFI_0”) NISCOPE_VAL_PFI_1
(“VAL_PFI_1”) NISCOPE_VAL_PFI_2
(“VAL_PFI_2”) NISCOPE_VAL_CLK_OUT
(“VAL_CLK_OUT”) Note
One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.
- signal_identifier (str) – Describes the signal being exported.
- signal (
-
niscope.Session.
fetch
(num_samples=None, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))¶ Returns the waveform from a previously initiated acquisition that the digitizer acquires for the specified channel. This method returns scaled voltage waveforms.
This method may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify.
Note
Some functionality, such as time stamping, is not supported in all digitizers.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].fetch(num_samples=None, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))
Parameters: - num_samples (int) – The maximum number of samples to fetch for each waveform. If the acquisition finishes with fewer points than requested, some devices return partial data if the acquisition finished, was aborted, or a timeout of 0 was used. If it fails to complete within the timeout period, the method raises.
- relative_to (
niscope.FetchRelativeTo
) – Position to start fetching within one record. - offset (int) – Offset in samples to start fetching data within each record. The offset can be positive or negative.
- record_number (int) – Zero-based index of the first record to fetch.
- num_records (int) – Number of records to fetch. Use -1 to fetch all configured records.
- timeout (float or datetime.timedelta) – The time to wait for data to be acquired; using 0 for this parameter tells NI-SCOPE to fetch whatever is currently available. Using -1 seconds for this parameter implies infinite timeout.
Return type: list of WaveformInfo
Returns: Returns an array of classes with the following timing and scaling information about each waveform:
relative_initial_x (float) the time (in seconds) from the trigger to the first sample in the fetched waveform
absolute_initial_x (float) timestamp (in seconds) of the first fetched sample. This timestamp is comparable between records and acquisitions; devices that do not support this parameter use 0 for this output.
x_increment (float) the time between points in the acquired waveform in seconds
channel (str) channel name this waveform was asquire from
record (int) record number of this waveform
gain (float) the gain factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]offset (float) the offset factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]samples (array of float) floating point array of samples. Length will be of the actual samples acquired
-
niscope.Session.
fetch_into
(waveform, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))¶ Returns the waveform from a previously initiated acquisition that the digitizer acquires for the specified channel. This method returns scaled voltage waveforms.
This method may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify.
Note
Some functionality, such as time stamping, is not supported in all digitizers.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].fetch(waveform, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))
Parameters: - waveform (array.array("d")) –
numpy array of the appropriate type and size the should be acquired as a 1D array. Size should be num_samples times number of waveforms. Call
niscope.Session._actual_num_wfms()
to determine the number of waveforms.Types supported are
- numpy.float64
- numpy.int8
- numpy.in16
- numpy.int32
Example:
waveform = numpy.ndarray(num_samples * session.actual_num_wfms(), dtype=numpy.float64) wfm_info = session['0,1'].fetch_into(num_samples, waveform, timeout=5.0)
- relative_to (
niscope.FetchRelativeTo
) – Position to start fetching within one record. - offset (int) – Offset in samples to start fetching data within each record.The offset can be positive or negative.
- record_number (int) – Zero-based index of the first record to fetch.
- num_records (int) – Number of records to fetch. Use -1 to fetch all configured records.
- timeout (float) – The time to wait in seconds for data to be acquired; using 0 for this parameter tells NI-SCOPE to fetch whatever is currently available. Using -1 for this parameter implies infinite timeout.
Return type: list of WaveformInfo
Returns: Returns an array of classed with the following timing and scaling information about each waveform:
relative_initial_x (float) the time (in seconds) from the trigger to the first sample in the fetched waveform
absolute_initial_x (float) timestamp (in seconds) of the first fetched sample. This timestamp is comparable between records and acquisitions; devices that do not support this parameter use 0 for this output.
x_increment (float) the time between points in the acquired waveform in seconds
channel (str) channel name this waveform was asquire from
record (int) record number of this waveform
gain (float) the gain factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]offset (float) the offset factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]samples (array of float) floating point array of samples. Length will be of the actual samples acquired
- waveform (array.array("d")) –
-
niscope.Session.
get_equalization_filter_coefficients
()¶ Retrieves the custom coefficients for the equalization FIR filter on the device. This filter is designed to compensate the input signal for artifacts introduced to the signal outside of the digitizer. Because this filter is a generic FIR filter, any coefficients are valid. Coefficient values should be between +1 and –1.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].get_equalization_filter_coefficients()
-
niscope.Session.
get_frequency_response
()¶ Gets the frequency response of the digitizer for the current configurations of the channel properties. Not all digitizers support this method.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].get_frequency_response()
Return type: int Returns: Returns the number of frequencies in the returned spectrum.
-
niscope.Session.
probe_compensation_signal_start
()¶ Starts the 1 kHz square wave output on PFI 1 for probe compensation.
-
niscope.Session.
probe_compensation_signal_stop
()¶ Stops the 1 kHz square wave output on PFI 1 for probe compensation.
-
niscope.Session.
read
(num_samples=None, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))¶ Initiates an acquisition, waits for it to complete, and retrieves the data. The process is similar to calling
niscope.Session._initiate_acquisition()
,niscope.Session.acquisition_status()
, andniscope.Session.fetch()
. The only difference is that withniscope.Session.read()
, you enable all channels specified with channelList before the acquisition; in the other method, you enable the channels withniscope.Session.configure_vertical()
.This method may return multiple waveforms depending on the number of channels, the acquisition type, and the number of records you specify.
Note
Some functionality, such as time stamping, is not supported in all digitizers.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].read(num_samples=None, relative_to=niscope.FetchRelativeTo.PRETRIGGER, offset=0, record_number=0, num_records=None, timeout=datetime.timedelta(seconds=5.0))
Parameters: - num_samples (int) – The maximum number of samples to fetch for each waveform. If the acquisition finishes with fewer points than requested, some devices return partial data if the acquisition finished, was aborted, or a timeout of 0 was used. If it fails to complete within the timeout period, the method raises.
- relative_to (
niscope.FetchRelativeTo
) – Position to start fetching within one record. - offset (int) – Offset in samples to start fetching data within each record. The offset can be positive or negative.
- record_number (int) – Zero-based index of the first record to fetch.
- num_records (int) – Number of records to fetch. Use -1 to fetch all configured records.
- timeout (float or datetime.timedelta) – The time to wait for data to be acquired; using 0 for this parameter tells NI-SCOPE to fetch whatever is currently available. Using -1 seconds for this parameter implies infinite timeout.
Return type: list of WaveformInfo
Returns: Returns an array of classes with the following timing and scaling information about each waveform:
relative_initial_x (float) the time (in seconds) from the trigger to the first sample in the fetched waveform
absolute_initial_x (float) timestamp (in seconds) of the first fetched sample. This timestamp is comparable between records and acquisitions; devices that do not support this parameter use 0 for this output.
x_increment (float) the time between points in the acquired waveform in seconds
channel (str) channel name this waveform was asquire from
record (int) record number of this waveform
gain (float) the gain factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]offset (float) the offset factor of the given channel; useful for scaling binary data with the following formula:
\[voltage = binary data * gain factor + offset\]samples (array of float) floating point array of samples. Length will be of the actual samples acquired
-
niscope.Session.
reset
()¶ Stops the acquisition, releases routes, and all session properties are reset to their default states.
-
niscope.Session.
reset_device
()¶ Performs a hard reset of the device. Acquisition stops, all routes are released, RTSI and PFI lines are tristated, hardware is configured to its default state, and all session properties are reset to their default state.
-
niscope.Session.
reset_with_defaults
()¶ Performs a software reset of the device, returning it to the default state and applying any initial default settings from the IVI Configuration Store.
-
niscope.Session.
self_cal
(option=niscope.Option.SELF_CALIBRATE_ALL_CHANNELS)¶ Self-calibrates most NI digitizers, including all SMC-based devices and most Traditional NI-DAQ (Legacy) devices. To verify that your digitizer supports self-calibration, refer to Features Supported by Device.
For SMC-based digitizers, if the self-calibration is performed successfully in a regular session, the calibration constants are immediately stored in the self-calibration area of the EEPROM. If the self-calibration is performed in an external calibration session, the calibration constants take effect immediately for the duration of the session. However, they are not stored in the EEPROM until
niscope.Session.CalEnd()
is called with action set toNISCOPE_VAL_ACTION_STORE
and no errors occur.Note
One or more of the referenced methods are not in the Python API for this driver.
Note
One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.
Tip
This method requires repeated capabilities (usually channels). If called directly on the niscope.Session object, then the method will use all repeated capabilities in the session. You can specify a subset of repeated capabilities using the Python index notation on an niscope.Session instance, and calling this method on the result.:
session.channels['0,1'].self_cal(option=niscope.Option.SELF_CALIBRATE_ALL_CHANNELS)
Parameters: option ( niscope.Option
) –The calibration option. Use VI_NULL for a normal self-calibration operation or
NISCOPE_VAL_CAL_RESTORE_EXTERNAL_CALIBRATION
to restore the previous calibration.Note
One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed.
-
niscope.Session.
self_test
()¶ Runs the instrument self-test routine and returns the test result(s). Refer to the device-specific help topics for an explanation of the message contents.
Raises SelfTestError on self test failure. Properties on exception object:
- code - failure code from driver
- message - status message from driver
Self-Test Code Description 0 Passed self-test 1 Self-test failed
-
niscope.Session.
send_software_trigger_edge
(which_trigger)¶ Sends the selected trigger to the digitizer. Call this method if you called
niscope.Session.configure_trigger_software()
when you want the Reference trigger to occur. You can also call this method to override a misused edge, digital, or hysteresis trigger. If you have configuredniscope.Session.acq_arm_source
,niscope.Session.arm_ref_trig_src
, orniscope.Session.adv_trig_src
, call this method when you want to send the corresponding trigger to the digitizer.Parameters: which_trigger ( niscope.WhichTrigger
) –Specifies the type of trigger to send to the digitizer.
Defined Values