diff --git a/.github/workflows/github_actions_aws_rhel_python64.yml b/.github/workflows/github_actions_aws_rhel_python64.yml index f602bb87d..a5230a68e 100644 --- a/.github/workflows/github_actions_aws_rhel_python64.yml +++ b/.github/workflows/github_actions_aws_rhel_python64.yml @@ -35,6 +35,7 @@ jobs: - nidmm - nifgen - nimodinst + - nirfsg - niscope - niswitch - nitclk diff --git a/.github/workflows/github_actions_aws_windows_python32.yml b/.github/workflows/github_actions_aws_windows_python32.yml index da695f4bd..b52d100f0 100644 --- a/.github/workflows/github_actions_aws_windows_python32.yml +++ b/.github/workflows/github_actions_aws_windows_python32.yml @@ -37,6 +37,7 @@ jobs: - nifgen - nidcpower - nidmm + - nirfsg - niscope - nimodinst - nise diff --git a/.github/workflows/github_actions_aws_windows_python64.yml b/.github/workflows/github_actions_aws_windows_python64.yml index 79faf63bf..ed750e981 100644 --- a/.github/workflows/github_actions_aws_windows_python64.yml +++ b/.github/workflows/github_actions_aws_windows_python64.yml @@ -51,6 +51,7 @@ jobs: - nifgen - nidcpower - nidmm + - nirfsg - niscope - nimodinst - nise diff --git a/build/templates/session.py/datetime_wrappers.py.mako b/build/templates/session.py/datetime_wrappers.py.mako index 19cf425a9..d71f28693 100644 --- a/build/templates/session.py/datetime_wrappers.py.mako +++ b/build/templates/session.py/datetime_wrappers.py.mako @@ -9,6 +9,9 @@ output_params_list.append(p['python_name']) output_params = ', '.join(output_params_list) + include_second = False + if "second" in output_params_list: + include_second = True %>\ def ${f['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION)}): '''${f['python_name']} @@ -16,4 +19,8 @@ ${helper.get_function_docstring(f, False, config, indent=8)} ''' ${output_params} = self.${called_function['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_CALL)}) + %if include_second is False: return hightime.datetime(year, month, day, hour, minute) + %else: + return hightime.datetime(year, month, day, hour, minute, second) + %endif diff --git a/docs/nirfsg/class.rst b/docs/nirfsg/class.rst index 66f22baa2..1005802cd 100644 --- a/docs/nirfsg/class.rst +++ b/docs/nirfsg/class.rst @@ -3,7 +3,7 @@ Session ======= -.. py:class:: Session(self, resource_name, options={}, id_query=False, reset_device=False) +.. py:class:: Session(self, resource_name, id_query=False, reset_device=False, options={}) @@ -41,40 +41,6 @@ Session :type resource_name: str - :param options: - - - Specifies the initial value of certain properties for the session. The - syntax for **options** is a dictionary of properties with an assigned - value. For example: - - { 'simulate': False } - - You do not have to specify a value for all the properties. If you do not - specify a value for a property, the default value is used. - - Advanced Example: - { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } - - +-------------------------+---------+ - | Property | Default | - +=========================+=========+ - | range_check | True | - +-------------------------+---------+ - | query_instrument_status | False | - +-------------------------+---------+ - | cache | True | - +-------------------------+---------+ - | simulate | False | - +-------------------------+---------+ - | record_value_coersions | False | - +-------------------------+---------+ - | driver_setup | {} | - +-------------------------+---------+ - - - :type options: str - :param id_query: @@ -111,6 +77,40 @@ Session :type reset_device: bool + :param options: + + + Specifies the initial value of certain properties for the session. The + syntax for **options** is a dictionary of properties with an assigned + value. For example: + + { 'simulate': False } + + You do not have to specify a value for all the properties. If you do not + specify a value for a property, the default value is used. + + Advanced Example: + { 'simulate': True, 'driver_setup': { 'Model': '', 'BoardType': '' } } + + +-------------------------+---------+ + | Property | Default | + +=========================+=========+ + | range_check | True | + +-------------------------+---------+ + | query_instrument_status | False | + +-------------------------+---------+ + | cache | True | + +-------------------------+---------+ + | simulate | False | + +-------------------------+---------+ + | record_value_coersions | False | + +-------------------------+---------+ + | driver_setup | {} | + +-------------------------+---------+ + + + :type options: dict + Methods ======= @@ -894,7 +894,7 @@ configure_digital_edge_script_trigger - :type edge: int + :type edge: :py:data:`nirfsg.ScriptTrigDigEdgeEdge` configure_digital_edge_start_trigger ------------------------------------ @@ -938,7 +938,7 @@ configure_digital_edge_start_trigger - :type edge: int + :type edge: :py:data:`nirfsg.StartTrigDigEdgeEdge` configure_digital_level_script_trigger -------------------------------------- @@ -1055,9 +1055,9 @@ configure_generation_mode Specifies the mode used by NI-RFSG for generating an RF output signal. - **Default Value** : :py:data:`~nirfsg.GenerationMode.CW` + **Default Value** : :py:data:`~nirfsg.GenerationMode.CW` - **Defined Values** : + **Defined Values** : +------------------------------------------------+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Value | Description | @@ -1183,7 +1183,7 @@ configure_power_level_type +-------------------------+-------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ - :type power_level_type: int + :type power_level_type: :py:data:`nirfsg.PowerLevelType` configure_pxi_chassis_clk10 --------------------------- @@ -1604,7 +1604,7 @@ 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 + **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 @@ -1615,7 +1615,7 @@ error_message Pass the status parameter that is returned from any NI-RFSG method. - **Default Value** : 0 (VI_SUCCESS) + **Default Value** : 0 (VI_SUCCESS) @@ -1626,7 +1626,7 @@ 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. + You must pass a ViChar array with at least 256 bytes to this parameter. @@ -1642,7 +1642,7 @@ 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 + **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 @@ -1665,7 +1665,7 @@ error_query Returns the error message string read from the instrument error message queue. - You must pass a ViChar array with at least 256 bytes. + You must pass a ViChar array with at least 256 bytes. @@ -1952,7 +1952,15 @@ get_external_calibration_last_date_and_time .. py:method:: get_external_calibration_last_date_and_time() - TBD + Returns the date and time of the last successful external calibration. + + The time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this method returns + + 14 for the hours parameter and + + 30 for the minutes parameter. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 @@ -1996,14 +2004,32 @@ get_self_calibration_last_date_and_time .. py:currentmodule:: nirfsg.Session - .. py:method:: get_self_calibration_last_date_and_time() + .. py:method:: get_self_calibration_last_date_and_time(module) + + Returns the date and time of the last successful self-calibration. + + The time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this method returns + + 14 for the hours parameter and - TBD + 30 for the minutes parameter. + + **Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + :param module: + + + Specifies from which stand-alone module to retrieve the last successful self-calibration date and time. + + + + + :type module: :py:data:`nirfsg.Module` + :rtype: hightime.datetime :return: @@ -2030,9 +2056,7 @@ get_self_calibration_temperature :param module: - Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. - **Default Value** : :py:data:`~nirfsg.Module.PRIMARY_MODULE` - **Defined Values** : + Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. **Default Value** : :py:data:`~nirfsg.Module.PRIMARY_MODULE` **Defined Values** : +------------------------------------------+----------------+---------------------------------------------------------------------+ | Name | Value | Description | @@ -2199,57 +2223,34 @@ get_waveform_burst_start_locations .. py:currentmodule:: nirfsg.Session - .. py:method:: get_waveform_burst_start_locations(number_of_locations) + .. py:method:: get_waveform_burst_start_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 + **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, + .. tip:: This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].get_waveform_burst_start_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, 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")): + :rtype: list of float + :return: 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. @@ -2259,57 +2260,34 @@ get_waveform_burst_stop_locations .. py:currentmodule:: nirfsg.Session - .. py:method:: get_waveform_burst_stop_locations(number_of_locations) + .. py:method:: get_waveform_burst_stop_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 + **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, + .. tip:: This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].get_waveform_burst_stop_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, 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")): + :rtype: list of float + :return: 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. @@ -2319,41 +2297,28 @@ get_waveform_marker_event_locations .. py:currentmodule:: nirfsg.Session - .. py:method:: get_waveform_marker_event_locations(number_of_locations) + .. py:method:: get_waveform_marker_event_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 + **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, + .. tip:: This method can be called on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers 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.markers[ ... ].get_waveform_marker_event_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all markers, 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")): + :rtype: list of float + :return: 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. @@ -2363,14 +2328,6 @@ get_waveform_marker_event_locations .. 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 -------- @@ -2655,7 +2612,7 @@ reset This method aborts the generation, deletes all de-embedding tables, clears all routes, and resets session properties to their initial values. During a reset, routes of signals between this and other devices are released, regardless of which device created the route. - 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. + 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.ResetWithOptions` method, with **stepsToOmit** set to :py:data:`~nirfsg.ResetWithOptionsStepsToOmit.ROUTES` . @@ -3154,35 +3111,26 @@ set_waveform_burst_start_locations .. py:currentmodule:: nirfsg.Session - .. py:method:: set_waveform_burst_start_locations(number_of_locations, locations) + .. py:method:: set_waveform_burst_start_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 + **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, + .. tip:: This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].set_waveform_burst_start_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, 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: @@ -3193,42 +3141,33 @@ set_waveform_burst_start_locations .. note:: One or more of the referenced properties are not in the Python API for this driver. - :type locations: array.array("d") + :type locations: list of float set_waveform_burst_stop_locations --------------------------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: set_waveform_burst_stop_locations(number_of_locations, locations) + .. py:method:: set_waveform_burst_stop_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 + **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, + .. tip:: This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].set_waveform_burst_stop_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, 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: @@ -3237,42 +3176,33 @@ set_waveform_burst_stop_locations - :type locations: array.array("d") + :type locations: list of float set_waveform_marker_event_locations ----------------------------------- .. py:currentmodule:: nirfsg.Session - .. py:method:: set_waveform_marker_event_locations(number_of_locations, locations) + .. py:method:: set_waveform_marker_event_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 + **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, + .. tip:: This method can be called on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers 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.markers[ ... ].set_waveform_marker_event_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all markers, 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: @@ -3281,7 +3211,7 @@ set_waveform_marker_event_locations - :type locations: array.array("d") + :type locations: list of float unlock ------ @@ -3325,6 +3255,63 @@ wait_until_settled :type max_time_milliseconds: int +write_arb_waveform +------------------ + + .. py:currentmodule:: nirfsg.Session + + .. py:method:: write_arb_waveform(waveform_name, waveform_data_array, more_data_pending=False) + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the :py:meth:`nirfsg.Session.allocate_arb_waveform` method, the **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + + + .. note:: This method only supports :py:data:`~nirfsg.PowerLevelType.PEAK` mode as specified in the :py:attr:`nirfsg.Session.power_level_type` property. If you download a waveform when using this method, you cannot set the :py:attr:`nirfsg.Session.power_level_type` to :py:data:`~nirfsg.PowerLevelType.AVERAGE` without causing error in the output. + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + + :param waveform_name: + + + Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + + + + :type waveform_name: str + :param waveform_data_array: + + + Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the :py:meth:`nirfsg.Session.allocate_arb_waveform` method. + + + + + :type waveform_data_array: numpy array of numpy.complex64, numpy array of numpy.complex128 or interleaved complex data in the form of numpy array of numpy.int16 + :param more_data_pending: + + + Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **:py:attr:`nirfsg.Session.MORE_DATA_PENDING`** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + + + .. note:: One or more of the referenced properties are not in the Python API for this driver. + + + :type more_data_pending: bool + write_p2p_endpoint_i16 ---------------------- @@ -11168,7 +11155,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.ResetWithOptions` 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) @@ -12853,7 +12840,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.ResetWithOptions` 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. @@ -13029,7 +13016,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.ResetWithOptions` 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/docs/nirfsg/examples.rst b/docs/nirfsg/examples.rst index aeaca2c24..3202debb5 100644 --- a/docs/nirfsg/examples.rst +++ b/docs/nirfsg/examples.rst @@ -3,6 +3,15 @@ Examples `You can download all nirfsg examples here `_ +nirfsg_arb_waveform.py +---------------------- + +.. literalinclude:: ../../src/nirfsg/examples/nirfsg_arb_waveform.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nirfsg_arb_waveform.py) `_ + nirfsg_cw.py ------------ @@ -12,3 +21,12 @@ nirfsg_cw.py :encoding: utf8 :caption: `(nirfsg_cw.py) `_ +nirfsg_script.py +---------------- + +.. literalinclude:: ../../src/nirfsg/examples/nirfsg_script.py + :language: python + :linenos: + :encoding: utf8 + :caption: `(nirfsg_script.py) `_ + diff --git a/generated/nirfsg/nirfsg/_complextype.py b/generated/nirfsg/nirfsg/_complextype.py new file mode 100644 index 000000000..45020aa99 --- /dev/null +++ b/generated/nirfsg/nirfsg/_complextype.py @@ -0,0 +1,16 @@ +# -*- coding: utf-8 -*- +# This file was generated +import ctypes +import nirfsg._visatype as _visatype + + +class NIComplexNumber(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal64), ("imag", _visatype.ViReal64)] + + +class NIComplexNumberF32(ctypes.Structure): + _fields_ = [("real", _visatype.ViReal32), ("imag", _visatype.ViReal32)] + + +class NIComplexI16(ctypes.Structure): + _fields_ = [("real", _visatype.ViInt16), ("imag", _visatype.ViInt16)] diff --git a/generated/nirfsg/nirfsg/_library.py b/generated/nirfsg/nirfsg/_library.py index d675ae656..905735dc8 100644 --- a/generated/nirfsg/nirfsg/_library.py +++ b/generated/nirfsg/nirfsg/_library.py @@ -5,6 +5,7 @@ import nirfsg.errors as errors import threading +from nirfsg._complextype import * # noqa: F403 from nirfsg._visatype import * # noqa: F403,H303 @@ -89,7 +90,6 @@ def __init__(self, ctypes_library): self.niRFSG_PerformThermalCorrection_cfunc = None self.niRFSG_QueryArbWaveformCapabilities_cfunc = None self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc = None - self.niRFSG_Reset_cfunc = None self.niRFSG_ResetAttribute_cfunc = None self.niRFSG_ResetDevice_cfunc = None self.niRFSG_ResetWithDefaults_cfunc = None @@ -112,9 +112,13 @@ def __init__(self, ctypes_library): self.niRFSG_SetWaveformMarkerEventLocations_cfunc = None self.niRFSG_UnlockSession_cfunc = None self.niRFSG_WaitUntilSettled_cfunc = None + self.niRFSG_WriteArbWaveformComplexF32_cfunc = None + self.niRFSG_WriteArbWaveformComplexF64_cfunc = None + self.niRFSG_WriteArbWaveformComplexI16_cfunc = None self.niRFSG_WriteP2PEndpointI16_cfunc = None self.niRFSG_WriteScript_cfunc = None self.niRFSG_close_cfunc = None + self.niRFSG_reset_cfunc = None def _get_library_function(self, name): try: @@ -683,14 +687,6 @@ def niRFSG_ReadAndDownloadWaveformFromFileTDMS(self, vi, waveform_name, file_pat self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_ReadAndDownloadWaveformFromFileTDMS_cfunc(vi, waveform_name, file_path, waveform_index) - def niRFSG_Reset(self, vi): # noqa: N802 - with self._func_lock: - if self.niRFSG_Reset_cfunc is None: - self.niRFSG_Reset_cfunc = self._get_library_function('niRFSG_Reset') - self.niRFSG_Reset_cfunc.argtypes = [ViSession] # noqa: F405 - self.niRFSG_Reset_cfunc.restype = ViStatus # noqa: F405 - return self.niRFSG_Reset_cfunc(vi) - def niRFSG_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802 with self._func_lock: if self.niRFSG_ResetAttribute_cfunc is None: @@ -867,6 +863,30 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 self.niRFSG_WaitUntilSettled_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_WaitUntilSettled_cfunc(vi, max_time_milliseconds) + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF32_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF32_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF32') + self.niRFSG_WriteArbWaveformComplexF32_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumberF32), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF32_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF32_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexF64_cfunc is None: + self.niRFSG_WriteArbWaveformComplexF64_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexF64') + self.niRFSG_WriteArbWaveformComplexF64_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexNumber), ViBoolean] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexF64_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexF64_cfunc(vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending) + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 + with self._func_lock: + if self.niRFSG_WriteArbWaveformComplexI16_cfunc is None: + self.niRFSG_WriteArbWaveformComplexI16_cfunc = self._get_library_function('niRFSG_WriteArbWaveformComplexI16') + self.niRFSG_WriteArbWaveformComplexI16_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(NIComplexI16)] # noqa: F405 + self.niRFSG_WriteArbWaveformComplexI16_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_WriteArbWaveformComplexI16_cfunc(vi, waveform_name, number_of_samples, waveform_data_array) + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 with self._func_lock: if self.niRFSG_WriteP2PEndpointI16_cfunc is None: @@ -890,3 +910,11 @@ def niRFSG_close(self, vi): # noqa: N802 self.niRFSG_close_cfunc.argtypes = [ViSession] # noqa: F405 self.niRFSG_close_cfunc.restype = ViStatus # noqa: F405 return self.niRFSG_close_cfunc(vi) + + def niRFSG_reset(self, vi): # noqa: N802 + with self._func_lock: + if self.niRFSG_reset_cfunc is None: + self.niRFSG_reset_cfunc = self._get_library_function('niRFSG_reset') + self.niRFSG_reset_cfunc.argtypes = [ViSession] # noqa: F405 + self.niRFSG_reset_cfunc.restype = ViStatus # noqa: F405 + return self.niRFSG_reset_cfunc(vi) diff --git a/generated/nirfsg/nirfsg/_library_interpreter.py b/generated/nirfsg/nirfsg/_library_interpreter.py index d105838d1..bee7a62fe 100644 --- a/generated/nirfsg/nirfsg/_library_interpreter.py +++ b/generated/nirfsg/nirfsg/_library_interpreter.py @@ -4,6 +4,7 @@ import array import ctypes import hightime # noqa: F401 +import nirfsg._complextype as _complextype import nirfsg._library_singleton as _library_singleton import nirfsg._visatype as _visatype import nirfsg.enums as enums # noqa: F401 @@ -18,7 +19,12 @@ def _get_ctypes_pointer_for_buffer(value=None, library_type=None, size=None): return ctypes.cast(addr, ctypes.POINTER(library_type)) elif str(type(value)).find("'numpy.ndarray'") != -1: import numpy - return numpy.ctypeslib.as_ctypes(value) + if library_type in (_complextype.NIComplexI16, _complextype.NIComplexNumberF32, _complextype.NIComplexNumber): + complex_dtype = numpy.dtype(library_type) + structured_array = value.view(complex_dtype) + return structured_array.ctypes.data_as(ctypes.POINTER(library_type)) + else: + return numpy.ctypeslib.as_ctypes(value) elif isinstance(value, bytes): return ctypes.cast(value, ctypes.POINTER(library_type)) elif isinstance(value, list): @@ -239,7 +245,7 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): # no vi_ctype = _visatype.ViSession(self._vi) # case S110 trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case C020 source_ctype = ctypes.create_string_buffer(source.encode(self._encoding)) # case C020 - edge_ctype = _visatype.ViInt32(edge) # case S150 + edge_ctype = _visatype.ViInt32(edge.value) # case S130 error_code = self._library.niRFSG_ConfigureDigitalEdgeScriptTrigger(vi_ctype, trigger_id_ctype, source_ctype, edge_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -247,7 +253,7 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): # no def configure_digital_edge_start_trigger(self, source, edge): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 source_ctype = ctypes.create_string_buffer(source.encode(self._encoding)) # case C020 - edge_ctype = _visatype.ViInt32(edge) # case S150 + edge_ctype = _visatype.ViInt32(edge.value) # case S130 error_code = self._library.niRFSG_ConfigureDigitalEdgeStartTrigger(vi_ctype, source_ctype, edge_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -292,7 +298,7 @@ def configure_p2p_endpoint_fullness_start_trigger(self, p2p_endpoint_fullness_le def configure_power_level_type(self, power_level_type): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 - power_level_type_ctype = _visatype.ViInt32(power_level_type) # case S150 + power_level_type_ctype = _visatype.ViInt32(power_level_type.value) # case S130 error_code = self._library.niRFSG_ConfigurePowerLevelType(vi_ctype, power_level_type_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return @@ -540,7 +546,7 @@ def get_max_settable_power(self): # noqa: N802 def get_self_calibration_date_and_time(self, module): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 - module_ctype = _visatype.ViInt32(module) # case S150 + module_ctype = _visatype.ViInt32(module.value) # case S130 year_ctype = _visatype.ViInt32() # case S220 month_ctype = _visatype.ViInt32() # case S220 day_ctype = _visatype.ViInt32() # case S220 @@ -581,41 +587,50 @@ def get_terminal_name(self, signal, signal_identifier): # noqa: N802 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 + def get_waveform_burst_start_locations(self, channel_name): # 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 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 + number_of_locations_ctype = _visatype.ViInt32(0) # case S190 + locations_ctype = None # case B610 required_size_ctype = _visatype.ViInt32() # case S220 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=True, is_error_handling=False) + number_of_locations_ctype = _visatype.ViInt32(required_size_ctype.value) # case S200 + locations_size = required_size_ctype.value # case B620 + locations_ctype = _get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=locations_size) # case B620 + 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 locations_array, int(required_size_ctype.value) + return [float(locations_ctype[i]) for i in range(number_of_locations_ctype.value)] - def get_waveform_burst_stop_locations(self, channel_name, number_of_locations): # noqa: N802 + def get_waveform_burst_stop_locations(self, channel_name): # 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 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 + number_of_locations_ctype = _visatype.ViInt32(0) # case S190 + locations_ctype = None # case B610 required_size_ctype = _visatype.ViInt32() # case S220 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=True, is_error_handling=False) + number_of_locations_ctype = _visatype.ViInt32(required_size_ctype.value) # case S200 + locations_size = required_size_ctype.value # case B620 + locations_ctype = _get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=locations_size) # case B620 + 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 locations_array, int(required_size_ctype.value) + return [float(locations_ctype[i]) for i in range(number_of_locations_ctype.value)] - def get_waveform_marker_event_locations(self, channel_name, number_of_locations): # noqa: N802 + def get_waveform_marker_event_locations(self, channel_name): # 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 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 + number_of_locations_ctype = _visatype.ViInt32(0) # case S190 + locations_ctype = None # case B610 required_size_ctype = _visatype.ViInt32() # case S220 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=True, is_error_handling=False) + number_of_locations_ctype = _visatype.ViInt32(required_size_ctype.value) # case S200 + locations_size = required_size_ctype.value # case B620 + locations_ctype = _get_ctypes_pointer_for_buffer(library_type=_visatype.ViReal64, size=locations_size) # case B620 + 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 locations_array, int(required_size_ctype.value) + return [float(locations_ctype[i]) for i in range(number_of_locations_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 @@ -678,12 +693,6 @@ def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, wa errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return - def reset(self): # noqa: N802 - vi_ctype = _visatype.ViSession(self._vi) # case S110 - error_code = self._library.niRFSG_Reset(vi_ctype) - errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) - return - def reset_attribute(self, channel_name, attribute_id): # noqa: N802 vi_ctype = _visatype.ViSession(self._vi) # case S110 channel_name_ctype = ctypes.create_string_buffer(channel_name.encode(self._encoding)) # case C010 @@ -823,32 +832,29 @@ 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, locations): # noqa: N802 + def set_waveform_burst_start_locations(self, channel_name, 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(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 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations, 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 - def set_waveform_burst_stop_locations(self, channel_name, number_of_locations, locations): # noqa: N802 + def set_waveform_burst_stop_locations(self, channel_name, 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(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 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations, 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 - def set_waveform_marker_event_locations(self, channel_name, number_of_locations, locations): # noqa: N802 + def set_waveform_marker_event_locations(self, channel_name, 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(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 + locations_ctype = _get_ctypes_pointer_for_buffer(value=locations, 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 @@ -866,6 +872,35 @@ 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_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumberF32) # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteArbWaveformComplexF32(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array)) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexNumber) # case B510 + more_data_pending_ctype = _visatype.ViBoolean(more_data_pending) # case S150 + error_code = self._library.niRFSG_WriteArbWaveformComplexF64(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype, more_data_pending_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + + def write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020 + number_of_samples_ctype = _visatype.ViInt32(0 if waveform_data_array is None else len(waveform_data_array) // 2) # case S160 + waveform_data_array_ctype = _get_ctypes_pointer_for_buffer(value=waveform_data_array, library_type=_complextype.NIComplexI16) # case B510 + error_code = self._library.niRFSG_WriteArbWaveformComplexI16(vi_ctype, waveform_name_ctype, number_of_samples_ctype, waveform_data_array_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return + 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 @@ -888,3 +923,9 @@ def close(self): # noqa: N802 error_code = self._library.niRFSG_close(vi_ctype) errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) return + + def reset(self): # noqa: N802 + vi_ctype = _visatype.ViSession(self._vi) # case S110 + error_code = self._library.niRFSG_reset(vi_ctype) + errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False) + return diff --git a/generated/nirfsg/nirfsg/session.py b/generated/nirfsg/nirfsg/session.py index 661d8b273..a420436c5 100644 --- a/generated/nirfsg/nirfsg/session.py +++ b/generated/nirfsg/nirfsg/session.py @@ -4310,7 +4310,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 ResetWithOptions 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) @@ -5163,7 +5163,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 ResetWithOptions 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. @@ -5254,7 +5254,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 ResetWithOptions 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. @@ -5539,16 +5539,16 @@ def error_message(self, 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 + **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) + **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. + You must pass a ViChar array with at least 256 bytes to this parameter. ''' self._interpreter.error_message(error_code, error_message) @@ -5758,115 +5758,91 @@ def _get_attribute_vi_string(self, attribute): return value @ivi_synchronized - def get_waveform_burst_start_locations(self, number_of_locations): + def get_waveform_burst_start_locations(self): r'''get_waveform_burst_start_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 + **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, + This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].get_waveform_burst_start_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, you can call it directly on the :py:class:`nirfsg.Session`. 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 (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. - - required_size (int): Returns the required size for the output array if you pass NULL to LOCATIONS parameter. + locations (list of 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. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - locations, required_size = self._interpreter.get_waveform_burst_start_locations(self._repeated_capability, number_of_locations) - return locations, required_size + locations = self._interpreter.get_waveform_burst_start_locations(self._repeated_capability) + return locations @ivi_synchronized - def get_waveform_burst_stop_locations(self, number_of_locations): + def get_waveform_burst_stop_locations(self): r'''get_waveform_burst_stop_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 + **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, + This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].get_waveform_burst_stop_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, you can call it directly on the :py:class:`nirfsg.Session`. 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 (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. - - required_size (int): Returns the required size for the output array if you pass NULL to LOCATIONS parameter. + locations (list of 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. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - locations, required_size = self._interpreter.get_waveform_burst_stop_locations(self._repeated_capability, number_of_locations) - return locations, required_size + locations = self._interpreter.get_waveform_burst_stop_locations(self._repeated_capability) + return locations @ivi_synchronized - def get_waveform_marker_event_locations(self, number_of_locations): + def get_waveform_marker_event_locations(self): r'''get_waveform_marker_event_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 + **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, + This method can be called on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers 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.markers[ ... ].get_waveform_marker_event_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all markers, you can call it directly on the :py:class:`nirfsg.Session`. Example: :py:meth:`my_session.get_waveform_marker_event_locations` - Args: - number_of_locations (int): Specifies the size of the locations array. - - Returns: - 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. + locations (list of 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. 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. - ''' - locations, required_size = self._interpreter.get_waveform_marker_event_locations(self._repeated_capability, number_of_locations) - return locations, required_size + locations = self._interpreter.get_waveform_marker_event_locations(self._repeated_capability) + return locations @ivi_synchronized def load_configurations_from_file(self, file_path): @@ -6258,88 +6234,82 @@ def _set_attribute_vi_string(self, attribute, value): self._interpreter.set_attribute_vi_string(self._repeated_capability, attribute, value) @ivi_synchronized - def set_waveform_burst_start_locations(self, number_of_locations, locations): + def set_waveform_burst_start_locations(self, 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. - **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + **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, + This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].set_waveform_burst_start_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, you can call it directly on the :py:class:`nirfsg.Session`. Example: :py:meth:`my_session.set_waveform_burst_start_locations` Args: - number_of_locations (int): Specifies the size of the burst start locations array. - - 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. + locations (list of 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. Note: One or more of the referenced properties are not in the Python API for this driver. ''' - self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, number_of_locations, locations) + self._interpreter.set_waveform_burst_start_locations(self._repeated_capability, locations) @ivi_synchronized - def set_waveform_burst_stop_locations(self, number_of_locations, locations): + def set_waveform_burst_stop_locations(self, 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. - **Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842 + **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, + This method can be called on specific waveform within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container waveform 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.waveform[ ... ].set_waveform_burst_stop_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all waveform, you can call it directly on the :py:class:`nirfsg.Session`. Example: :py:meth:`my_session.set_waveform_burst_stop_locations` Args: - number_of_locations (int): Specifies the size of the burst stop locations array. - - locations (array.array("d")): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. + locations (list of float): Specifies the burst stop locations, in samples, to store in the NI-RFSG session. ''' - self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, number_of_locations, locations) + self._interpreter.set_waveform_burst_stop_locations(self._repeated_capability, locations) @ivi_synchronized - def set_waveform_marker_event_locations(self, number_of_locations, locations): + def set_waveform_marker_event_locations(self, locations): r'''set_waveform_marker_event_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 + **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, + This method can be called on specific markers within your :py:class:`nirfsg.Session` instance. + Use Python index notation on the repeated capabilities container markers 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.markers[ ... ].set_waveform_marker_event_locations` - To call the method on all channels, you can call it directly on the :py:class:`nirfsg.Session`. + To call the method on all markers, you can call it directly on the :py:class:`nirfsg.Session`. Example: :py:meth:`my_session.set_waveform_marker_event_locations` Args: - number_of_locations (int): Specifies the size of the locations array. - - locations (array.array("d")): Specifies the marker location, in samples, to store in the NI-RFSG database. + locations (list of float): Specifies the marker location, in samples, to store in the NI-RFSG database. ''' - self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, number_of_locations, locations) + self._interpreter.set_waveform_marker_event_locations(self._repeated_capability, locations) def unlock(self): '''unlock @@ -6354,7 +6324,7 @@ def unlock(self): class Session(_SessionBase): '''An NI-RFSG session to the NI-RFSG driver''' - def __init__(self, resource_name, options={}, id_query=False, reset_device=False): + def __init__(self, resource_name, id_query=False, reset_device=False, options={}): r'''An NI-RFSG session to the NI-RFSG driver Opens a session to the device you specify as the RESOURCE_NAME and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6381,7 +6351,31 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. - options (str): Specifies the initial value of certain properties for the session. The + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + + options (dict): Specifies the initial value of certain properties for the session. The syntax for **options** is a dictionary of properties with an assigned value. For example: @@ -6409,30 +6403,6 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False | driver_setup | {} | +-------------------------+---------+ - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -6447,22 +6417,23 @@ def __init__(self, resource_name, options={}, id_query=False, reset_device=False freeze_it=False, all_channels_in_session=None ) + options = _converters.convert_init_with_options_dictionary(options) # Call specified init function # Note that _interpreter default-initializes the session handle in its constructor, so that # if _init_with_options fails, the error handler can reference it. # And then here, once _init_with_options succeeds, we call set_session_handle # with the actual session handle. - self._interpreter.set_session_handle(self._init_with_options(resource_name, options, id_query, reset_device)) + self._interpreter.set_session_handle(self._init_with_options(resource_name, id_query, reset_device, options)) self.tclk = nitclk.SessionReference(self._interpreter.get_session_handle()) # Store the parameter list for later printing in __repr__ param_list = [] param_list.append("resource_name=" + pp.pformat(resource_name)) - param_list.append("options=" + pp.pformat(options)) param_list.append("id_query=" + pp.pformat(id_query)) param_list.append("reset_device=" + pp.pformat(reset_device)) + param_list.append("options=" + pp.pformat(options)) self._param_list = ', '.join(param_list) # Store the list of channels in the Session which is needed by some nimi-python modules. @@ -6840,9 +6811,11 @@ def configure_digital_edge_script_trigger(self, trigger_id, source, edge): source (str): Specifies the source terminal for the digital edge Script Trigger. NI-RFSG sets the digital_edge_script_trigger_source property to this value. - edge (int): Specifies the active edge for the digital edge Script Trigger. NI-RFSG sets the digital_edge_script_trigger_edge property to this value. + edge (enums.ScriptTrigDigEdgeEdge): Specifies the active edge for the digital edge Script Trigger. NI-RFSG sets the digital_edge_script_trigger_edge property to this value. ''' + if type(edge) is not enums.ScriptTrigDigEdgeEdge: + raise TypeError('Parameter edge must be of type ' + str(enums.ScriptTrigDigEdgeEdge)) self._interpreter.configure_digital_edge_script_trigger(trigger_id, source, edge) @ivi_synchronized @@ -6866,9 +6839,11 @@ def configure_digital_edge_start_trigger(self, source, edge): Args: source (str): Specifies the source terminal for the digital edge trigger. NI-RFSG sets the digital_edge_start_trigger_source property to this value. - edge (int): Specifies the active edge for the Start Trigger. NI-RFSG sets the digital_edge_start_trigger_edge property to this value. + edge (enums.StartTrigDigEdgeEdge): Specifies the active edge for the Start Trigger. NI-RFSG sets the digital_edge_start_trigger_edge property to this value. ''' + if type(edge) is not enums.StartTrigDigEdgeEdge: + raise TypeError('Parameter edge must be of type ' + str(enums.StartTrigDigEdgeEdge)) self._interpreter.configure_digital_edge_start_trigger(source, edge) @ivi_synchronized @@ -6935,9 +6910,9 @@ def configure_generation_mode(self, generation_mode): Args: generation_mode (enums.GenerationMode): Specifies the mode used by NI-RFSG for generating an RF output signal. - **Default Value** : GenerationMode.CW + **Default Value** : GenerationMode.CW - **Defined Values** : + **Defined Values** : +-----------------------------+--------------+------------------------------------------------------------------------------------------------------------------------+ | Name | Value | Description | @@ -7024,7 +6999,7 @@ def configure_power_level_type(self, power_level_type): `Optimizing for Low Power Generation `_ Args: - power_level_type (int): Specifies the way the driver interprets the value of the power_level property. NI-RFSG sets the power_level_type property to this value. + power_level_type (enums.PowerLevelType): Specifies the way the driver interprets the value of the power_level property. NI-RFSG sets the power_level_type property to this value. +-------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ | Name | Value | Description | @@ -7035,6 +7010,8 @@ def configure_power_level_type(self, power_level_type): +-------------------------+-------+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ ''' + if type(power_level_type) is not enums.PowerLevelType: + raise TypeError('Parameter power_level_type must be of type ' + str(enums.PowerLevelType)) self._interpreter.configure_power_level_type(power_level_type) @ivi_synchronized @@ -7310,14 +7287,14 @@ def error_query(self): 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 + **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. + You must pass a ViChar array with at least 256 bytes. ''' error_code, error_message = self._interpreter.error_query() @@ -7522,27 +7499,47 @@ def _get_external_calibration_last_date_and_time(self): def get_external_calibration_last_date_and_time(self): '''get_external_calibration_last_date_and_time - TBD + Returns the date and time of the last successful external calibration. + + The time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this method returns + + 14 for the hours parameter and + + 30 for the minutes parameter. + + **Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 Returns: last_cal_datetime (hightime.datetime): ''' year, month, day, hour, minute, second = self._get_external_calibration_last_date_and_time() - return hightime.datetime(year, month, day, hour, minute) + return hightime.datetime(year, month, day, hour, minute, second) @ivi_synchronized - def get_self_calibration_last_date_and_time(self): + def get_self_calibration_last_date_and_time(self, module): '''get_self_calibration_last_date_and_time - TBD + Returns the date and time of the last successful self-calibration. + + The time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this method returns + + 14 for the hours parameter and + + 30 for the minutes parameter. + + **Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + Args: + module (enums.Module): Specifies from which stand-alone module to retrieve the last successful self-calibration date and time. + Returns: last_cal_datetime (hightime.datetime): ''' - year, month, day, hour, minute, second = self._get_self_calibration_date_and_time() - return hightime.datetime(year, month, day, hour, minute) + year, month, day, hour, minute, second = self._get_self_calibration_date_and_time(module) + return hightime.datetime(year, month, day, hour, minute, second) @ivi_synchronized def get_max_settable_power(self): @@ -7574,7 +7571,7 @@ def _get_self_calibration_date_and_time(self, module): **Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 Args: - module (int): Specifies from which stand-alone module to retrieve the last successful self-calibration date and time. + module (enums.Module): Specifies from which stand-alone module to retrieve the last successful self-calibration date and time. Returns: @@ -7591,6 +7588,8 @@ def _get_self_calibration_date_and_time(self, module): second (int): Returns the second of the last successful calibration. ''' + if type(module) is not enums.Module: + raise TypeError('Parameter module must be of type ' + str(enums.Module)) year, month, day, hour, minute, second = self._interpreter.get_self_calibration_date_and_time(module) return year, month, day, hour, minute, second @@ -7603,9 +7602,7 @@ def get_self_calibration_temperature(self, module): **Supported Devices** : PXI-5610, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831 (IF only)/5832 (IF only)/5840/5841/5842/5860 Args: - module (enums.Module): Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. - **Default Value** : Module.PRIMARY_MODULE - **Defined Values** : + module (enums.Module): Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. **Default Value** : Module.PRIMARY_MODULE **Defined Values** : +-----------------------+----------------+---------------------------------------------------------------------+ | Name | Value | Description | @@ -7734,7 +7731,7 @@ def get_terminal_name(self, signal, signal_identifier): terminal_name = self._interpreter.get_terminal_name(signal, signal_identifier) return terminal_name - def _init_with_options(self, resource_name, option_string, id_query=False, reset_device=False): + def _init_with_options(self, resource_name, id_query=False, reset_device=False, option_string=""): r'''_init_with_options Opens a session to the device you specify as the RESOURCE_NAME and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. @@ -7761,7 +7758,31 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset Note: NI-RFSG device names are not case-sensitive. However, all IVI names, such as logical names, are case-sensitive. If you use an IVI logical name, make sure the name is identical to the name shown in the IVI Configuration Utility. - option_string (str): Specifies the initial value of certain properties for the session. The following table lists the properties and the name you pass in this parameter to identify the property. + id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. + + **Defined Values** : + + +-----------+--------------------------+ + | Value | Description | + +===========+==========================+ + | True (1) | Perform ID query. | + +-----------+--------------------------+ + | False (0) | Do not perform ID query. | + +-----------+--------------------------+ + + reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. + + **Defined Values** : + + +-----------+----------------------+ + | Value | Description | + +===========+======================+ + | True (1) | Reset device. | + +-----------+----------------------+ + | False (0) | Do not reset device. | + +-----------+----------------------+ + + option_string (dict): Specifies the initial value of certain properties for the session. The following table lists the properties and the name you pass in this parameter to identify the property. The format of this string consists of the following relations: "AttributeName=Value" @@ -7787,35 +7808,12 @@ def _init_with_options(self, resource_name, option_string, id_query=False, reset | Simulate | simulate | +------------------+-------------------------+ - id_query (bool): Specifies whether you want NI-RFSG to perform an ID query. - - **Defined Values** : - - +-----------+--------------------------+ - | Value | Description | - +===========+==========================+ - | True (1) | Perform ID query. | - +-----------+--------------------------+ - | False (0) | Do not perform ID query. | - +-----------+--------------------------+ - - reset_device (bool): Specifies whether you want to reset the NI-RFSG device during the initialization procedure. - - **Defined Values** : - - +-----------+----------------------+ - | Value | Description | - +===========+======================+ - | True (1) | Reset device. | - +-----------+----------------------+ - | False (0) | Do not reset device. | - +-----------+----------------------+ - Returns: new_vi (int): Returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG method calls. ''' + option_string = _converters.convert_init_with_options_dictionary(option_string) new_vi = self._interpreter.init_with_options(resource_name, id_query, reset_device, option_string) return new_vi @@ -7933,24 +7931,6 @@ def read_and_download_waveform_from_file_tdms(self, waveform_name, file_path, wa ''' self._interpreter.read_and_download_waveform_from_file_tdms(waveform_name, file_path, waveform_index) - @ivi_synchronized - def reset(self): - r'''reset - - Resets all properties to their default values and moves the NI-RFSG device to the Configuration state. - - This method aborts the generation, deletes all de-embedding tables, clears all routes, and resets session properties to their initial values. During a reset, routes of signals between this and other devices are released, regardless of which device created the route. - - 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 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 - - Note: This method resets all configured routes for the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 in NI-RFSA and NI-RFSG. - ''' - self._interpreter.reset() - @ivi_synchronized def reset_device(self): r'''reset_device @@ -8198,6 +8178,164 @@ def wait_until_settled(self, max_time_milliseconds): ''' self._interpreter.wait_until_settled(max_time_milliseconds) + def _write_arb_waveform_complex_f32(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f32 + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + Args: + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy.array(dtype=numpy.complex64)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. + + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the WAVEFORM_NAME parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex64'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex64, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + + def _write_arb_waveform_complex_f64(self, waveform_name, waveform_data_array, more_data_pending): + r'''_write_arb_waveform_complex_f64 + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the allocate_arb_waveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, you can call this method when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it. + + Args: + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy.array(dtype=numpy.complex128)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. + + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('complex128'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=complex128, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + + def _write_arb_waveform_complex_i16(self, waveform_name, waveform_data_array): + r'''_write_arb_waveform_complex_i16 + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. + + Args: + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy.array(dtype=numpy.int16)): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. + + ''' + import numpy + + if type(waveform_data_array) is not numpy.ndarray: + raise TypeError('waveform_data_array must be {0}, is {1}'.format(numpy.ndarray, type(waveform_data_array))) + if numpy.isfortran(waveform_data_array) is True: + raise TypeError('waveform_data_array must be in C-order') + if waveform_data_array.dtype is not numpy.dtype('int16'): + raise TypeError('waveform_data_array must be numpy.ndarray of dtype=int16, is ' + str(waveform_data_array.dtype)) + self._interpreter.write_arb_waveform_complex_i16(waveform_name, waveform_data_array) + + def write_arb_waveform(self, waveform_name, waveform_data_array, more_data_pending=False): + '''write_arb_waveform + + Writes an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory. + + This method accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the allocate_arb_waveform method, the **MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this method. When streaming is enabled, this method can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state. + + **Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860 + + **Related Topics** + + `Streaming `_ + + `Assigning Properties or Properties to a Waveform `_ + + Note: This method only supports PowerLevelType.PEAK mode as specified in the power_level_type property. If you download a waveform when using this method, you cannot set the power_level_type to PowerLevelType.AVERAGE without causing error in the output. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + Args: + waveform_name (str): Specifies the name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words. + + waveform_data_array (numpy array of numpy.complex64, numpy array of numpy.complex128 or interleaved complex data in the form of numpy array of numpy.int16): Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the allocate_arb_waveform method. + + more_data_pending (bool): Specifies whether or not the data block contains the end of the waveform. Set this parameter to True to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **MORE_DATA_PENDING** to False to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored. + + Note: + One or more of the referenced properties are not in the Python API for this driver. + + ''' + import numpy + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array) + else: + raise TypeError("Unsupported datatype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported datatype. Expected {} or {} or {}".format(numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + @ivi_synchronized def write_p2p_endpoint_i16(self, stream_endpoint, number_of_samples, endpoint_data): r'''write_p2p_endpoint_i16 @@ -8266,3 +8404,21 @@ def _close(self): `NI-RFSG Programming State Model `_ ''' self._interpreter.close() + + @ivi_synchronized + def reset(self): + r'''reset + + Resets all properties to their default values and moves the NI-RFSG device to the Configuration state. + + This method aborts the generation, deletes all de-embedding tables, clears all routes, and resets session properties to their initial values. During a reset, routes of signals between this and other devices are released, regardless of which device created the route. + + 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 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 + + Note: This method resets all configured routes for the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 in NI-RFSA and NI-RFSG. + ''' + self._interpreter.reset() diff --git a/generated/nirfsg/nirfsg/unit_tests/_matchers.py b/generated/nirfsg/nirfsg/unit_tests/_matchers.py index 4a8ac9681..d3f1819f4 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_matchers.py +++ b/generated/nirfsg/nirfsg/unit_tests/_matchers.py @@ -5,6 +5,7 @@ ''' import ctypes +import nirfsg._complextype as _complextype import nirfsg._visatype as _visatype import pprint @@ -271,6 +272,57 @@ def __init__(self): _PointerMatcher.__init__(self, _visatype.ViReal64) +def _compare_complex_number_arrays(expected, actual): + for i in range(expected.expected_size): + expected_value = expected.expected_data[i] + actual_value = actual[i] + if expected_value.real != actual_value.real or expected_value.imag != actual_value.imag: + return False + return True + + +class NIComplexNumberPointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.NIComplexNumber) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + return _compare_complex_number_arrays(self, other) + + def __repr__(self): + return f"NIComplexNumberPointerMatcher({self.expected_data})" + + +class NIComplexNumberF32PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.NIComplexNumberF32) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + return _compare_complex_number_arrays(self, other) + + def __repr__(self): + return f"NIComplexNumberF32PointerMatcher({self.expected_data})" + + +class NIComplexI16PointerMatcher(_PointerMatcher): + def __init__(self, expected_data, expected_size): + _PointerMatcher.__init__(self, _complextype.NIComplexI16) + self.expected_data = expected_data + self.expected_size = expected_size + + def __eq__(self, other): + _PointerMatcher.__eq__(self, other) + return _compare_complex_number_arrays(self, other) + + def __repr__(self): + return f"NIComplexI16PointerMatcher({self.expected_data})" + + # Buffers diff --git a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py index 7511a67de..266783a51 100644 --- a/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py +++ b/generated/nirfsg/nirfsg/unit_tests/_mock_helper.py @@ -170,16 +170,16 @@ def __init__(self): self._defaults['GetTerminalName']['terminalName'] = None self._defaults['GetWaveformBurstStartLocations'] = {} self._defaults['GetWaveformBurstStartLocations']['return'] = 0 - self._defaults['GetWaveformBurstStartLocations']['locations'] = None self._defaults['GetWaveformBurstStartLocations']['requiredSize'] = None + self._defaults['GetWaveformBurstStartLocations']['locations'] = None self._defaults['GetWaveformBurstStopLocations'] = {} self._defaults['GetWaveformBurstStopLocations']['return'] = 0 - self._defaults['GetWaveformBurstStopLocations']['locations'] = None self._defaults['GetWaveformBurstStopLocations']['requiredSize'] = None + self._defaults['GetWaveformBurstStopLocations']['locations'] = None self._defaults['GetWaveformMarkerEventLocations'] = {} self._defaults['GetWaveformMarkerEventLocations']['return'] = 0 - self._defaults['GetWaveformMarkerEventLocations']['locations'] = None self._defaults['GetWaveformMarkerEventLocations']['requiredSize'] = None + self._defaults['GetWaveformMarkerEventLocations']['locations'] = None self._defaults['InitWithOptions'] = {} self._defaults['InitWithOptions']['return'] = 0 self._defaults['InitWithOptions']['newVi'] = None @@ -202,8 +202,6 @@ def __init__(self): self._defaults['QueryArbWaveformCapabilities']['maxWaveformSize'] = None self._defaults['ReadAndDownloadWaveformFromFileTDMS'] = {} self._defaults['ReadAndDownloadWaveformFromFileTDMS']['return'] = 0 - self._defaults['Reset'] = {} - self._defaults['Reset']['return'] = 0 self._defaults['ResetAttribute'] = {} self._defaults['ResetAttribute']['return'] = 0 self._defaults['ResetDevice'] = {} @@ -252,12 +250,20 @@ def __init__(self): self._defaults['UnlockSession']['callerHasLock'] = None self._defaults['WaitUntilSettled'] = {} self._defaults['WaitUntilSettled']['return'] = 0 + self._defaults['WriteArbWaveformComplexF32'] = {} + self._defaults['WriteArbWaveformComplexF32']['return'] = 0 + self._defaults['WriteArbWaveformComplexF64'] = {} + self._defaults['WriteArbWaveformComplexF64']['return'] = 0 + self._defaults['WriteArbWaveformComplexI16'] = {} + self._defaults['WriteArbWaveformComplexI16']['return'] = 0 self._defaults['WriteP2PEndpointI16'] = {} self._defaults['WriteP2PEndpointI16']['return'] = 0 self._defaults['WriteScript'] = {} self._defaults['WriteScript']['return'] = 0 self._defaults['close'] = {} self._defaults['close']['return'] = 0 + self._defaults['reset'] = {} + self._defaults['reset']['return'] = 0 def __getitem__(self, func): return self._defaults[func] @@ -743,64 +749,64 @@ def niRFSG_GetTerminalName(self, vi, signal, signal_identifier, buffer_size, ter 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'] + # required_size + if self._defaults['GetWaveformBurstStartLocations']['requiredSize'] is None: + raise MockFunctionCallError("niRFSG_GetWaveformBurstStartLocations", param='requiredSize') + if required_size is not None: + required_size.contents.value = self._defaults['GetWaveformBurstStartLocations']['requiredSize'] # locations if self._defaults['GetWaveformBurstStartLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStartLocations", param='locations') - test_value = self._defaults['GetWaveformBurstStartLocations']['locations'] + if number_of_locations.value == 0: + return len(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') - if required_size is not None: - required_size.contents.value = self._defaults['GetWaveformBurstStartLocations']['requiredSize'] + for i in range(len(self._defaults['GetWaveformBurstStartLocations']['locations'])): + locations_ref[i] = self._defaults['GetWaveformBurstStartLocations']['locations'][i] return self._defaults['GetWaveformBurstStartLocations']['return'] def niRFSG_GetWaveformBurstStopLocations(self, vi, channel_name, number_of_locations, locations, required_size): # noqa: N802 if self._defaults['GetWaveformBurstStopLocations']['return'] != 0: return self._defaults['GetWaveformBurstStopLocations']['return'] + # required_size + if self._defaults['GetWaveformBurstStopLocations']['requiredSize'] is None: + raise MockFunctionCallError("niRFSG_GetWaveformBurstStopLocations", param='requiredSize') + if required_size is not None: + required_size.contents.value = self._defaults['GetWaveformBurstStopLocations']['requiredSize'] # locations if self._defaults['GetWaveformBurstStopLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformBurstStopLocations", param='locations') - test_value = self._defaults['GetWaveformBurstStopLocations']['locations'] + if number_of_locations.value == 0: + return len(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') - if required_size is not None: - required_size.contents.value = self._defaults['GetWaveformBurstStopLocations']['requiredSize'] + for i in range(len(self._defaults['GetWaveformBurstStopLocations']['locations'])): + locations_ref[i] = self._defaults['GetWaveformBurstStopLocations']['locations'][i] return self._defaults['GetWaveformBurstStopLocations']['return'] def niRFSG_GetWaveformMarkerEventLocations(self, vi, channel_name, number_of_locations, locations, required_size): # noqa: N802 if self._defaults['GetWaveformMarkerEventLocations']['return'] != 0: return self._defaults['GetWaveformMarkerEventLocations']['return'] + # required_size + if self._defaults['GetWaveformMarkerEventLocations']['requiredSize'] is None: + raise MockFunctionCallError("niRFSG_GetWaveformMarkerEventLocations", param='requiredSize') + if required_size is not None: + required_size.contents.value = self._defaults['GetWaveformMarkerEventLocations']['requiredSize'] # locations if self._defaults['GetWaveformMarkerEventLocations']['locations'] is None: raise MockFunctionCallError("niRFSG_GetWaveformMarkerEventLocations", param='locations') - test_value = self._defaults['GetWaveformMarkerEventLocations']['locations'] + if number_of_locations.value == 0: + return len(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') - if required_size is not None: - required_size.contents.value = self._defaults['GetWaveformMarkerEventLocations']['requiredSize'] + for i in range(len(self._defaults['GetWaveformMarkerEventLocations']['locations'])): + locations_ref[i] = self._defaults['GetWaveformMarkerEventLocations']['locations'][i] return self._defaults['GetWaveformMarkerEventLocations']['return'] def niRFSG_InitWithOptions(self, resource_name, id_query, reset_device, option_string, new_vi): # noqa: N802 @@ -873,11 +879,6 @@ def niRFSG_ReadAndDownloadWaveformFromFileTDMS(self, vi, waveform_name, file_pat return self._defaults['ReadAndDownloadWaveformFromFileTDMS']['return'] return self._defaults['ReadAndDownloadWaveformFromFileTDMS']['return'] - def niRFSG_Reset(self, vi): # noqa: N802 - if self._defaults['Reset']['return'] != 0: - return self._defaults['Reset']['return'] - return self._defaults['Reset']['return'] - def niRFSG_ResetAttribute(self, vi, channel_name, attribute_id): # noqa: N802 if self._defaults['ResetAttribute']['return'] != 0: return self._defaults['ResetAttribute']['return'] @@ -1016,6 +1017,21 @@ def niRFSG_WaitUntilSettled(self, vi, max_time_milliseconds): # noqa: N802 return self._defaults['WaitUntilSettled']['return'] return self._defaults['WaitUntilSettled']['return'] + def niRFSG_WriteArbWaveformComplexF32(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF32']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF32']['return'] + return self._defaults['WriteArbWaveformComplexF32']['return'] + + def niRFSG_WriteArbWaveformComplexF64(self, vi, waveform_name, number_of_samples, waveform_data_array, more_data_pending): # noqa: N802 + if self._defaults['WriteArbWaveformComplexF64']['return'] != 0: + return self._defaults['WriteArbWaveformComplexF64']['return'] + return self._defaults['WriteArbWaveformComplexF64']['return'] + + def niRFSG_WriteArbWaveformComplexI16(self, vi, waveform_name, number_of_samples, waveform_data_array): # noqa: N802 + if self._defaults['WriteArbWaveformComplexI16']['return'] != 0: + return self._defaults['WriteArbWaveformComplexI16']['return'] + return self._defaults['WriteArbWaveformComplexI16']['return'] + def niRFSG_WriteP2PEndpointI16(self, vi, stream_endpoint, number_of_samples, endpoint_data): # noqa: N802 if self._defaults['WriteP2PEndpointI16']['return'] != 0: return self._defaults['WriteP2PEndpointI16']['return'] @@ -1031,6 +1047,11 @@ def niRFSG_close(self, vi): # noqa: N802 return self._defaults['close']['return'] return self._defaults['close']['return'] + def niRFSG_reset(self, vi): # noqa: N802 + if self._defaults['reset']['return'] != 0: + return self._defaults['reset']['return'] + return self._defaults['reset']['return'] + # Helper function to setup Mock object with default side effects and return values def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_Abort.side_effect = MockFunctionCallError("niRFSG_Abort") @@ -1173,8 +1194,6 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_QueryArbWaveformCapabilities.return_value = 0 mock_library.niRFSG_ReadAndDownloadWaveformFromFileTDMS.side_effect = MockFunctionCallError("niRFSG_ReadAndDownloadWaveformFromFileTDMS") mock_library.niRFSG_ReadAndDownloadWaveformFromFileTDMS.return_value = 0 - mock_library.niRFSG_Reset.side_effect = MockFunctionCallError("niRFSG_Reset") - mock_library.niRFSG_Reset.return_value = 0 mock_library.niRFSG_ResetAttribute.side_effect = MockFunctionCallError("niRFSG_ResetAttribute") mock_library.niRFSG_ResetAttribute.return_value = 0 mock_library.niRFSG_ResetDevice.side_effect = MockFunctionCallError("niRFSG_ResetDevice") @@ -1219,9 +1238,17 @@ def set_side_effects_and_return_values(self, mock_library): mock_library.niRFSG_UnlockSession.return_value = 0 mock_library.niRFSG_WaitUntilSettled.side_effect = MockFunctionCallError("niRFSG_WaitUntilSettled") mock_library.niRFSG_WaitUntilSettled.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF32.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF32") + mock_library.niRFSG_WriteArbWaveformComplexF32.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexF64.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexF64") + mock_library.niRFSG_WriteArbWaveformComplexF64.return_value = 0 + mock_library.niRFSG_WriteArbWaveformComplexI16.side_effect = MockFunctionCallError("niRFSG_WriteArbWaveformComplexI16") + mock_library.niRFSG_WriteArbWaveformComplexI16.return_value = 0 mock_library.niRFSG_WriteP2PEndpointI16.side_effect = MockFunctionCallError("niRFSG_WriteP2PEndpointI16") mock_library.niRFSG_WriteP2PEndpointI16.return_value = 0 mock_library.niRFSG_WriteScript.side_effect = MockFunctionCallError("niRFSG_WriteScript") mock_library.niRFSG_WriteScript.return_value = 0 mock_library.niRFSG_close.side_effect = MockFunctionCallError("niRFSG_close") mock_library.niRFSG_close.return_value = 0 + mock_library.niRFSG_reset.side_effect = MockFunctionCallError("niRFSG_reset") + mock_library.niRFSG_reset.return_value = 0 diff --git a/src/nirfsg/examples/nirfsg_arb_waveform.py b/src/nirfsg/examples/nirfsg_arb_waveform.py new file mode 100644 index 000000000..7bbc6fd26 --- /dev/null +++ b/src/nirfsg/examples/nirfsg_arb_waveform.py @@ -0,0 +1,46 @@ +import argparse +import nirfsg +import numpy as np +import sys + + +def example(resource_name, options, frequency, power_level, number_of_samples): + waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex128) + with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: + session.configure_rf( + frequency, + power_level + ) + session.generation_mode = nirfsg.GenerationMode.ARB_WAVEFORM + session.write_arb_waveform('wfm', waveform_data, False) + with session.initiate(): + session.check_generation_status() + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Continuously generates an arbitrary waveform using NI-RFSG.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') + parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') + parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') + parser.add_argument('-s', '--number-of-samples', default=1000, type=int, help='Number of samples.') + parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = "Simulate=1, DriverSetup=Model:5841" + example('5841', options, 1e9, -10.0, 1000) + + +def test_main(): + cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] + _main(cmd_line) + + +if __name__ == '__main__': + main() diff --git a/src/nirfsg/examples/nirfsg_cw.py b/src/nirfsg/examples/nirfsg_cw.py index 9607855b5..4f2701f49 100644 --- a/src/nirfsg/examples/nirfsg_cw.py +++ b/src/nirfsg/examples/nirfsg_cw.py @@ -42,4 +42,4 @@ def test_main(): if __name__ == '__main__': - main() \ No newline at end of file + main() diff --git a/src/nirfsg/examples/nirfsg_script.py b/src/nirfsg/examples/nirfsg_script.py new file mode 100644 index 000000000..627ca1845 --- /dev/null +++ b/src/nirfsg/examples/nirfsg_script.py @@ -0,0 +1,55 @@ +import argparse +import nirfsg +import numpy as np +import sys + +SAMPLE_SCRIPT = ''' +script continuousWaveform + repeat forever + generate wfm + end repeat +end script +''' + + +def example(resource_name, options, frequency, power_level, number_of_samples): + waveform_data = np.full(number_of_samples, 1 + 0j, dtype=np.complex64) + with nirfsg.Session(resource_name=resource_name, id_query=False, reset_device=False, options=options) as session: + session.configure_rf( + frequency, + power_level + ) + session.generation_mode = nirfsg.GenerationMode.SCRIPT + session.write_arb_waveform('wfm', waveform_data, False) + session.write_script(SAMPLE_SCRIPT) + with session.initiate(): + session.check_generation_status() + + +def _main(argsv): + parser = argparse.ArgumentParser(description='Generates a signal based on the script provided.', formatter_class=argparse.ArgumentDefaultsHelpFormatter) + parser.add_argument('-n', '--resource-name', default='5841', help='Resource name of the NI RF signal generator.') + parser.add_argument('-f', '--frequency', default=1e9, type=float, help='Frequency in Hz.') + parser.add_argument('-p', '--power-level', default=-10.0, type=float, help='Power level in dBm.') + parser.add_argument('-s', '--number-of-samples', default=1000, type=int, help='Number of samples.') + parser.add_argument('-op', '--option-string', default='Simulate=1, DriverSetup=Model:5841', type=str, help='Option string for the session.') + args = parser.parse_args(argsv) + example(args.resource_name, args.option_string, args.frequency, args.power_level, args.number_of_samples) + + +def main(): + _main(sys.argv[1:]) + + +def test_example(): + options = "Simulate=1, DriverSetup=Model:5841" + example('5841', options, 1e9, -10.0, 1000) + + +def test_main(): + cmd_line = ['--resource-name', '5841', '--frequency', '1e9', '--power-level', '-10', '--number-of-samples', '1000', '--option-string', 'Simulate=1, DriverSetup=Model:5841'] + _main(cmd_line) + + +if __name__ == '__main__': + main() diff --git a/src/nirfsg/metadata/functions.py b/src/nirfsg/metadata/functions.py index bebed2af1..356bfc376 100644 --- a/src/nirfsg/metadata/functions.py +++ b/src/nirfsg/metadata/functions.py @@ -32,7 +32,7 @@ 'AllocateArbWaveform': { 'codegen_method': 'public', 'documentation': { - 'description': 'Allocates onboard memory space for the arbitrary waveform. \n\nUse this function to specify the total size of a waveform before writing the data. Use this function only if you are calling the nirfsg_WriteArbWaveform function multiple times to write a large waveform in smaller blocks.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Streaming Waveform Data `_' + 'description': 'Allocates onboard memory space for the arbitrary waveform.\n\nUse this function to specify the total size of a waveform before writing the data. Use this function only if you are calling the nirfsg_WriteArbWaveform function multiple times to write a large waveform in smaller blocks.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Streaming Waveform Data `_' }, 'included_in_proto': True, 'method_templates': [ @@ -486,7 +486,7 @@ 'CheckGenerationStatus': { 'codegen_method': 'public', 'documentation': { - 'description': '\nChecks the status of the generation. \n\nCall this function to check for any errors that might occur during the signal generation or to check whether the device has finished generating.\n\n**Supported Devices** : 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\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_\n\n`Stopping Pear-to-Peer Generation `_' + 'description': '\nChecks the status of the generation.\n\nCall this function to check for any errors that might occur during the signal generation or to check whether the device has finished generating.\n\n**Supported Devices** : 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\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_\n\n`Stopping Pear-to-Peer Generation `_' }, 'included_in_proto': True, 'method_templates': [ @@ -600,7 +600,7 @@ 'CheckIfWaveformExists': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nReturns whether the waveform that you specify as NIRFSG_ATTR_WAVEFORM_NAME exists.\n\n**Supported Devices** : PXIe-5673/5673E, PXIe-5830/5831/5840/5841/5842/5860' + 'description': '\nReturns whether the waveform that you specify as NIRFSG_ATTR_WAVEFORM_NAME exists.\n\n**Supported Devices** : PXIe-5673/5673E, PXIe-5830/5831/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -662,7 +662,7 @@ 'ClearAllArbWaveforms': { 'codegen_method': 'public', 'documentation': { - 'description': '\nDeletes all currently defined waveforms and scripts. \n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nDeletes all currently defined waveforms and scripts.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -690,7 +690,7 @@ 'ClearArbWaveform': { 'codegen_method': 'public', 'documentation': { - 'description': '\nDeletes a specified waveform from the pool of currently defined waveforms. \n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nDeletes a specified waveform from the pool of currently defined waveforms.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -728,7 +728,7 @@ 'ClearError': { 'codegen_method': 'public', 'documentation': { - 'description': '\nClears the error information associated with the session. \n\nIf you pass VI_NULL for the NIRFSG_ATTR_VI parameter, this function clears the error information for the current execution thread.\n\nThe IVI Engine also maintains this error information separately for each thread. This feature of the IVI Engine is useful if you do not have a session handle to pass to the nirfsg_ClearError function or the nirfsg_GetError function, which occurs when a call to the nirfsg_Init function or the nirfsg_InitWithOptions function fails.\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/5840/5841/5842/5860', + 'description': '\nClears the error information associated with the session.\n\nIf you pass VI_NULL for the NIRFSG_ATTR_VI parameter, this function clears the error information for the current execution thread.\n\nThe IVI Engine also maintains this error information separately for each thread. This feature of the IVI Engine is useful if you do not have a session handle to pass to the nirfsg_ClearError function or the nirfsg_GetError function, which occurs when a call to the nirfsg_Init function or the nirfsg_InitWithOptions function fails.\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/5840/5841/5842/5860', 'note': 'The nirfsg_GetError function clears the error information after it is retrieved. A call to the nirfsg_ClearError function is necessary only when you do not use a call to the nirfsg_GetError function to retrieve error information.' }, 'included_in_proto': True, @@ -785,7 +785,7 @@ 'Commit': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nPrograms the device with the correct settings. \n\nCalling this function moves the NI-RFSG device from the Configuration state to the Committed state. After this function executes, a change to any attribute reverts the NI-RFSG device to the Configuration state.\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\n**Related Topics**\n\n`NI-RFSG Programming State Model `_' + 'description': '\nPrograms the device with the correct settings.\n\nCalling this function moves the NI-RFSG device from the Configuration state to the Committed state. After this function executes, a change to any attribute reverts the NI-RFSG device to the Configuration state.\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\n**Related Topics**\n\n`NI-RFSG Programming State Model `_' }, 'included_in_proto': True, 'method_templates': [ @@ -813,7 +813,7 @@ 'ConfigureDeembeddingTableInterpolationLinear': { 'codegen_method': 'public', 'documentation': { - 'description': 'Selects the linear interpolation method. \n\nIf the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a linear interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' + 'description': 'Selects the linear interpolation method.\n\nIf the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a linear interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -894,7 +894,7 @@ 'ConfigureDeembeddingTableInterpolationNearest': { 'codegen_method': 'public', 'documentation': { - 'description': 'Selects the nearest interpolation method. \n\nNI-RFSG uses the parameters of the table nearest to the carrier frequency for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' + 'description': 'Selects the nearest interpolation method.\n\nNI-RFSG uses the parameters of the table nearest to the carrier frequency for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -942,7 +942,7 @@ 'ConfigureDeembeddingTableInterpolationSpline': { 'codegen_method': 'public', 'documentation': { - 'description': 'Selects the spline interpolation method. \n\nIf the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a spline interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' + 'description': 'Selects the spline interpolation method.\n\nIf the carrier frequency does not match a row in the de-embedding table, NI-RFSG performs a spline interpolation based on the entries in the de-embedding table to determine the parameters to use for de-embedding.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -990,7 +990,7 @@ 'ConfigureDigitalEdgeScriptTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the specified Script Trigger for digital edge triggering. \n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Digital Edge Trigger `_' + 'description': '\nConfigures the specified Script Trigger for digital edge triggering.\n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Digital Edge Trigger `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1038,6 +1038,7 @@ 'description': 'Specifies the active edge for the digital edge Script Trigger. NI-RFSG sets the NIRFSG_ATTR_DIGITAL_EDGE_SCRIPT_TRIGGER_EDGE attribute to this value.' }, 'name': 'edge', + 'enum': 'ScriptTrigDigEdgeEdge', 'type': 'ViInt32', 'use_array': False, 'use_in_python_api': True @@ -1048,7 +1049,7 @@ 'ConfigureDigitalEdgeStartTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the Start Trigger for digital edge triggering. \n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_\n\n`Digital Edge Trigger `_', + 'description': '\nConfigures the Start Trigger for digital edge triggering.\n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_\n\n`Digital Edge Trigger `_', 'note': 'For the PXIe-5654/5654 with PXIe-5696, the Start Trigger is valid only with a timer-based list when RF list mode is enabled.' }, 'included_in_proto': True, @@ -1087,6 +1088,7 @@ 'description': 'Specifies the active edge for the Start Trigger. NI-RFSG sets the NIRFSG_ATTR_DIGITAL_EDGE_START_TRIGGER_EDGE attribute to this value.' }, 'name': 'edge', + 'enum': 'StartTrigDigEdgeEdge', 'type': 'ViInt32', 'use_array': False, 'use_in_python_api': True @@ -1097,7 +1099,7 @@ 'ConfigureDigitalLevelScriptTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures a specified Script Trigger for digital level triggering. \n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Digital Level Trigger `_' + 'description': '\nConfigures a specified Script Trigger for digital level triggering.\n\nThe NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Digital Level Trigger `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1207,7 +1209,7 @@ 'ConfigureGenerationMode': { 'codegen_method': 'public', 'documentation': { - 'description': '\nConfigures the NI-RFSG device to generate a continuous sine tone (CW), apply I/Q (vector) modulation to the RF output signal, or generate arbitrary waveforms according to scripts. \n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**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\n\n**Related Topics**\n\n`Assigning Properties or Attributes to a Waveform `_\n\n`Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.' + 'description': '\nConfigures the NI-RFSG device to generate a continuous sine tone (CW), apply I/Q (vector) modulation to the RF output signal, or generate arbitrary waveforms according to scripts.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\n**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\n\n**Related Topics**\n\n`Assigning Properties or Attributes to a Waveform `_\n\n`Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.' }, 'included_in_proto': True, 'method_templates': [ @@ -1232,7 +1234,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the mode used by NI-RFSG for generating an RF output signal.\n\n **Default Value** : NIRFSG_VAL_CW\n\n **Defined Values** :\n ', + 'description': 'Specifies the mode used by NI-RFSG for generating an RF output signal.\n\n **Default Value** : NIRFSG_VAL_CW\n\n **Defined Values** : ', 'note': '- For the PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, only NIRFSG_VAL_CW is supported.\n\n - If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported.', 'table_body': [ [ @@ -1269,7 +1271,7 @@ 'ConfigureOutputEnabled': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nEnables or disables signal output. \n\nSetting NIRFSG_ATTR_OUTPUT_ENABLED to VI_FALSE while in the Generation state attenuates the generated signal so that no signal is output.\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\n**Related Topics**\n\n`Output Enabled `_\n\n`NI-RFSG Instrument Driver Programming Flow `_\n\n`RF List Mode `_' + 'description': '\nEnables or disables signal output.\n\nSetting NIRFSG_ATTR_OUTPUT_ENABLED to VI_FALSE while in the Generation state attenuates the generated signal so that no signal is output.\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\n**Related Topics**\n\n`Output Enabled `_\n\n`NI-RFSG Instrument Driver Programming Flow `_\n\n`RF List Mode `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1307,7 +1309,7 @@ 'ConfigureP2PEndpointFullnessStartTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\nConfigures the Start Trigger to detect peer-to-peer endpoint fullness. \n\nGeneration begins when the number of samples in the peer-to-peer endpoint reaches the threshold specified by the NIRFSG_ATTR_P2P_ENDPOINT_FULLNESS_LEVEL parameter. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n**Related Topics**\n\n`Start Trigger `_', + 'description': '\nConfigures the Start Trigger to detect peer-to-peer endpoint fullness.\n\nGeneration begins when the number of samples in the peer-to-peer endpoint reaches the threshold specified by the NIRFSG_ATTR_P2P_ENDPOINT_FULLNESS_LEVEL parameter. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n**Related Topics**\n\n`Start Trigger `_', 'note': 'Due to an additional internal FIFO in the RF signal generator, the writer peer actually writes 2,304 bytes more than the quantity of data specified by this function to satisfy the trigger level.' }, 'included_in_proto': True, @@ -1346,7 +1348,7 @@ 'ConfigurePowerLevelType': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nSpecifies the way the driver interprets the NIRFSG_ATTR_POWER_LEVEL attribute. \n\nIn average power mode, NI-RFSG automatically scales waveform data to use the maximum dynamic range. In peak power mode, waveforms are scaled according to the NIRFSG_ATTR_ARB_WAVEFORM_SOFTWARE_SCALING_FACTOR attribute.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Spurious Performance `_\n\n`Optimizing for Low Power Generation `_' + 'description': '\nSpecifies the way the driver interprets the NIRFSG_ATTR_POWER_LEVEL attribute.\n\nIn average power mode, NI-RFSG automatically scales waveform data to use the maximum dynamic range. In peak power mode, waveforms are scaled according to the NIRFSG_ATTR_ARB_WAVEFORM_SOFTWARE_SCALING_FACTOR attribute.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Spurious Performance `_\n\n`Optimizing for Low Power Generation `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1391,6 +1393,7 @@ ] }, 'name': 'powerLevelType', + 'enum': 'PowerLevelType', 'type': 'ViInt32', 'use_array': False, 'use_in_python_api': True @@ -1401,7 +1404,7 @@ 'ConfigurePxiChassisClk10': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nSpecifies the signal to drive the 10MHz Reference Clock on the PXI backplane. \n\nThis option can only be configured when the PXI-5610 is in Slot 2 of the PXI chassis. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXI-5610, PXI-5670/5671\n\n**Related Topics**\n\n`Timing Configurations `_\n\n`System Reference Clock `_' + 'description': '\nSpecifies the signal to drive the 10MHz Reference Clock on the PXI backplane.\n\nThis option can only be configured when the PXI-5610 is in Slot 2 of the PXI chassis. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXI-5610, PXI-5670/5671\n\n**Related Topics**\n\n`Timing Configurations `_\n\n`System Reference Clock `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1439,7 +1442,7 @@ 'ConfigureRF': { 'codegen_method': 'public', 'documentation': { - 'description': '\nConfigures the frequency and power level of the RF output signal. \n\nThe PXI-5670/5671, PXIe-5672, and PXIe-5860 device must be in the Configuration state before calling this function. The PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXIe-5673/5673E, and PXIe-5830/5831/5832/5840/5841/5842 device can be in the Configuration or Generation state when you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_' + 'description': '\nConfigures the frequency and power level of the RF output signal.\n\nThe PXI-5670/5671, PXIe-5672, and PXIe-5860 device must be in the Configuration state before calling this function. The PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXIe-5673/5673E, and PXIe-5830/5831/5832/5840/5841/5842 device can be in the Configuration or Generation state when you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1487,7 +1490,7 @@ 'ConfigureRefClock': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the NI-RFSG device Reference Clock. \n\nThe Reference Clock ensures that the NI-RFSG devices are operating from a common timebase. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXI-5610, PXIe-5644/5645/5646, 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\n**Related Topics**\n\n`PXIe-5672 Timing Configurations `_\n\n`PXIe-5673 Timing Configurations `_\n\n`PXIe-5673E Timing Configurations `_\n\n`PXIe-5830 Timing Configurations `_\n\n`PXIe-5831 Timing Configurations `_' + 'description': '\nConfigures the NI-RFSG device Reference Clock.\n\nThe Reference Clock ensures that the NI-RFSG devices are operating from a common timebase. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXI-5610, PXIe-5644/5645/5646, 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\n**Related Topics**\n\n`PXIe-5672 Timing Configurations `_\n\n`PXIe-5673 Timing Configurations `_\n\n`PXIe-5673E Timing Configurations `_\n\n`PXIe-5830 Timing Configurations `_\n\n`PXIe-5831 Timing Configurations `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1604,7 +1607,7 @@ 'ConfigureSoftwareScriptTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\nConfigures the Script Trigger for software triggering. \n\nRefer to the nirfsg_SendSoftwareEdgeTrigger function for more information about using the software Script Trigger. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Trigger Types `_' + 'description': '\nConfigures the Script Trigger for software triggering.\n\nRefer to the nirfsg_SendSoftwareEdgeTrigger function for more information about using the software Script Trigger. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_\n\n`Trigger Types `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1642,7 +1645,7 @@ 'ConfigureSoftwareStartTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the Start Trigger for software triggering. \n\nRefer to the nirfsg_SendSoftwareEdgeTrigger function for more information about using a software trigger. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_\n\n`Trigger Types `_' + 'description': '\nConfigures the Start Trigger for software triggering.\n\nRefer to the nirfsg_SendSoftwareEdgeTrigger function for more information about using a software trigger. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_\n\n`Trigger Types `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1860,7 +1863,7 @@ 'DisableScriptTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\nConfigures the device not to wait for the specified Script Trigger. \n\nCall this function only if you previously configured a Script Trigger and now want it disabled. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_' + 'description': '\nConfigures the device not to wait for the specified Script Trigger.\n\nCall this function only if you previously configured a Script Trigger and now want it disabled. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Script Trigger `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1898,7 +1901,7 @@ 'DisableStartTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the device not to wait for a Start Trigger. \n\nThis function is necessary only if you previously configured a Start Trigger and now want it disabled. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_' + 'description': '\nConfigures the device not to wait for a Start Trigger.\n\nThis function is necessary only if you previously configured a Start Trigger and now want it disabled. The NI-RFSG device must be in the Configuration state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Start Trigger `_' }, 'included_in_proto': True, 'method_templates': [ @@ -1926,7 +1929,7 @@ '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 ' + 'description': '\nConverts 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' }, 'included_in_proto': True, 'is_error_handling': True, @@ -1942,7 +1945,7 @@ { '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 ' + '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', @@ -1952,7 +1955,7 @@ { '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 ' + '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', @@ -1962,7 +1965,7 @@ { '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 ' + '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': { @@ -1980,7 +1983,7 @@ '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 ' + 'description': '\nReads 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' }, 'included_in_proto': True, 'method_templates': [ @@ -2015,7 +2018,7 @@ { '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 ' + '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. ' }, 'name': 'errorMessage', 'size': { @@ -2032,7 +2035,7 @@ 'ExportSignal': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nRoutes signals (triggers, clocks, and events) to a specified output terminal. \n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\nYou can clear a previously routed signal by exporting the signal to "" (empty string).\n\n**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\n\n**Related Topics**\n\n`Triggers `_\n\n`Events `_\n\n`PFI Lines `_\n\n`PXI Trigger Lines `_' + 'description': '\nRoutes signals (triggers, clocks, and events) to a specified output terminal.\n\nThe NI-RFSG device must be in the Configuration state before you call this function.\n\nYou can clear a previously routed signal by exporting the signal to "" (empty string).\n\n**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\n\n**Related Topics**\n\n`Triggers `_\n\n`Events `_\n\n`PFI Lines `_\n\n`PXI Trigger Lines `_' }, 'included_in_proto': True, 'method_templates': [ @@ -2261,7 +2264,7 @@ 'GetAllScriptNames': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nReturn names of the scripts present in the memory.\n\n**Supported Devices** :PXIe-5830/5831/5840/5841/5842E' + 'description': '\nReturn names of the scripts present in the memory.\n\n**Supported Devices** :PXIe-5830/5831/5840/5841/5842E' }, 'included_in_proto': True, 'method_templates': [ @@ -2381,7 +2384,7 @@ 'GetAttributeViInt32': { 'codegen_method': 'private', 'documentation': { - 'description': '\n\nQueries the value of a ViInt32 attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.' + 'description': '\nQueries the value of a ViInt32 attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.' }, 'included_in_proto': True, 'method_templates': [ @@ -2497,7 +2500,7 @@ 'GetAttributeViReal64': { 'codegen_method': 'private', 'documentation': { - 'description': '\n\nQueries the value of a ViReal64 attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.' + 'description': '\nQueries the value of a ViReal64 attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.' }, 'included_in_proto': True, 'method_templates': [ @@ -2613,7 +2616,7 @@ 'GetAttributeViString': { 'codegen_method': 'private', 'documentation': { - 'description': '\n\n\nQueries the value of a ViString attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.\n\nYou must provide a ViString (ViChar array) to serve as a buffer for the value. Pass the number of bytes in the buffer as the Buffer Size parameter. If the current value of the attribute, including the terminating NULL byte, is larger than the size you indicate in the buffer size parameter, the function copies buffer size-1 bytes into the buffer, places an ASCII NULL byte at the end of the buffer, and returns the buffer size you must pass to get the entire value. For example, if the value is "123456" and the buffer size is 4, the function places "123" into the buffer and returns 7.\n\nTo call this function to get only the required buffer size, pass 0 for the buffer size and VI_NULL for the attribute value buffer.' + 'description': '\nQueries the value of a ViString attribute.\n\nUse this low-level function to get the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid.\n\nYou must provide a ViString (ViChar array) to serve as a buffer for the value. Pass the number of bytes in the buffer as the Buffer Size parameter. If the current value of the attribute, including the terminating NULL byte, is larger than the size you indicate in the buffer size parameter, the function copies buffer size-1 bytes into the buffer, places an ASCII NULL byte at the end of the buffer, and returns the buffer size you must pass to get the entire value. For example, if the value is "123456" and the buffer size is 4, the function places "123" into the buffer and returns 7.\n\nTo call this function to get only the required buffer size, pass 0 for the buffer size and VI_NULL for the attribute value buffer.' }, 'included_in_proto': True, 'method_templates': [ @@ -2813,7 +2816,7 @@ 'GetExternalCalibrationLastDateAndTime': { 'codegen_method': 'private', 'documentation': { - 'description': '\nReturns the date and time of the last successful external calibration. \n\nThe time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nReturns the date and time of the last successful external calibration.\n\nThe time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_name_for_documentation': 'get_external_calibration_last_date_and_time', @@ -2894,7 +2897,7 @@ 'GetLastExtCalLastDateAndTime': { 'codegen_method': 'python-only', 'documentation': { - 'description': 'TBD' + 'description': '\nReturns the date and time of the last successful external calibration.\n\nThe time returned is 24-hour (military) local time; for example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5696, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -2924,7 +2927,7 @@ 'GetLastSelfCalLastDateAndTime': { 'codegen_method': 'python-only', 'documentation': { - 'description': 'TBD' + 'description': '\nReturns the date and time of the last successful self-calibration.\n\nThe time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -2941,6 +2944,17 @@ 'name': 'vi', 'type': 'ViSession' }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies from which stand-alone module to retrieve the last successful self-calibration date and time.' + }, + 'name': 'module', + 'enum': 'Module', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': True + }, { 'direction': 'out', 'name': 'lastCalDatetime', @@ -2954,7 +2968,7 @@ 'GetMaxSettablePower': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nReturns the maximum settable output power level for the current configuration.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' + 'description': '\nReturns the maximum settable output power level for the current configuration.\n\n**Supported Devices** : PXIe-5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -2992,7 +3006,7 @@ 'GetSelfCalibrationDateAndTime': { 'codegen_method': 'private', 'documentation': { - 'description': '\nReturns the date and time of the last successful self-calibration. \n\nThe time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nReturns the date and time of the last successful self-calibration.\n\nThe time returned is 24-hour local time. For example, if the device was calibrated at 2:30PM, this function returns\n\n14 for the hours parameter and\n\n30 for the minutes parameter.\n\n**Supported Devices** : PXI-5610, PXIe-5644/5645/5646, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_name_for_documentation': 'get_self_calibration_date_and_time', @@ -3013,6 +3027,7 @@ 'description': 'Specifies from which stand-alone module to retrieve the last successful self-calibration date and time.' }, 'name': 'module', + 'enum': 'Module', 'type': 'ViInt32', 'use_array': False, 'use_in_python_api': True @@ -3108,7 +3123,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. \n **Default Value** : NIRFSG_VAL_PRIMARY_MODULE\n **Defined Values** :\n ', + 'description': 'Specifies from which stand-alone module to retrieve the last successful self-calibration temperature. **Default Value** : NIRFSG_VAL_PRIMARY_MODULE **Defined Values** : ', 'table_body': [ [ 'NIRFSG_VAL_PRIMARY_MODULE', @@ -3154,7 +3169,7 @@ 'GetStreamEndpointHandle': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nReturns a reader endpoint handle that can be used with NI-P2P to configure a peer-to-peer stream with an RF signal generator endpoint.\n\n**Supported Devices** : PXIe-5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n**Related Topics**\n\n`Configuring a Peer-to-Peer Stream `_\n\n`Configuring Flow Control `_' + 'description': '\nReturns a reader endpoint handle that can be used with NI-P2P to configure a peer-to-peer stream with an RF signal generator endpoint.\n\n**Supported Devices** : PXIe-5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n**Related Topics**\n\n`Configuring a Peer-to-Peer Stream `_\n\n`Configuring Flow Control `_' }, 'included_in_proto': True, 'method_templates': [ @@ -3202,7 +3217,7 @@ 'GetTerminalName': { 'codegen_method': 'public', 'documentation': { - 'description': '\nReturns the fully-qualified name of the specified signal. \n\nThe fully-qualified name is helpful to automatically route signals in a multisegment chassis.\n\n**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\n\n**Related Topics**\n\n`Triggers `_\n\n`Events `_\n\n`Syntax for Terminal Names `_' + 'description': '\nReturns the fully-qualified name of the specified signal.\n\nThe fully-qualified name is helpful to automatically route signals in a multisegment chassis.\n\n**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\n\n**Related Topics**\n\n`Triggers `_\n\n`Events `_\n\n`Syntax for Terminal Names `_' }, 'included_in_proto': True, 'method_templates': [ @@ -3227,7 +3242,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the signal to query. **Defined Values** :\n ', + 'description': 'Specifies the signal to query. **Defined Values** : ', 'table_body': [ [ 'NIRFSG_VAL_START_TRIGGER', @@ -3285,7 +3300,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies which instance of the selected signal to query. This parameter is necessary when you set the NIRFSG_ATTR_SIGNAL parameter to NIRFSG_VAL_SCRIPT_TRIGGER or NIRFSG_VAL_MARKER_EVENT . Otherwise, set the NIRFSG_ATTR_SIGNAL_IDENTIFIER parameter to "" (empty string). **Possible Values** :\n ', + 'description': 'Specifies which instance of the selected signal to query. This parameter is necessary when you set the NIRFSG_ATTR_SIGNAL parameter to NIRFSG_VAL_SCRIPT_TRIGGER or NIRFSG_VAL_MARKER_EVENT . Otherwise, set the NIRFSG_ATTR_SIGNAL_IDENTIFIER parameter to "" (empty string). **Possible Values** : ', 'table_body': [ [ '"marker0"', @@ -3360,7 +3375,7 @@ 'GetWaveformBurstStartLocations': { '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 ' + 'description': '\nReturns 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' }, 'included_in_proto': True, 'method_templates': [ @@ -3388,6 +3403,8 @@ 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'waveform', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -3409,11 +3426,11 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', - 'value': 'numberOfLocations' + 'mechanism': 'ivi-dance-with-a-twist', + 'value': 'numberOfLocations', + 'value_twist': 'requiredSize' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True }, { @@ -3432,7 +3449,7 @@ 'GetWaveformBurstStopLocations': { '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 ' + 'description': '\nReturns 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' }, 'included_in_proto': True, 'method_templates': [ @@ -3460,6 +3477,8 @@ 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'waveform', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -3481,11 +3500,11 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', - 'value': 'numberOfLocations' + 'mechanism': 'ivi-dance-with-a-twist', + 'value': 'numberOfLocations', + 'value_twist': 'requiredSize' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True }, { @@ -3504,7 +3523,7 @@ 'GetWaveformMarkerEventLocations': { '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 ' + 'description': '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' }, 'included_in_proto': True, 'method_templates': [ @@ -3529,9 +3548,11 @@ { 'direction': 'in', 'documentation': { - 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0" ' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'markers', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -3553,11 +3574,11 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', - 'value': 'numberOfLocations' + 'mechanism': 'ivi-dance-with-a-twist', + 'value': 'numberOfLocations', + 'value_twist': 'requiredSize' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True }, { @@ -3576,7 +3597,7 @@ 'InitWithOptions': { 'codegen_method': 'private', 'documentation': { - 'description': '\nOpens a session to the device you specify as the NIRFSG_ATTR_RESOURCE_NAME and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG function calls. \n\nThis function also configures the device through the NIRFSG_ATTR_OPTION_STRING input.\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\n**Related Topics**\n\n`Simulating an NI RF Signal Generator `_', + 'description': '\nOpens a session to the device you specify as the NIRFSG_ATTR_RESOURCE_NAME and returns a ViSession handle that you use to identify the NI-RFSG device in all subsequent NI-RFSG function calls.\n\nThis function also configures the device through the NIRFSG_ATTR_OPTION_STRING input.\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\n**Related Topics**\n\n`Simulating an NI RF Signal Generator `_', 'note': 'For multichannel devices such as the PXIe-5860, the resource name must include the channel number to use. The channel number is specified by appending /*ChannelNumber* to the device name, where *ChannelNumber* is the channel number (0, 1, etc.). For example, if the device name is PXI1Slot2 and you want to use channel 0, use the resource name PXI1Slot2/0.' }, 'included_in_proto': True, @@ -3652,6 +3673,7 @@ 'use_in_python_api': True }, { + 'default_value': '""', 'direction': 'in', 'documentation': { 'description': 'Specifies the initial value of certain attributes for the session. The following table lists the attributes and the name you pass in this parameter to identify the attribute.\n\nThe format of this string consists of the following relations:\n"AttributeName=Value"\n\nwhere\n*AttributeName* is the name of the attribute and *Value* is the value to which the attribute is set. To set multiple attributes, separate their assignments with a comma, as shown in the following option string:\n\n"RangeCheck=1,QueryInstrStatus=0,Cache=1,DriverSetup=AWG:pxi1slot4"\n\nThe `DriverSetup string `_ is required in order to simulate a specific device.', @@ -3683,9 +3705,9 @@ ] }, 'name': 'optionString', + 'python_api_converter_name': 'convert_init_with_options_dictionary', 'type': 'ViConstString', - 'use_array': False, - 'use_in_python_api': True + 'type_in_documentation': 'dict' }, { 'direction': 'out', @@ -3704,7 +3726,7 @@ 'Initiate': { 'codegen_method': 'private', 'documentation': { - 'description': '\n\nInitiates signal generation, causing the NI-RFSG device to leave the Configuration state and enter the Generation state. \n\nIf the settings have not been committed to the device before you call this function, they are committed by this function. The operation returns when the RF output signal settles. To return to the Configuration state, call the nirfsg_Abort function.\n\n**Supported Devices** : 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\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_' + 'description': '\nInitiates signal generation, causing the NI-RFSG device to leave the Configuration state and enter the Generation state.\n\nIf the settings have not been committed to the device before you call this function, they are committed by this function. The operation returns when the RF output signal settles. To return to the Configuration state, call the nirfsg_Abort function.\n\n**Supported Devices** : 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\n**Related Topics**\n\n`NI-RFSG Instrument Driver Programming Flow `_' }, 'included_in_proto': True, 'parameters': [ @@ -3724,7 +3746,7 @@ 'LoadConfigurationsFromFile': { 'codegen_method': 'public', 'documentation': { - 'description': '\nLoads the configurations from the specified file to the NI-RFSG driver session. \n\nThe VI does an implicit reset before loading the configurations from the file.\n\n**Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nLoads the configurations from the specified file to the NI-RFSG driver session.\n\nThe VI does an implicit reset before loading the configurations from the file.\n\n**Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -3749,7 +3771,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the waveform name and the marker name.\n\nExample:\n\n"waveform::waveform0/marker0"' + 'description': 'Specifies the name of the channel.' }, 'name': 'channelName', 'type': 'ViConstString', @@ -3772,7 +3794,7 @@ 'LockSession': { 'codegen_method': 'public', 'documentation': { - 'description': '\nObtains a multithread lock on the instrument session. \n\nBefore doing so, this function waits until all other execution threads have released their locks on the instrument session.\n\nOther threads might have obtained a lock on this session in the following ways:\n\n- Your application already called the nirfsg_LockSession function.\n- A call to NI-RFSG locked the session.\n\nAfter the call to this function returns successfully, no other threads can access the instrument session until you call the nirfsg_UnlockSession function. Use the nirfsg_LockSession function and the nirfsg_UnlockSession function around a sequence of calls to NI-RFSG functions if you require that the NI-RFSG device retain its settings through the end of the sequence.\n\nYou can safely make nested calls to the nirfsg_LockSession function within the same thread. To completely unlock the session, balance each call to the nirfsg_LockSession function with a call to the nirfsg_UnlockSession function. If, however, you use the NIRFSG_ATTR_CALLER_HAS_LOCK parameter in all calls to the nirfsg_LockSession function and the nirfsg_UnlockSession function within a function, the IVI Library locks the session only once within the function regardless of the number of calls you make to the nirfsg_LockSession function. Locking the session only once allows you to call nirfsg_UnlockSession just once at the end of the function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860' + 'description': '\nObtains a multithread lock on the instrument session.\n\nBefore doing so, this function waits until all other execution threads have released their locks on the instrument session.\n\nOther threads might have obtained a lock on this session in the following ways:\n\n- Your application already called the nirfsg_LockSession function.\n- A call to NI-RFSG locked the session.\n\nAfter the call to this function returns successfully, no other threads can access the instrument session until you call the nirfsg_UnlockSession function. Use the nirfsg_LockSession function and the nirfsg_UnlockSession function around a sequence of calls to NI-RFSG functions if you require that the NI-RFSG device retain its settings through the end of the sequence.\n\nYou can safely make nested calls to the nirfsg_LockSession function within the same thread. To completely unlock the session, balance each call to the nirfsg_LockSession function with a call to the nirfsg_UnlockSession function. If, however, you use the NIRFSG_ATTR_CALLER_HAS_LOCK parameter in all calls to the nirfsg_LockSession function and the nirfsg_UnlockSession function within a function, the IVI Library locks the session only once within the function regardless of the number of calls you make to the nirfsg_LockSession function. Locking the session only once allows you to call nirfsg_UnlockSession just once at the end of the function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -3813,7 +3835,7 @@ 'PerformPowerSearch': { 'codegen_method': 'public', 'documentation': { - 'description': '\nPerforms a power search if the NIRFSG_ATTR_ALC_CONTROL attribute is disabled. \n\nCalling this function disables modulation for a short time while the device levels the output signal.\n\n**Supported Devices** : PXIe-5654 with PXIe-5696\n\n**Related Topics**\n\n`Power Search `_', + 'description': '\nPerforms a power search if the NIRFSG_ATTR_ALC_CONTROL attribute is disabled.\n\nCalling this function disables modulation for a short time while the device levels the output signal.\n\n**Supported Devices** : PXIe-5654 with PXIe-5696\n\n**Related Topics**\n\n`Power Search `_', 'note': 'Power search temporarily enables the ALC, so ensure the appropriate included cable is connected between the PXIe-5654 ALCIN connector and the PXIe-5696 ALCOUT connector to successfully perform a power search.' }, 'included_in_proto': True, @@ -3842,7 +3864,7 @@ 'PerformThermalCorrection': { 'codegen_method': 'public', 'documentation': { - 'description': '\nCorrects for any signal drift due to environmental temperature variation when generating the same signal for extended periods of time without a parameter change. \n\nUnder normal circumstances of short-term signal generation, NI-RFSG performs thermal correction automatically by ensuring stable power levels, and you do not need to call this function.\n\nUse this function when generating the same signal for an extended period of time in a temperature-fluctuating environment. The NI-RFSG device must be in the Generation state before calling this function.\n\n**Supported Devices** : PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Thermal Management `_\n\n`Impairment Calibration `_' + 'description': '\nCorrects for any signal drift due to environmental temperature variation when generating the same signal for extended periods of time without a parameter change.\n\nUnder normal circumstances of short-term signal generation, NI-RFSG performs thermal correction automatically by ensuring stable power levels, and you do not need to call this function.\n\nUse this function when generating the same signal for an extended period of time in a temperature-fluctuating environment. The NI-RFSG device must be in the Generation state before calling this function.\n\n**Supported Devices** : PXIe-5611, PXI/PXIe-5650/5651/5652, PXIe-5653/5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Thermal Management `_\n\n`Impairment Calibration `_' }, 'included_in_proto': True, 'method_templates': [ @@ -3870,7 +3892,7 @@ 'QueryArbWaveformCapabilities': { 'codegen_method': 'public', 'documentation': { - 'description': '\nQueries and returns the waveform capabilities of the NI-RFSG device. \n\nThese capabilities are related to the current device configuration. The NI-RFSG device must be in the Configuration or the Generation state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nQueries and returns the waveform capabilities of the NI-RFSG device.\n\nThese capabilities are related to the current device configuration. The NI-RFSG device must be in the Configuration or the Generation state before calling this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -3993,10 +4015,10 @@ ], 'returns': 'ViStatus' }, - 'Reset': { + 'reset': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nResets all attributes to their default values and moves the NI-RFSG device to the Configuration state. \n\nThis function aborts the generation, deletes all de-embedding tables, clears all routes, and resets session attributes to their initial values. During a reset, routes of signals between this and other devices are released, regardless of which device created the route.\n\nGenerally, calling this function instead of the nirfsg_ResetDevice function is acceptable. The nirfsg_Reset function executes faster than the nirfsg_ResetDevice function.\n\nTo 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 nirfsg_ResetWithOptions function, with **stepsToOmit** set to NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES .\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', + 'description': '\nResets all attributes to their default values and moves the NI-RFSG device to the Configuration state.\n\nThis function aborts the generation, deletes all de-embedding tables, clears all routes, and resets session attributes to their initial values. During a reset, routes of signals between this and other devices are released, regardless of which device created the route.\n\nGenerally, calling this function instead of the nirfsg_ResetDevice function is acceptable. The nirfsg_Reset function executes faster than the nirfsg_ResetDevice function.\n\nTo 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 nirfsg_ResetWithOptions function, with **stepsToOmit** set to NIRFSG_VAL_RESET_WITH_OPTIONS_ROUTES .\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', 'note': 'This function resets all configured routes for the PXIe-5644/5645/5646 and PXIe-5820/5830/5831/5832/5840/5841/5842/5860 in NI-RFSA and NI-RFSG.' }, 'included_in_proto': True, @@ -4025,7 +4047,7 @@ 'ResetAttribute': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nResets the attribute to its default value.\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' + 'description': '\nResets the attribute to its default value.\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' }, 'included_in_proto': True, 'method_templates': [ @@ -4050,7 +4072,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the waveform name and the marker name.\n\nExample:\n\n"waveform::waveform0/marker0"' + 'description': 'Specifies the name of the channel.' }, 'name': 'channelName', 'type': 'ViConstString', @@ -4186,7 +4208,7 @@ 'SaveConfigurationsToFile': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nSaves the configurations of the session to the specified file.\n\n**Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842/5860' + 'description': '\nSaves the configurations of the session to the specified file.\n\n**Supported Devices** : PXIe-5820/5830/5831/5832/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -4211,7 +4233,7 @@ { 'direction': 'in', 'documentation': { - 'description': 'Specifies the waveform name and the marker name.\n\nExample:\n\n"waveform::waveform0/marker0"' + 'description': 'Specifies the name of the channel.' }, 'name': 'channelName', 'type': 'ViConstString', @@ -4234,7 +4256,7 @@ 'SelectArbWaveform': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nSpecifies the waveform that is generated upon a call to the nirfsg_Initiate function when the **generationMode** parameter of the nirfsg_ConfigureGenerationMode function is set to NIRFSG_VAL_ARB_WAVEFORM. \n\nYou must specify a waveform using the NIRFSG_ATTR_NAME parameter if you have written multiple waveforms. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Assigning Properties or Attributes to a Waveform `_' + 'description': '\nSpecifies the waveform that is generated upon a call to the nirfsg_Initiate function when the **generationMode** parameter of the nirfsg_ConfigureGenerationMode function is set to NIRFSG_VAL_ARB_WAVEFORM.\n\nYou must specify a waveform using the NIRFSG_ATTR_NAME parameter if you have written multiple waveforms. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Assigning Properties or Attributes to a Waveform `_' }, 'included_in_proto': True, 'method_templates': [ @@ -4272,7 +4294,7 @@ 'SelfCal': { 'codegen_method': 'public', 'documentation': { - 'description': '\nPerforms an internal self-calibration on the device and associated modules that support self-calibration. \n\nIf the calibration is successful, new calibration data and constants are stored in the onboard nonvolatile memory of the module.\n\nThe PXIe-5841 maintains separate self-calibration data for both the PXIe-5841 standalone and when associated with the PXIe-5655. Use this function once for each intended configuration.\n\n**Supported Devices** : PXI-5610, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860', + 'description': '\nPerforms an internal self-calibration on the device and associated modules that support self-calibration.\n\nIf the calibration is successful, new calibration data and constants are stored in the onboard nonvolatile memory of the module.\n\nThe PXIe-5841 maintains separate self-calibration data for both the PXIe-5841 standalone and when associated with the PXIe-5655. Use this function once for each intended configuration.\n\n**Supported Devices** : PXI-5610, PXIe-5653, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860', 'note': 'If there is an existing NI-RFSA session open for the same PXIe-5820/5830/5831/5832/5840/5841/5842/5860 while this function runs, it may remain open but cannot be used for operations that access the hardware, for example niRFSA_Commit or niRFSA_Initiate.' }, 'included_in_proto': True, @@ -4418,7 +4440,7 @@ 'SelfTest': { 'codegen_method': 'public', 'documentation': { - 'description': '\nPerforms a self-test on the NI-RFSG device and returns the test results. \n\nThis function performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.\n\nThis function does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this function. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, 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\n**Related Topics**\n\n`Device Warm-Up `_' + 'description': '\nPerforms a self-test on the NI-RFSG device and returns the test results.\n\nThis function performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.\n\nThis function does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this function. The NI-RFSG device must be in the Configuration state before you call this function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, 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\n**Related Topics**\n\n`Device Warm-Up `_' }, 'included_in_proto': True, 'parameters': [ @@ -4470,7 +4492,7 @@ 'SendSoftwareEdgeTrigger': { 'codegen_method': 'public', 'documentation': { - 'description': '\nForces a trigger to occur. \n\nThe specified trigger generates regardless of whether the trigger has been configured as a software trigger.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Triggers `_' + 'description': '\nForces a trigger to occur.\n\nThe specified trigger generates regardless of whether the trigger has been configured as a software trigger.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Triggers `_' }, 'included_in_proto': True, 'method_templates': [ @@ -4563,7 +4585,7 @@ 'SetArbWaveformNextWritePosition': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nConfigures the start position to use for writing a waveform before calling the nirfsg_WriteArbWaveform function. \n\nThis function allows you to write to arbitrary locations within the waveform. These settings apply only to the next write to the waveform specified by the **name** input of the nirfsg_AllocateArbWaveform function or the nirfsg_WriteArbWaveform function. Subsequent writes to that waveform begin where the last write ended, unless this function is called again.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860', + 'description': '\nConfigures the start position to use for writing a waveform before calling the nirfsg_WriteArbWaveform function.\n\nThis function allows you to write to arbitrary locations within the waveform. These settings apply only to the next write to the waveform specified by the **name** input of the nirfsg_AllocateArbWaveform function or the nirfsg_WriteArbWaveform function. Subsequent writes to that waveform begin where the last write ended, unless this function is called again.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5820/5830/5831/5832/5840/5841/5842/5860', 'note': 'If you use this function to write the waveform that is currently generating, an undefined output may result.' }, 'included_in_proto': True, @@ -4640,7 +4662,7 @@ 'SetAttributeViBoolean': { 'codegen_method': 'private', 'documentation': { - 'description': '\n\nSets the value of a ViBoolean attribute.\n\nUse this low-level function to set the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid or is different than the value you specify.\n\nNI-RFSG contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible, as they handle order dependencies and multithread locking. The high-level functions also perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the SetAttribute functions, the functions check the instrument status after each call.\n\nAlso, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.' + 'description': '\nSets the value of a ViBoolean attribute.\n\nUse this low-level function to set the values of inherent IVI attributes, class-defined attributes, and instrument-specific attributes. If the attribute represents an instrument state, this function performs instrument I/O in the following cases:\n\n- State caching is disabled for the entire session or for the particular attribute.\n- State caching is enabled, and the currently cached value is invalid or is different than the value you specify.\n\nNI-RFSG contains high-level functions that set most of the instrument attributes. Use the high-level driver functions as much as possible, as they handle order dependencies and multithread locking. The high-level functions also perform status checking only after setting all of the attributes. In contrast, when you set multiple attributes using the SetAttribute functions, the functions check the instrument status after each call.\n\nAlso, when state caching is enabled, the high-level functions that configure multiple attributes perform instrument I/O only for the attributes whose value you change. Thus, you can safely call the high-level functions without the penalty of redundant instrument I/O.' }, 'included_in_proto': True, 'method_templates': [ @@ -4997,7 +5019,7 @@ '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 ' + 'description': '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' }, 'included_in_proto': True, 'method_templates': [ @@ -5025,6 +5047,8 @@ 'description': 'Specifies the waveform name and the marker name. Example: "waveform::waveform0/marker0"' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'waveform', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -5046,11 +5070,10 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', + 'mechanism': 'len', 'value': 'numberOfLocations' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True } ], @@ -5059,7 +5082,7 @@ '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 ' + 'description': '\nConfigures 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' }, 'included_in_proto': True, 'method_templates': [ @@ -5084,9 +5107,11 @@ { 'direction': 'in', 'documentation': { - 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0" ' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'waveform', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -5108,11 +5133,10 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', + 'mechanism': 'len', 'value': 'numberOfLocations' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True } ], @@ -5121,7 +5145,7 @@ '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 ' + 'description': '\nConfigures 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' }, 'included_in_proto': True, 'method_templates': [ @@ -5146,9 +5170,11 @@ { 'direction': 'in', 'documentation': { - 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0"\n ' + 'description': ' Specifies the waveform name and the marker name.\n\n Example:\n\n "waveform::waveform0/marker0" ' }, 'name': 'channelName', + 'is_repeated_capability': True, + 'repeated_capability_type': 'markers', 'type': 'ViConstString', 'use_array': False, 'use_in_python_api': True @@ -5170,11 +5196,10 @@ }, 'name': 'locations', 'size': { - 'mechanism': 'passed-in', + 'mechanism': 'len', 'value': 'numberOfLocations' }, 'type': 'ViReal64[]', - 'use_array': True, 'use_in_python_api': True } ], @@ -5183,7 +5208,7 @@ 'UnlockSession': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nReleases a lock obtained on an NI-RFSG device session by calling the nirfsg_LockSession function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860' + 'description': '\nReleases a lock obtained on an NI-RFSG device session by calling the nirfsg_LockSession function.\n\n**Supported Devices** : PXI-5610, PXIe-5611, PXIe-5644/5645/5646, PXI/PXIe-5650/5651/5652, PXIe-5654/5654 with PXIe-5696, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5840/5841/5842/5860' }, 'included_in_proto': True, 'method_templates': [ @@ -5224,7 +5249,7 @@ 'WaitUntilSettled': { 'codegen_method': 'public', 'documentation': { - 'description': '\nWaits until the RF output signal has settled. This function is useful for devices that support changes while in the Generation state. \n\nCall this function after making a dynamic change to wait for the output signal to settle.\n\nYou can also call this function after calling the nirfsg_Commit function to wait for changes to settle. The nirfsg_WaitUntilSettled function is not required after calling the nirfsg_Initiate function because the nirfsg_Initiate automatically waits for the output to settle.\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' + 'description': '\nWaits until the RF output signal has settled. This function is useful for devices that support changes while in the Generation state.\n\nCall this function after making a dynamic change to wait for the output signal to settle.\n\nYou can also call this function after calling the nirfsg_Commit function to wait for changes to settle. The nirfsg_WaitUntilSettled function is not required after calling the nirfsg_Initiate function because the nirfsg_Initiate automatically waits for the output to settle.\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' }, 'included_in_proto': True, 'method_templates': [ @@ -5262,7 +5287,7 @@ 'WriteP2PEndpointI16': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nWrites an array of 16-bit integer data to the peer-to-peer endpoint. \n\nUse this function to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation.\n\n**Supported Devices** : PXIe-5673E\n\n**Related Topics**\n\n`Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream.\n\n`Configuring Flow Control `_\n\n`Starting Peer-to-Peer Generation `_\n\n`Reconfiguring a Stream `_' + 'description': '\nWrites an array of 16-bit integer data to the peer-to-peer endpoint.\n\nUse this function to write initial data from the host to the endpoint before starting generation to avoid an underflow when you start the generation.\n\n**Supported Devices** : PXIe-5673E\n\n**Related Topics**\n\n`Peer-to-Peer Data Streaming `_--Refer to this topic for more information about configuring a stream.\n\n`Configuring Flow Control `_\n\n`Starting Peer-to-Peer Generation `_\n\n`Reconfiguring a Stream `_' }, 'included_in_proto': True, 'method_templates': [ @@ -5321,11 +5346,315 @@ } ], 'returns': 'ViStatus' + }, + 'WriteArbWaveformComplexF32': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nWrites an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory.\n\nThis function accepts the complex baseband data in the form of complex singles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Streaming `_\n\n`Assigning Properties or Attributes to a Waveform `_', + 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842/5860, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_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 name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in both of the data arrays.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'NIComplexNumberF32[]', + 'use_in_python_api': True, + 'use_numpy_array': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the NIRFSG_ATTR_WAVEFORM_NAME parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'WriteArbWaveformComplexF64': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nWrites an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory.\n\nThis function accepts the complex baseband data in the form of complex doubles. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform, the moreDataPending parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, you can call this function when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842 is in the Generation state.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842\n\n**Related Topics**\n\n`Streaming `_\n\n`Assigning Properties or Attributes to a Waveform `_', + 'note': 'On the PXIe-5644/5645/5646, PXIe-5672/5673/5673E, and PXIe-5820/5830/5831/5832/5840/5841/5842, the moreDataPending parameter is always ignored. To write data in blocks on these devices, you must allocate the waveform before writing it.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_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 name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the data array.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'NIComplexNumber[]', + 'use_in_python_api': True, + 'use_numpy_array': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'use_array': False, + 'use_in_python_api': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'WriteArbWaveformComplexI16': { + 'codegen_method': 'private', + 'documentation': { + 'description': '\nWrites an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory.\n\nThis function accepts the interleaved I/Q data of a complex baseband signal. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Streaming `_\n\n`Assigning Properties or Attributes to a Waveform `_', + 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_name_for_documentation': 'write_arb_waveform', + 'method_templates': [ + { + 'documentation_filename': 'numpy_method', + 'library_interpreter_filename': 'numpy_write_method', + 'method_python_name_suffix': '', + 'session_filename': 'numpy_write_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 name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the data array.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'interleaved', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'NIComplexI16[]', + 'use_in_python_api': True, + 'use_numpy_array': True + } + ], + 'returns': 'ViStatus', + 'use_session_lock': False + }, + 'WriteArbWaveformDispatcher': { + 'codegen_method': 'python-only', + 'documentation': { + 'description': '\nWrites an arbitrary waveform to the NI-RFSG device starting at the position of the last data written in onboard memory.\n\nThis function accepts the complex baseband data in the form of numpy array of numpy.complex64 or numpy.complex128 or interleaved numpy array of numpy.int16. If the waveform to write is already allocated using the nirfsg_AllocateArbWaveform function, the **NIRFSG_ATTR_MORE_DATA_PENDING** parameter is ignored. The PXI-5670/5671 must be in the Configuration state before you call this function. When streaming is enabled, this function can be called when the PXIe-5672/5673/5673E or PXIe-5820/5830/5831/5832/5840/5841/5842/5860 is in the Generation state.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Streaming `_\n\n`Assigning Properties or Attributes to a Waveform `_', + 'note': 'This function only supports NIRFSG_VAL_PEAK_POWER mode as specified in the NIRFSG_ATTR_POWER_LEVEL_TYPE attribute. If you download a waveform when using this function, you cannot set the NIRFSG_ATTR_POWER_LEVEL_TYPE to NIRFSG_VAL_AVERAGE_POWER without causing error in the output.' + }, + 'included_in_proto': False, + 'is_error_handling': False, + 'method_templates': [ + { + 'documentation_filename': 'default_method', + 'library_interpreter_filename': 'none', + 'method_python_name_suffix': '', + 'session_filename': 'write_arb_waveform' + } + ], + '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 name used to identify the waveform. This string is case-insensitive and alphanumeric, and it does not use reserved words.' + }, + 'name': 'waveformName', + 'type': 'ViConstString', + 'use_array': False, + 'use_in_python_api': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the number of samples in the data array.' + }, + 'name': 'numberOfSamples', + 'type': 'ViInt32', + 'use_array': False, + 'use_in_python_api': False + }, + { + 'complex_type': 'numpy', + 'direction': 'in', + 'documentation': { + 'description': 'Specifies the array of data to load into the waveform. The array must have at least as many elements as the value in the **size_in_samples** parameter in the nirfsg_AllocateArbWaveform function.' + }, + 'type_in_documentation': 'numpy array of numpy.complex64, numpy array of numpy.complex128 or interleaved complex data in the form of numpy array of numpy.int16', + 'name': 'waveformDataArray', + 'numpy': True, + 'size': { + 'mechanism': 'len', + 'value': 'numberOfSamples' + }, + 'type': 'NIComplexNumber[]', + 'use_in_python_api': True, + 'use_numpy_array': True + }, + { + 'direction': 'in', + 'documentation': { + 'description': 'Specifies whether or not the data block contains the end of the waveform. Set this parameter to VI_TRUE to allow data to be appended later to the waveform. Splitting the waveform into multiple data blocks can reduce the memory requirements of the write operation. Append data to a previously written waveform by using the same waveform in the **name** parameter. Set **NIRFSG_ATTR_MORE_DATA_PENDING** to VI_FALSE to indicate that this data block contains the end of the waveform. If the waveform is already allocated, this parameter is ignored.' + }, + 'name': 'moreDataPending', + 'type': 'ViBoolean', + 'default_value': False, + 'use_array': False, + 'use_in_python_api': True + } + ], + 'python_name': 'write_arb_waveform', + 'returns': 'ViStatus', + 'use_session_lock': False }, 'WriteScript': { 'codegen_method': 'public', 'documentation': { - 'description': '\n\nWrites a script to the device to control waveform generation in Script mode. \n\nFirst, configure your device for Script mode by calling the nirfsg_ConfigureGenerationMode function. The NI-RFSG device must be in the Configuration state before calling the nirfsg_WriteScript function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.\n\n`Common Scripting Use Cases `_', + 'description': '\nWrites a script to the device to control waveform generation in Script mode.\n\nFirst, configure your device for Script mode by calling the nirfsg_ConfigureGenerationMode function. The NI-RFSG device must be in the Configuration state before calling the nirfsg_WriteScript function.\n\n**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860\n\n**Related Topics**\n\n`Scripting Instructions `_--Refer to this topic for more information about VST restrictions on scripts.\n\n`Common Scripting Use Cases `_', 'note': 'If you are using an RF vector signal transceiver (VST) device, some script instructions may not be supported.' }, 'included_in_proto': True, diff --git a/src/nirfsg/nirfsg.mak b/src/nirfsg/nirfsg.mak index 010defb46..3570d3638 100644 --- a/src/nirfsg/nirfsg.mak +++ b/src/nirfsg/nirfsg.mak @@ -2,7 +2,7 @@ include $(BUILD_HELPER_DIR)/defines.mak -MODULE_FILES_TO_GENERATE := $(DEFAULT_PY_FILES_TO_GENERATE) +MODULE_FILES_TO_GENERATE := $(DEFAULT_PY_FILES_TO_GENERATE) _complextype.py MODULE_FILES_TO_COPY := $(DEFAULT_PY_FILES_TO_COPY) diff --git a/src/nirfsg/system_tests/ValidWaveformTDMSFile.tdms b/src/nirfsg/system_tests/ValidWaveformTDMSFile.tdms new file mode 100755 index 000000000..01ea4e461 Binary files /dev/null and b/src/nirfsg/system_tests/ValidWaveformTDMSFile.tdms differ diff --git a/src/nirfsg/system_tests/samples2pfile.s2p b/src/nirfsg/system_tests/samples2pfile.s2p new file mode 100755 index 000000000..70e36cc52 --- /dev/null +++ b/src/nirfsg/system_tests/samples2pfile.s2p @@ -0,0 +1,7 @@ +! 2-port S-parameter file, four frequency points +# GHz S RI R 50.0 +!freq RS11 IS11 RS21 AS21 MS12 AS12 MS22 AS22 +0.500 1.0 0.0 1.0 0.0 1.0 0.0 1.0 0.0 +1.000 2.0 0.0 2.0 0.0 2.0 0.0 2.0 0.0 +2.000 3.0 0.0 3.0 0.0 3.0 0.0 3.0 0.0 +6.000 4.0 0.0 4.0 0.0 4.0 0.0 4.0 0.0 diff --git a/src/nirfsg/system_tests/test_system_nirfsg.py b/src/nirfsg/system_tests/test_system_nirfsg.py new file mode 100644 index 000000000..d82766c15 --- /dev/null +++ b/src/nirfsg/system_tests/test_system_nirfsg.py @@ -0,0 +1,567 @@ +import array +import hightime +import nirfsg +import numpy as np +import os +import pathlib +import pytest +import sys +import time + + +sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.parent / 'shared')) +import system_test_utilities # noqa: E402 + +# Set up global information we need +test_files_base_dir = os.path.join(os.path.dirname(__file__)) +use_simulated_session = True +real_hw_resource_name = '5841' + + +def get_test_file_path(file_name): + return os.path.join(test_files_base_dir, file_name) + + +sys.path.insert(0, str(pathlib.Path(__file__).parent.parent.parent / 'generated/nirfsg')) + + +class SystemTests: + @pytest.fixture(scope='function') + def rfsg_device_session(self, session_creation_kwargs): + if use_simulated_session: + with nirfsg.Session("5841sim", options="Simulate=1, DriverSetup=Model:5841", **session_creation_kwargs) as sim_5841_session: + yield sim_5841_session + else: + with nirfsg.Session(real_hw_resource_name, **session_creation_kwargs) as real_rfsg_device_session: + yield real_rfsg_device_session + +# Attribute set and get related tests + def test_get_float_attribute(self, rfsg_device_session): + value = rfsg_device_session.power_level + assert isinstance(value, float) + + def test_set_float_attribute(self, rfsg_device_session): + rfsg_device_session.power_level = -3.0 + assert rfsg_device_session.power_level == -3.0 + + def test_get_string_attribute(self, rfsg_device_session): + model = rfsg_device_session.instrument_model + assert model == "NI PXIe-5841" + + def test_set_string_attribute(self, rfsg_device_session): + rfsg_device_session.selected_script = "myScript" + assert rfsg_device_session.selected_script == "myScript" + + def test_get_int32_attribute(self, rfsg_device_session): + value = rfsg_device_session.external_calibration_recommended_interval + assert isinstance(value, int) + + def test_set_int32_enum_attribute(self, rfsg_device_session): + rfsg_device_session.frequency_settling_units = nirfsg.FrequencySettlingUnits.TIME_AFTER_LOCK + assert rfsg_device_session.frequency_settling_units == nirfsg.FrequencySettlingUnits.TIME_AFTER_LOCK + + def test_set_invalid_attribute_raises(self, rfsg_device_session): + with pytest.raises(AttributeError): + rfsg_device_session.non_existent_attribute = 123 + +# Multi-threading related tests + def test_multi_threading_lock_unlock(self, rfsg_device_session): + system_test_utilities.impl_test_multi_threading_lock_unlock(rfsg_device_session) + + def test_multi_threading_ivi_synchronized_wrapper_releases_lock(self, rfsg_device_session): + system_test_utilities.impl_test_multi_threading_ivi_synchronized_wrapper_releases_lock(rfsg_device_session.abort) + +# Error handling related tests + def test_error_message(self, session_creation_kwargs): + try: + with nirfsg.Session(resource_name="invalid_model", id_query=False, reset_device=False, options="Simulate=1, DriverSetup=Model:invalid_model", **session_creation_kwargs): + assert False + except nirfsg.Error as e: + assert e.code == -1074135025 + assert "Invalid model in DriverSetup string" in e.description + + def test_get_error(self, rfsg_device_session): + try: + rfsg_device_session.instrument_model = '' + assert False + except nirfsg.Error as e: + assert e.code == -1074135027 + assert "Attribute is read-only" in e.description + +# Utility method tests + def test_reset(self, rfsg_device_session): + # Save the original value of an attribute, change it, reset, and check it returns to default + default_power_level = rfsg_device_session.power_level + rfsg_device_session.power_level = default_power_level + 1.0 + assert rfsg_device_session.power_level == default_power_level + 1.0 + rfsg_device_session.reset() + # After reset, attribute should return to default + assert rfsg_device_session.power_level == default_power_level + + @pytest.mark.skipif(use_simulated_session is False, reason="Takes long time in real device") + def test_self_cal(self, rfsg_device_session): + rfsg_device_session.self_cal() + + @pytest.mark.skipif(use_simulated_session is True, reason="Bad date returned by driver for simulated device") + def test_get_external_calibration_last_date_and_time(self, rfsg_device_session): + dt = rfsg_device_session.get_external_calibration_last_date_and_time() + assert isinstance(dt, hightime.datetime) + + @pytest.mark.skipif(use_simulated_session is True, reason="Bad date returned by driver for simulated device") + def test_get_self_calibration_last_date_and_time(self, rfsg_device_session): + dt = rfsg_device_session.get_self_calibration_last_date_and_time(nirfsg.Module.PRIMARY_MODULE) + assert isinstance(dt, hightime.datetime) + + def test_get_terminal_name(self, rfsg_device_session): + terminal_name = rfsg_device_session.get_terminal_name(nirfsg.Signal.MARKER_EVENT, 'marker3') + assert '/ao/0/Marker3Event' in terminal_name + + def test_query_arb_waveform_capabilities(self, rfsg_device_session): + max_number_waveforms, waveform_quantum, min_waveform_size, max_waveform_size = rfsg_device_session.query_arb_waveform_capabilities() + assert max_number_waveforms == 67108864 + assert waveform_quantum == 1 + assert min_waveform_size == 8 + assert max_waveform_size == 536870912 + +# Repeated capability tests + def test_markers_rep_cap(self, rfsg_device_session): + marker = rfsg_device_session.markers[0] + requested_terminal_name = '/Dev0/PXI_Trig0' + marker.exported_marker_event_output_terminal = requested_terminal_name + assert marker.exported_marker_event_output_terminal == requested_terminal_name + + def test_script_triggers_rep_cap(self, rfsg_device_session): + trigger = rfsg_device_session.script_triggers[0] + requested_terminal_name = '/Dev0/PXI_Trig0' + trigger.exported_script_trigger_output_terminal = requested_terminal_name + assert trigger.exported_script_trigger_output_terminal == requested_terminal_name + + def test_waveform_rep_cap(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform', waveform_data, False) + requested_waveform_iq_rate = 1e6 + rfsg_device_session.waveform['mywaveform'].waveform_iq_rate = requested_waveform_iq_rate + assert rfsg_device_session.waveform['mywaveform'].waveform_iq_rate == requested_waveform_iq_rate + + def test_deembedding_port_rep_cap(self, rfsg_device_session): + port = rfsg_device_session.deembedding_port[''] + requested_deembedding_type = nirfsg.DeembeddingTypeAttrVals.SCALAR + port.deembedding_type = requested_deembedding_type + assert port.deembedding_type == requested_deembedding_type + +# Configuration methods related tests + def test_configure_rf(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + assert rfsg_device_session.power_level == -5.0 + assert rfsg_device_session.frequency == 2e9 + + def test_configure_output_enabled(self, rfsg_device_session): + rfsg_device_session.configure_output_enabled(True) + assert rfsg_device_session.output_enabled is True + rfsg_device_session.configure_output_enabled(False) + assert rfsg_device_session.output_enabled is False + + def test_configure_generation_mode(self, rfsg_device_session): + # Test CW mode + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.CW) + assert rfsg_device_session.generation_mode == nirfsg.GenerationMode.CW + # Test ARB_WAVEFORM mode + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + assert rfsg_device_session.generation_mode == nirfsg.GenerationMode.ARB_WAVEFORM + # Test SCRIPT mode + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + assert rfsg_device_session.generation_mode == nirfsg.GenerationMode.SCRIPT + + def test_configure_signalbandwidth_and_powerleveltype(self, rfsg_device_session): + rfsg_device_session.configure_signal_bandwidth(8e5) + assert rfsg_device_session.signal_bandwidth == 8e5 + rfsg_device_session.configure_power_level_type(nirfsg.PowerLevelType.PEAK) + assert rfsg_device_session.power_level_type == nirfsg.PowerLevelType.PEAK + + def test_write_arb_waveform_numpy_complex128(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is True + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform2') + assert waveform_exists is False + + def test_write_arb_waveform_numpy_complex64(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1600, 1 + 0j, dtype=np.complex64) + rfsg_device_session.write_arb_waveform('mywaveform2', waveform_data, False) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform2') + assert waveform_exists is True + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform3') + assert waveform_exists is False + + def test_write_arb_waveform_numpy_interleaved_int16(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + rfsg_device_session.power_level_type = nirfsg.PowerLevelType.PEAK # Needed for writing unscaled int16 data + waveform_data = np.array([1, 0] * 3000, dtype=np.int16) + rfsg_device_session.write_arb_waveform('mywaveform3', waveform_data, False) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform3') + assert waveform_exists is True + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is False + + def test_write_arb_waveform_with_wrong_datatype(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data_wrong_numpy_type = np.array([1, 0] * 3000, dtype=np.int32) + waveform_data_non_numpy_type = array.array('h', [1, 0] * 3000) + try: + rfsg_device_session.write_arb_waveform('mywaveform3', waveform_data_wrong_numpy_type, False) + assert False + except TypeError: + pass + try: + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data_non_numpy_type, False) + assert False + except TypeError: + pass + + def test_clear_arb_waveform(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is True + rfsg_device_session.clear_arb_waveform('mywaveform1') + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is False + + def test_clear_all_arb_waveforms(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + rfsg_device_session.write_arb_waveform('mywaveform2', waveform_data, False) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is True + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform2') + assert waveform_exists is True + rfsg_device_session.clear_all_arb_waveforms() + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform1') + assert waveform_exists is False + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform2') + assert waveform_exists is False + + def test_allocate_arb_waveform(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + rfsg_device_session.power_level_type = nirfsg.PowerLevelType.PEAK # To be able to call write multiple times on same waveform + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.allocate_arb_waveform('foo', len(waveform_data) * 2) + rfsg_device_session.write_arb_waveform('foo', waveform_data, True) + rfsg_device_session.write_arb_waveform('foo', waveform_data, False) + + def test_set_arb_waveform_next_write_position(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + rfsg_device_session.power_level_type = nirfsg.PowerLevelType.PEAK # To be able to call write multiple times on same waveform + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, True) + rfsg_device_session.set_arb_waveform_next_write_position('mywaveform1', nirfsg.RelativeTo.START_OF_WAVEFORM, 500) + waveform_data_new_second_half = np.full(500, 0 + 1j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data_new_second_half, False) + + def test_set_get_burst_start_stop_locations(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + startlocations = [1, 100, 200] + stoplocations = [50, 175, 750] + rfsg_device_session.waveform['mywaveform1'].set_waveform_burst_start_locations(startlocations) + rfsg_device_session.waveform['mywaveform1'].set_waveform_burst_stop_locations(stoplocations) + startlocations_out = rfsg_device_session.waveform['mywaveform1'].get_waveform_burst_start_locations() + stoplocations_out = rfsg_device_session.waveform['mywaveform1'].get_waveform_burst_stop_locations() + assert startlocations_out == startlocations + assert stoplocations_out == stoplocations + + def test_set_get_marker_event_locations(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + markerlocations = [1, 100, 200] + rfsg_device_session.waveform['mywaveform1'].markers[0].set_waveform_marker_event_locations(markerlocations) + markerlocations_out = rfsg_device_session.waveform['mywaveform1'].markers[0].get_waveform_marker_event_locations() + assert markerlocations_out == markerlocations + + def test_write_script(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex64) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + script = '''script myScript1 + repeat forever + generate mywaveform1 + end repeat + end script''' + rfsg_device_session.write_script(script) + + @pytest.mark.skipif(use_simulated_session is True, reason="Scripts not compiled on simulated device") + def test_check_if_script_exists(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + waveform_data = np.full(1000, 0.707 + 0.707j, dtype=np.complex64) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data, False) + script = '''script myScript1 + repeat forever + generate mywaveform1 + end repeat + end script''' + rfsg_device_session.write_script(script) + script_exists = rfsg_device_session.check_if_script_exists('myScript1') + assert script_exists is True + script_exists = rfsg_device_session.check_if_script_exists('myScript2') + assert script_exists is False + + @pytest.mark.skipif(use_simulated_session is True, reason="Scripts not compiled on simulated device") + def test_write_script_with_bad_script(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + script = '''script myScript1 + repeat forever + generate mywaveform1 + end repeat + end script''' + try: + rfsg_device_session.write_script(script) + assert False + except nirfsg.Error as e: + assert e.code == -1074101603 + assert "A waveform matching the provided name does not exist in memory" in e.description + + def test_configure_software_trigger(self, rfsg_device_session): + rfsg_device_session.configure_software_start_trigger() + assert rfsg_device_session.start_trigger_type == nirfsg.StartTrigType.SOFTWARE + rfsg_device_session.configure_software_script_trigger('scriptTrigger0') + assert rfsg_device_session.script_triggers[0].script_trigger_type == nirfsg.ScriptTrigType.SOFTWARE + + def test_configure_digital_edge_trigger(self, rfsg_device_session): + rfsg_device_session.configure_digital_edge_start_trigger('PXI_Trig1', nirfsg.StartTrigDigEdgeEdge.RISING) + rfsg_device_session.configure_digital_edge_script_trigger('scriptTrigger1', 'PXI_Trig2', nirfsg.ScriptTrigDigEdgeEdge.FALLING) + assert rfsg_device_session.start_trigger_type == nirfsg.StartTrigType.DIGITAL_EDGE + assert rfsg_device_session.digital_edge_start_trigger_source == 'PXI_Trig1' + assert rfsg_device_session.digital_edge_start_trigger_edge == nirfsg.StartTrigDigEdgeEdge.RISING + assert rfsg_device_session.script_triggers[1].script_trigger_type == nirfsg.ScriptTrigType.DIGITAL_EDGE + assert rfsg_device_session.script_triggers[1].digital_edge_script_trigger_source == 'PXI_Trig2' + assert rfsg_device_session.script_triggers[1].digital_edge_script_trigger_edge == nirfsg.ScriptTrigDigEdgeEdge.FALLING + + def test_disable_trigger(self, rfsg_device_session): + rfsg_device_session.configure_software_start_trigger() + assert rfsg_device_session.start_trigger_type == nirfsg.StartTrigType.SOFTWARE + rfsg_device_session.disable_start_trigger() + assert rfsg_device_session.start_trigger_type == nirfsg.StartTrigType.NONE + rfsg_device_session.configure_software_script_trigger('scriptTrigger3') + assert rfsg_device_session.script_triggers[3].script_trigger_type == nirfsg.ScriptTrigType.SOFTWARE + rfsg_device_session.disable_script_trigger('scriptTrigger3') + assert rfsg_device_session.script_triggers[3].script_trigger_type == nirfsg.ScriptTrigType.NONE + + def test_export_signal(self, rfsg_device_session): + rfsg_device_session.export_signal(nirfsg.Signal.START_TRIGGER, '', 'PXI_Trig0') + assert rfsg_device_session.exported_start_trigger_output_terminal == 'PXI_Trig0' + rfsg_device_session.export_signal(nirfsg.Signal.SCRIPT_TRIGGER, 'scriptTrigger2', 'PXI_Trig1') + assert rfsg_device_session.script_triggers[2].exported_script_trigger_output_terminal == 'PXI_Trig1' + rfsg_device_session.export_signal(nirfsg.Signal.MARKER_EVENT, 'marker1', 'PXI_Trig2') + assert rfsg_device_session.markers[1].exported_marker_event_output_terminal == 'PXI_Trig2' + rfsg_device_session.export_signal(nirfsg.Signal.REF_CLOCK, '', '') + assert rfsg_device_session.exported_ref_clock_output_terminal == '' + rfsg_device_session.export_signal(nirfsg.Signal.STARTED_EVENT, '', 'PXI_Trig3') + assert rfsg_device_session.exported_started_event_output_terminal == 'PXI_Trig3' + rfsg_device_session.export_signal(nirfsg.Signal.DONE_EVENT, '', 'PFI0') + assert rfsg_device_session.exported_done_event_output_terminal == 'PFI0' + + def test_export_signal_with_invalid_signal(self, rfsg_device_session): + try: + rfsg_device_session.export_signal(nirfsg.Signal.INVALID, '', 'PXI_Trig0') + assert False + except AttributeError: + pass + + @pytest.mark.skipif(use_simulated_session is True, reason="RoCo is not invoked for simulated device") + def test_export_signal_with_invalid_terminal(self, rfsg_device_session): + try: + rfsg_device_session.export_signal(nirfsg.Signal.START_TRIGGER, '', 'InvalidTerminal') + rfsg_device_session.commit() + assert False + except nirfsg.Error as e: + assert e.code == -1074107490 + assert 'Destination terminal to be routed could not be found on the device' in e.description + + def test_save_load_configuration(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + rfsg_device_session.iq_rate = 1e6 + rfsg_device_session.save_configurations_to_file(get_test_file_path('tempConfiguration.json')) + assert os.path.exists(get_test_file_path('tempConfiguration.json')) + rfsg_device_session.configure_rf(3e9, -15.0) + rfsg_device_session.iq_rate = 2e6 + assert rfsg_device_session.frequency == 3e9 + assert rfsg_device_session.power_level == -15.0 + assert rfsg_device_session.iq_rate == 2e6 + rfsg_device_session.load_configurations_from_file(get_test_file_path('tempConfiguration.json')) + assert rfsg_device_session.frequency == 2e9 + assert rfsg_device_session.power_level == -5.0 + assert rfsg_device_session.iq_rate == 1e6 + os.remove(get_test_file_path('tempConfiguration.json')) + +# Basic tests for generation + @pytest.mark.skipif(use_simulated_session is False, reason="Test executed with status check in real hw") + def test_cw_generation(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + + @pytest.mark.skipif(use_simulated_session is True, reason="is_done is always True on simulated device") + def test_cw_generation_with_status(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + with rfsg_device_session.initiate(): + is_done = rfsg_device_session.check_generation_status() + assert is_done is False # is_done will never be True in CW mode + + def test_abort(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + rfsg_device_session.initiate() + rfsg_device_session.check_generation_status() + rfsg_device_session.abort() + + @pytest.mark.skipif(use_simulated_session is True, reason="is_done is always True on simulated device") + def test_abort_with_status(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + with rfsg_device_session.initiate(): + is_done = rfsg_device_session.check_generation_status() + assert is_done is False # is_done will never be True in CW mode + is_done = rfsg_device_session.check_generation_status() + assert is_done is True # is_done should now be True after aborting + + @pytest.mark.skipif(use_simulated_session is False, reason="Test executed with status check in real hw") + def test_multiple_arb_waveform_generation(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data1 = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data1, False) + waveform_data2 = np.full(8000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform2', waveform_data2, False) + rfsg_device_session.arb_selected_waveform = 'mywaveform1' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + rfsg_device_session.arb_selected_waveform = 'mywaveform2' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + + @pytest.mark.skipif(use_simulated_session is True, reason="is_done is always True on simulated device") + def test_multiple_arb_waveform_generation_with_status(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + waveform_data1 = np.full(1000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform1', waveform_data1, False) + waveform_data2 = np.full(8000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform2', waveform_data2, False) + rfsg_device_session.arb_selected_waveform = 'mywaveform1' + with rfsg_device_session.initiate(): + is_done = rfsg_device_session.check_generation_status() + assert is_done is False # is_done will never be True since we have not authored waveform_repeat_count + rfsg_device_session.arb_selected_waveform = 'mywaveform2' + with rfsg_device_session.initiate(): + is_done = rfsg_device_session.check_generation_status() + assert is_done is False # is_done will never be True since we have not authored waveform_repeat_count + + @pytest.mark.skipif(use_simulated_session is False, reason="Test executed with status check in real hw") + def test_multiple_script_generation(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + waveform_data = np.full(2000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform', waveform_data, False) + script0 = '''script myScript0 + repeat 1 + generate mywaveform + end repeat + end script''' + script1 = '''script myScript1 + repeat forever + generate mywaveform + end repeat + end script''' + rfsg_device_session.write_script(script0) + rfsg_device_session.write_script(script1) + rfsg_device_session.selected_script = 'myScript0' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + rfsg_device_session.selected_script = 'myScript1' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + + @pytest.mark.skipif(use_simulated_session is True, reason="is_done is always True on simulated device") + def test_multiple_script_generation_with_status(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + waveform_data = np.full(2000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform', waveform_data, False) + script0 = '''script myScript0 + repeat 1 + generate mywaveform + end repeat + end script''' + script1 = '''script myScript1 + repeat forever + generate mywaveform + end repeat + end script''' + rfsg_device_session.write_script(script0) + rfsg_device_session.write_script(script1) + rfsg_device_session.selected_script = 'myScript0' + with rfsg_device_session.initiate(): + time.sleep(2) + is_done = rfsg_device_session.check_generation_status() + assert is_done is True # is_done will be True since we are repeating only once + rfsg_device_session.selected_script = 'myScript1' + with rfsg_device_session.initiate(): + is_done = rfsg_device_session.check_generation_status() + assert is_done is False # is_done will never be True since we are repeating forever + + def test_send_software_edge_trigger(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.SCRIPT) + waveform_data = np.full(2000, 1 + 0j, dtype=np.complex128) + rfsg_device_session.write_arb_waveform('mywaveform', waveform_data, False) + script0 = '''script myScript0 + wait until scriptTrigger0 + generate mywaveform + end script''' + rfsg_device_session.write_script(script0) + rfsg_device_session.configure_software_start_trigger() + rfsg_device_session.configure_software_script_trigger('scriptTrigger0') + with rfsg_device_session.initiate(): + rfsg_device_session.send_software_edge_trigger(nirfsg.SoftwareTriggerType.START, '') + rfsg_device_session.send_software_edge_trigger(nirfsg.SoftwareTriggerType.SCRIPT, 'scriptTrigger0') + + @pytest.mark.skipif(sys.platform == "linux", reason="Function not supported on Linux OS") + def test_deembedding_table_with_s2p_file(self, rfsg_device_session): + rfsg_device_session.create_deembedding_sparameter_table_s2p_file('', 'myTable1', get_test_file_path('samples2pfile.s2p'), nirfsg.SparameterOrientation.PORT2) + rfsg_device_session.create_deembedding_sparameter_table_s2p_file('', 'myTable2', get_test_file_path('samples2pfile.s2p'), nirfsg.SparameterOrientation.PORT1) + rfsg_device_session.configure_deembedding_table_interpolation_linear('', 'myTable1', nirfsg.Format.MAGNITUDE_AND_PHASE) + rfsg_device_session.deembedding_port[''].deembedding_selected_table = 'myTable1' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + rfsg_device_session.delete_deembedding_table('', 'myTable1') + rfsg_device_session.deembedding_port[''].deembedding_selected_table = 'myTable2' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + rfsg_device_session.delete_all_deembedding_tables() + try: + rfsg_device_session.commit() + assert False + except nirfsg.Error as e: + assert e.code == -1074097772 + assert 'The specified de-embedding table cannot be found' in e.description + rfsg_device_session.deembedding_port[''].deembedding_selected_table = '' + with rfsg_device_session.initiate(): + rfsg_device_session.check_generation_status() + + def test_read_and_download_waveform_from_file_tdms(self, rfsg_device_session): + rfsg_device_session.configure_generation_mode(nirfsg.GenerationMode.ARB_WAVEFORM) + rfsg_device_session.read_and_download_waveform_from_file_tdms('mywaveform', get_test_file_path('ValidWaveformTDMSFile.tdms'), 0) + waveform_exists = rfsg_device_session.check_if_waveform_exists('mywaveform') + assert waveform_exists is True + + def test_wait_until_settled(self, rfsg_device_session): + rfsg_device_session.configure_rf(2e9, -5.0) + with rfsg_device_session.initiate(): + rfsg_device_session.wait_until_settled(15000) + + +class TestLibrary(SystemTests): + @pytest.fixture(scope='class') + def session_creation_kwargs(self): + return {} diff --git a/src/nirfsg/templates/session.py/write_arb_waveform.py.mako b/src/nirfsg/templates/session.py/write_arb_waveform.py.mako new file mode 100644 index 000000000..6aa41b5c5 --- /dev/null +++ b/src/nirfsg/templates/session.py/write_arb_waveform.py.mako @@ -0,0 +1,24 @@ +<%page args="f, config, method_template"/>\ +<% + '''Dispatches to the appropriate "write arb waveform" method based on the waveform type.''' + import build.helper as helper +%>\ + def ${f['python_name']}(${helper.get_params_snippet(f, helper.ParameterUsageOptions.SESSION_METHOD_DECLARATION)}): + '''${f['python_name']} + + ${helper.get_function_docstring(f, False, config, indent=8)} + ''' + import numpy + if str(type(waveform_data_array)).find("'numpy.ndarray'") != -1: + if waveform_data_array.dtype == numpy.complex128: + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.complex64: + return self._write_arb_waveform_complex_f32(waveform_name, waveform_data_array, more_data_pending) + elif waveform_data_array.dtype == numpy.int16: + return self._write_arb_waveform_complex_i16(waveform_name, waveform_data_array) + else: + raise TypeError("Unsupported datatype. Is {}, expected {} or {} or {}".format(waveform_data_array.dtype, numpy.complex128, numpy.complex64, numpy.int16)) + else: + raise TypeError("Unsupported datatype. Expected {} or {} or {}".format(numpy.complex128, numpy.complex64, numpy.int16)) + + return self._write_arb_waveform_complex_f64(waveform_name, waveform_data_array, more_data_pending) diff --git a/tox-travis.ini b/tox-travis.ini index c7b847edd..ecff2680e 100644 --- a/tox-travis.ini +++ b/tox-travis.ini @@ -106,6 +106,7 @@ commands = flake8: flake8 --config=./tox.ini src/nidmm/system_tests/ src/nidmm/examples/ flake8: flake8 --config=./tox.ini src/nifgen/system_tests/ src/nifgen/examples/ flake8: flake8 --config=./tox.ini src/nimodinst/system_tests/ src/nimodinst/examples/ + flake8: flake8 --config=./tox.ini src/nirfsg/system_tests/ src/nirfsg/examples/ flake8: flake8 --config=./tox.ini src/niscope/system_tests/ src/niscope/examples/ flake8: flake8 --config=./tox.ini src/nise/system_tests/ src/nise/examples/ flake8: flake8 --config=./tox.ini src/niswitch/system_tests/ src/niswitch/examples/ diff --git a/tox.ini b/tox.ini index 517c919d9..0330ec7bc 100644 --- a/tox.ini +++ b/tox.ini @@ -106,6 +106,7 @@ commands = flake8: flake8 --config=./tox.ini src/nidmm/system_tests/ src/nidmm/examples/ flake8: flake8 --config=./tox.ini src/nifgen/system_tests/ src/nifgen/examples/ flake8: flake8 --config=./tox.ini src/nimodinst/system_tests/ src/nimodinst/examples/ + flake8: flake8 --config=./tox.ini src/nirfsg/system_tests/ src/nirfsg/examples/ flake8: flake8 --config=./tox.ini src/niscope/system_tests/ src/niscope/examples/ flake8: flake8 --config=./tox.ini src/nise/system_tests/ src/nise/examples/ flake8: flake8 --config=./tox.ini src/niswitch/system_tests/ src/niswitch/examples/