Skip to content

Conversation

@Vaishnavigupta1312
Copy link
Contributor

@Vaishnavigupta1312 Vaishnavigupta1312 commented May 16, 2025

  • This contribution adheres to CONTRIBUTING.md.

  • I've updated CHANGELOG.md if applicable.

  • I've added tests applicable for this pull request

What does this Pull Request accomplish?

Currently to set an attribute with repeated capability, we create a new _SessionBase instance with repeated_capability information passed at the time of initalization.
The information of repeated capability stored in this new _SessionBase instance is used when dispatching call to the interpreter session to set the value in the driver.
Repeated Capabilities can be handled in a way that avoids going down this route.

  • Adding new class _RepeatedCapabilityBase to serve as the base class for each of the repeated capability type, for eg _RepeatedCapablityScript for script.
  • These new capability specific classes will contain the attributes supporting that repeated capability.
  • Example of existing flow using a script attribute.
    image
  • Proposed flow using same script example, changes are highlighted using red font.
    image

Changes are made to the helper scripts and session mako template to support custom object expansion of the applicable only attributes.

List issues fixed by this Pull Request below, if any.

What testing has been done?

  • Successful tox build without any errors.
  • No failure of newly added unit test.

@codecov-commenter
Copy link

codecov-commenter commented May 16, 2025

Codecov Report

Attention: Patch coverage is 60.00000% with 4 lines in your changes missing coverage. Please review.

Project coverage is 91.33%. Comparing base (9efe042) to head (2faedc0).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
build/helper/documentation_helper.py 25.00% 3 Missing ⚠️
build/helper/metadata_filters.py 50.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2100      +/-   ##
==========================================
- Coverage   91.34%   91.33%   -0.01%     
==========================================
  Files          66       66              
  Lines       16292    16301       +9     
==========================================
+ Hits        14882    14889       +7     
- Misses       1410     1412       +2     
Flag Coverage Δ
codegenunittests 84.85% <60.00%> (-0.11%) ⬇️
nidcpowersystemtests 94.59% <ø> (+0.04%) ⬆️
nidcpowerunittests 89.53% <ø> (ø)
nidigitalsystemtests 92.26% <ø> (ø)
nidigitalunittests 68.44% <ø> (ø)
nidmmsystemtests 92.72% <ø> (ø)
nifakeunittests 87.24% <ø> (ø)
nifgensystemtests 94.86% <ø> (ø)
nimodinstsystemtests 73.85% <ø> (ø)
nimodinstunittests 94.20% <ø> (ø)
niscopesystemtests 92.94% <ø> (ø)
niscopeunittests 43.20% <ø> (ø)
nisesystemtests 91.50% <ø> (ø)
niswitchsystemtests 82.03% <ø> (ø)
nitclksystemtests 94.87% <ø> (ø)
nitclkunittests 98.26% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
build/helper/__init__.py 100.00% <100.00%> (ø)
build/helper/documentation_snippets.py 85.18% <100.00%> (+0.27%) ⬆️
build/helper/metadata_add_all.py 80.84% <100.00%> (+0.08%) ⬆️
build/helper/metadata_filters.py 78.72% <50.00%> (-0.63%) ⬇️
build/helper/documentation_helper.py 88.12% <25.00%> (-0.32%) ⬇️

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9efe042...2faedc0. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment on lines 315 to 319
complete_rep_cap_list = [
current_rep_cap + self._separator + rep_cap
for current_rep_cap in self._current_repeated_capability_list
for rep_cap in rep_caps_list
]
Copy link
Collaborator

Choose a reason for hiding this comment

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

This list comprehension exists to support the chaining of repeated capabilities, i.e. session.sites[0, 1].pins['PinA', 'PinB'].ppmu_source().
See #1291

This new implementation won't work with chaining.
You can't call .pins in a class where we don't define properties/attributes for each of the other rep cap classes.

Comment on lines 320 to 321
object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list)
self._current_repeated_capability_list = complete_rep_cap_list
Copy link
Collaborator

@ni-jfitzger ni-jfitzger May 16, 2025

Choose a reason for hiding this comment

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

Why is this being set twice?

