Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update niscope metadata to new extraction type #980

Merged
merged 9 commits into from
May 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ All notable changes to this project will be documented in this file.
* ### NI-SCOPE
* #### Added
* #### Changed
* Fixed enum values for `TIME_HISTOGRAM_MEAN_PLUS_STDEV`, `TIME_HISTOGRAM_MEAN_PLUS_2_STDEV`, `HF_REJECT` and `LF_REJECT`
* #### Removed
* ### NI Switch Executive
* #### Added
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

ALL_DRIVERS := nifake nimodinst nidmm
ALL_DRIVERS := nifake nimodinst nidmm niscope
DRIVERS ?= $(ALL_DRIVERS)

ROOT_DIR := $(abspath .)
Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ NI-SCOPE Python API Status
+-------------------------------+------------------------+
| NI-SCOPE (niscope) | |
+===============================+========================+
| Driver Version Tested Against | 18.1.0 |
| Driver Version Tested Against | 19.1.0d28 |
+-------------------------------+------------------------+
| PyPI Version | |niscopeLatestVersion| |
+-------------------------------+------------------------+
Expand Down
527 changes: 267 additions & 260 deletions docs/niscope/class.rst

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/niscope/status.inc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ NI-SCOPE Python API Status
+-------------------------------+------------------------+
| NI-SCOPE (niscope) | |
+===============================+========================+
| Driver Version Tested Against | 18.1.0 |
| Driver Version Tested Against | 19.1.0d28 |
+-------------------------------+------------------------+
| PyPI Version | |niscopeLatestVersion| |
+-------------------------------+------------------------+
Expand Down
8 changes: 4 additions & 4 deletions generated/niscope/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,8 @@ class _ScalarMeasurement(Enum):
TIME_HISTOGRAM_MAX = 3005
TIME_HISTOGRAM_MIN = 3006
TIME_HISTOGRAM_PEAK_TO_PEAK = 3002
TIME_HISTOGRAM_MEAN_PLUS_STDEV = 3008
TIME_HISTOGRAM_MEAN_PLUS_2_STDEV = 3009
TIME_HISTOGRAM_MEAN_PLUS_STDEV = 3007
TIME_HISTOGRAM_MEAN_PLUS_2_STDEV = 3008
TIME_HISTOGRAM_HITS = 3004
TIME_HISTOGRAM_NEW_HITS = 3011

Expand Down Expand Up @@ -457,11 +457,11 @@ class TriggerCoupling(Enum):
r'''
DC coupling
'''
HF_REJECT = 2
HF_REJECT = 3
r'''
Highpass filter coupling
'''
LF_REJECT = 3
LF_REJECT = 4
r'''
Lowpass filter coupling
'''
Expand Down
145 changes: 71 additions & 74 deletions generated/niscope/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,46 +133,6 @@ class _SessionBase(object):
periods, .5 sample clock periods]. The default absolute sample clock
offset is 0s.
'''
accessory_gain = _attributes.AttributeViReal64(1150279)
'''Type: float

Returns the calibration gain for the current device configuration.
**Related topics:**
`NI 5122/5124/5142
Calibration <digitizers.chm::/5122_Calibration.html>`__

Note:
This property is only supported by the NI PXI-5900 differential
amplifier.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

var = session.channels[0,1].accessory_gain
'''
accessory_offset = _attributes.AttributeViReal64(1150280)
'''Type: float

Returns the calibration offset for the current device configuration.
**Related topics:**
`NI 5122/5124/5142
Calibration <digitizers.chm::/5122_Calibration.html>`__

Note:
This property is supported only by the NI PXI-5900 differential
amplifier.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

var = session.channels[0,1].accessory_offset
'''
acquisition_start_time = _attributes.AttributeViReal64TimeDeltaSeconds(1250109)
'''Type: float in seconds or datetime.timedelta

Expand Down Expand Up @@ -309,6 +269,14 @@ class _SessionBase(object):
This property indicates the Driver Setup string that the user specified when initializing the driver.
Some cases exist where the end-user must specify instrument driver options at initialization. An example of this is specifying a particular instrument model from among a family of instruments that the driver supports. This is useful when using simulation. The end-user can specify driver-specific options through the DriverSetup keyword in the optionsString parameter in __init__, or through the IVI Configuration Utility.
If the user does not specify a Driver Setup string, this property returns an empty string.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

var = session.channels[0,1].driver_setup
'''
enable_dc_restore = _attributes.AttributeViBoolean(1150093)
'''Type: bool
Expand Down Expand Up @@ -777,17 +745,14 @@ class _SessionBase(object):
'''Type: enums.FIRFilterWindow

Specifies the FIR window type. The possible choices are:
NISCOPE_VAL_NONE
_FIRFilterWindow.NONE
_ArrayMeasurement.HANNING_WINDOW
_ArrayMeasurement.HAMMING_WINDOW
_ArrayMeasurement.TRIANGLE_WINDOW
_ArrayMeasurement.FLAT_TOP_WINDOW
_ArrayMeasurement.BLACKMAN_WINDOW
The symmetric windows are applied to the FIR filter coefficients to limit passband ripple in FIR filters.
Default: NISCOPE_VAL_NONE

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.
Default: _FIRFilterWindow.NONE

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
Expand Down Expand Up @@ -1017,6 +982,15 @@ class _SessionBase(object):
'''Type: int

Specifies the poll interval in milliseconds to use during RIS acquisitions to check whether the acquisition is complete.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

