Skip to content

Commit

Permalink
NI-Digital 21.0 API updates (#1647)
Browse files Browse the repository at this point in the history
* NI-Digital 21.0 API updates

* Add system tests for `rio_events` and `rio_triggers` repeated capabilities.

* Use ints to select the repeated capability; it's more pythonic.
  • Loading branch information
sbethur authored Aug 19, 2021
1 parent a9776d2 commit 45ee975
Show file tree
Hide file tree
Showing 11 changed files with 740 additions and 16 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,17 @@ All notable changes to this project will be documented in this file.
* #### Removed
* ### `nidigital` (NI-Digital Pattern Driver)
* #### Added
* API parity with NI-Digital Pattern Driver 21.0.0.
* Properties added:
* `digital_edge_rio_trigger_edge`
* `digital_edge_rio_trigger_source`
* `exported_rio_event_output_terminal`
* `rio_event_terminal_name`
* `rio_trigger_terminal_name`
* `rio_trigger_type`
* Repeated Capabilities added:
* `rio_events`
* `rio_triggers`
* #### Changed
* #### Removed
* ### `nidmm` (NI-DMM)
Expand Down
250 changes: 250 additions & 0 deletions docs/nidigital/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3258,6 +3258,88 @@ digital_edge_conditional_jump_trigger_source

- C Attribute: **NIDIGITAL_ATTR_DIGITAL_EDGE_CONDITIONAL_JUMP_TRIGGER_SOURCE**

digital_edge_rio_trigger_edge
-----------------------------

.. py:attribute:: digital_edge_rio_trigger_edge
Configures the active edge of the incoming trigger signal for the RIO trigger instance. The default value is :py:data:`~nidigital.DigitalEdge.RISING`.

+-------------------------------------------+---------------------------------------------------------------+
| Valid Values: | |
+===========================================+===============================================================+
| :py:data:`~nidigital.DigitalEdge.RISING` | Specifies the signal transition from low level to high level. |
+-------------------------------------------+---------------------------------------------------------------+
| :py:data:`~nidigital.DigitalEdge.FALLING` | Specifies the signal transition from high level to low level. |
+-------------------------------------------+---------------------------------------------------------------+


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

Example: :py:attr:`my_session.rio_triggers[ ... ].digital_edge_rio_trigger_edge`

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

Example: :py:attr:`my_session.digital_edge_rio_trigger_edge`

The following table lists the characteristics of this property.

+-----------------------+-------------------+
| Characteristic | Value |
+=======================+===================+
| Datatype | enums.DigitalEdge |
+-----------------------+-------------------+
| Permissions | read-write |
+-----------------------+-------------------+
| Repeated Capabilities | rio_triggers |
+-----------------------+-------------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_DIGITAL_EDGE_RIO_TRIGGER_EDGE**

digital_edge_rio_trigger_source
-------------------------------

.. py:attribute:: digital_edge_rio_trigger_source
Configures the digital trigger source terminal for a RIO trigger instance. The PXIe-6570/6571 supports triggering through the PXI trigger bus. You can specify source terminals in one of two ways. If the digital pattern instrument is named Dev1 and your terminal is PXI_Trig0, you can specify the terminal with the fully qualified terminal name, /Dev1/PXI_Trig0, or with the shortened terminal name, PXI_Trig0. The source terminal can also be a terminal from another device, in which case the NI-Digital Pattern Driver automatically finds a route (if one is available) from that terminal to the input terminal (going through a physical PXI backplane trigger line). For example, you can set the source terminal on Dev1 to be /Dev2/RIOTrigger0. The default value is VI_NULL.

+----------------------------------------------+
| Valid Values: |
+==============================================+
| String identifier to any valid terminal name |
+----------------------------------------------+


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

Example: :py:attr:`my_session.rio_triggers[ ... ].digital_edge_rio_trigger_source`

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

Example: :py:attr:`my_session.digital_edge_rio_trigger_source`

The following table lists the characteristics of this property.

+-----------------------+--------------+
| Characteristic | Value |
+=======================+==============+
| Datatype | str |
+-----------------------+--------------+
| Permissions | read-write |
+-----------------------+--------------+
| Repeated Capabilities | rio_triggers |
+-----------------------+--------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_DIGITAL_EDGE_RIO_TRIGGER_SOURCE**

digital_edge_start_trigger_edge
-------------------------------

Expand Down Expand Up @@ -3468,6 +3550,60 @@ exported_pattern_opcode_event_output_terminal

- C Attribute: **NIDIGITAL_ATTR_EXPORTED_PATTERN_OPCODE_EVENT_OUTPUT_TERMINAL**

exported_rio_event_output_terminal
----------------------------------

.. py:attribute:: exported_rio_event_output_terminal
Specifies the destination terminal for exporting the RIO Event. Terminals can be specified in one of two ways. If the digital pattern instrument is named Dev1 and your terminal is PXI_Trig0, you can specify the terminal with the fully qualified terminal name, /Dev1/PXI_Trig0, or with the shortened terminal name, PXI_Trig0.

+-----------------+--------------------+
| Defined Values: | |
+=================+====================+
| PXI_Trig0 | PXI trigger line 0 |
+-----------------+--------------------+
| PXI_Trig1 | PXI trigger line 1 |
+-----------------+--------------------+
| PXI_Trig2 | PXI trigger line 2 |
+-----------------+--------------------+
| PXI_Trig3 | PXI trigger line 3 |
+-----------------+--------------------+
| PXI_Trig4 | PXI trigger line 4 |
+-----------------+--------------------+
| PXI_Trig5 | PXI trigger line 5 |
+-----------------+--------------------+
| PXI_Trig6 | PXI trigger line 6 |
+-----------------+--------------------+
| PXI_Trig7 | PXI trigger line 7 |
+-----------------+--------------------+


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

Example: :py:attr:`my_session.rio_events[ ... ].exported_rio_event_output_terminal`

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

Example: :py:attr:`my_session.exported_rio_event_output_terminal`

The following table lists the characteristics of this property.

+-----------------------+------------+
| Characteristic | Value |
+=======================+============+
| Datatype | str |
+-----------------------+------------+
| Permissions | read-write |
+-----------------------+------------+
| Repeated Capabilities | rio_events |
+-----------------------+------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_EXPORTED_RIO_EVENT_OUTPUT_TERMINAL**

exported_start_trigger_output_terminal
--------------------------------------

Expand Down Expand Up @@ -4710,6 +4846,120 @@ record_coercions

- C Attribute: **NIDIGITAL_ATTR_RECORD_COERCIONS**

rio_event_terminal_name
-----------------------

.. py:attribute:: rio_event_terminal_name
Specifies the terminal name for the output signal of the specified instance of a RIO Event. You can use this terminal name as an input signal source for another trigger.




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

Example: :py:attr:`my_session.rio_events[ ... ].rio_event_terminal_name`

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

Example: :py:attr:`my_session.rio_event_terminal_name`

The following table lists the characteristics of this property.

+-----------------------+------------+
| Characteristic | Value |
+=======================+============+
| Datatype | str |
+-----------------------+------------+
| Permissions | read only |
+-----------------------+------------+
| Repeated Capabilities | rio_events |
+-----------------------+------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_RIO_EVENT_TERMINAL_NAME**

rio_trigger_terminal_name
-------------------------

.. py:attribute:: rio_trigger_terminal_name
Specifies the terminal name from which the exported RIO trigger signal may be routed to other instruments through the PXI trigger bus. You can use this signal to trigger other instruments when the RIO trigger instance asserts on the digital pattern instrument.




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

Example: :py:attr:`my_session.rio_triggers[ ... ].rio_trigger_terminal_name`

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

Example: :py:attr:`my_session.rio_trigger_terminal_name`

The following table lists the characteristics of this property.

+-----------------------+--------------+
| Characteristic | Value |
+=======================+==============+
| Datatype | str |
+-----------------------+--------------+
| Permissions | read only |
+-----------------------+--------------+
| Repeated Capabilities | rio_triggers |
+-----------------------+--------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_RIO_TRIGGER_TERMINAL_NAME**

rio_trigger_type
----------------

.. py:attribute:: rio_trigger_type
Disables the rio trigger or configures it for hardware triggering. The default value is :py:data:`~nidigital.TriggerType.NONE`.

+------------------------------------------------+------------------------------------------------------------------+
| Valid Values: | |
+================================================+==================================================================+
| :py:data:`~nidigital.TriggerType.NONE` | Disables the conditional jump trigger. |
+------------------------------------------------+------------------------------------------------------------------+
| :py:data:`~nidigital.TriggerType.DIGITAL_EDGE` | Configures the conditional jump trigger for hardware triggering. |
+------------------------------------------------+------------------------------------------------------------------+


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

Example: :py:attr:`my_session.rio_triggers[ ... ].rio_trigger_type`

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

Example: :py:attr:`my_session.rio_trigger_type`

The following table lists the characteristics of this property.

+-----------------------+-------------------+
| Characteristic | Value |
+=======================+===================+
| Datatype | enums.TriggerType |
+-----------------------+-------------------+
| Permissions | read-write |
+-----------------------+-------------------+
| Repeated Capabilities | rio_triggers |
+-----------------------+-------------------+

.. tip::
This property corresponds to the following LabVIEW Property or C Attribute:

- C Attribute: **NIDIGITAL_ATTR_RIO_TRIGGER_TYPE**

selected_function
-----------------

Expand Down
10 changes: 10 additions & 0 deletions docs/nidigital/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,16 @@ SelectedFunction



.. py:attribute:: SelectedFunction.RIO
Yields control of the specified pin(s) to LabVIEW FPGA.





SequencerFlag
-------------

Expand Down
52 changes: 52 additions & 0 deletions docs/nidigital/rep_caps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,56 @@ sites
passes a string of :python:`'site0, site1, site2'` to the set attribute function.


rio_events
----------

.. py:attribute:: nidigital.Session.rio_events[]
If no prefix is added to the items in the parameter, the correct prefix will be added when
the driver function call is made.

.. code:: python
session.rio_events['0-2'].channel_enabled = True
passes a string of :python:`'RIOEvent0, RIOEvent1, RIOEvent2'` to the set attribute function.

If an invalid repeated capability is passed to the driver, the driver will return an error.

You can also explicitly use the prefix as part of the parameter, but it must be the correct prefix
for the specific repeated capability.

.. code:: python
session.rio_events['RIOEvent0-RIOEvent2'].channel_enabled = True
passes a string of :python:`'RIOEvent0, RIOEvent1, RIOEvent2'` to the set attribute function.


rio_triggers
------------

.. py:attribute:: nidigital.Session.rio_triggers[]
If no prefix is added to the items in the parameter, the correct prefix will be added when
the driver function call is made.

.. code:: python
session.rio_triggers['0-2'].channel_enabled = True
passes a string of :python:`'RIOTrigger0, RIOTrigger1, RIOTrigger2'` to the set attribute function.

If an invalid repeated capability is passed to the driver, the driver will return an error.

You can also explicitly use the prefix as part of the parameter, but it must be the correct prefix
for the specific repeated capability.

.. code:: python
session.rio_triggers['RIOTrigger0-RIOTrigger2'].channel_enabled = True
passes a string of :python:`'RIOTrigger0, RIOTrigger1, RIOTrigger2'` to the set attribute function.



4 changes: 4 additions & 0 deletions generated/nidigital/nidigital/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ class SelectedFunction(Enum):
r'''
The I/O switch connecting the instrument channel is open to the I/O connector. If the PPMU is sourcing, it is stopped prior to opening the I/O switch.
'''
RIO = 1104
r'''
Yields control of the specified pin(s) to LabVIEW FPGA.
'''


class SequencerFlag(Enum):
Expand Down
Loading

0 comments on commit 45ee975

Please sign in to comment.