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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1702,6 +1702,9 @@
#### [nirfsg] Unreleased
- Added
- Python 3.14 Support
- `get_script` and `delete_script` methods
- `SCRIPTS` added to enum `LoadOptions`
- `DO_NOT_DRIVE_SIGNAL` added to enum `PulseModulationSource`
- Changed
- Removed

Expand Down
66 changes: 65 additions & 1 deletion docs/nirfsg/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,31 @@ delete_deembedding_table

:type table_name: str

delete_script
-------------

.. py:currentmodule:: nirfsg.Session

.. py:method:: delete_script(script_name)

Deletes a specified script from the pool of currently defined scripts. The NI-RFSG device must be in the Configuration state before you call this method.

**Supported Devices** :PXIe-5820/5830/5831/5832/5840/5841/5842/5860





:param script_name:


Specifies the name of the script to delete. This string is case-insensitive.




:type script_name: str

disable_script_trigger
----------------------

Expand Down Expand Up @@ -1342,6 +1367,41 @@ get_max_settable_power



get_script
----------

.. py:currentmodule:: nirfsg.Session

.. py:method:: get_script(script_name)

Returns the content of specified script.

**Supported Devices** :PXIe-5820/5830/5831/5832/5840/5841/5842/5860





:param script_name:


Specifies the name of the script. This string is case-insensitive.




:type script_name: str

:rtype: str
:return:


Returns the script.





get_self_cal_last_date_and_time
-------------------------------

Expand Down Expand Up @@ -2114,7 +2174,11 @@ self_cal



.. note:: If there is an existing NI-RFSA session open for the same PXIe-5820/5830/5831/5832/5840/5841/5842/5860 while this method runs, it may remain open but cannot be used for operations that access the hardware, for example niRFSA_Commit or niRFSA_Initiate.
.. note:: If there is an existing NI-RFSA session open for the same PXIe-5820/5830/5831/5832/5840/5841/5842/5860 while this method runs, it may remain open but cannot be used for operations that access the hardware, for example niRFSA_Commit or niRFSA_Initiate. For the existing open session to use the new self-calibration data, the session will need to be closed and reopened.

**PXIe-5860**

While this VI is running on one channel, if there are any existing NI-RFSG or NI-RFSA sessions open on the other channel, they may remain open but cannot be used for operations that access the hardware, for example niRFSG Commit or niRFSG Initiate or niRFSA Commit or niRFSA Initiate. For the existing open session to use the new self-calibration data, the session will need to be closed and reopened.



Expand Down
20 changes: 20 additions & 0 deletions docs/nirfsg/enums.rst
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,16 @@ LoadOptions



.. py:attribute:: LoadOptions.SCRIPTS



NI-RFSG skips loading the scripts to the session.





LoopBandwidth
-------------

Expand Down Expand Up @@ -1136,6 +1146,16 @@ PulseModulationSource



.. py:attribute:: PulseModulationSource.DO_NOT_DRIVE_SIGNAL



Do not drive pulse modulation.





RFBlanking
----------

Expand Down
18 changes: 18 additions & 0 deletions generated/nirfsg/nirfsg/_library.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def __init__(self, ctypes_library):
self.niRFSG_CreateDeembeddingSparameterTableS2PFile_cfunc = None
self.niRFSG_DeleteAllDeembeddingTables_cfunc = None
self.niRFSG_DeleteDeembeddingTable_cfunc = None
self.niRFSG_DeleteScript_cfunc = None
self.niRFSG_DisableScriptTrigger_cfunc = None
self.niRFSG_DisableStartTrigger_cfunc = None
self.niRFSG_ErrorMessage_cfunc = None
Expand All @@ -60,6 +61,7 @@ def __init__(self, ctypes_library):
self.niRFSG_GetError_cfunc = None
self.niRFSG_GetExternalCalibrationLastDateAndTime_cfunc = None
self.niRFSG_GetMaxSettablePower_cfunc = None
self.niRFSG_GetScript_cfunc = None
self.niRFSG_GetSelfCalibrationDateAndTime_cfunc = None
self.niRFSG_GetSelfCalibrationTemperature_cfunc = None
self.niRFSG_GetTerminalName_cfunc = None
Expand Down Expand Up @@ -301,6 +303,14 @@ def niRFSG_DeleteDeembeddingTable(self, vi, port, table_name): # noqa: N802
self.niRFSG_DeleteDeembeddingTable_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_DeleteDeembeddingTable_cfunc(vi, port, table_name)

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