session.channels[0,1].poll_interval = var
var = session.channels[0,1].poll_interval
'''
probe_attenuation = _attributes.AttributeViReal64(1250004)
'''Type: float
Expand Down Expand Up @@ -1105,27 +1079,6 @@ class _SessionBase(object):

The number of averages for each bin in an RIS acquisition. The number of averages times the oversampling factor is the minimum number of real-time acquisitions necessary to reconstruct the RIS waveform. Averaging is useful in RIS because the trigger times are not evenly spaced, so adjacent points in the reconstructed waveform not be accurately spaced. By averaging, the errors in both time and voltage are smoothed.
'''
sample_clock_timebase_multiplier = _attributes.AttributeViInt32(1150367)
'''Type: int

If `Sample Clock Timebase
Source <pSampleClockTimebaseSource.html>`__ is an external
source, this property specifies the ratio between the `Sample Clock
Timebase Rate <pSampleClockTimebaseRate.html>`__ and the actual
sample rate, which can be higher. This property can be used in
conjunction with the `Sample Clock Timebase Divisor
Property <pSampleClockTimebaseDivisor.html>`__.
Some devices use multiple ADCs to sample the same channel at an
effective sample rate that is greater than the specified clock rate.
When providing an external sample clock use this property to indicate
when you want a higher sample rate. Valid values for this property vary
by device and current configuration.
**Related topics:**
`Sample Clock <digitizers.chm::/Sample_Clock.html>`__

Note:
One or more of the referenced methods are not in the Python API for this driver.
'''
sample_mode = _attributes.AttributeViInt32(1250106)
'''Type: int

Expand All @@ -1136,6 +1089,15 @@ class _SessionBase(object):

If samp_clk_timebase_src is an external source, specifies the ratio between the sample clock timebase rate and the actual sample rate, which can be slower.
'''
sample_clock_timebase_multiplier = _attributes.AttributeViInt32(1150367)
'''Type: int

If samp_clk_timebase_src is an external source, this property specifies the ratio between the samp_clk_timebase_rate and the actual sample rate, which can be higher. This property can be used in conjunction with samp_clk_timebase_div.
Some devices use multiple ADCs to sample the same channel at an effective sample rate that is greater than the specified clock rate. When providing an external sample clock use this property to indicate when you want a higher sample rate. Valid values for this property vary by device and current configuration.

**Related topics:**
`Sample Clock <digitizers.chm::/Sample_Clock.html>`__
'''
samp_clk_timebase_rate = _attributes.AttributeViReal64(1150088)
'''Type: float

Expand All @@ -1151,6 +1113,44 @@ class _SessionBase(object):

Returns the serial number of the device.
'''
accessory_gain = _attributes.AttributeViReal64(1150279)
'''Type: float

Returns the calibration gain for the current device configuration.

**Related topics:**
`NI 5122/5124/5142 Calibration <digitizers.chm::/5122_Calibration.html>`__

Note:
This property is supported only by the NI PXI-5900 differential amplifier.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

var = session.channels[0,1].signal_cond_gain
'''
accessory_offset = _attributes.AttributeViReal64(1150280)
'''Type: float

Returns the calibration offset for the current device configuration.

**Related topics:**
`NI 5122/5124/5142 Calibration <digitizers.chm::/5122_Calibration.html>`__

Note:
This property is supported only by the NI PXI-5900 differential amplifier.

Tip:
This property can use repeated capabilities (channels). If set or get directly on the
niscope.Session object, then the set/get 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 repeated capabilities container, and calling set/get value on the result.:

var = session.channels[0,1].signal_cond_offset
'''
simulate = _attributes.AttributeViBoolean(1050005)
'''Type: bool

Expand Down Expand Up @@ -1566,7 +1566,7 @@ def _clear_waveform_measurement_stats(self, clearable_measurement_function=enums

Clears the waveform stats on the channel and measurement you specify. If
you want to clear all of the measurements, use
NISCOPE_VAL_ALL_MEASUREMENTS in the **clearableMeasurementFunction**
_ClearableMeasurement.ALL_MEASUREMENTS in the **clearableMeasurementFunction**
parameter.

Every time a measurement is called, the statistics information is
Expand All @@ -1575,9 +1575,6 @@ def _clear_waveform_measurement_stats(self, clearable_measurement_function=enums
_fetch_measurement_stats. The multi-acquisition array measurements
are also cleared with this method.

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 (channels). If called directly on the
niscope.Session object, then the method will use all repeated capabilities in the session.
Expand Down Expand Up @@ -1775,7 +1772,7 @@ def fetch(self, num_samples=None, relative_to=enums.FetchRelativeTo.PRETRIGGER,

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.
timeout (float in seconds 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.


Returns:
Expand Down Expand Up @@ -1896,7 +1893,7 @@ def read(self, num_samples=None, relative_to=enums.FetchRelativeTo.PRETRIGGER, o

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.
timeout (float in seconds 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.


Returns:
Expand Down Expand Up @@ -2718,11 +2715,11 @@ def fetch_into(self, waveform, relative_to=enums.FetchRelativeTo.PRETRIGGER, off

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.
timeout (float in seconds or datetime.timedelta): 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.


Returns:
wfm_info (list of WaveformInfo): Returns an array of classed with the following timing and scaling information about each waveform:
wfm_info (WaveformInfo): Returns an array of classed with the following timing and scaling information about each waveform:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignoring the odd wording which came from metadata (array of classed??), the type no longer says this is a list.
Is this a codegen bug introduced?

I'm ok fixing this in a separate PR.


- **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.
Expand Down
Loading