From 8b4c517c35ea884eb02415d98b9e31265508cfb9 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Thu, 12 Jun 2025 15:35:23 +0530 Subject: [PATCH 1/3] corrected datatype to float64 list and turned on some apis --- docs/nirfsg/class.rst | 774 +++++++++++++++++- generated/nirfsg/nirfsg/_library.py | 27 + .../nirfsg/nirfsg/_library_interpreter.py | 87 +- generated/nirfsg/nirfsg/session.py | 144 +++- .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 111 ++- src/nirfsg/metadata/functions.py | 610 +++++++++++++- 6 files changed, 1591 insertions(+), 162 deletions(-) diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index c35091f21..b8c9726da 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -1601,20 +1601,92 @@ disable_start_trigger -export_signal +error_message ------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: export_signal(signal, signal_identifier, output_terminal) + .. py:method:: error_message(error_code, error_message) + + Converts an error code returned by an NI-RFSG method into a user-readable string. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + + + + + :param error_code: + + + Pass the status parameter that is returned from any NI-RFSG method. + + **Default Value** : 0 (VI_SUCCESS) + + + + + :type error_code: int + :param error_message: + + + Returns the user-readable message string that corresponds to the status code you specify. + + You must pass a ViChar array with at least 256 bytes to this parameter. + + + + + :type error_message: str + +error_query +----------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: error_query() + + Reads an error code and an error message from the instrument error queue. + + **Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860 + + - Routes signals (triggers, clocks, and events) to a specified output terminal. - The NI-RFSG device must be in the Configuration state before you call this method. - You can clear a previously routed signal by exporting the signal to "" (empty string). + :rtype: tuple (error_code, error_message) + + WHERE + + error_code (int): + + + Returns the error code read from the instrument error queue. + + + + + error_message (str): + + + Returns the error message string read from the instrument error message queue. + + You must pass a ViChar array with at least 256 bytes. + + + - **Supported Devices** :PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + +error_message +------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: error_message(error_code, error_message) + + Converts an error code returned by an NI-RFSG method into a user-readable string. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** @@ -1662,55 +1734,168 @@ export_signal :param signal_identifier: - Specifies which instance of the selected signal to export. This parameter is useful when you set the :py:attr:`nirfsg.Session.SIGNAL` parameter to :py:data:`~nirfsg.NIRFSG_VAL_SCRIPT_TRIGGER` or :py:data:`~nirfsg.NIRFSG_VAL_MARKER_EVENT`. Otherwise, set the :py:attr:`nirfsg.Session.SIGNAL_IDENTIFIER` parameter to '' (empty string). **Defined Values** : - - +-----------------------------------------------------+----------------+-----------------------------+ - | Name | Value | Description | - +=====================================================+================+=============================+ - | :py:data:`~nirfsg.SignalIdentifier.MARKER_EVENT0` | marker0 | Specifies Marker 0. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.MARKER_EVENT1` | marker1 | Specifies Marker 1. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.MARKER_EVENT2` | marker2 | Specifies Marker 2. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.MARKER_EVENT3` | marker3 | Specifies Marker 3. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.SCRIPT_TRIGGER0` | scriptTrigger0 | Specifies Script Trigger 0. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.SCRIPT_TRIGGER1` | scriptTrigger1 | Specifies Script Trigger 1. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.SCRIPT_TRIGGER2` | scriptTrigger2 | Specifies Script Trigger 2. | - +-----------------------------------------------------+----------------+-----------------------------+ - | :py:data:`~nirfsg.SignalIdentifier.SCRIPT_TRIGGER3` | scriptTrigger3 | Specifies Script Trigger 3. | - +-----------------------------------------------------+----------------+-----------------------------+ + Specifies which instance of the selected signal to export. This parameter is useful when you set the :py:attr:`nirfsg.Session.SIGNAL` parameter to :py:data:`~nirfsg.NIRFSG_VAL_SCRIPT_TRIGGER` or :py:data:`~nirfsg.NIRFSG_VAL_MARKER_EVENT`. Otherwise, set the :py:attr:`nirfsg.Session.SIGNAL_IDENTIFIER` parameter to '' (empty string). **Possible Values** : + + +----------------+-----------------------------+ + | Possible Value | Description | + +================+=============================+ + | marker0 | Specifies Marker 0. | + +----------------+-----------------------------+ + | marker1 | Specifies Marker 1. | + +----------------+-----------------------------+ + | marker2 | Specifies Marker 2. | + +----------------+-----------------------------+ + | marker3 | Specifies Marker 3. | + +----------------+-----------------------------+ + | scriptTrigger0 | Specifies Script Trigger 0. | + +----------------+-----------------------------+ + | scriptTrigger1 | Specifies Script Trigger 1. | + +----------------+-----------------------------+ + | scriptTrigger2 | Specifies Script Trigger 2. | + +----------------+-----------------------------+ + | scriptTrigger3 | Specifies Script Trigger 3. | + +----------------+-----------------------------+ .. note:: One or more of the referenced properties are not in the Python API for this driver. .. note:: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. - :type signal_identifier: :py:data:`nirfsg.SignalIdentifier` + :type signal_identifier: str :param output_terminal: - Specifies the terminal where the signal is exported. You can choose not to export any signal. For the PXIe-5841 with PXIe-5655, the signal is exported to the terminal on the PXIe-5841. **Defined Values** : + Specifies the terminal where the signal is exported. You can choose not to export any signal. For the PXIe-5841 with PXIe-5655, the signal is exported to the terminal on the PXIe-5841. **Possible Values** : - +---------------------------------------------------------------------+---------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | | - +=====================================================================+=========+============================================================================================+=======================================================================================================================================================================+ - | :py:data:`~nirfsg.ReferenceClockExportOutputTerminal.CLK_OUT` | ClkOut | Exports the Reference Clock signal to the CLK OUT connector of the device. | Supported on PXIe-5673, 5673E | - +---------------------------------------------------------------------+---------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ReferenceClockExportOutputTerminal.DO_NOT_EXPORT` | | The Reference Clock signal is not exported. | Supported on PXIe-5644/5645/5646, 5820/5830/5831/5832/5840/5841/5842/5860, 5650/5651/5652, 5654, 5673, 5673E, PXIe-5654 with PXIe-5696, PXI-5650/5651/5652 (See Note) | - +---------------------------------------------------------------------+---------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ReferenceClockExportOutputTerminal.REF_OUT` | RefOut | Exports the Reference Clock signal to the REF OUT connector of the device. | Supported on PXIe-5644/5645/5646, 5820/5830/5831/5832/5840/5841/5842/5860, 5650/5651/5653, 5653, 5654, 5673, 5673E, PXIe-5654 with PXIe-5696, PXI-5650/5651/5653, | - +---------------------------------------------------------------------+---------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ReferenceClockExportOutputTerminal.REF_OUT2` | RefOut2 | Exports the Reference Clock signal to the REF OUT2 connector of the device, if applicable. | Supported on PXIe-5650/5651/5652, 5654, 5673E, PXIe-5654 with PXIe-5696 | - +---------------------------------------------------------------------+---------+--------------------------------------------------------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + +----------------+--------------------------------------------------------------------------------------------+ + | Possible Value | Description | + +================+============================================================================================+ + | ClkOut | Exports the Reference Clock signal to the CLK OUT connector of the device. | + +----------------+--------------------------------------------------------------------------------------------+ + | | The Reference Clock signal is not exported. | + +----------------+--------------------------------------------------------------------------------------------+ + | RefOut | Exports the Reference Clock signal to the REF OUT connector of the device. | + +----------------+--------------------------------------------------------------------------------------------+ + | RefOut2 | Exports the Reference Clock signal to the REF OUT2 connector of the device, if applicable. | + +----------------+--------------------------------------------------------------------------------------------+ - .. 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. + + :type output_terminal: str + +get_all_named_waveform_names +---------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_all_named_waveform_names() + + Return names of the waveforms present in the memory. + + **Supported Devices** :PXIe-5830/5831/5840/5841/5842E + + + + + + :rtype: tuple (waveform_names, actual_buffer_size) + + WHERE + + waveform_names (str): + + + Returns a string having waveform names separated by commas. + + + + + actual_buffer_size (int): + + + Fetch the number of bytes needed to pass in the :py:attr:`nirfsg.Session.BUFFER_SIZE` parameter. + + It can be fetch by passing VI_NULL in the :py:attr:`nirfsg.Session.WAVEFORM_NAMES` parameter. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + +get_all_script_names +-------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_all_script_names() + + Return names of the scripts present in the memory. + + **Supported Devices** :PXIe-5830/5831/5840/5841/5842E + + + + + + :rtype: tuple (script_names, actual_buffer_size) + + WHERE + + script_names (str): + + + Returns a string having script names separated by commas. + + + + + actual_buffer_size (int): + + + Fetch the number of bytes needed to pass in the :py:attr:`nirfsg.Session.BUFFER_SIZE` parameter. + + It can be fetch by passing VI_NULL in the :py:attr:`nirfsg.Session.SCRIPT_NAMES` parameter. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + +get_channel_name +---------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_channel_name(index) + + Returns the channel string that is in the channel table at an index you specify. + + **Supported Devices** : PXI-5670/5671, PXIe-5672/5673/5673E + + + + + + :param index: + + + Specifies a one-based index into the channel table. + + + + + :type index: int + + :rtype: str + :return: + + + Returns a channel string from the channel table at the index you specify in the Index parameter. Do not modify the contents of the channel string. + + - :type output_terminal: :py:data:`nirfsg.ReferenceClockExportOutputTerminal` get_error --------- @@ -1909,6 +2094,280 @@ get_stream_endpoint_handle +get_terminal_name +----------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_terminal_name(signal, signal_identifier) + + Returns the fully-qualified name of the specified signal. + + The fully-qualified name is helpful to automatically route signals in a multisegment chassis. + + **Supported Devices** : PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Triggers `_ + + `Events `_ + + `Syntax for Terminal Names `_ + + + + + + :param signal: + + + Specifies the signal to query. **Defined Values** : + + +-----------------------------------------------------------+---------+--------------------------------------------+ + | Name | Value | Description | + +===========================================================+=========+============================================+ + | :py:data:`~nirfsg.Signal.START_TRIGGER` | 0 (0x0) | Exports a Start Trigger. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.SCRIPT_TRIGGER` | 1 (0x1) | Exports a Script Trigger. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.MARKER_EVENT` | 2 (0x2) | Exports a Marker Event. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.REF_CLOCK` | 3 (0x3) | Exports the Reference Clock. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.STARTED_EVENT` | 4 (0x4) | Exports a Started Event. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.DONE_EVENT` | 5 (0x5) | Exports a Done Event. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.CONFIGURATION_LIST_STEP_TRIGGER` | 6 (0x6) | Exports a Configuration List Step Trigger. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + | :py:data:`~nirfsg.Signal.CONFIGURATION_SETTLED_EVENT` | 7 (0x7) | Exports a Configuration Settled Event. | + +-----------------------------------------------------------+---------+--------------------------------------------+ + + .. 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. + + + :type signal: :py:data:`nirfsg.Signal` + :param signal_identifier: + + + Specifies which instance of the selected signal to query. This parameter is necessary when you set the :py:attr:`nirfsg.Session.SIGNAL` parameter to :py:data:`~nirfsg.NIRFSG_VAL_SCRIPT_TRIGGER` or :py:data:`~nirfsg.NIRFSG_VAL_MARKER_EVENT` . Otherwise, set the :py:attr:`nirfsg.Session.SIGNAL_IDENTIFIER` parameter to '' (empty string). **Possible Values** : + + +----------------+-----------------------------+ + | Possible Value | Description | + +================+=============================+ + | marker0 | Specifies Marker 0. | + +----------------+-----------------------------+ + | marker1 | Specifies Marker 1. | + +----------------+-----------------------------+ + | marker2 | Specifies Marker 2. | + +----------------+-----------------------------+ + | marker3 | Specifies Marker 3. | + +----------------+-----------------------------+ + | scriptTrigger0 | Specifies Script Trigger 0. | + +----------------+-----------------------------+ + | scriptTrigger1 | Specifies Script Trigger 1. | + +----------------+-----------------------------+ + | scriptTrigger2 | Specifies Script Trigger 2. | + +----------------+-----------------------------+ + | scriptTrigger3 | Specifies Script Trigger 3. | + +----------------+-----------------------------+ + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + .. note:: One or more of the referenced values are not in the Python API for this driver. Enums that only define values, or represent True/False, have been removed. + + + :type signal_identifier: str + + :rtype: str + :return: + + + Returns the string to use as the source for other devices. + + + + + +get_waveform_burst_start_locations +---------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_waveform_burst_start_locations(number_of_locations) + + Returns the burst start locations of the waveform stored in the NI-RFSG session. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].get_waveform_burst_start_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.get_waveform_burst_start_locations` + + + :param number_of_locations: + + + Specifies the size of the burst start locations array. + + + + + :type number_of_locations: int + + :rtype: tuple (locations, required_size) + + WHERE + + locations (array.array("d")): + + + Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the :py:attr:`nirfsg.Session.CHANNEL_NAME` parameter. This value is expressed in samples. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + required_size (int): + + + Returns the required size for the output array if you pass NULL to :py:attr:`nirfsg.Session.LOCATIONS` parameter. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + +get_waveform_burst_stop_locations +--------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_waveform_burst_stop_locations(number_of_locations) + + Returns the burst stop locations of the waveform stored in the NI-RFSG session. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].get_waveform_burst_stop_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.get_waveform_burst_stop_locations` + + + :param number_of_locations: + + + Specifies the size of the burst start locations array. + + + + + :type number_of_locations: int + + :rtype: tuple (locations, required_size) + + WHERE + + locations (array.array("d")): + + + Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the :py:attr:`nirfsg.Session.CHANNEL_NAME` parameter. This value is expressed in samples. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + required_size (int): + + + Returns the required size for the output array if you pass NULL to :py:attr:`nirfsg.Session.LOCATIONS` parameter. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + +get_waveform_marker_event_locations +----------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: get_waveform_marker_event_locations(number_of_locations) + + Returns the marker locations associated with the waveform and the marker stored in the NI-RFSG session. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].get_waveform_marker_event_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.get_waveform_marker_event_locations` + + + :param number_of_locations: + + + Specifies the size of the locations array. + + + + + :type number_of_locations: int + + :rtype: tuple (locations, required_size) + + WHERE + + locations (array.array("d")): + + + Returns the marker locations stored in the NI-RFSG database for the channel you specified in the :py:attr:`nirfsg.Session.CHANNEL_NAME` parameter. This value is expressed in samples. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + required_size (int): + + + Returns the required size for the output array if you pass NULL to **Locations** parameter. + + + + + initiate -------- @@ -2286,6 +2745,99 @@ reset_with_defaults +reset_with_options +------------------ + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: reset_with_options(steps_to_omit) + + Resets all properties to default values and specifies steps to omit during the reset process, such as signal routes. + + By default, this method exhibits the same behavior as :py:meth:`nirfsg.Session.reset`. You can specify steps to omit using the steps to omit parameter. For example, if you specify :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` for the :py:attr:`nirfsg.Session.STEPS_TO_OMIT` parameter, this method does not release signal routes during the reset process. + + When routes of signals between two devices are released, they are released regardless of which device created the route. + + To avoid resetting routes on PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using this method instead of :py:meth:`nirfsg.Session.reset`, with :py:attr:`nirfsg.Session.STEPS_TO_OMIT` set to :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES`. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Triggers `_ + + `Events `_ + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + + :param steps_to_omit: + + + Specifies a list of steps to skip during the reset process. The default value is :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.NONE`, which specifies that no step is omitted during reset. **Defined Values** : + + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | Name | Value | Description | + +===================================================================+=========+============================================================================================================================================================================================================+ + | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.NONE` | 0 (0x0) | No step is omitted during reset. | + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.WAVEFORMS` | 1 (0x1) | Omits clearing waveforms. | + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.SCRIPTS` | 2 (0x2) | Omits clearing scripts. | + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` | 4 (0x4) | Omits the routing reset step. Routing is preserved after a reset. However, routing related properties are reset to default, and routing is released if the default properties are committed after a reset. | + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.DEEMBEDDING_TABLES` | 8 (0x8) | Omits deleting de-embedding tables. This step is valid only for the PXIe-5830/5831/5832/5840. | + +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ + + .. note:: :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` is not supported in external calibration or alignment sessions. + + + :type steps_to_omit: :py:data:`nirfsg.ResetWithOptionsStepsToOmit` + +revision_query +-------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: revision_query() + + Returns the revision numbers of the NI-RFSG driver and the instrument firmware. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + + + + + :rtype: tuple (instrument_driver_revision, firmware_revision) + + WHERE + + instrument_driver_revision (str): + + + Returns the value of the :py:attr:`nirfsg.Session.specific_driver_revision` property in the form of a string. + + You must pass a ViChar array with at least 256 bytes. + + + + + firmware_revision (str): + + + Returns the value of the :py:attr:`nirfsg.Session.instrument_firmware_revision` property in the form of a string. + + You must pass a ViChar array with at least 256 bytes. + + + + + save_configurations_to_file --------------------------- @@ -2648,6 +3200,140 @@ set_arb_waveform_next_write_position :type offset: int +set_waveform_burst_start_locations +---------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: set_waveform_burst_start_locations(number_of_locations, locations) + + Configures the start location of the burst in samples where the burst refers to the active portion of a waveform. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].set_waveform_burst_start_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.set_waveform_burst_start_locations` + + + :param number_of_locations: + + + Specifies the size of the burst start locations array. + + + + + :type number_of_locations: int + :param locations: + + + Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the :py:attr:`nirfsg.Session.CHANNEL_NAME` parameter. This value is expressed in samples. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + :type locations: array.array("d") + +set_waveform_burst_stop_locations +--------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: set_waveform_burst_stop_locations(number_of_locations, locations) + + Configures the stop location of the burst in samples where the burst refers to the active portion of a waveform. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].set_waveform_burst_stop_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.set_waveform_burst_stop_locations` + + + :param number_of_locations: + + + Specifies the size of the burst stop locations array. + + + + + :type number_of_locations: int + :param locations: + + + Specifies the burst stop locations, in samples, to store in the NI-RFSG session. + + + + + :type locations: array.array("d") + +set_waveform_marker_event_locations +----------------------------------- + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: set_waveform_marker_event_locations(number_of_locations, locations) + + Configures the marker locations associated with waveform and marker in the NI-RFSG session. + + **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + + + + + .. tip:: This method can be called on specific channels within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container channels to specify a subset, + and then call this method on the result. + + Example: :py:meth:`my_session.channels[ ... ].set_waveform_marker_event_locations` + + To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + + Example: :py:meth:`my_session.set_waveform_marker_event_locations` + + + :param number_of_locations: + + + Specifies the size of the locations array. + + + + + :type number_of_locations: int + :param locations: + + + Specifies the marker location, in samples, to store in the NI-RFSG database. + + + + + :type locations: array.array("d") + unlock ------ @@ -7293,7 +7979,7 @@ instrument_firmware_revision **High-Level Methods**: - - :py:meth:`nirfsg.Session.RevisionQuery` + - :py:meth:`nirfsg.Session.revision_query` The following table lists the characteristics of this property. @@ -12422,7 +13108,7 @@ write_waveform_burst_detection .. py:attribute:: write_waveform_burst_detection - Enables the detection of burst start and burst stop locations in the waveform. You can read the detected burst start and burst stop locations using :py:meth:`nirfsg.Session._get_waveform_burst_start_locations` and :py:meth:`nirfsg.Session._get_waveform_burst_stop_locations` methods respectively. + Enables the detection of burst start and burst stop locations in the waveform. You can read the detected burst start and burst stop locations using :py:meth:`nirfsg.Session.get_waveform_burst_start_locations` and :py:meth:`nirfsg.Session.get_waveform_burst_stop_locations` methods respectively. **Default Value:** :py:data:`~nirfsg.WriteWaveformBurstDetection.DISABLE` diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index dc194ec70..fdd58a073 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -59,6 +59,8 @@ def __init__(self, ctypes_library): self.niRFSG_Disable_cfunc = None self.niRFSG_DisableScriptTrigger_cfunc = None self.niRFSG_DisableStartTrigger_cfunc = None + self.niRFSG_ErrorMessage_cfunc = None + self.niRFSG_ErrorQuery_cfunc = None self.niRFSG_ExportSignal_cfunc = None self.niRFSG_GetAttributeViBoolean_cfunc = None self.niRFSG_GetAttributeViInt32_cfunc = None @@ -87,6 +89,7 @@ def __init__(self, ctypes_library): self.niRFSG_ResetAttribute_cfunc = None self.niRFSG_ResetDevice_cfunc = None self.niRFSG_ResetWithDefaults_cfunc = None + self.niRFSG_RevisionQuery_cfunc = None self.niRFSG_SaveConfigurationsToFile_cfunc = None self.niRFSG_SelectArbWaveform_cfunc = None self.niRFSG_SelfCal_cfunc = None @@ -436,6 +439,22 @@ def niRFSG_DisableStartTrigger(self, vi): # noqa: N802 self.niRFSG_DisableStartTrigger_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_DisableStartTrigger_cfunc(vi) + def niRFSG_ErrorMessage(self, vi, error_code, error_message): # noqa: N802 + with self._func_lock: + if self.niRFSG_ErrorMessage_cfunc is None: + self.niRFSG_ErrorMessage_cfunc = self._get_library_function('niRFSG_ErrorMessage') + self.niRFSG_ErrorMessage_cfunc.argtypes = [ViSession, ViStatus, ctypes.POINTER(ViChar)] # noqa: F405 + self.niRFSG_ErrorMessage_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_ErrorMessage_cfunc(vi, error_code, error_message) + + def niRFSG_ErrorQuery(self, vi, error_code, error_message): # noqa: N802 + with self._func_lock: + if self.niRFSG_ErrorQuery_cfunc is None: + self.niRFSG_ErrorQuery_cfunc = self._get_library_function('niRFSG_ErrorQuery') + self.niRFSG_ErrorQuery_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt32), ctypes.POINTER(ViChar)] # noqa: F405 + self.niRFSG_ErrorQuery_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_ErrorQuery_cfunc(vi, error_code, error_message) + def niRFSG_ExportSignal(self, vi, signal, signal_identifier, output_terminal): # noqa: N802 with self._func_lock: if self.niRFSG_ExportSignal_cfunc is None: @@ -660,6 +679,14 @@ def niRFSG_ResetWithDefaults(self, vi): # noqa: N802 self.niRFSG_ResetWithDefaults_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_ResetWithDefaults_cfunc(vi) + def niRFSG_RevisionQuery(self, vi, instrument_driver_revision, firmware_revision): # noqa: N802 + with self._func_lock: + if self.niRFSG_RevisionQuery_cfunc is None: + self.niRFSG_RevisionQuery_cfunc = self._get_library_function('niRFSG_RevisionQuery') + self.niRFSG_RevisionQuery_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ctypes.POINTER(ViChar)] # noqa: F405 + self.niRFSG_RevisionQuery_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_RevisionQuery_cfunc(vi, instrument_driver_revision, firmware_revision) + def niRFSG_SaveConfigurationsToFile(self, vi, channel_name, file_path): # noqa: N802 with self._func_lock: if self.niRFSG_SaveConfigurationsToFile_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index 0646b26fd..185470955 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -383,6 +383,22 @@ def disable_start_trigger(self): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def error_message(self, error_code, error_message): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + error_code_ctype = _visatype.ViStatus(error_code) # case S150 + error_message_ctype = ctypes.create_string_buffer(error_message.encode(self._encoding)) # case C020 + error_code = self._library.niRFSG_ErrorMessage(vi_ctype, error_code_ctype, error_message_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True) + return + + def error_query(self): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + error_code_ctype = _visatype.ViInt32() # case S220 + error_message_ctype = (_visatype.ViChar * 256)() # case C070 + error_code = self._library.niRFSG_ErrorQuery(vi_ctype, None if error_code_ctype is None else (ctypes.pointer(error_code_ctype)), error_message_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return int(error_code_ctype.value), error_message_ctype.value.decode(self._encoding) + def export_signal(self, signal, signal_identifier, output_terminal): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 signal_ctype = _visatype.ViInt32(signal.value) # case S130 @@ -515,32 +531,38 @@ def get_stream_endpoint_handle(self, stream_endpoint): # noqa: N802 def get_waveform_burst_start_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 + number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S210 + locations_size = number_of_locations # case B600 + locations_array = array.array("d", [0]) * locations_size # case B600 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B600 required_size_ctype = _visatype.ViInt32() # case S220 - error_code = self._library.niRFSG_GetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype)), None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) + error_code = self._library.niRFSG_GetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype, None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value), int(required_size_ctype.value) + return locations_array, int(required_size_ctype.value) def get_waveform_burst_stop_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 + number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S210 + locations_size = number_of_locations # case B600 + locations_array = array.array("d", [0]) * locations_size # case B600 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B600 required_size_ctype = _visatype.ViInt32() # case S220 - error_code = self._library.niRFSG_GetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype)), None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) + error_code = self._library.niRFSG_GetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype, None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value), int(required_size_ctype.value) + return locations_array, int(required_size_ctype.value) def get_waveform_marker_event_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 + number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S210 + locations_size = number_of_locations # case B600 + locations_array = array.array("d", [0]) * locations_size # case B600 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B600 required_size_ctype = _visatype.ViInt32() # case S220 - error_code = self._library.niRFSG_GetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype)), None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) + error_code = self._library.niRFSG_GetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype, None if required_size_ctype is None else (ctypes.pointer(required_size_ctype))) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value), int(required_size_ctype.value) + return locations_array, int(required_size_ctype.value) def init_with_options(self, resource_name, id_query, reset_device, option_string): # noqa: N802 resource_name_ctype = ctypes.create_string_buffer(resource_name.encode(self._encoding)) # case C020 @@ -629,6 +651,14 @@ def reset_with_defaults(self): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + def revision_query(self): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + instrument_driver_revision_ctype = (_visatype.ViChar * 256)() # case C070 + firmware_revision_ctype = (_visatype.ViChar * 256)() # case C070 + error_code = self._library.niRFSG_RevisionQuery(vi_ctype, instrument_driver_revision_ctype, firmware_revision_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return instrument_driver_revision_ctype.value.decode(self._encoding), firmware_revision_ctype.value.decode(self._encoding) + def save_configurations_to_file(self, channel_name, file_path): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 @@ -740,32 +770,35 @@ def set_attribute_vi_string(self, channel_name, attribute, value): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def set_waveform_burst_start_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_burst_start_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + number_of_locations_ctype = _visatype.ViInt32(0 if locations is None else len(locations)) # case S160 + locations_array = _convert_to_array(value=locations, array_type="d") # case B550 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B550 + error_code = self._library.niRFSG_SetWaveformBurstStartLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return - def set_waveform_burst_stop_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_burst_stop_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + number_of_locations_ctype = _visatype.ViInt32(0 if locations is None else len(locations)) # case S160 + locations_array = _convert_to_array(value=locations, array_type="d") # case B550 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B550 + error_code = self._library.niRFSG_SetWaveformBurstStopLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return - def set_waveform_marker_event_locations(self, channel_name, number_of_locations): # noqa: N802 + def set_waveform_marker_event_locations(self, channel_name, number_of_locations, locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 - number_of_locations_ctype = _visatype.ViInt32(number_of_locations) # case S150 - locations_ctype = _visatype.ViReal64() # case S220 - error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, None if locations_ctype is None else (ctypes.pointer(locations_ctype))) + number_of_locations_ctype = _visatype.ViInt32(0 if locations is None else len(locations)) # case S160 + locations_array = _convert_to_array(value=locations, array_type="d") # case B550 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations_array, library_type=_visatype.ViReal64) # case B550 + error_code = self._library.niRFSG_SetWaveformMarkerEventLocations(vi_ctype, channel_name_ctype, number_of_locations_ctype, locations_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return float(locations_ctype.value) + return def unlock(self): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index c81c41bad..00c107f85 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -2625,7 +2625,7 @@ class _SessionBase(object): **High-Level Methods**: - - RevisionQuery + - revision_query ''' instrument_manufacturer = _attributes.AttributeViString(1050511) '''Type: str @@ -5294,7 +5294,7 @@ class _SessionBase(object): write_waveform_burst_detection = _attributes.AttributeEnum(_attributes.AttributeViInt32, enums.WriteWaveformBurstDetection, 1150273) '''Type: enums.WriteWaveformBurstDetection - Enables the detection of burst start and burst stop locations in the waveform. You can read the detected burst start and burst stop locations using _get_waveform_burst_start_locations and _get_waveform_burst_stop_locations methods respectively. + Enables the detection of burst start and burst stop locations in the waveform. You can read the detected burst start and burst stop locations using get_waveform_burst_start_locations and get_waveform_burst_stop_locations methods respectively. **Default Value:** WriteWaveformBurstDetection.DISABLE @@ -5586,6 +5586,25 @@ def check_attribute_vi_string(self, attribute, value): ''' self._interpreter.check_attribute_vi_string(self._repeated_capability, attribute, value) + def error_message(self, error_code, error_message): + r'''error_message + + Converts an error code returned by an NI-RFSG method into a user-readable string. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + Args: + error_code (int): Pass the status parameter that is returned from any NI-RFSG method. + + **Default Value** : 0 (VI_SUCCESS) + + error_message (str): Returns the user-readable message string that corresponds to the status code you specify. + + You must pass a ViChar array with at least 256 bytes to this parameter. + + ''' + self._interpreter.error_message(error_code, error_message) + def _get_attribute_vi_boolean(self, attribute): r'''_get_attribute_vi_boolean @@ -5784,8 +5803,9 @@ def _get_attribute_vi_string(self, attribute): value = self._interpreter.get_attribute_vi_string(self._repeated_capability, attribute) return value - def _get_waveform_burst_start_locations(self, number_of_locations): - r'''_get_waveform_burst_start_locations + @ivi_synchronized + def get_waveform_burst_start_locations(self, number_of_locations): + r'''get_waveform_burst_start_locations Returns the burst start locations of the waveform stored in the NI-RFSG session. @@ -5796,18 +5816,18 @@ def _get_waveform_burst_start_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._get_waveform_burst_start_locations` + Example: :py:meth:`my_session.channels[ ... ].get_waveform_burst_start_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._get_waveform_burst_start_locations` + Example: :py:meth:`my_session.get_waveform_burst_start_locations` Args: number_of_locations (int): Specifies the size of the burst start locations array. Returns: - locations (float): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. + locations (array.array("d")): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the CHANNEL_NAME parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. @@ -5821,8 +5841,9 @@ def _get_waveform_burst_start_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_start_locations(self._repeated_capability, number_of_locations) return locations, required_size - def _get_waveform_burst_stop_locations(self, number_of_locations): - r'''_get_waveform_burst_stop_locations + @ivi_synchronized + def get_waveform_burst_stop_locations(self, number_of_locations): + r'''get_waveform_burst_stop_locations Returns the burst stop locations of the waveform stored in the NI-RFSG session. @@ -5833,18 +5854,18 @@ def _get_waveform_burst_stop_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._get_waveform_burst_stop_locations` + Example: :py:meth:`my_session.channels[ ... ].get_waveform_burst_stop_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._get_waveform_burst_stop_locations` + Example: :py:meth:`my_session.get_waveform_burst_stop_locations` Args: number_of_locations (int): Specifies the size of the burst start locations array. Returns: - locations (float): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. + locations (array.array("d")): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the CHANNEL_NAME parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. @@ -5858,8 +5879,9 @@ def _get_waveform_burst_stop_locations(self, number_of_locations): locations, required_size = self._interpreter.get_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) return locations, required_size - def _get_waveform_marker_event_locations(self, number_of_locations): - r'''_get_waveform_marker_event_locations + @ivi_synchronized + def get_waveform_marker_event_locations(self, number_of_locations): + r'''get_waveform_marker_event_locations Returns the marker locations associated with the waveform and the marker stored in the NI-RFSG session. @@ -5870,18 +5892,18 @@ def _get_waveform_marker_event_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._get_waveform_marker_event_locations` + Example: :py:meth:`my_session.channels[ ... ].get_waveform_marker_event_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._get_waveform_marker_event_locations` + Example: :py:meth:`my_session.get_waveform_marker_event_locations` Args: number_of_locations (int): Specifies the size of the locations array. Returns: - locations (float): Returns the marker locations stored in the NI-RFSG database for the channel you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. + locations (array.array("d")): Returns the marker locations stored in the NI-RFSG database for the channel you specified in the CHANNEL_NAME parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. @@ -6273,8 +6295,9 @@ def _set_attribute_vi_string(self, attribute, value): ''' self._interpreter.set_attribute_vi_string(self._repeated_capability, attribute, value) - def _set_waveform_burst_start_locations(self, number_of_locations): - r'''_set_waveform_burst_start_locations + @ivi_synchronized + def set_waveform_burst_start_locations(self, number_of_locations, locations): + r'''set_waveform_burst_start_locations Configures the start location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6285,28 +6308,26 @@ def _set_waveform_burst_start_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._set_waveform_burst_start_locations` + Example: :py:meth:`my_session.channels[ ... ].set_waveform_burst_start_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._set_waveform_burst_start_locations` + Example: :py:meth:`my_session.set_waveform_burst_start_locations` Args: number_of_locations (int): Specifies the size of the burst start locations array. - - Returns: - locations (float): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **CHANNEL_NAME** parameter. This value is expressed in samples. + locations (array.array("d")): Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the CHANNEL_NAME parameter. This value is expressed in samples. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - locations = self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations, locations) - def _set_waveform_burst_stop_locations(self, number_of_locations): - r'''_set_waveform_burst_stop_locations + @ivi_synchronized + def set_waveform_burst_stop_locations(self, number_of_locations, locations): + r'''set_waveform_burst_stop_locations Configures the stop location of the burst in samples where the burst refers to the active portion of a waveform. @@ -6317,25 +6338,23 @@ def _set_waveform_burst_stop_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._set_waveform_burst_stop_locations` + Example: :py:meth:`my_session.channels[ ... ].set_waveform_burst_stop_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._set_waveform_burst_stop_locations` + Example: :py:meth:`my_session.set_waveform_burst_stop_locations` Args: number_of_locations (int): Specifies the size of the burst stop locations array. - - Returns: - locations (float): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. + locations (array.array("d")): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. ''' - locations = self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations, locations) - def _set_waveform_marker_event_locations(self, number_of_locations): - r'''_set_waveform_marker_event_locations + @ivi_synchronized + def set_waveform_marker_event_locations(self, number_of_locations, locations): + r'''set_waveform_marker_event_locations Configures the marker locations associated with waveform and marker in the NI-RFSG session. @@ -6346,22 +6365,19 @@ def _set_waveform_marker_event_locations(self, number_of_locations): Use Python index notation on the repeated capabilities container channels to specify a subset, and then call this method on the result. - Example: :py:meth:`my_session.channels[ ... ]._set_waveform_marker_event_locations` + Example: :py:meth:`my_session.channels[ ... ].set_waveform_marker_event_locations` To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. - Example: :py:meth:`my_session._set_waveform_marker_event_locations` + Example: :py:meth:`my_session.set_waveform_marker_event_locations` Args: number_of_locations (int): Specifies the size of the locations array. - - Returns: - locations (float): Specifies the marker location, in samples, to store in the NI-RFSG database. + locations (array.array("d")): Specifies the marker location, in samples, to store in the NI-RFSG database. ''' - locations = self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations) - return locations + self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations, locations) def unlock(self): '''unlock @@ -7299,6 +7315,25 @@ def disable_start_trigger(self): ''' self._interpreter.disable_start_trigger() + @ivi_synchronized + def error_query(self): + r'''error_query + + Reads an error code and an error message from the instrument error queue. + + **Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860 + + Returns: + error_code (int): Returns the error code read from the instrument error queue. + + error_message (str): Returns the error message string read from the instrument error message queue. + + You must pass a ViChar array with at least 256 bytes. + + ''' + error_code, error_message = self._interpreter.error_query() + return error_code, error_message + def export_signal(self, signal, signal_identifier, output_terminal): r'''export_signal @@ -7804,6 +7839,27 @@ def reset_with_defaults(self): ''' self._interpreter.reset_with_defaults() + @ivi_synchronized + def revision_query(self): + r'''revision_query + + Returns the revision numbers of the NI-RFSG driver and the instrument firmware. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + Returns: + instrument_driver_revision (str): Returns the value of the specific_driver_revision property in the form of a string. + + You must pass a ViChar array with at least 256 bytes. + + firmware_revision (str): Returns the value of the instrument_firmware_revision property in the form of a string. + + You must pass a ViChar array with at least 256 bytes. + + ''' + instrument_driver_revision, firmware_revision = self._interpreter.revision_query() + return instrument_driver_revision, firmware_revision + def select_arb_waveform(self, name): r'''select_arb_waveform diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index e7a01aadd..5108f2480 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -99,6 +99,12 @@ def __init__(self): self._defaults['DisableScriptTrigger']['return'] = 0 self._defaults['DisableStartTrigger'] = {} self._defaults['DisableStartTrigger']['return'] = 0 + self._defaults['ErrorMessage'] = {} + self._defaults['ErrorMessage']['return'] = 0 + self._defaults['ErrorQuery'] = {} + self._defaults['ErrorQuery']['return'] = 0 + self._defaults['ErrorQuery']['errorCode'] = None + self._defaults['ErrorQuery']['errorMessage'] = None self._defaults['ExportSignal'] = {} self._defaults['ExportSignal']['return'] = 0 self._defaults['GetAttributeViBoolean'] = {} @@ -190,6 +196,10 @@ def __init__(self): self._defaults['ResetDevice']['return'] = 0 self._defaults['ResetWithDefaults'] = {} self._defaults['ResetWithDefaults']['return'] = 0 + self._defaults['RevisionQuery'] = {} + self._defaults['RevisionQuery']['return'] = 0 + self._defaults['RevisionQuery']['instrumentDriverRevision'] = None + self._defaults['RevisionQuery']['firmwareRevision'] = None self._defaults['SaveConfigurationsToFile'] = {} self._defaults['SaveConfigurationsToFile']['return'] = 0 self._defaults['SelectArbWaveform'] = {} @@ -219,13 +229,10 @@ def __init__(self): self._defaults['SetAttributeViString']['return'] = 0 self._defaults['SetWaveformBurstStartLocations'] = {} self._defaults['SetWaveformBurstStartLocations']['return'] = 0 - self._defaults['SetWaveformBurstStartLocations']['locations'] = None self._defaults['SetWaveformBurstStopLocations'] = {} self._defaults['SetWaveformBurstStopLocations']['return'] = 0 - self._defaults['SetWaveformBurstStopLocations']['locations'] = None self._defaults['SetWaveformMarkerEventLocations'] = {} self._defaults['SetWaveformMarkerEventLocations']['return'] = 0 - self._defaults['SetWaveformMarkerEventLocations']['locations'] = None self._defaults['UnlockSession'] = {} self._defaults['UnlockSession']['return'] = 0 self._defaults['UnlockSession']['callerHasLock'] = None @@ -459,6 +466,30 @@ def niRFSG_DisableStartTrigger(self, vi): # noqa: N802 return self._defaults['DisableStartTrigger']['return'] return self._defaults['DisableStartTrigger']['return'] + def niRFSG_ErrorMessage(self, vi, error_code, error_message): # noqa: N802 + if self._defaults['ErrorMessage']['return'] != 0: + return self._defaults['ErrorMessage']['return'] + return self._defaults['ErrorMessage']['return'] + + def niRFSG_ErrorQuery(self, vi, error_code, error_message): # noqa: N802 + if self._defaults['ErrorQuery']['return'] != 0: + return self._defaults['ErrorQuery']['return'] + # error_code + if self._defaults['ErrorQuery']['errorCode'] is None: + raise MockFunctionCallError("niRFSG_ErrorQuery", param='errorCode') + if error_code is not None: + error_code.contents.value = self._defaults['ErrorQuery']['errorCode'] + # error_message + if self._defaults['ErrorQuery']['errorMessage'] is None: + raise MockFunctionCallError("niRFSG_ErrorQuery", param='errorMessage') + test_value = self._defaults['ErrorQuery']['errorMessage'] + if type(test_value) is str: + test_value = test_value.encode('ascii') + assert len(error_message) >= len(test_value) + for i in range(len(test_value)): + error_message[i] = test_value[i] + return self._defaults['ErrorQuery']['return'] + def niRFSG_ExportSignal(self, vi, signal, signal_identifier, output_terminal): # noqa: N802 if self._defaults['ExportSignal']['return'] != 0: return self._defaults['ExportSignal']['return'] @@ -647,8 +678,14 @@ def niRFSG_GetWaveformBurstStartLocations(self, vi, channel_name, number_of_loca # locations if self._defaults['GetWaveformBurstStartLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStartLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['GetWaveformBurstStartLocations']['locations'] + test_value = self._defaults['GetWaveformBurstStartLocations']['locations'] + try: + locations_ref = locations.contents + except AttributeError: + locations_ref = locations + assert len(locations_ref) >= len(test_value) + for i in range(len(test_value)): + locations_ref[i] = test_value[i] # required_size if self._defaults['GetWaveformBurstStartLocations']['requiredSize'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStartLocations", param='requiredSize') @@ -662,8 +699,14 @@ def niRFSG_GetWaveformBurstStopLocations(self, vi, channel_name, number_of_locat # locations if self._defaults['GetWaveformBurstStopLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStopLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['GetWaveformBurstStopLocations']['locations'] + test_value = self._defaults['GetWaveformBurstStopLocations']['locations'] + try: + locations_ref = locations.contents + except AttributeError: + locations_ref = locations + assert len(locations_ref) >= len(test_value) + for i in range(len(test_value)): + locations_ref[i] = test_value[i] # required_size if self._defaults['GetWaveformBurstStopLocations']['requiredSize'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStopLocations", param='requiredSize') @@ -677,8 +720,14 @@ def niRFSG_GetWaveformMarkerEventLocations(self, vi, channel_name, number_of_loc # locations if self._defaults['GetWaveformMarkerEventLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformMarkerEventLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['GetWaveformMarkerEventLocations']['locations'] + test_value = self._defaults['GetWaveformMarkerEventLocations']['locations'] + try: + locations_ref = locations.contents + except AttributeError: + locations_ref = locations + assert len(locations_ref) >= len(test_value) + for i in range(len(test_value)): + locations_ref[i] = test_value[i] # required_size if self._defaults['GetWaveformMarkerEventLocations']['requiredSize'] is None: raise MockFunctionCallError("niRFSG_GetWaveformMarkerEventLocations", param='requiredSize') @@ -776,6 +825,29 @@ def niRFSG_ResetWithDefaults(self, vi): # noqa: N802 return self._defaults['ResetWithDefaults']['return'] return self._defaults['ResetWithDefaults']['return'] + def niRFSG_RevisionQuery(self, vi, instrument_driver_revision, firmware_revision): # noqa: N802 + if self._defaults['RevisionQuery']['return'] != 0: + return self._defaults['RevisionQuery']['return'] + # instrument_driver_revision + if self._defaults['RevisionQuery']['instrumentDriverRevision'] is None: + raise MockFunctionCallError("niRFSG_RevisionQuery", param='instrumentDriverRevision') + test_value = self._defaults['RevisionQuery']['instrumentDriverRevision'] + if type(test_value) is str: + test_value = test_value.encode('ascii') + assert len(instrument_driver_revision) >= len(test_value) + for i in range(len(test_value)): + instrument_driver_revision[i] = test_value[i] + # firmware_revision + if self._defaults['RevisionQuery']['firmwareRevision'] is None: + raise MockFunctionCallError("niRFSG_RevisionQuery", param='firmwareRevision') + test_value = self._defaults['RevisionQuery']['firmwareRevision'] + if type(test_value) is str: + test_value = test_value.encode('ascii') + assert len(firmware_revision) >= len(test_value) + for i in range(len(test_value)): + firmware_revision[i] = test_value[i] + return self._defaults['RevisionQuery']['return'] + def niRFSG_SaveConfigurationsToFile(self, vi, channel_name, file_path): # noqa: N802 if self._defaults['SaveConfigurationsToFile']['return'] != 0: return self._defaults['SaveConfigurationsToFile']['return'] @@ -849,31 +921,16 @@ def niRFSG_SetAttributeViString(self, vi, channel_name, attribute, value): # no def niRFSG_SetWaveformBurstStartLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStartLocations']['return'] != 0: return self._defaults['SetWaveformBurstStartLocations']['return'] - # locations - if self._defaults['SetWaveformBurstStartLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformBurstStartLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformBurstStartLocations']['locations'] return self._defaults['SetWaveformBurstStartLocations']['return'] def niRFSG_SetWaveformBurstStopLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformBurstStopLocations']['return'] != 0: return self._defaults['SetWaveformBurstStopLocations']['return'] - # locations - if self._defaults['SetWaveformBurstStopLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformBurstStopLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformBurstStopLocations']['locations'] return self._defaults['SetWaveformBurstStopLocations']['return'] def niRFSG_SetWaveformMarkerEventLocations(self, vi, channel_name, number_of_locations, locations): # noqa: N802 if self._defaults['SetWaveformMarkerEventLocations']['return'] != 0: return self._defaults['SetWaveformMarkerEventLocations']['return'] - # locations - if self._defaults['SetWaveformMarkerEventLocations']['locations'] is None: - raise MockFunctionCallError("niRFSG_SetWaveformMarkerEventLocations", param='locations') - if locations is not None: - locations.contents.value = self._defaults['SetWaveformMarkerEventLocations']['locations'] return self._defaults['SetWaveformMarkerEventLocations']['return'] def niRFSG_UnlockSession(self, vi, caller_has_lock): # noqa: N802 @@ -988,6 +1045,10 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_DisableScriptTrigger.return_value = 0 mock_library.niRFSG_DisableStartTrigger.side_effect = MockFunctionCallError("niRFSG_DisableStartTrigger") mock_library.niRFSG_DisableStartTrigger.return_value = 0 + mock_library.niRFSG_ErrorMessage.side_effect = MockFunctionCallError("niRFSG_ErrorMessage") + mock_library.niRFSG_ErrorMessage.return_value = 0 + mock_library.niRFSG_ErrorQuery.side_effect = MockFunctionCallError("niRFSG_ErrorQuery") + mock_library.niRFSG_ErrorQuery.return_value = 0 mock_library.niRFSG_ExportSignal.side_effect = MockFunctionCallError("niRFSG_ExportSignal") mock_library.niRFSG_ExportSignal.return_value = 0 mock_library.niRFSG_GetAttributeViBoolean.side_effect = MockFunctionCallError("niRFSG_GetAttributeViBoolean") @@ -1044,6 +1105,8 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_ResetDevice.return_value = 0 mock_library.niRFSG_ResetWithDefaults.side_effect = MockFunctionCallError("niRFSG_ResetWithDefaults") mock_library.niRFSG_ResetWithDefaults.return_value = 0 + mock_library.niRFSG_RevisionQuery.side_effect = MockFunctionCallError("niRFSG_RevisionQuery") + mock_library.niRFSG_RevisionQuery.return_value = 0 mock_library.niRFSG_SaveConfigurationsToFile.side_effect = MockFunctionCallError("niRFSG_SaveConfigurationsToFile") mock_library.niRFSG_SaveConfigurationsToFile.return_value = 0 mock_library.niRFSG_SelectArbWaveform.side_effect = MockFunctionCallError("niRFSG_SelectArbWaveform") diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index b3dd8ba68..c56481ee3 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -2010,6 +2010,112 @@ 'returns': 'ViStatus', 'use_session_lock': False }, + 'ErrorMessage': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n\n Converts an error code returned by an NI-RFSG function into a user-readable string.\n\n **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n ' + }, + 'included_in_proto': True, + 'is_error_handling': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': ' The ViSession handle that you obtain from nirfsg_Init or nirfsg_InitWithOptions. The handle identifies a particular instrument session.\n\n You can pass VI_NULL for this parameter. Passing VI_NULL is useful when nirfsg_Init or nirfsg_InitWithOptions fails.\n\n **Default Value** : VI_NULL\n\n ' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': ' Pass the status parameter that is returned from any NI-RFSG function.\n\n **Default Value** : 0 (VI_SUCCESS)\n\n ' + }, + 'name': 'errorCode', + 'type': 'ViStatus', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': ' Returns the user-readable message string that corresponds to the status code you specify.\n\n You must pass a ViChar array with at least 256 bytes to this parameter.\n\n ' + }, + 'name': 'errorMessage', + 'size': { + 'mechanism': 'fixed', + 'value': 256 + }, + 'type': 'ViChar[]', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'ErrorQuery': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n\n Reads an error code and an error message from the instrument error queue.\n\n **Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860\n ' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the error code read from the instrument error queue.' + }, + 'name': 'errorCode', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': ' Returns the error message string read from the instrument error message queue.\n\n You must pass a ViChar array with at least 256 bytes.\n ' + }, + 'name': 'errorMessage', + 'size': { + 'mechanism': 'fixed', + 'value': 256 + }, + 'type': 'ViChar[]', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus' + }, 'ExportSignal': { 'codegen_method': 'public', 'documentation': { @@ -3046,8 +3152,218 @@ 'documentation': { 'description': 'Returns the reader endpoint handle that is used with NI-P2P to create a stream with the NI-RFSG device as an endpoint.' }, - 'name': 'readerHandle', - 'type': 'ViUInt32', + 'name': 'readerHandle', + 'type': 'ViUInt32', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'GetWaveformBurstStartLocations': { + 'codegen_method': 'private', + 'documentation': { + 'description': ' \n Returns the burst start locations of the waveform stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the burst start locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + }, + 'name': 'locations', + 'type': 'ViReal64', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the required size for the output array if you pass NULL to NIRFSG_ATTR_LOCATIONS parameter.' + }, + 'name': 'requiredSize', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'GetWaveformBurstStopLocations': { + 'codegen_method': 'private', + 'documentation': { + 'description': ' \n\n Returns the burst stop locations of the waveform stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the burst start locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + }, + 'name': 'locations', + 'type': 'ViReal64', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the required size for the output array if you pass NULL to NIRFSG_ATTR_LOCATIONS parameter.' + }, + 'name': 'requiredSize', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'GetWaveformMarkerEventLocations': { + 'codegen_method': 'private', + 'documentation': { + 'description': ' \n Returns the marker locations associated with the waveform and the marker stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the marker locations stored in the NI-RFSG database for the channel you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + }, + 'name': 'locations', + 'type': 'ViReal64', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': 'Returns the required size for the output array if you pass NULL to **Locations** parameter.' + }, + 'name': 'requiredSize', + 'type': 'ViInt32', 'use_array': False, 'use_in_python_api': True } @@ -3056,12 +3372,11 @@ 'use_session_lock': False }, 'GetWaveformBurstStartLocations': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': ' \n Returns the burst start locations of the waveform stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' }, 'included_in_proto': True, - 'is_error_handling': False, 'method_templates': [ { 'documentation_filename': 'default_method', @@ -3104,11 +3419,15 @@ { 'direction': 'out', 'documentation': { - 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the NIRFSG_ATTR_CHANNEL_NAME parameter. This value is expressed in samples.' }, 'name': 'locations', - 'type': 'ViReal64', - 'use_array': False, + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, 'use_in_python_api': True }, { @@ -3122,16 +3441,14 @@ 'use_in_python_api': True } ], - 'returns': 'ViStatus', - 'use_session_lock': False + 'returns': 'ViStatus' }, 'GetWaveformBurstStopLocations': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': ' \n\n Returns the burst stop locations of the waveform stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' }, 'included_in_proto': True, - 'is_error_handling': False, 'method_templates': [ { 'documentation_filename': 'default_method', @@ -3174,11 +3491,15 @@ { 'direction': 'out', 'documentation': { - 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the NIRFSG_ATTR_CHANNEL_NAME parameter. This value is expressed in samples.' }, 'name': 'locations', - 'type': 'ViReal64', - 'use_array': False, + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, 'use_in_python_api': True }, { @@ -3192,16 +3513,14 @@ 'use_in_python_api': True } ], - 'returns': 'ViStatus', - 'use_session_lock': False + 'returns': 'ViStatus' }, 'GetWaveformMarkerEventLocations': { - 'codegen_method': 'private', + 'codegen_method': 'public', 'documentation': { 'description': ' \n Returns the marker locations associated with the waveform and the marker stored in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' }, 'included_in_proto': True, - 'is_error_handling': False, 'method_templates': [ { 'documentation_filename': 'default_method', @@ -3244,11 +3563,15 @@ { 'direction': 'out', 'documentation': { - 'description': 'Returns the marker locations stored in the NI-RFSG database for the channel you specified in the **NIRFSG_ATTR_CHANNEL_NAME** parameter. This value is expressed in samples.' + 'description': 'Returns the marker locations stored in the NI-RFSG database for the channel you specified in the NIRFSG_ATTR_CHANNEL_NAME parameter. This value is expressed in samples.' }, 'name': 'locations', - 'type': 'ViReal64', - 'use_array': False, + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, 'use_in_python_api': True }, { @@ -3262,8 +3585,7 @@ 'use_in_python_api': True } ], - 'returns': 'ViStatus', - 'use_session_lock': False + 'returns': 'ViStatus' }, 'InitWithOptions': { 'codegen_method': 'private', @@ -3839,6 +4161,62 @@ 'returns': 'ViStatus', 'use_session_lock': False }, + 'RevisionQuery': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n\n Returns the revision numbers of the NI-RFSG driver and the instrument firmware.\n\n **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n ' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': ' Returns the value of the NIRFSG_ATTR_SPECIFIC_DRIVER_REVISION attribute in the form of a string.\n\n You must pass a ViChar array with at least 256 bytes.\n\n ' + }, + 'name': 'instrumentDriverRevision', + 'size': { + 'mechanism': 'fixed', + 'value': 256 + }, + 'type': 'ViChar[]', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'out', + 'documentation': { + 'description': ' Returns the value of the NIRFSG_ATTR_INSTRUMENT_FIRMWARE_REVISION attribute in the form of a string.\n\n You must pass a ViChar array with at least 256 bytes.\n\n ' + }, + 'name': 'firmwareRevision', + 'size': { + 'mechanism': 'fixed', + 'value': 256 + }, + 'type': 'ViChar[]', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus' + }, 'SaveConfigurationsToFile': { 'codegen_method': 'public', 'documentation': { @@ -4862,6 +5240,192 @@ 'returns': 'ViStatus', 'use_session_lock': False }, + 'SetWaveformBurstStartLocations': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n Configures the start location of the burst in samples where the burst refers to the active portion of a waveform.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the burst start locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Returns the burst start locations stored in the NI-RFSG session for the waveform that you specified in the NIRFSG_ATTR_CHANNEL_NAME parameter. This value is expressed in samples.' + }, + 'name': 'locations', + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus' + }, + 'SetWaveformBurstStopLocations': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n\n Configures the stop location of the burst in samples where the burst refers to the active portion of a waveform.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the burst stop locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the burst stop locations, in samples, to store in the NI-RFSG session.' + }, + 'name': 'locations', + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus' + }, + 'SetWaveformMarkerEventLocations': { + 'codegen_method': 'public', + 'documentation': { + 'description': ' \n\n Configures the marker locations associated with waveform and marker in the NI-RFSG session.\n\n **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842\n ' + }, + 'included_in_proto': True, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'default_method', + 'method_python_name_suffix': '', + 'session_filename': 'default_method' + } + ], + 'parameters': [ + { + 'direction': 'in', + 'documentation': { + 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' + }, + 'name': 'vi', + 'type': 'ViSession', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + }, + 'name': 'channelName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the size of the locations array.' + }, + 'name': 'numberOfLocations', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the marker location, in samples, to store in the NI-RFSG database.' + }, + 'name': 'locations', + 'size': { + 'mechanism': 'passed-in', + 'value': 'numberOfLocations' + }, + 'type': 'ViReal64[]', + 'use_array': True, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus' + }, 'UnlockSession': { 'codegen_method': 'public', 'documentation': { From b2dc8c71574c65992664dc78cd2e0e32c05315fb Mon Sep 17 00:00:00 2001 From: Vagupta Date: Tue, 17 Jun 2025 16:02:41 +0530 Subject: [PATCH 2/3] updated metadata after resolving conflicts --- docs/nirfsg/class.rst | 296 +----------------- generated/nirfsg/nirfsg/_library.py | 17 +- .../nirfsg/nirfsg/_library_interpreter.py | 14 + generated/nirfsg/nirfsg/session.py | 9 +- .../nirfsg/nirfsg/unit_tests/_mock_helper.py | 16 + src/nirfsg/metadata/functions.py | 72 ----- 6 files changed, 54 insertions(+), 370 deletions(-) diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index ee9f76b65..78f1775ca 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -1677,92 +1677,20 @@ error_query -error_message +export_signal ------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: error_message(error_code, error_message) - - Converts an error code returned by an NI-RFSG method into a user-readable string. - - **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - - - - - :param error_code: - - - Pass the status parameter that is returned from any NI-RFSG method. - - **Default Value** : 0 (VI_SUCCESS) - - - - - :type error_code: int - :param error_message: - - - Returns the user-readable message string that corresponds to the status code you specify. - - You must pass a ViChar array with at least 256 bytes to this parameter. - - - - - :type error_message: str - -error_query ------------ - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: error_query() - - Reads an error code and an error message from the instrument error queue. - - **Supported Devices** : PXI-5610, PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860 - - - - - - :rtype: tuple (error_code, error_message) + .. py:method:: export_signal(signal, signal_identifier, output_terminal) - WHERE - - error_code (int): - - - Returns the error code read from the instrument error queue. - - - - - error_message (str): - - - Returns the error message string read from the instrument error message queue. - - You must pass a ViChar array with at least 256 bytes. + Routes signals (triggers, clocks, and events) to a specified output terminal. - - - - -error_message -------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: error_message(error_code, error_message) + The NI-RFSG device must be in the Configuration state before you call this method. - Converts an error code returned by an NI-RFSG method into a user-readable string. + You can clear a previously routed signal by exporting the signal to "" (empty string). - **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + **Supported Devices** :PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 **Related Topics** @@ -1810,28 +1738,8 @@ error_message :param signal_identifier: - Specifies which instance of the selected signal to export. This parameter is useful when you set the :py:attr:`nirfsg.Session.SIGNAL` parameter to :py:data:`~nirfsg.NIRFSG_VAL_SCRIPT_TRIGGER` or :py:data:`~nirfsg.NIRFSG_VAL_MARKER_EVENT`. Otherwise, set the :py:attr:`nirfsg.Session.SIGNAL_IDENTIFIER` parameter to '' (empty string). **Possible Values** : Specifies which instance of the selected signal to export. This parameter is useful when you set the :py:attr:`nirfsg.Session.SIGNAL` parameter to :py:data:`~nirfsg.NIRFSG_VAL_SCRIPT_TRIGGER` or :py:data:`~nirfsg.NIRFSG_VAL_MARKER_EVENT`. Otherwise, set the :py:attr:`nirfsg.Session.SIGNAL_IDENTIFIER` parameter to '' (empty string). **Possible Values** : - +----------------+-----------------------------+ - | Possible Value | Description | - +================+=============================+ - | marker0 | Specifies Marker 0. | - +----------------+-----------------------------+ - | marker1 | Specifies Marker 1. | - +----------------+-----------------------------+ - | marker2 | Specifies Marker 2. | - +----------------+-----------------------------+ - | marker3 | Specifies Marker 3. | - +----------------+-----------------------------+ - | scriptTrigger0 | Specifies Script Trigger 0. | - +----------------+-----------------------------+ - | scriptTrigger1 | Specifies Script Trigger 1. | - +----------------+-----------------------------+ - | scriptTrigger2 | Specifies Script Trigger 2. | - +----------------+-----------------------------+ - | scriptTrigger3 | Specifies Script Trigger 3. | - +----------------+-----------------------------+ +----------------+-----------------------------+ | Possible Value | Description | +================+=============================+ @@ -1857,12 +1765,10 @@ error_message .. 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. - :type signal_identifier: str :type signal_identifier: str :param output_terminal: - Specifies the terminal where the signal is exported. You can choose not to export any signal. For the PXIe-5841 with PXIe-5655, the signal is exported to the terminal on the PXIe-5841. **Possible Values** : Specifies the terminal where the signal is exported. You can choose not to export any signal. For the PXIe-5841 with PXIe-5655, the signal is exported to the terminal on the PXIe-5841. **Possible Values** : +----------------+--------------------------------------------------------------------------------------------+ @@ -1994,135 +1900,6 @@ get_channel_name - +----------------+--------------------------------------------------------------------------------------------+ - | Possible Value | Description | - +================+============================================================================================+ - | ClkOut | Exports the Reference Clock signal to the CLK OUT connector of the device. | - +----------------+--------------------------------------------------------------------------------------------+ - | | The Reference Clock signal is not exported. | - +----------------+--------------------------------------------------------------------------------------------+ - | RefOut | Exports the Reference Clock signal to the REF OUT connector of the device. | - +----------------+--------------------------------------------------------------------------------------------+ - | RefOut2 | Exports the Reference Clock signal to the REF OUT2 connector of the device, if applicable. | - +----------------+--------------------------------------------------------------------------------------------+ - - - :type output_terminal: str - -get_all_named_waveform_names ----------------------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: get_all_named_waveform_names() - - Return names of the waveforms present in the memory. - - **Supported Devices** :PXIe-5830/5831/5840/5841/5842E - - - - - - :rtype: tuple (waveform_names, actual_buffer_size) - - WHERE - - waveform_names (str): - - - Returns a string having waveform names separated by commas. - - - - - actual_buffer_size (int): - - - Fetch the number of bytes needed to pass in the :py:attr:`nirfsg.Session.BUFFER_SIZE` parameter. - - It can be fetch by passing VI_NULL in the :py:attr:`nirfsg.Session.WAVEFORM_NAMES` parameter. - - - - .. note:: One or more of the referenced properties are not in the Python API for this driver. - - - -get_all_script_names --------------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: get_all_script_names() - - Return names of the scripts present in the memory. - - **Supported Devices** :PXIe-5830/5831/5840/5841/5842E - - - - - - :rtype: tuple (script_names, actual_buffer_size) - - WHERE - - script_names (str): - - - Returns a string having script names separated by commas. - - - - - actual_buffer_size (int): - - - Fetch the number of bytes needed to pass in the :py:attr:`nirfsg.Session.BUFFER_SIZE` parameter. - - It can be fetch by passing VI_NULL in the :py:attr:`nirfsg.Session.SCRIPT_NAMES` parameter. - - - - .. note:: One or more of the referenced properties are not in the Python API for this driver. - - - -get_channel_name ----------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: get_channel_name(index) - - Returns the channel string that is in the channel table at an index you specify. - - **Supported Devices** : PXI-5670/5671, PXIe-5672/5673/5673E - - - - - - :param index: - - - Specifies a one-based index into the channel table. - - - - - :type index: int - - :rtype: str - :return: - - - Returns a channel string from the channel table at the index you specify in the Index parameter. Do not modify the contents of the channel string. - - - - get_error --------- @@ -2880,7 +2657,7 @@ reset Generally, calling this method instead of the :py:meth:`nirfsg.Session.reset_device` method is acceptable. The :py:meth:`nirfsg.Session.reset` method executes faster than the :py:meth:`nirfsg.Session.reset_device` method. - To avoid resetting routes on the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using the :py:meth:`nirfsg.Session.reset_with_options` method, with **stepsToOmit** set to :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` . + To avoid resetting routes on the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using the :py:meth:`nirfsg.Session.ResetWithOptions` method, with **stepsToOmit** set to :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` . **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 @@ -2972,59 +2749,6 @@ reset_with_defaults -reset_with_options ------------------- - - .. py:currentmodule:: nirfsg.Session - - .. py:method:: reset_with_options(steps_to_omit) - - Resets all properties to default values and specifies steps to omit during the reset process, such as signal routes. - - By default, this method exhibits the same behavior as :py:meth:`nirfsg.Session.reset`. You can specify steps to omit using the steps to omit parameter. For example, if you specify :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` for the :py:attr:`nirfsg.Session.STEPS_TO_OMIT` parameter, this method does not release signal routes during the reset process. - - When routes of signals between two devices are released, they are released regardless of which device created the route. - - To avoid resetting routes on PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using this method instead of :py:meth:`nirfsg.Session.reset`, with :py:attr:`nirfsg.Session.STEPS_TO_OMIT` set to :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES`. - - **Supported Devices** : PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 - - **Related Topics** - - `Triggers `_ - - `Events `_ - - - - .. note:: One or more of the referenced properties are not in the Python API for this driver. - - - - :param steps_to_omit: - - - Specifies a list of steps to skip during the reset process. The default value is :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.NONE`, which specifies that no step is omitted during reset. **Defined Values** : - - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | Name | Value | Description | - +===================================================================+=========+============================================================================================================================================================================================================+ - | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.NONE` | 0 (0x0) | No step is omitted during reset. | - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.WAVEFORMS` | 1 (0x1) | Omits clearing waveforms. | - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.SCRIPTS` | 2 (0x2) | Omits clearing scripts. | - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` | 4 (0x4) | Omits the routing reset step. Routing is preserved after a reset. However, routing related properties are reset to default, and routing is released if the default properties are committed after a reset. | - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - | :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.DEEMBEDDING_TABLES` | 8 (0x8) | Omits deleting de-embedding tables. This step is valid only for the PXIe-5830/5831/5832/5840. | - +-------------------------------------------------------------------+---------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - - .. note:: :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` is not supported in external calibration or alignment sessions. - - - :type steps_to_omit: :py:data:`nirfsg.ResetWithOptionsStepsToOmit` - revision_query -------------- @@ -11474,7 +11198,7 @@ rf_blanking_source PXIe-5840/5841: RF blanking does not occur for frequencies below 120MHz. - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.reset_with_options` or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.ResetWithOptions` or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. **Default Value:** "" (empty string) @@ -13159,7 +12883,7 @@ waveform_rf_blanking | :py:data:`~nirfsg.NIRFSG_VAL_MARKER0`, :py:data:`~nirfsg.NIRFSG_VAL_MARKER1`, :py:data:`~nirfsg.NIRFSG_VAL_MARKER2`, or :py:data:`~nirfsg.NIRFSG_VAL_MARKER3` | :py:data:`~nirfsg.RFBlanking.ENABLE` | Error is shown. | +---------------------------------------------------------------------------------------------------------------------------------------------------------------+------------------------------------------------+-----------------------------------------------------------------------------------------------------------+ - .. note:: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.reset_with_options` or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + .. note:: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.ResetWithOptions` or `niRFSA_ResetWithOptions `_. 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. @@ -13335,7 +13059,7 @@ write_waveform_burst_detection .. note:: - When you download a waveform using :py:meth:`nirfsg.Session.ReadAndDownloadWaveformFromFileTdms` method and if :py:attr:`nirfsg.Session.waveform_rf_blanking` property is enabled, you must set the :py:attr:`nirfsg.Session.write_waveform_burst_detection` property to :py:data:`~nirfsg.WriteWaveformBurstDetection.DISABLE`. - - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.reset_with_options` or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any :py:meth:`nirfsg.Session.reset` or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call :py:meth:`nirfsg.Session.ResetWithOptions` or `niRFSA_ResetWithOptions `_. 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. diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index da92c4076..d675ae656 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -77,6 +77,7 @@ def __init__(self, ctypes_library): self.niRFSG_GetSelfCalibrationDateAndTime_cfunc = None self.niRFSG_GetSelfCalibrationTemperature_cfunc = None self.niRFSG_GetStreamEndpointHandle_cfunc = None + self.niRFSG_GetTerminalName_cfunc = None self.niRFSG_GetWaveformBurstStartLocations_cfunc = None self.niRFSG_GetWaveformBurstStopLocations_cfunc = None self.niRFSG_GetWaveformMarkerEventLocations_cfunc = None @@ -586,6 +587,14 @@ def niRFSG_GetStreamEndpointHandle(self, vi, stream_endpoint, reader_handle): # self.niRFSG_GetStreamEndpointHandle_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_GetStreamEndpointHandle_cfunc(vi, stream_endpoint, reader_handle) + def niRFSG_GetTerminalName(self, vi, signal, signal_identifier, buffer_size, terminal_name): # noqa: N802 + with self._func_lock: + if self.niRFSG_GetTerminalName_cfunc is None: + self.niRFSG_GetTerminalName_cfunc = self._get_library_function('niRFSG_GetTerminalName') + self.niRFSG_GetTerminalName_cfunc.argtypes = [ViSession, ViInt32, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViChar)] # noqa: F405 + self.niRFSG_GetTerminalName_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_GetTerminalName_cfunc(vi, signal, signal_identifier, buffer_size, terminal_name) + def niRFSG_GetWaveformBurstStartLocations(self, vi, channel_name, number_of_locations, locations, required_size): # noqa: N802 with self._func_lock: if self.niRFSG_GetWaveformBurstStartLocations_cfunc is None: @@ -706,14 +715,6 @@ def niRFSG_ResetWithDefaults(self, vi): # noqa: N802 self.niRFSG_ResetWithDefaults_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_ResetWithDefaults_cfunc(vi) - def niRFSG_ResetWithOptions(self, vi, steps_to_omit): # noqa: N802 - with self._func_lock: - if self.niRFSG_ResetWithOptions_cfunc is None: - self.niRFSG_ResetWithOptions_cfunc = self._get_library_function('niRFSG_ResetWithOptions') - self.niRFSG_ResetWithOptions_cfunc.argtypes = [ViSession, ViUInt64] # noqa: F405 - self.niRFSG_ResetWithOptions_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_ResetWithOptions_cfunc(vi, steps_to_omit) - def niRFSG_RevisionQuery(self, vi, instrument_driver_revision, firmware_revision): # noqa: N802 with self._func_lock: if self.niRFSG_RevisionQuery_cfunc is None: diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index 77c601b75..bd2eedbd7 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -567,6 +567,20 @@ def get_stream_endpoint_handle(self, stream_endpoint): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return int(reader_handle_ctype.value) + def get_terminal_name(self, signal, signal_identifier): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + signal_ctype = _visatype.ViInt32(signal.value) # case S130 + signal_identifier_ctype = ctypes.create_string_buffer(signal_identifier.encode(self._encoding)) # case C020 + buffer_size_ctype = _visatype.ViInt32() # case S170 + terminal_name_ctype = None # case C050 + error_code = self._library.niRFSG_GetTerminalName(vi_ctype, signal_ctype, signal_identifier_ctype, buffer_size_ctype, terminal_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False) + buffer_size_ctype = _visatype.ViInt32(error_code) # case S180 + terminal_name_ctype = (_visatype.ViChar * buffer_size_ctype.value)() # case C060 + error_code = self._library.niRFSG_GetTerminalName(vi_ctype, signal_ctype, signal_identifier_ctype, buffer_size_ctype, terminal_name_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return terminal_name_ctype.value.decode(self._encoding) + def get_waveform_burst_start_locations(self, channel_name, number_of_locations): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 831e898ef..2a5acff4e 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -4341,7 +4341,7 @@ class _SessionBase(object): PXIe-5840/5841: RF blanking does not occur for frequencies below 120MHz. - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call reset_with_options or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. **Default Value:** "" (empty string) @@ -5194,7 +5194,7 @@ class _SessionBase(object): | 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 `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call reset_with_options or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + Note: For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions `_. 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. @@ -5285,7 +5285,7 @@ class _SessionBase(object): Note: - When you download a waveform using ReadAndDownloadWaveformFromFileTdms method and if waveform_rf_blanking property is enabled, you must set the write_waveform_burst_detection property to WriteWaveformBurstDetection.DISABLE. - - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call reset_with_options or `niRFSA_ResetWithOptions `_. Select **Routes** in the **steps to omit** parameter. + - For PXIe-5830/5831/5832: The RF Blanking reserves a PXI trigger line. If you are calling any reset or `niRFSA_reset `_ on the same device, NI recommends calling it before committing blanking properties. Alternatively, you can call ResetWithOptions or `niRFSA_ResetWithOptions `_. 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. @@ -7975,7 +7975,7 @@ def reset(self): Generally, calling this method instead of the reset_device method is acceptable. The reset method executes faster than the reset_device method. - To avoid resetting routes on the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using the reset_with_options method, with **stepsToOmit** set to ResetWithOptionsStepsToOmit.ROUTES . + To avoid resetting routes on the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using the ResetWithOptions method, with **stepsToOmit** set to ResetWithOptionsStepsToOmit.ROUTES . **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 @@ -8041,6 +8041,7 @@ def revision_query(self): instrument_driver_revision, firmware_revision = self._interpreter.revision_query() return instrument_driver_revision, firmware_revision + @ivi_synchronized def select_arb_waveform(self, name): r'''select_arb_waveform diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index 7a8d8390d..7511a67de 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -165,6 +165,9 @@ def __init__(self): self._defaults['GetStreamEndpointHandle'] = {} self._defaults['GetStreamEndpointHandle']['return'] = 0 self._defaults['GetStreamEndpointHandle']['readerHandle'] = None + self._defaults['GetTerminalName'] = {} + self._defaults['GetTerminalName']['return'] = 0 + self._defaults['GetTerminalName']['terminalName'] = None self._defaults['GetWaveformBurstStartLocations'] = {} self._defaults['GetWaveformBurstStartLocations']['return'] = 0 self._defaults['GetWaveformBurstStartLocations']['locations'] = None @@ -726,6 +729,17 @@ def niRFSG_GetStreamEndpointHandle(self, vi, stream_endpoint, reader_handle): # reader_handle.contents.value = self._defaults['GetStreamEndpointHandle']['readerHandle'] return self._defaults['GetStreamEndpointHandle']['return'] + def niRFSG_GetTerminalName(self, vi, signal, signal_identifier, buffer_size, terminal_name): # noqa: N802 + if self._defaults['GetTerminalName']['return'] != 0: + return self._defaults['GetTerminalName']['return'] + # terminal_name + if self._defaults['GetTerminalName']['terminalName'] is None: + raise MockFunctionCallError("niRFSG_GetTerminalName", param='terminalName') + if buffer_size.value == 0: + return len(self._defaults['GetTerminalName']['terminalName']) + terminal_name.value = self._defaults['GetTerminalName']['terminalName'].encode('ascii') + return self._defaults['GetTerminalName']['return'] + def niRFSG_GetWaveformBurstStartLocations(self, vi, channel_name, number_of_locations, locations, required_size): # noqa: N802 if self._defaults['GetWaveformBurstStartLocations']['return'] != 0: return self._defaults['GetWaveformBurstStartLocations']['return'] @@ -1135,6 +1149,8 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_GetSelfCalibrationTemperature.return_value = 0 mock_library.niRFSG_GetStreamEndpointHandle.side_effect = MockFunctionCallError("niRFSG_GetStreamEndpointHandle") mock_library.niRFSG_GetStreamEndpointHandle.return_value = 0 + mock_library.niRFSG_GetTerminalName.side_effect = MockFunctionCallError("niRFSG_GetTerminalName") + mock_library.niRFSG_GetTerminalName.return_value = 0 mock_library.niRFSG_GetWaveformBurstStartLocations.side_effect = MockFunctionCallError("niRFSG_GetWaveformBurstStartLocations") mock_library.niRFSG_GetWaveformBurstStartLocations.return_value = 0 mock_library.niRFSG_GetWaveformBurstStopLocations.side_effect = MockFunctionCallError("niRFSG_GetWaveformBurstStopLocations") diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index 76e2a825b..a64cabd75 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -4134,78 +4134,6 @@ ], 'returns': 'ViStatus' }, - 'ResetWithOptions': { - 'codegen_method': 'public', - 'documentation': { - 'description': ' \n Resets all properties to default values and specifies steps to omit during the reset process, such as signal routes.\n\n By default, this function exhibits the same behavior as nirfsg_Reset. You can specify steps to omit using the steps to omit parameter. For example, if you specify NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES for the NIRFSG_ATTR_STEPS_TO_OMIT parameter, this function does not release signal routes during the reset process.\n\n When routes of signals between two devices are released, they are released regardless of which device created the route.\n\n To avoid resetting routes on PXIe-5820/5830/5831/5832/5840/5841/5842/5860 that are in use by NI-RFSA sessions, NI recommends using this function instead of nirfsg_Reset, with NIRFSG_ATTR_STEPS_TO_OMIT set to NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES.\n\n **Supported Devices** : PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n **Related Topics**\n\n `Triggers `_\n\n `Events `_\n ' - }, - 'included_in_proto': True, - 'method_templates': [ - { - 'documentation_filename': 'default_method', - 'library_interpreter_filename': 'default_method', - 'method_python_name_suffix': '', - 'session_filename': 'default_method' - } - ], - 'parameters': [ - { - 'direction': 'in', - 'documentation': { - 'description': 'Identifies your instrument session. The ViSession handle is obtained from the nirfsg_Init function or the nirfsg_InitWithOptions function and identifies a particular instrument session.' - }, - 'name': 'vi', - 'type': 'ViSession', - 'use_array': False, - 'use_in_python_api': True - }, - { - 'direction': 'in', - 'documentation': { - 'description': 'Specifies a list of steps to skip during the reset process. The default value is NIRFSG_VAL_RESET_WITH_OPTIONS_NONE, which specifies that no step is omitted during reset. **Defined Values** :', - 'note': 'NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES is not supported in external calibration or alignment sessions.', - 'table_body': [ - [ - 'NIRFSG_VAL_RESET_WITH_OPTIONS_NONE', - '0 (0x0)', - 'No step is omitted during reset.' - ], - [ - 'NIRFSG_VAL_RESET_WITH_OPTIONS_WAVEFORMS', - '1 (0x1)', - 'Omits clearing waveforms.' - ], - [ - 'NIRFSG_VAL_RESET_WITH_OPTIONS_SCRIPTS', - '2 (0x2)', - 'Omits clearing scripts.' - ], - [ - 'NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES', - '4 (0x4)', - 'Omits the routing reset step. Routing is preserved after a reset. However, routing related properties are reset to default, and routing is released if the default properties are committed after a reset.' - ], - [ - 'NIRFSG_VAL_RESET_WITH_OPTIONS_DEEMBEDDING_TABLES', - '8 (0x8)', - 'Omits deleting de-embedding tables. This step is valid only for the PXIe-5830/5831/5832/5840.' - ] - ], - 'table_header': [ - 'Name', - 'Value', - 'Description' - ] - }, - 'enum': 'ResetWithOptionsStepsToOmit', - 'name': 'stepsToOmit', - 'type': 'ViUInt64', - 'use_array': False, - 'use_in_python_api': True - } - ], - 'returns': 'ViStatus' - }, 'RevisionQuery': { 'codegen_method': 'public', 'documentation': { From f799e3586d97e830f068805038b4ce2202e22616 Mon Sep 17 00:00:00 2001 From: Vagupta Date: Thu, 19 Jun 2025 17:13:32 +0530 Subject: [PATCH 3/3] corrected name of APIs and removed mismatched enum value --- build/helper/helper.py | 2 +- docs/nirfsg/class.rst | 20 +++++++++---------- docs/nirfsg/enums.rst | 4 ---- .../nirfsg/nirfsg/_library_interpreter.py | 9 +++++---- generated/nirfsg/nirfsg/enums.py | 1 - generated/nirfsg/nirfsg/session.py | 20 +++++++++---------- src/nirfsg/metadata/enums.py | 4 ---- src/nirfsg/metadata/functions.py | 3 ++- 8 files changed, 28 insertions(+), 35 deletions(-) diff --git a/build/helper/helper.py b/build/helper/helper.py index 83c3f005b..f78bdf741 100644 --- a/build/helper/helper.py +++ b/build/helper/helper.py @@ -42,7 +42,7 @@ def camelcase_to_snakecase(camelcase_string): '''Converts a camelCase string to lower_case_snake_case''' # https://stackoverflow.com/questions/1175208/elegant-python-function-to-convert-camelcase-to-snake-case s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', camelcase_string) - return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() + return re.sub('([a-z])([A-Z])', r'\1_\2', s1).lower() # TODO(marcoskirsch): not being used diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index 78f1775ca..0400287c1 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -1113,12 +1113,12 @@ configure_output_enabled :type output_enabled: bool -configure_p2_p_endpoint_fullness_start_trigger ----------------------------------------------- +configure_p2p_endpoint_fullness_start_trigger +--------------------------------------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) + .. py:method:: configure_p2p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) Configures the Start Trigger to detect peer-to-peer endpoint fullness. @@ -1419,12 +1419,12 @@ configure_software_start_trigger -create_deembedding_sparameter_table_s2_p_file ---------------------------------------------- +create_deembedding_sparameter_table_s2p_file +-------------------------------------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation) + .. py:method:: create_deembedding_sparameter_table_s2p_file(port, table_name, s2p_file_path, sparameter_orientation) Creates an S-parameter de-embedding table for the port based on the specified S2P file. @@ -3327,12 +3327,12 @@ wait_until_settled :type max_time_milliseconds: int -write_p2_p_endpoint_i16 ------------------------ +write_p2p_endpoint_i16 +---------------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) + .. py:method:: write_p2p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) Writes an array of 16-bit integer data to the peer-to-peer endpoint. @@ -3380,7 +3380,7 @@ write_p2_p_endpoint_i16 - :type endpoint_data: list of int + :type endpoint_data: array.array("h") write_script ------------ diff --git a/docs/nirfsg/enums.rst b/docs/nirfsg/enums.rst index e48744908..94bb59629 100644 --- a/docs/nirfsg/enums.rst +++ b/docs/nirfsg/enums.rst @@ -1318,10 +1318,6 @@ RFFilter - .. py:attribute:: RFFilter.CONFIGURATION_SETTLED_EVENT - - - .. py:attribute:: RFFilter.LO_FREQ_MOD_4000 diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index bd2eedbd7..d105838d1 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -283,7 +283,7 @@ def configure_output_enabled(self, output_enabled): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): # noqa: N802 + def configure_p2p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 p2p_endpoint_fullness_level_ctype = _visatype.ViInt64(p2p_endpoint_fullness_level) # case S150 error_code = self._library.niRFSG_ConfigureP2PEndpointFullnessStartTrigger(vi_ctype, p2p_endpoint_fullness_level_ctype) @@ -340,7 +340,7 @@ def configure_software_start_trigger(self): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation): # noqa: N802 + def create_deembedding_sparameter_table_s2p_file(self, port, table_name, s2p_file_path, sparameter_orientation): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 port_ctype = ctypes.create_string_buffer(port.encode(self._encoding)) # case C020 table_name_ctype = ctypes.create_string_buffer(table_name.encode(self._encoding)) # case C020 @@ -866,11 +866,12 @@ def wait_until_settled(self, max_time_milliseconds): # noqa: N802 errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 + def write_p2p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 stream_endpoint_ctype = ctypes.create_string_buffer(stream_endpoint.encode(self._encoding)) # case C020 number_of_samples_ctype = _visatype.ViInt32(0 if endpoint_data is None else len(endpoint_data)) # case S160 - endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data, library_type=_visatype.ViInt16) # case B550 + endpoint_data_array = _convert_to_array(value=endpoint_data, array_type="h") # case B550 + endpoint_data_ctype = _get_ctypes_pointer_for_buffer(value=endpoint_data_array, library_type=_visatype.ViInt16) # case B550 error_code = self._library.niRFSG_WriteP2PEndpointI16(vi_ctype, stream_endpoint_ctype, number_of_samples_ctype, endpoint_data_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return diff --git a/generated/nirfsg/nirfsg/enums.py b/generated/nirfsg/nirfsg/enums.py index 6d6fe66b4..7d316a441 100644 --- a/generated/nirfsg/nirfsg/enums.py +++ b/generated/nirfsg/nirfsg/enums.py @@ -566,7 +566,6 @@ class RFFilter(Enum): r''' yet to be defined ''' - CONFIGURATION_SETTLED_EVENT = 7 LO_FREQ_MOD_4000 = '1' r''' yet to be defined diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 2a5acff4e..90f5e9f72 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -7016,8 +7016,8 @@ def configure_output_enabled(self, output_enabled): self._interpreter.configure_output_enabled(output_enabled) @ivi_synchronized - def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): - r'''configure_p2_p_endpoint_fullness_start_trigger + def configure_p2p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_level): + r'''configure_p2p_endpoint_fullness_start_trigger Configures the Start Trigger to detect peer-to-peer endpoint fullness. @@ -7038,7 +7038,7 @@ def configure_p2_p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_l p2p_endpoint_fullness_level (int): Specifies the quantity of data in the FIFO endpoint that asserts the trigger. Units are samples per channel. The default value is -1, which allows NI-RFSG to select the appropriate fullness value. ''' - self._interpreter.configure_p2_p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) + self._interpreter.configure_p2p_endpoint_fullness_start_trigger(p2p_endpoint_fullness_level) @ivi_synchronized def configure_power_level_type(self, power_level_type): @@ -7233,8 +7233,8 @@ def configure_software_start_trigger(self): self._interpreter.configure_software_start_trigger() @ivi_synchronized - def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_file_path, sparameter_orientation): - r'''create_deembedding_sparameter_table_s2_p_file + def create_deembedding_sparameter_table_s2p_file(self, port, table_name, s2p_file_path, sparameter_orientation): + r'''create_deembedding_sparameter_table_s2p_file Creates an S-parameter de-embedding table for the port based on the specified S2P file. @@ -7268,7 +7268,7 @@ def create_deembedding_sparameter_table_s2_p_file(self, port, table_name, s2p_fi ''' if type(sparameter_orientation) is not enums.SparameterOrientation: raise TypeError('Parameter sparameter_orientation must be of type ' + str(enums.SparameterOrientation)) - self._interpreter.create_deembedding_sparameter_table_s2_p_file(port, table_name, s2p_file_path, sparameter_orientation) + self._interpreter.create_deembedding_sparameter_table_s2p_file(port, table_name, s2p_file_path, sparameter_orientation) @ivi_synchronized def delete_all_deembedding_tables(self): @@ -8234,8 +8234,8 @@ def wait_until_settled(self, max_time_milliseconds): self._interpreter.wait_until_settled(max_time_milliseconds) @ivi_synchronized - def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): - r'''write_p2_p_endpoint_i16 + def write_p2p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): + r'''write_p2p_endpoint_i16 Writes an array of 16-bit integer data to the peer-to-peer endpoint. @@ -8258,10 +8258,10 @@ def write_p2_p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_d number_of_samples (int): Specifies the number of samples to write into the endpoint FIFO. - endpoint_data (list of int): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified. + endpoint_data (array.array("h")): Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified. ''' - self._interpreter.write_p2_p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) + self._interpreter.write_p2p_endpoint_i16(stream_endpoint, number_of_samples, endpoint_data) @ivi_synchronized def write_script(self, script): diff --git a/src/nirfsg/metadata/enums.py b/src/nirfsg/metadata/enums.py index 99484673f..f38c9fbbb 100644 --- a/src/nirfsg/metadata/enums.py +++ b/src/nirfsg/metadata/enums.py @@ -1176,10 +1176,6 @@ 'name': 'NIRFSG_VAL_HI_FREQ_MOD', 'value': '0' }, - { - 'name': 'NIRFSG_VAL_CONFIGURATION_SETTLED_EVENT', - 'value': 7 - }, { 'documentation': { 'description': 'yet to be defined' diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index a64cabd75..7af666fba 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -5317,12 +5317,13 @@ 'description': 'Specifies the array of data to write into the endpoint FIFO. The binary data is left-justified.' }, 'name': 'endpointData', + 'numpy': True, 'size': { 'mechanism': 'passed-in', 'value': 'numberOfSamples' }, 'type': 'ViInt16[]', - 'use_array': False, + 'use_array': True, 'use_in_python_api': True } ],