def niRFSG_DisableScriptTrigger(self, vi, trigger_id): # noqa: N802
with self._func_lock:
if self.niRFSG_DisableScriptTrigger_cfunc is None:
Expand Down Expand Up @@ -429,6 +439,14 @@ def niRFSG_GetMaxSettablePower(self, vi, value): # noqa: N802
self.niRFSG_GetMaxSettablePower_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_GetMaxSettablePower_cfunc(vi, value)

def niRFSG_GetScript(self, vi, script_name, script, buffer_size, actual_buffer_size): # noqa: N802
with self._func_lock:
if self.niRFSG_GetScript_cfunc is None:
self.niRFSG_GetScript_cfunc = self._get_library_function('niRFSG_GetScript')
self.niRFSG_GetScript_cfunc.argtypes = [ViSession, ctypes.POINTER(ViChar), ctypes.POINTER(ViChar), ViInt32, ctypes.POINTER(ViInt32)] # noqa: F405
self.niRFSG_GetScript_cfunc.restype = ViStatus # noqa: F405
return self.niRFSG_GetScript_cfunc(vi, script_name, script, buffer_size, actual_buffer_size)

def niRFSG_GetSelfCalibrationDateAndTime(self, vi, module, year, month, day, hour, minute, second): # noqa: N802
with self._func_lock:
if self.niRFSG_GetSelfCalibrationDateAndTime_cfunc is None:
Expand Down
21 changes: 21 additions & 0 deletions generated/nirfsg/nirfsg/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,13 @@ def delete_deembedding_table(self, port, table_name): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def delete_script(self, script_name): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
script_name_ctype = ctypes.create_string_buffer(script_name.encode(self._encoding)) # case C020
error_code = self._library.niRFSG_DeleteScript(vi_ctype, script_name_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def disable_script_trigger(self, trigger_id): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
trigger_id_ctype = ctypes.create_string_buffer(trigger_id.encode(self._encoding)) # case C010
Expand Down Expand Up @@ -438,6 +445,20 @@ def get_max_settable_power(self): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return float(value_ctype.value)

def get_script(self, script_name): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
script_name_ctype = ctypes.create_string_buffer(script_name.encode(self._encoding)) # case C020
script_ctype = None # case C090
buffer_size_ctype = _visatype.ViInt32(0) # case S190
actual_buffer_size_ctype = _visatype.ViInt32() # case S220
error_code = self._library.niRFSG_GetScript(vi_ctype, script_name_ctype, script_ctype, buffer_size_ctype, None if actual_buffer_size_ctype is None else (ctypes.pointer(actual_buffer_size_ctype)))
errors.handle_error(self, error_code, ignore_warnings=True, is_error_handling=False)
buffer_size_ctype = _visatype.ViInt32(actual_buffer_size_ctype.value) # case S200
script_ctype = (_visatype.ViChar * actual_buffer_size_ctype.value)() # case C100
error_code = self._library.niRFSG_GetScript(vi_ctype, script_name_ctype, script_ctype, buffer_size_ctype, None if actual_buffer_size_ctype is None else (ctypes.pointer(actual_buffer_size_ctype)))
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return script_ctype.value.decode(self._encoding)

def get_self_calibration_date_and_time(self, module): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
module_ctype = _visatype.ViInt32(module.value) # case S130
Expand Down
8 changes: 8 additions & 0 deletions generated/nirfsg/nirfsg/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,10 @@ class LoadOptions(Enum):
r'''
NI-RFSG skips loading the waveform configurations to the session.
'''
SCRIPTS = 2
r'''
NI-RFSG skips loading the scripts to the session.
'''


class LoopBandwidth(Enum):
Expand Down Expand Up @@ -491,6 +495,10 @@ class PulseModulationSource(Enum):
r'''
The trigger is received from the Marker 3.
'''
DO_NOT_DRIVE_SIGNAL = ''
r'''
Do not drive pulse modulation.
'''


class RFBlanking(Enum):
Expand Down
39 changes: 38 additions & 1 deletion generated/nirfsg/nirfsg/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -6291,6 +6291,20 @@ def delete_deembedding_table(self, port, table_name):
'''
self._interpreter.delete_deembedding_table(port, table_name)

@ivi_synchronized
def delete_script(self, script_name):
r'''delete_script

Deletes a specified script from the pool of currently defined scripts. The NI-RFSG device must be in the Configuration state before you call this method.

**Supported Devices** :PXIe-5820/5830/5831/5832/5840/5841/5842/5860

Args:
script_name (str): Specifies the name of the script to delete. This string is case-insensitive.

'''
self._interpreter.delete_script(script_name)

@ivi_synchronized
def disable_start_trigger(self):
r'''disable_start_trigger
Expand Down Expand Up @@ -6502,6 +6516,25 @@ def get_max_settable_power(self):
value = self._interpreter.get_max_settable_power()
return value

@ivi_synchronized
def get_script(self, script_name):
r'''get_script

Returns the content of specified script.

**Supported Devices** :PXIe-5820/5830/5831/5832/5840/5841/5842/5860

Args:
script_name (str): Specifies the name of the script. This string is case-insensitive.


Returns:
script (str): Returns the script.

'''
script = self._interpreter.get_script(script_name)
return script

@ivi_synchronized
def _get_self_calibration_date_and_time(self, module):
r'''_get_self_calibration_date_and_time
Expand Down Expand Up @@ -6960,7 +6993,11 @@ def self_cal(self):

**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 method runs, it may remain open but cannot be used for operations that access the hardware, for example niRFSA_Commit or niRFSA_Initiate.
Note: If there is an existing NI-RFSA session open for the same PXIe-5820/5830/5831/5832/5840/5841/5842/5860 while this method runs, it may remain open but cannot be used for operations that access the hardware, for example niRFSA_Commit or niRFSA_Initiate. For the existing open session to use the new self-calibration data, the session will need to be closed and reopened.

**PXIe-5860**

While this VI is running on one channel, if there are any existing NI-RFSG or NI-RFSA sessions open on the other channel, they may remain open but cannot be used for operations that access the hardware, for example niRFSG Commit or niRFSG Initiate or niRFSA Commit or niRFSA Initiate. For the existing open session to use the new self-calibration data, the session will need to be closed and reopened.
'''
self._interpreter.self_cal()

Expand Down
31 changes: 31 additions & 0 deletions generated/nirfsg/nirfsg/unit_tests/_mock_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def __init__(self):
self._defaults['DeleteAllDeembeddingTables']['return'] = 0
self._defaults['DeleteDeembeddingTable'] = {}
self._defaults['DeleteDeembeddingTable']['return'] = 0
self._defaults['DeleteScript'] = {}
self._defaults['DeleteScript']['return'] = 0
self._defaults['DisableScriptTrigger'] = {}
self._defaults['DisableScriptTrigger']['return'] = 0
self._defaults['DisableStartTrigger'] = {}
Expand Down Expand Up @@ -122,6 +124,10 @@ def __init__(self):
self._defaults['GetMaxSettablePower'] = {}
self._defaults['GetMaxSettablePower']['return'] = 0
self._defaults['GetMaxSettablePower']['value'] = None
self._defaults['GetScript'] = {}
self._defaults['GetScript']['return'] = 0
self._defaults['GetScript']['actualBufferSize'] = None
self._defaults['GetScript']['script'] = None
self._defaults['GetSelfCalibrationDateAndTime'] = {}
self._defaults['GetSelfCalibrationDateAndTime']['return'] = 0
self._defaults['GetSelfCalibrationDateAndTime']['year'] = None
Expand Down Expand Up @@ -369,6 +375,11 @@ def niRFSG_DeleteDeembeddingTable(self, vi, port, table_name): # noqa: N802
return self._defaults['DeleteDeembeddingTable']['return']
return self._defaults['DeleteDeembeddingTable']['return']

def niRFSG_DeleteScript(self, vi, script_name): # noqa: N802
if self._defaults['DeleteScript']['return'] != 0:
return self._defaults['DeleteScript']['return']
return self._defaults['DeleteScript']['return']

def niRFSG_DisableScriptTrigger(self, vi, trigger_id): # noqa: N802
if self._defaults['DisableScriptTrigger']['return'] != 0:
return self._defaults['DisableScriptTrigger']['return']
Expand Down Expand Up @@ -574,6 +585,22 @@ def niRFSG_GetMaxSettablePower(self, vi, value): # noqa: N802
value.contents.value = self._defaults['GetMaxSettablePower']['value']
return self._defaults['GetMaxSettablePower']['return']

def niRFSG_GetScript(self, vi, script_name, script, buffer_size, actual_buffer_size): # noqa: N802
if self._defaults['GetScript']['return'] != 0:
return self._defaults['GetScript']['return']
# actual_buffer_size
if self._defaults['GetScript']['actualBufferSize'] is None:
raise MockFunctionCallError("niRFSG_GetScript", param='actualBufferSize')
if actual_buffer_size is not None:
actual_buffer_size.contents.value = self._defaults['GetScript']['actualBufferSize']
# script
if self._defaults['GetScript']['script'] is None:
raise MockFunctionCallError("niRFSG_GetScript", param='script')
if buffer_size.value == 0:
return len(self._defaults['GetScript']['script'])
script.value = self._defaults['GetScript']['script'].encode('ascii')
return self._defaults['GetScript']['return']

def niRFSG_GetSelfCalibrationDateAndTime(self, vi, module, year, month, day, hour, minute, second): # noqa: N802
if self._defaults['GetSelfCalibrationDateAndTime']['return'] != 0:
return self._defaults['GetSelfCalibrationDateAndTime']['return']
Expand Down Expand Up @@ -967,6 +994,8 @@ def set_side_effects_and_return_values(self, mock_library):
mock_library.niRFSG_DeleteAllDeembeddingTables.return_value = 0
mock_library.niRFSG_DeleteDeembeddingTable.side_effect = MockFunctionCallError("niRFSG_DeleteDeembeddingTable")
mock_library.niRFSG_DeleteDeembeddingTable.return_value = 0
mock_library.niRFSG_DeleteScript.side_effect = MockFunctionCallError("niRFSG_DeleteScript")
mock_library.niRFSG_DeleteScript.return_value = 0
mock_library.niRFSG_DisableScriptTrigger.side_effect = MockFunctionCallError("niRFSG_DisableScriptTrigger")
mock_library.niRFSG_DisableScriptTrigger.return_value = 0
mock_library.niRFSG_DisableStartTrigger.side_effect = MockFunctionCallError("niRFSG_DisableStartTrigger")
Expand Down Expand Up @@ -999,6 +1028,8 @@ def set_side_effects_and_return_values(self, mock_library):
mock_library.niRFSG_GetExternalCalibrationLastDateAndTime.return_value = 0
mock_library.niRFSG_GetMaxSettablePower.side_effect = MockFunctionCallError("niRFSG_GetMaxSettablePower")
mock_library.niRFSG_GetMaxSettablePower.return_value = 0
mock_library.niRFSG_GetScript.side_effect = MockFunctionCallError("niRFSG_GetScript")
mock_library.niRFSG_GetScript.return_value = 0
mock_library.niRFSG_GetSelfCalibrationDateAndTime.side_effect = MockFunctionCallError("niRFSG_GetSelfCalibrationDateAndTime")
mock_library.niRFSG_GetSelfCalibrationDateAndTime.return_value = 0
mock_library.niRFSG_GetSelfCalibrationTemperature.side_effect = MockFunctionCallError("niRFSG_GetSelfCalibrationTemperature")
Expand Down
2 changes: 1 addition & 1 deletion src/nirfsg/metadata/attributes.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
# This file is generated from NI-RFSG API metadata version 25.8.0d197
# This file is generated from NI-RFSG API metadata version 26.3.0d9999
attributes = {
1050302: {
'access': 'read only',
Expand Down
4 changes: 2 additions & 2 deletions src/nirfsg/metadata/config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
# This file is generated from NI-RFSG API metadata version 25.8.0d197
# This file is generated from NI-RFSG API metadata version 26.3.0d9999
config = {
'api_version': '25.8.0d197',
'api_version': '26.3.0d9999',
'c_function_prefix': 'niRFSG_',
'close_function': 'close',
'context_manager_name': {
Expand Down
Loading
Loading