Skip to content
Open
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
31 changes: 30 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -557,6 +557,35 @@
#### [nidigital] Unreleased
- Added
- (Common) Added `nitlsconfig[grpc]>=1.0.0a2` to the optional gRPC dependencies.
- API parity with NI-Digital Pattern Driver 2026 Q4.
- Repeated Capability added:
- `time_measurement_units`
- Properties added:
- `tmu_arm_type`
- `tmu_count`
- `tmu_edge_arm_polarity`
- `tmu_edge_arm_source`
- `tmu_edge_arm_source_event`
- `tmu_enabled`
- `tmu_samples_to_acquire`
- `tmu_sample_timeout`
- `tmu_start_input_debounce_time`
- `tmu_start_source`
- `tmu_start_source_event`
- `tmu_start_source_event_polarity`
- `tmu_stop_input_debounce_time`
- `tmu_stop_source`
- `tmu_stop_source_event`
- `tmu_stop_source_event_polarity`
- Methods added:
- `tmu_abort`
- `tmu_fetch_averaged_measurement`
- `tmu_get_disabled_tmu_contexts`
- `tmu_initiate`
- Enums added:
- `TMUArmType`
- `TMUPolarity`
- `TMUSourceEvent`
- Changed
- Removed

Expand Down Expand Up @@ -1799,7 +1828,7 @@
- `arb_sample_clock_source`
- `ref_clock_source`
- `trigger_identifier` parameter in `send_software_edge_trigger` method
- Updated below properties to be list of str instead of them returning a comma separated list of string values
- Updated below properties to be list of str instead of them returning a comma separated list of string values
- `available_paths`
- `available_ports`
- `fixed_group_delay_across_ports`
Expand Down
764 changes: 755 additions & 9 deletions docs/nidigital/class.rst

Large diffs are not rendered by default.

94 changes: 94 additions & 0 deletions docs/nidigital/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@ HistoryRAMCyclesToAcquire



HistoryRAMMaxSamplesToAcquirePerSite
------------------------------------

.. py:class:: HistoryRAMMaxSamplesToAcquirePerSite

.. py:attribute:: HistoryRAMMaxSamplesToAcquirePerSite.SAMPLES



HistoryRAMTriggerType
---------------------

Expand Down Expand Up @@ -605,6 +614,91 @@ TDREndpointTermination



TMUArmType
----------

.. py:class:: TMUArmType

.. py:attribute:: TMUArmType.IMMEDIATE



The TMU arms immediately when you call the %method{tmu initiate} method.





.. py:attribute:: TMUArmType.EDGE



The TMU waits for a source event on the configured edge arm source channel before arming.





TMUPolarity
-----------

.. py:class:: TMUPolarity

.. py:attribute:: TMUPolarity.RISING



The event is detected on the rising edge of the source signal.





.. py:attribute:: TMUPolarity.FALLING



The event is detected on the falling edge of the source signal.





.. py:attribute:: TMUPolarity.EITHER



The event is detected on either the rising or falling edge of the source signal.





TMUSourceEvent
--------------

.. py:class:: TMUSourceEvent

.. py:attribute:: TMUSourceEvent.VOL



The event occurs when the signal crosses the configured VOL threshold.





.. py:attribute:: TMUSourceEvent.VOH



The event occurs when the signal crosses the configured VOH threshold.





TerminationMode
---------------

Expand Down
22 changes: 22 additions & 0 deletions docs/nidigital/rep_caps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,26 @@ rio_triggers
passes a string of :python:`'RIOTrigger0, RIOTrigger1, RIOTrigger2'` to the set attribute function.


time_measurement_units
----------------------

.. py:attribute:: nidigital.Session.time_measurement_units[]

TMU repeated capabilities identify the time measurement unit contexts for an instrument. The numeric portion of the identifier may be used without the "tmu" prefix. In that case, the correct prefix will be added when the driver function call is made. When accessing TMUs from an instrument context, select one TMU identifier at a time.

Valid Indices: :python:`'tmu0, tmu1'`.

.. code:: python

session.instruments['PXI1Slot2'].time_measurement_units[0].tmu_enabled = True

passes a string of :python:`'PXI1Slot2/tmu0'` to the set attribute function.

.. code:: python

session.instruments['PXI1Slot2'].time_measurement_units['tmu0'].tmu_enabled = True

passes a string of :python:`'PXI1Slot2/tmu0'` to the set attribute function.



26 changes: 26 additions & 0 deletions generated/nidigital/nidigital/_grpc_stub_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,6 +583,32 @@ def tdr(self, channel_list, apply_offsets): # noqa: N802
)
return response.offsets