Comment on lines 453 to 461
def filter_rep_cap_supported_attributes(attributes, rep_cap_name):
'''Returns attribute metadata only for those attributes that support the specified repeated capability.
Args:
attributes: Dictionary of attribute metadata.
rep_cap_name: The name of the repeated capability to filter by.
Returns:
Dictionary of attributes that support the specified repeated capability.
'''
return {k: v for k, v in attributes.items() if rep_cap_name in v.get('supported_rep_caps', [])}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is good, but what about filter_rep_cap_supported_functions?

Comment on lines 80 to 89
+===========================================+=============+=================================================================================================================================+
| MarkerEventExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| MarkerEventExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. |
+-------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+

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 property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].exported_marker_event_output_terminal`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.exported_marker_event_output_terminal`
'''
marker_event_output_behavior = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventOutputBehavior, 1150206)
'''Type: enums.MarkerEventOutputBehavior

Specifies the output behavior for the Marker Event. To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** MarkerEventOutputBehavior.PULSE

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Marker Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/marker_events.html>`_

**Defined Values**:

+----------------------------------+----------------+-------------------------------------------------------+
| Name | Value | Description |
+==================================+================+=======================================================+
| MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. |
+----------------------------------+----------------+-------------------------------------------------------+
| MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. |
+----------------------------------+----------------+-------------------------------------------------------+

Tip:
This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].marker_event_output_behavior`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.marker_event_output_behavior`
'''
marker_event_pulse_width = _attributes.AttributeViReal64(1150207)
'''Type: float

Specifies the pulse width value for the Marker Event. Use the marker_event_pulse_width_units property to set the units for the pulse width value. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE.

To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** 200 ns

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Marker Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/marker_events.html>`_

Tip:
This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.marker_event_pulse_width`
'''
marker_event_pulse_width_units = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventPulseWidthUnits, 1150208)
'''Type: enums.MarkerEventPulseWidthUnits

Specifies the pulse width units for the Marker Event. This property is valid only when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.PULSE.

To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** MarkerEventPulseWidthUnits.SECONDS

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Marker Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/marker_events.html>`_

**Defined Values**:

+----------------------------------+----------------+-------------------------------------------------------+
| Name | Value | Description |
+==================================+================+=======================================================+
| MarkerEventOutputBehavior.PULSE | 23000 (0x59d8) | Specifies the Marker Event output behavior as pulse. |
+----------------------------------+----------------+-------------------------------------------------------+
| MarkerEventOutputBehavior.TOGGLE | 23001 (0x59d9) | Specifies the Marker Event output behavior as toggle. |
+----------------------------------+----------------+-------------------------------------------------------+

Tip:
This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].marker_event_pulse_width_units`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.marker_event_pulse_width_units`
'''
marker_event_terminal_name = _attributes.AttributeViString(1150115)
'''Type: str

Returns the name of the fully qualified signal name as a string.

**Default Values**:

PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/Marker *X* Event, where *AWGName* is the name of your associated AWG module in MAX and *X* is Marker Event 0 through 3.

PXIe-5830/5831/5832: /*BasebandModule*/ao/0/Marker *X* Event, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Marker Event 0 through 3.

PXIe-5820/5840/5841: /*ModuleName*/ao/0/Marker *X* Event, where *ModuleName* is the name of your device in MAX and *X* is Marker Event 0 through 3.

**Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/events.html>`_

`Syntax for Terminal Names <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/syntax_for_terminal_names.html>`_

**High-Level Methods**:

- GetTerminalName

Tip:
This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].marker_event_terminal_name`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.marker_event_terminal_name`
'''
marker_event_toggle_initial_state = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.MarkerEventToggleInitialState, 1150209)
'''Type: enums.MarkerEventToggleInitialState

Specifies the initial state for the Marker Event when the marker_event_output_behavior property is set to MarkerEventOutputBehavior.TOGGLE.

To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** MarkerEventToggleInitialState.LOW

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Marker Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/marker_events.html>`_

**Defined Values**:

