Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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 `self_test` to not have any parameters, aligning with other MI drivers
- 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
26 changes: 13 additions & 13 deletions generated/nirfsg/nirfsg/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ def __init__(self, ctypes_library):
self.niRFSG_SelectArbWaveform_cfunc = None
self.niRFSG_SelfCal_cfunc = None
self.niRFSG_SelfCalibrateRange_cfunc = None
self.niRFSG_SelfTest_cfunc = None
self.niRFSG_SendSoftwareEdgeTrigger_cfunc = None
self.niRFSG_SetArbWaveformNextWritePosition_cfunc = None
self.niRFSG_SetAttributeViBoolean_cfunc = None
Expand All @@ -101,6 +100,7 @@ def __init__(self, ctypes_library):
self.niRFSG_WriteScript_cfunc = None
self.niRFSG_close_cfunc = None
self.niRFSG_reset_cfunc = None
self.niRFSG_self_test_cfunc = None

def _get_library_function(self, name):
try:
Expand Down 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 All @@ -597,14 +597,6 @@ def niRFSG_SelfCalibrateRange(self, vi, steps_to_omit, min_frequency, max_freque
self.niRFSG_SelfCalibrateRange_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_SelfCalibrateRange_cfunc(vi, steps_to_omit, min_frequency, max_frequency, min_power_level, max_power_level)

def niRFSG_SelfTest(self, vi, self_test_result, self_test_message): # noqa: N802
with self._func_lock:
if self.niRFSG_SelfTest_cfunc is None:
self.niRFSG_SelfTest_cfunc = self._get_library_function('niRFSG_SelfTest')
self.niRFSG_SelfTest_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt16), ctypes.POINTER(ViChar)] # noqa: F405
self.niRFSG_SelfTest_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_SelfTest_cfunc(vi, self_test_result, self_test_message)

def niRFSG_SendSoftwareEdgeTrigger(self, vi, trigger, trigger_identifier): # noqa: N802
with self._func_lock:
if self.niRFSG_SendSoftwareEdgeTrigger_cfunc is None:
Expand Down Expand Up @@ -756,3 +748,11 @@ def niRFSG_reset(self, vi): # noqa: N802
self.niRFSG_reset_cfunc.argtypes = [ViSession] # noqa: F405
self.niRFSG_reset_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_reset_cfunc(vi)

def niRFSG_self_test(self, vi, self_test_result, self_test_message): # noqa: N802
with self._func_lock:
if self.niRFSG_self_test_cfunc is None:
self.niRFSG_self_test_cfunc = self._get_library_function('niRFSG_self_test')
self.niRFSG_self_test_cfunc.argtypes = [ViSession, ctypes.POINTER(ViInt16), ctypes.POINTER(ViChar)] # noqa: F405
self.niRFSG_self_test_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_self_test_cfunc(vi, self_test_result, self_test_message)
28 changes: 14 additions & 14 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 All @@ -625,14 +625,6 @@ def self_calibrate_range(self, steps_to_omit, min_frequency, max_frequency, min_
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def self_test(self, self_test_message): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
self_test_result_ctype = _visatype.ViInt16() # case S220
self_test_message_ctype = ctypes.create_string_buffer(self_test_message.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_SelfTest(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return int(self_test_result_ctype.value)

def send_software_edge_trigger(self, trigger, trigger_identifier): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
trigger_ctype = _visatype.ViInt32(trigger.value) # case S130
Expand Down Expand Up @@ -791,3 +783,11 @@ def reset(self): # noqa: N802
error_code = self._library.niRFSG_reset(vi_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def self_test(self): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
self_test_result_ctype = _visatype.ViInt16() # case S220
self_test_message_ctype = (_visatype.ViChar * 256)() # case C070
error_code = self._library.niRFSG_self_test(vi_ctype, None if self_test_result_ctype is None else (ctypes.pointer(self_test_result_ctype)), self_test_message_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return int(self_test_result_ctype.value), self_test_message_ctype.value.decode(self._encoding)
Loading