def tmu_abort(self, tmu): # noqa: N802
self._invoke(
self._client.TMUAbort,
grpc_types.TMUAbortRequest(vi=self._vi, tmu=tmu),
)

def tmu_fetch_averaged_measurement(self, tmu, timeout): # noqa: N802
response = self._invoke(
self._client.TMUFetchAveragedMeasurement,
grpc_types.TMUFetchAveragedMeasurementRequest(vi=self._vi, tmu=tmu, timeout=timeout),
)
return response.measurement

def tmu_get_disabled_tmu_contexts(self): # noqa: N802
response = self._invoke(
self._client.TMUGetDisabledTMUContexts,
grpc_types.TMUGetDisabledTMUContextsRequest(vi=self._vi),
)
return response.tmu_contexts

def tmu_initiate(self, tmu): # noqa: N802
self._invoke(
self._client.TMUInitiate,
grpc_types.TMUInitiateRequest(vi=self._vi, tmu=tmu),
)

def unload_all_patterns(self, unload_keep_alive_pattern): # noqa: N802
self._invoke(
self._client.UnloadAllPatterns,
Expand Down
36 changes: 36 additions & 0 deletions generated/nidigital/nidigital/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ def __init__(self, ctypes_library):
self.niDigital_SetAttributeViString_cfunc = None
self.niDigital_SetRuntimeEnvironment_cfunc = None
self.niDigital_TDR_cfunc = None
self.niDigital_TMU_Abort_cfunc = None
self.niDigital_TMU_FetchAveragedMeasurement_cfunc = None
self.niDigital_TMU_GetDisabledTMUContexts_cfunc = None
self.niDigital_TMU_Initiate_cfunc = None
self.niDigital_UnloadAllPatterns_cfunc = None
self.niDigital_UnloadSpecifications_cfunc = None
self.niDigital_UnlockSession_cfunc = None
Expand Down Expand Up @@ -763,6 +767,38 @@ def niDigital_TDR(self, vi, channel_list, apply_offsets, offsets_buffer_size, of
self.niDigital_TDR_cfunc.restype = ViStatus # noqa: F405
return self.niDigital_TDR_cfunc(vi, channel_list, apply_offsets, offsets_buffer_size, offsets, actual_num_offsets)

def niDigital_TMU_Abort(self, vi, tmu): # noqa: N802
with self._func_lock:
if self.niDigital_TMU_Abort_cfunc is None:
self.niDigital_TMU_Abort_cfunc = self._get_library_function('niDigital_TMU_Abort')
self.niDigital_TMU_Abort_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405
self.niDigital_TMU_Abort_cfunc.restype = ViStatus # noqa: F405
return self.niDigital_TMU_Abort_cfunc(vi, tmu)

def niDigital_TMU_FetchAveragedMeasurement(self, vi, tmu, timeout, measurement): # noqa: N802
with self._func_lock:
if self.niDigital_TMU_FetchAveragedMeasurement_cfunc is None:
self.niDigital_TMU_FetchAveragedMeasurement_cfunc = self._get_library_function('niDigital_TMU_FetchAveragedMeasurement')
self.niDigital_TMU_FetchAveragedMeasurement_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViReal64, ctypes.POINTER(ViReal64)] # noqa: F405
self.niDigital_TMU_FetchAveragedMeasurement_cfunc.restype = ViStatus # noqa: F405
return self.niDigital_TMU_FetchAveragedMeasurement_cfunc(vi, tmu, timeout, measurement)

def niDigital_TMU_GetDisabledTMUContexts(self, vi, tmu_contexts_buffer_size, tmu_contexts): # noqa: N802
with self._func_lock:
if self.niDigital_TMU_GetDisabledTMUContexts_cfunc is None:
self.niDigital_TMU_GetDisabledTMUContexts_cfunc = self._get_library_function('niDigital_TMU_GetDisabledTMUContexts')
self.niDigital_TMU_GetDisabledTMUContexts_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ViChar)] # noqa: F405
self.niDigital_TMU_GetDisabledTMUContexts_cfunc.restype = ViStatus # noqa: F405
return self.niDigital_TMU_GetDisabledTMUContexts_cfunc(vi, tmu_contexts_buffer_size, tmu_contexts)

def niDigital_TMU_Initiate(self, vi, tmu): # noqa: N802
with self._func_lock:
if self.niDigital_TMU_Initiate_cfunc is None:
self.niDigital_TMU_Initiate_cfunc = self._get_library_function('niDigital_TMU_Initiate')
self.niDigital_TMU_Initiate_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar)] # noqa: F405
self.niDigital_TMU_Initiate_cfunc.restype = ViStatus # noqa: F405
return self.niDigital_TMU_Initiate_cfunc(vi, tmu)