+------------------------------------+----------------+----------------------------------------------------------------------------------+
| Name | Value | Description |
+====================================+================+==================================================================================+
| MarkerEventToggleInitialState.HIGH | 21001 (0x5209) | Specifies the initial state of the Marker Event toggle behavior as digital high. |
+------------------------------------+----------------+----------------------------------------------------------------------------------+
| MarkerEventToggleInitialState.LOW | 21000 (0x5208) | Specifies the initial state of the Marker Event toggle behavior as digital low. |
+------------------------------------+----------------+----------------------------------------------------------------------------------+

Tip:
This property can be set/get on specific markers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container markers to specify a subset.

Example: :py:attr:`my_session.markers[ ... ].marker_event_toggle_initial_state`

To set/get on all markers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.marker_event_toggle_initial_state`
'''
def __init__(self, session, repeated_capability_list):
object.__setattr__(self, '_session', session)
object.__setattr__(self, '_repeated_capability_list', repeated_capability_list)
object.__setattr__(self, '_prefix', 'marker')
object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else [''])
object.__setattr__(self, '_separator', '')

def __setattr__(self, key, value):
if key not in dir(self):
raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key))
object.__setattr__(self, key, value)

def __getitem__(self, repeated_capability):
'''Set/get properties or call methods with a repeated capability (i.e. channels)'''
rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix)
complete_rep_cap_list = [
current_rep_cap + self._separator + rep_cap
for current_rep_cap in self._current_repeated_capability_list
for rep_cap in rep_caps_list
]
object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list)
self._current_repeated_capability_list = complete_rep_cap_list

return self

def _get_attribute_vi_real64(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute)
return value

def _set_attribute_vi_real64(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value)

def _get_attribute_vi_int32(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute)
return value

def _set_attribute_vi_int32(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value)

def _get_attribute_vi_string(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute)
return value

def _set_attribute_vi_string(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value)

class _RepeatedCapabilityScript_triggers(object):
digital_edge_script_trigger_edge = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigEdgeEdge, 1150021)
'''Type: enums.ScriptTrigDigEdgeEdge

Specifies the active edge for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set the digital_edge_script_trigger_edge property, the NI-RFSG device must be in the Configuration state.

**Default Value:** ScriptTrigDigEdgeEdge.RISING

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_

`Digital Edge Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/trigger_edge.html>`_

**High-Level Methods**:

- configure_digital_edge_script_trigger

**Defined Values**:

+-------------------------------+---------+-------------------------------------------------------------------------------+
| Name | Value | Description |
+===============================+=========+===============================================================================+
| ScriptTrigDigEdgeEdge.FALLING | 1 (0x1) | Asserts the trigger when the signal transitions from high level to low level. |
+-------------------------------+---------+-------------------------------------------------------------------------------+
| ScriptTrigDigEdgeEdge.RISING | 0 (0x0) | Asserts the trigger when the signal transitions from low level to high level. |
+-------------------------------+---------+-------------------------------------------------------------------------------+

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 property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_edge`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.digital_edge_script_trigger_edge`
'''
digital_edge_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigEdgeSource, 1150020)
'''Type: enums.ScriptTrigDigEdgeSource

Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to digital edge. To set this property, the NI-RFSG device must be in the Configuration state.

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_

`PFI Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pfi_lines.html>`_

`PXI Trigger Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pxi_trigger.html>`_

**High-Level Methods**:

- configure_digital_edge_script_trigger

**Defined Values**:

+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Name | Value | Description |
+=============================================+=============+=========================================================================================================================================+
| ScriptTrigDigEdgeSource.PFI0 | PFI0 | The trigger is received on PFI 0. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PFI1 | PFI1 | The trigger is received on PFI 1. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PFI2 | PFI2 | The trigger is received on PFI 2. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PFI3 | PFI3 | The trigger is received on PFI 3. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigEdgeSource.SYNC_SCRIPT_TRIGGER | Sync_Script | The trigger is received on the Sync Script trigger line. This value is valid on only the PXIe-5644/5645/5646. |
+---------------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+

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 property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].digital_edge_script_trigger_source`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.digital_edge_script_trigger_source`
'''
digital_level_script_trigger_active_level = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigDigLevelActiveLevel, 1150055)
'''Type: enums.ScriptTrigDigLevelActiveLevel

Specifies the active level for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL.

**Default Value:** ScriptTrigDigLevelActiveLevel.HIGH

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860



**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_

`Digital Level Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/trigger_level.html>`_

**Defined Values**:

+------------------------------------+---------------+--------------------------------------------------+
| Name | Value | Description |
+====================================+===============+==================================================+
| ScriptTrigDigLevelActiveLevel.HIGH | 9000 (0x2328) | Trigger when the digital trigger signal is high. |
+------------------------------------+---------------+--------------------------------------------------+
| ScriptTrigDigLevelActiveLevel.LOW | 9001 (0x2329) | Trigger when the digital trigger signal is low. |
+------------------------------------+---------------+--------------------------------------------------+

Tip:
This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_active_level`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.digital_level_script_trigger_active_level`
'''
digital_level_script_trigger_source = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigDigLevelSource, 1150054)
'''Type: enums.ScriptTrigDigLevelSource

Specifies the source terminal for the Script Trigger. This property is used when the script_trigger_type property is set to ScriptTrigType.DIGITAL_LEVEL. The digital_level_script_trigger_source property is not case-sensitive.

To set the digital_level_script_trigger_source property, the NI-RFSG device must be in the Configuration state.

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_

`PFI Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pfi_lines.html>`_

`PXI Trigger Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pxi_trigger.html>`_

**Defined Values**:

+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Name | Value | Description |
+======================================+=============+=========================================================================================================================================+
| ScriptTrigDigLevelSource.PFI0 | PFI0 | The trigger is received on PFI 0. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PFI1 | PFI1 | The trigger is received on PFI 1. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PFI2 | PFI2 | The trigger is received on PFI 2. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PFI3 | PFI3 | The trigger is received on PFI 3. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_STAR | PXI_Star | The trigger is received on the PXI star trigger line. This value is not valid for the PXIe-5644/5645/5646. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXI_TRIG7 | PXI_Trig7 | The trigger is received on PXI trigger line 7. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PXIE_DSTARB | PXIe_DStarB | The trigger is received on the PXIe DStar B trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841/5842/5860. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.PULSE_IN | PulseIn | The trigger is received on the PULSE IN terminal. This value is valid on only the PXIe-5842. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigDigLevelSource.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. |
+--------------------------------------+-------------+-----------------------------------------------------------------------------------------------------------------------------------------+

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 property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].digital_level_script_trigger_source`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.digital_level_script_trigger_source`
'''
exported_script_trigger_output_terminal = _attributes.AttributeEnum(_attributes.AttributeViString, enums.ScriptTrigExportOutputTerm, 1150022)
'''Type: enums.ScriptTrigExportOutputTerm

Specifies the destination terminal for exporting the Script Trigger. To set this property, the NI-RFSG device must be in the Configuration state.

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_ —Refer to this topic for information about trigger delay.

`PFI Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pfi_lines.html>`_

`PXI Trigger Lines <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/integration_pxi_trigger.html>`_

**High-Level Methods**:

- export_signal

**Defined Values**:

+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| Name | Value | Description |
+==========================================+=============+=================================================================================================================================+
| ScriptTrigExportOutputTerm.DO_NOT_EXPORT | | The signal is not exported. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PFI0 | PFI0 | The signal is exported to the PFI 0 connector. For the PXIe-5841 with PXIe-5655, the signal is exported to the PXIe-5841 PFI 0. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PFI1 | PFI1 | The signal is exported to the PFI 1 connector. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PFI4 | PFI4 | The signal is exported to the PFI 4 connector. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PFI5 | PFI5 | The signal is exported to the PFI 5 connector. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG0 | PXI_Trig0 | The trigger is received on PXI trigger line 0. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG1 | PXI_Trig1 | The trigger is received on PXI trigger line 1. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG2 | PXI_Trig2 | The trigger is received on PXI trigger line 2. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG3 | PXI_Trig3 | The trigger is received on PXI trigger line 3. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG4 | PXI_Trig4 | The trigger is received on PXI trigger line 4. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG5 | PXI_Trig5 | The trigger is received on PXI trigger line 5. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXI_TRIG6 | PXI_Trig6 | The trigger is received on PXI trigger line 6. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.PXIE_DSTARC | PXIe_DStarC | The signal is exported to the PXIe DStar C trigger line. This value is valid on only the PXIe-5820/5830/5831/5832/5840/5841. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO0 | DIO/PFI0 | The trigger is received on PFI0 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO1 | DIO/PFI1 | The trigger is received on PFI1 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO2 | DIO/PFI2 | The trigger is received on PFI2 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO3 | DIO/PFI3 | The trigger is received on PFI3 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO4 | DIO/PFI4 | The trigger is received on PFI4 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO5 | DIO/PFI5 | The trigger is received on PFI5 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO6 | DIO/PFI6 | The trigger is received on PFI6 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigExportOutputTerm.DIO7 | DIO/PFI7 | The trigger is received on PFI7 from the front panel DIO terminal. |
+------------------------------------------+-------------+---------------------------------------------------------------------------------------------------------------------------------+

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 property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].exported_script_trigger_output_terminal`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.exported_script_trigger_output_terminal`
'''
script_trigger_terminal_name = _attributes.AttributeViString(1150116)
'''Type: str

Returns the name of the fully qualified signal name as a string.

**Default Values**:

PXI-5670/5671, PXIe-5672/5673/5673E: /*AWGName*/ScriptTrigger *X*, where *AWGName* is the name of your associated AWG module in MAX and *X* is Script Trigger 0 through 3.

PXIe-5830/5831/5832: /*BasebandModule*/ao/0/ScriptTrigger *X*, where *BasebandModule* is the name of the baseband module of your device in MAX and *X* is Script Trigger 0 through 3.

PXIe-5820/5840/5841/5842: /*ModuleName*/ao/0/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX and *X* is Script Trigger 0 through 3.

PXIe-5860: /*ModuleName*/ao/*ChannelNumber*/ScriptTrigger *X*, where *ModuleName* is the name of your device in MAX, *ChannelNumber* is the channel number (0 or 1), and *X* is Script Trigger 0 through 3.

**Supported Devices:** PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Triggers <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/triggers.html>`_

