Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1692,6 +1692,10 @@
- Added
- Changed
- Fixed the return type of `get_all_script_names` and `get_all_named_waveform_names` to remove the size parameter and return a list of strings instead of a comma-separated string
- Changed the parameter name for waveform name from `name` to `waveform_name` in `clear_arb_waveform` and `select_arb_waveform` to be consistent with other waveform methods
- Changed the name of `get_self_calibration_last_date_and_time` to `get_self_cal_last_date_and_time` to be consistent with other MI drivers
- Added default value for `module` parameter in `get_self_cal_last_date_and_time` and `get_self_calibration_temperature` methods to align with documentation and allow duck-typing
- Updated the `self_test` to not have any parameters aligning with other MI drivers
Comment thread
vnktshr21 marked this conversation as resolved.
Outdated
- Removed
- Methods and properties applicable only to hardware which are not supported anymore
- Methods
Expand Down
58 changes: 18 additions & 40 deletions docs/nirfsg/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ clear_arb_waveform

.. py:currentmodule:: nirfsg.Session

.. py:method:: clear_arb_waveform(name)
.. py:method:: clear_arb_waveform(waveform_name)

Deletes a specified waveform from the pool of currently defined waveforms.

Expand All @@ -373,15 +373,15 @@ clear_arb_waveform



:param name:
:param waveform_name:


Name of the stored waveform to delete.




:type name: str
:type waveform_name: str

clear_self_calibrate_range
--------------------------
Expand Down Expand Up @@ -1342,12 +1342,12 @@ get_max_settable_power



get_self_calibration_last_date_and_time
---------------------------------------
get_self_cal_last_date_and_time
-------------------------------

.. py:currentmodule:: nirfsg.Session

.. py:method:: get_self_calibration_last_date_and_time(module)
.. py:method:: get_self_cal_last_date_and_time(module=nirfsg.Module.PRIMARY_MODULE)

Returns the date and time of the last successful self-calibration.

Expand Down Expand Up @@ -1386,7 +1386,7 @@ get_self_calibration_temperature

.. py:currentmodule:: nirfsg.Session

.. py:method:: get_self_calibration_temperature(module)
.. py:method:: get_self_calibration_temperature(module=nirfsg.Module.PRIMARY_MODULE)

Returns the temperature, in degrees Celsius, of the device at the last successful self-calibration.

Expand Down Expand Up @@ -2069,7 +2069,7 @@ select_arb_waveform

.. py:currentmodule:: nirfsg.Session

.. py:method:: select_arb_waveform(name)
.. py:method:: select_arb_waveform(waveform_name)

Specifies the waveform that is generated upon a call to the :py:meth:`nirfsg.Session._initiate` method when the generation_mode property is set to :py:data:`~nirfsg.GenerationMode.ARB_WAVEFORM`.

Expand All @@ -2087,15 +2087,15 @@ select_arb_waveform



:param name:
:param waveform_name:


Specifies the name of the stored waveform to generate. This is a case-insensitive alphanumeric string that does not use reserved words. NI-RFSG sets the :py:attr:`nirfsg.Session.arb_selected_waveform` property to this value.




:type name: str
:type waveform_name: str

self_cal
--------
Expand Down Expand Up @@ -2216,7 +2216,7 @@ self_test

.. py:currentmodule:: nirfsg.Session

.. py:method:: self_test(self_test_message)
.. py:method:: self_test()

Performs a self-test on the NI-RFSG device and returns the test results.

Expand All @@ -2230,35 +2230,13 @@ self_test

`Device Warm-Up <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/warmup.html>`_





:param self_test_message:


Returns the self-test response string from the NI-RFSG device. For an explanation of the string contents, refer to the **status** parameter of this method.

You must pass a ViChar array with at least 256 bytes.




:type self_test_message: str

:rtype: int
:return:


This parameter contains the value returned from the NI-RFSG device self test.