def niDigital_UnloadAllPatterns(self, vi, unload_keep_alive_pattern): # noqa: N802
with self._func_lock:
if self.niDigital_UnloadAllPatterns_cfunc is None:
Expand Down
35 changes: 35 additions & 0 deletions generated/nidigital/nidigital/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,6 +938,41 @@ def tdr(self, channel_list, apply_offsets): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return [float(offsets_ctype[i]) for i in range(offsets_buffer_size_ctype.value)]

def tmu_abort(self, tmu): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
tmu_ctype = ctypes.create_string_buffer(tmu.encode(self._encoding)) # case C010
error_code = self._library.niDigital_TMU_Abort(vi_ctype, tmu_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def tmu_fetch_averaged_measurement(self, tmu, timeout): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
tmu_ctype = ctypes.create_string_buffer(tmu.encode(self._encoding)) # case C010
timeout_ctype = _visatype.ViReal64(timeout) # case S150
measurement_ctype = _visatype.ViReal64() # case S220
error_code = self._library.niDigital_TMU_FetchAveragedMeasurement(vi_ctype, tmu_ctype, timeout_ctype, None if measurement_ctype is None else (ctypes.pointer(measurement_ctype)))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(measurement_ctype.value)

def tmu_get_disabled_tmu_contexts(self): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
tmu_contexts_buffer_size_ctype = _visatype.ViInt32() # case S170
tmu_contexts_ctype = None # case C050
error_code = self._library.niDigital_TMU_GetDisabledTMUContexts(vi_ctype, tmu_contexts_buffer_size_ctype, tmu_contexts_ctype)
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
tmu_contexts_buffer_size_ctype = _visatype.ViInt32(error_code) # case S180
tmu_contexts_ctype = (_visatype.ViChar * tmu_contexts_buffer_size_ctype.value)() # case C060
error_code = self._library.niDigital_TMU_GetDisabledTMUContexts(vi_ctype, tmu_contexts_buffer_size_ctype, tmu_contexts_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return tmu_contexts_ctype.value.decode(self._encoding)

def tmu_initiate(self, tmu): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
tmu_ctype = ctypes.create_string_buffer(tmu.encode(self._encoding)) # case C010
error_code = self._library.niDigital_TMU_Initiate(vi_ctype, tmu_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def unload_all_patterns(self, unload_keep_alive_pattern): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
unload_keep_alive_pattern_ctype = _visatype.ViBoolean(unload_keep_alive_pattern) # case S150
Expand Down
41 changes: 41 additions & 0 deletions generated/nidigital/nidigital/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ class HistoryRAMCyclesToAcquire(Enum):
'''


class HistoryRAMMaxSamplesToAcquirePerSite(Enum):
SAMPLES = -1

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Something feels off about this enum. If nothing else, the value name "SAMPLES" feels like a terrible name.

Is this ENUM even needed?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Something must be off with the codegen for us to be trimming the rest of value name.
I'm really not sure we want to add this to the API.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Apparently, _add_enum_value_python_name strips everything through the last underscore when there's only one value.
Seems like a codegen bug.
If we fix the name, I can accept this enum addtion. I don't know how @marcoskirsch feels about it.



class HistoryRAMTriggerType(Enum):
FIRST_FAILURE = 2200
r'''
Expand Down Expand Up @@ -270,6 +274,43 @@ class TDREndpointTermination(Enum):
'''


class TMUArmType(Enum):
IMMEDIATE = 4000
r'''
The TMU arms immediately when you call the %method{tmu initiate} method.
'''
EDGE = 4001
r'''
The TMU waits for a source event on the configured edge arm source channel before arming.
'''


class TMUPolarity(Enum):
RISING = 1800
r'''
The event is detected on the rising edge of the source signal.
'''
FALLING = 1801
r'''
The event is detected on the falling edge of the source signal.
'''
EITHER = 1802
r'''
The event is detected on either the rising or falling edge of the source signal.
'''


class TMUSourceEvent(Enum):
VOL = 3900
r'''
The event occurs when the signal crosses the configured VOL threshold.
'''
VOH = 3901
r'''
The event occurs when the signal crosses the configured VOH threshold.
'''


class TerminationMode(Enum):
ACTIVE_LOAD = 1200
r'''
Expand Down
1,146 changes: 583 additions & 563 deletions generated/nidigital/nidigital/nidigitalpattern_pb2.py

Large diffs are not rendered by default.

Loading
Loading