`Syntax for Terminal Names <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/syntax_for_terminal_names.html>`_

**High-Level Methods**:

- GetTerminalName

Tip:
This property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_terminal_name`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.script_trigger_terminal_name`
'''
script_trigger_type = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.ScriptTrigType, 1150019)
'''Type: enums.ScriptTrigType

Specifies the Script Trigger type. Depending upon the value of this property, more properties may be needed to fully configure the trigger. To set this property, the NI-RFSG device must be in the Configuration state.

**Default Value:** ScriptTrigType.NONE

**Supported Devices:** PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Script Trigger <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/script_triggers.html>`_

`Trigger Types <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/trigger_types.html>`_

**High-Level Methods**:

- configure_digital_edge_script_trigger

**Defined Values**:

+------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Value | Description |
+==============================+=======================================================================================================================================================================================================================================================================+
| ScriptTrigType.NONE | No trigger is configured. Signal generation starts immediately. |
+------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigType.DIGITAL_EDGE | The data operation does not start until a digital edge is detected. The source of the digital edge is specified with the digital_edge_start_trigger_source property, and the active edge is specified with the digital_edge_start_trigger_edge property. |
+------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigType.DIGITAL_LEVEL | The data operation does not start until the digital level is detected. The source of the digital level is specified in the digital_level_script_trigger_source property, and the active level is specified in the digital_level_script_trigger_active_level property. |
+------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| ScriptTrigType.SOFTWARE | The data operation does not start until a software trigger occurs. You can create a software event by calling the send_software_edge_trigger 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 property can be set/get on specific script_triggers within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container script_triggers to specify a subset.

Example: :py:attr:`my_session.script_triggers[ ... ].script_trigger_type`

To set/get on all script_triggers, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.script_trigger_type`
'''
def __init__(self, session, repeated_capability_list):
object.__setattr__(self, '_session', session)
object.__setattr__(self, '_repeated_capability_list', repeated_capability_list)
object.__setattr__(self, '_prefix', 'scripttrigger')
object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else [''])
object.__setattr__(self, '_separator', '')

def __setattr__(self, key, value):
if key not in dir(self):
raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key))
object.__setattr__(self, key, value)

def __getitem__(self, repeated_capability):
'''Set/get properties or call methods with a repeated capability (i.e. channels)'''
rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix)
complete_rep_cap_list = [
current_rep_cap + self._separator + rep_cap
for current_rep_cap in self._current_repeated_capability_list
for rep_cap in rep_caps_list
]
object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list)
self._current_repeated_capability_list = complete_rep_cap_list

return self

def _get_attribute_vi_real64(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute)
return value

def _set_attribute_vi_real64(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value)

def _get_attribute_vi_int32(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute)
return value

def _set_attribute_vi_int32(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value)

def _get_attribute_vi_string(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute)
return value

def _set_attribute_vi_string(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value)

class _RepeatedCapabilityWaveform(object):
waveform_iq_rate = _attributes.AttributeViReal64(1150263)
'''Type: float