+----------------+------------------+
| Self-Test Code | Description |
+================+==================+
| 0 | Self test passed |
+----------------+------------------+
| 1 | Self test failed |
+----------------+------------------+
+----------------+------------------+
| Self-Test Code | Description |
+================+==================+
| 0 | Passed self-test |
+----------------+------------------+
| 1 | Self-test failed |
+----------------+------------------+



Expand Down
8 changes: 4 additions & 4 deletions generated/nirfsg/nirfsg/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,13 @@ def niRFSG_ClearAllArbWaveforms(self, vi): # noqa: N802
self.niRFSG_ClearAllArbWaveforms_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_ClearAllArbWaveforms_cfunc(vi)

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

def niRFSG_ClearSelfCalibrateRange(self, vi): # noqa: N802
with self._func_lock:
Expand Down Expand Up @@ -573,13 +573,13 @@ def niRFSG_SaveConfigurationsToFile(self, vi, channel_name, file_path): # noqa:
self.niRFSG_SaveConfigurationsToFile_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_SaveConfigurationsToFile_cfunc(vi, channel_name, file_path)

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

def niRFSG_SelfCal(self, vi): # noqa: N802
with self._func_lock:
Expand Down
12 changes: 6 additions & 6 deletions generated/nirfsg/nirfsg/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@ def clear_all_arb_waveforms(self): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def clear_arb_waveform(self, name): # noqa: N802
def clear_arb_waveform(self, waveform_name): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
name_ctype = ctypes.create_string_buffer(name.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_ClearArbWaveform(vi_ctype, name_ctype)
waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_ClearArbWaveform(vi_ctype, waveform_name_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

Expand Down Expand Up @@ -601,10 +601,10 @@ def save_configurations_to_file(self, channel_name, file_path): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def select_arb_waveform(self, name): # noqa: N802
def select_arb_waveform(self, waveform_name): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
name_ctype = ctypes.create_string_buffer(name.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_SelectArbWaveform(vi_ctype, name_ctype)
waveform_name_ctype = ctypes.create_string_buffer(waveform_name.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_SelectArbWaveform(vi_ctype, waveform_name_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

Expand Down
51 changes: 40 additions & 11 deletions generated/nirfsg/nirfsg/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -5942,7 +5942,7 @@ def clear_all_arb_waveforms(self):
self._interpreter.clear_all_arb_waveforms()

@ivi_synchronized
def clear_arb_waveform(self, name):
def clear_arb_waveform(self, waveform_name):
r'''clear_arb_waveform

Deletes a specified waveform from the pool of currently defined waveforms.
Expand All @@ -5952,10 +5952,10 @@ def clear_arb_waveform(self, name):
**Supported Devices** : PXIe-5644/5645/5646, PXI-5670/5671, PXIe-5672/5673/5673E, PXIe-5820/5830/5831/5832/5840/5841/5842/5860

Args:
name (str): Name of the stored waveform to delete.
waveform_name (str): Name of the stored waveform to delete.

'''
self._interpreter.clear_arb_waveform(name)
self._interpreter.clear_arb_waveform(waveform_name)

@ivi_synchronized
def clear_self_calibrate_range(self):
Expand Down Expand Up @@ -6528,8 +6528,8 @@ def get_external_calibration_last_date_and_time(self):
return hightime.datetime(year, month, day, hour, minute, second)

@ivi_synchronized
def get_self_calibration_last_date_and_time(self, module):
'''get_self_calibration_last_date_and_time
def get_self_cal_last_date_and_time(self, module=enums.Module.PRIMARY_MODULE):
'''get_self_cal_last_date_and_time

Returns the date and time of the last successful self-calibration.

Expand Down Expand Up @@ -6605,7 +6605,7 @@ def _get_self_calibration_date_and_time(self, module):
return year, month, day, hour, minute, second

@ivi_synchronized
def get_self_calibration_temperature(self, module):
def get_self_calibration_temperature(self, module=enums.Module.PRIMARY_MODULE):
r'''get_self_calibration_temperature

Returns the temperature, in degrees Celsius, of the device at the last successful self-calibration.
Expand Down Expand Up @@ -6991,7 +6991,7 @@ def reset_with_options(self, steps_to_omit):
self._interpreter.reset_with_options(steps_to_omit)

@ivi_synchronized
def select_arb_waveform(self, name):
def select_arb_waveform(self, waveform_name):
r'''select_arb_waveform

Specifies the waveform that is generated upon a call to the _initiate method when the generation_mode property is set to GenerationMode.ARB_WAVEFORM.
Expand All @@ -7008,10 +7008,10 @@ def select_arb_waveform(self, name):
One or more of the referenced properties are not in the Python API for this driver.

Args:
name (str): Specifies the name of the stored waveform to generate. This is a case-insensitive alphanumeric string that does not use reserved words. NI-RFSG sets the arb_selected_waveform property to this value.
waveform_name (str): Specifies the name of the stored waveform to generate. This is a case-insensitive alphanumeric string that does not use reserved words. NI-RFSG sets the arb_selected_waveform property to this value.

'''
self._interpreter.select_arb_waveform(name)
self._interpreter.select_arb_waveform(waveform_name)

@ivi_synchronized
def self_cal(self):
Expand Down Expand Up @@ -7088,8 +7088,8 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_
self._interpreter.self_calibrate_range(steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level)

@ivi_synchronized
def self_test(self, self_test_message):
r'''self_test
def _self_test(self, self_test_message):
r'''_self_test

Performs a self-test on the NI-RFSG device and returns the test results.

Expand Down Expand Up @@ -7374,6 +7374,35 @@ def _close(self):
'''
self._interpreter.close()

@ivi_synchronized
def self_test(self):
'''self_test

Performs a self-test on the NI-RFSG device and returns the test results.

This method performs a simple series of tests to ensure that the NI-RFSG device is powered up and responding.

This method does not affect external I/O connections or connections between devices. Complete functional testing and calibration are not performed by this method. The NI-RFSG device must be in the Configuration state before you call this method.

**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

**Related Topics**

`Device Warm-Up <https://www.ni.com/docs/en-US/bundle/rfsg/page/rfsg/warmup.html>`_

+----------------+------------------+
| Self-Test Code | Description |
+================+==================+
| 0 | Passed self-test |
+----------------+------------------+
| 1 | Self-test failed |
+----------------+------------------+
'''
code, msg = self._self_test()
Comment thread
vnktshr21 marked this conversation as resolved.
if code:
raise errors.SelfTestError(code, msg)
return None

@ivi_synchronized
def reset(self):
r'''reset
Expand Down
4 changes: 2 additions & 2 deletions generated/nirfsg/nirfsg/unit_tests/_mock_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def niRFSG_ClearAllArbWaveforms(self, vi): # noqa: N802
return self._defaults['ClearAllArbWaveforms']['return']
return self._defaults['ClearAllArbWaveforms']['return']

def niRFSG_ClearArbWaveform(self, vi, name): # noqa: N802
def niRFSG_ClearArbWaveform(self, vi, waveform_name): # noqa: N802
if self._defaults['ClearArbWaveform']['return'] != 0:
return self._defaults['ClearArbWaveform']['return']
return self._defaults['ClearArbWaveform']['return']
Expand Down Expand Up @@ -782,7 +782,7 @@ def niRFSG_SaveConfigurationsToFile(self, vi, channel_name, file_path): # noqa:
return self._defaults['SaveConfigurationsToFile']['return']
return self._defaults['SaveConfigurationsToFile']['return']

def niRFSG_SelectArbWaveform(self, vi, name): # noqa: N802
def niRFSG_SelectArbWaveform(self, vi, waveform_name): # noqa: N802
if self._defaults['SelectArbWaveform']['return'] != 0:
return self._defaults['SelectArbWaveform']['return']
return self._defaults['SelectArbWaveform']['return']
Expand Down
Loading
Loading