Specifies the I/Q rate of the waveform. To set this property, the NI-RFSG device must be in the Configuration state.

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860

**Related Topics**

`Streaming <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/streaming.html>`_

`Assigning Properties or Properties to a Waveform <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/assigning_properties_or_attributes_to_a_waveform.html>`_—Refer to this topic for more information about using this property to associate an I/Q rate with a waveform.

`Digital Upconverter <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/duc.html>`_

Tip:
This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_iq_rate`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_iq_rate`
'''
waveform_papr = _attributes.AttributeViReal64(1150266)
'''Type: float

Specifies the peak-to-average power ratio (PAPR).

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860

Tip:
This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_papr`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_papr`
'''
waveform_rf_blanking = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.RFBlanking, 1150278)
'''Type: enums.RFBlanking

**Defined Values**:

Name (Value): Description

RFBlanking.DISABLE (0): RF blanking is disabled.

RFBlanking.ENABLE (1): RF blanking is enabled.

**Default Value:** RFBlanking.DISABLE

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842

**Related Topics**

`Marker Events <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/marker_events.html>`_

Enables or disables RF blanking.

+-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+
| rf_blanking_source | waveform_rf_blanking | Behaviour |
+===================================================================================+======================+===========================================================================================================+
| "" (empty string) | RFBlanking.DISABLE | No blanking performed. |
+-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+
| "" (empty string) | RFBlanking.ENABLE | Blanking performed based on burst start and stop values and blanking source set to private marker. |
+-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+
| NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.DISABLE | Blanking performed based on the marker locations for the marker that the user set in the blanking source. |
+-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+
| NIRFSG_VAL_MARKER0, NIRFSG_VAL_MARKER1, NIRFSG_VAL_MARKER2, or NIRFSG_VAL_MARKER3 | RFBlanking.ENABLE | Error is shown. |
+-----------------------------------------------------------------------------------+----------------------+-----------------------------------------------------------------------------------------------------------+

Note: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/cvinirfsa_reset.html>`_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/cvinirfsa_resetwithoptions.html>`_. Select **Routes** in the **steps to omit** parameter.

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 property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_rf_blanking`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_rf_blanking`
'''
waveform_runtime_scaling = _attributes.AttributeViReal64(1150265)
'''Type: float

Specifies the waveform runtime scaling. The waveform runtime scaling is applied to the waveform data before any other signal processing.

**Units**: dB

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860, PXIe-5841 with PXIe-5655

Tip:
This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_runtime_scaling`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_runtime_scaling`
'''
waveform_signal_bandwidth = _attributes.AttributeViReal64(1150264)
'''Type: float

Specifies the bandwidth of the arbitrary signal. This value must be less than or equal to (0.8× iq_rate).

**Units**: hertz (Hz)

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5842/5860

Tip:
This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_signal_bandwidth`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_signal_bandwidth`
'''
waveform_waveform_size = _attributes.AttributeViInt32(1150297)
'''Type: int

Specifies the size of the waveform specified by an active channel.

**Supported Devices:** PXIe-5820/5830/5831/5832/5840/5841/5841 with PXIe-5655/5842/5860

Tip:
This property can be set/get on specific waveform within your :py:class:`nirfsg.Session` instance.
Use Python index notation on the repeated capabilities container waveform to specify a subset.

Example: :py:attr:`my_session.waveform[ ... ].waveform_waveform_size`

To set/get on all waveform, you can call the property directly on the :py:class:`nirfsg.Session`.

Example: :py:attr:`my_session.waveform_waveform_size`
'''
def __init__(self, session, repeated_capability_list):
object.__setattr__(self, '_session', session)
object.__setattr__(self, '_repeated_capability_list', repeated_capability_list)
object.__setattr__(self, '_prefix', 'waveform::')
object.__setattr__(self, '_current_repeated_capability_list', repeated_capability_list if len(repeated_capability_list) > 0 else [''])
object.__setattr__(self, '_separator', '')

def __setattr__(self, key, value):
if key not in dir(self):
raise AttributeError("'{0}' object has no attribute '{1}'".format(type(self).__name__, key))
object.__setattr__(self, key, value)

def __getitem__(self, repeated_capability):
'''Set/get properties or call methods with a repeated capability (i.e. channels)'''
rep_caps_list = _converters.convert_repeated_capabilities(repeated_capability, self._prefix)
complete_rep_cap_list = [current_rep_cap + self._separator + rep_cap for current_rep_cap in self._current_repeated_capability_list for rep_cap in rep_caps_list]
complete_rep_cap_list = [
current_rep_cap + self._separator + rep_cap
for current_rep_cap in self._current_repeated_capability_list
for rep_cap in rep_caps_list
]
object.__setattr__(self, '_current_repeated_capability_list', complete_rep_cap_list)
self._current_repeated_capability_list = complete_rep_cap_list

return _SessionBase(
repeated_capability_list=complete_rep_cap_list,
all_channels_in_session=self._session._all_channels_in_session,
interpreter=self._session._interpreter,
freeze_it=True
)
return self

def _get_attribute_vi_real64(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute)
return value

# This is a very simple context manager we can use when we need to set/get attributes
# or call functions from _SessionBase that require no channels. It is tied to the specific
# implementation of _SessionBase and how repeated capabilities are handled.
class _NoChannel(object):
def __init__(self, session):
self._session = session
def _set_attribute_vi_real64(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value)

def __enter__(self):
self._repeated_capability_cache = self._session._repeated_capability
self._session._repeated_capability = ''
def _get_attribute_vi_int32(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute)
return value

def __exit__(self, exc_type, exc_value, traceback):
self._session._repeated_capability = self._repeated_capability_cache
Copy link
Collaborator

Choose a reason for hiding this comment

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

This class is for calling a function or attribute that does not support repeated capabilities, while in the middle of a fancy function that may have had repeated capabilties passed in.

Even if nirfsg doesn't happen to need it at the moment, I'm not sure it's okay to just blindly omit it. We need to reason through how such a use case would work without it. If nothing else, fancy function code would need to change to not use this, but I'm not sure it would work.

@ni-jfitzger
Copy link
Collaborator

The description for this PR is not sufficient.
I'd like to see a theory of operation. I don't think you've reasoned through all of the use cases.
You could probably stand to add some more tests. If nothing else, you should test your new error behavior.

Comment on lines 788 to 813
def _get_attribute_vi_real64(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_real64(repeated_capability, attribute)
return value

def _set_attribute_vi_real64(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_real64(repeated_capability, attribute, value)

def _get_attribute_vi_int32(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_int32(repeated_capability, attribute)
return value

def _set_attribute_vi_int32(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_int32(repeated_capability, attribute, value)

def _get_attribute_vi_string(self, attribute):
repeated_capability = ','.join(self._current_repeated_capability_list)
value = self._session._interpreter.get_attribute_vi_string(repeated_capability, attribute)
return value

def _set_attribute_vi_string(self, attribute, value):
repeated_capability = ','.join(self._current_repeated_capability_list)
self._session._interpreter.set_attribute_vi_string(repeated_capability, attribute, value)
Copy link
Collaborator

Choose a reason for hiding this comment

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

If you're going to put these in every rep cap class, why not have a base class to inherit them from?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

APIs allow repeated capabilities to access attributes and methods that don't support them

4 participants