Skip to content
Open
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1708,6 +1708,7 @@
- `numpy` is now an install dependency
- gRPC support, enabling remote session management via NI gRPC Device Server
- Changed
- Fixed `error_message` method to return the error string as output
- Removed

#### [nirfsg] 1.0.1 - 2026-01-09
Expand Down
11 changes: 5 additions & 6 deletions docs/nirfsg/class.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,7 @@ error_message

.. py:currentmodule:: nirfsg.Session

.. py:method:: error_message(error_code, error_message)
.. py:method:: error_message(error_code)

Converts an error code returned by an NI-RFSG method into a user-readable string.

Expand All @@ -1184,17 +1184,16 @@ error_message


:type error_code: int
:param error_message:

:rtype: str
:return:

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.
Returns the user-readable message string that corresponds to the status code you specify.




:type error_message: str

get_all_named_waveform_names
----------------------------
Expand Down
7 changes: 4 additions & 3 deletions generated/nirfsg/nirfsg/_grpc_stub_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,11 +241,12 @@ def disable_start_trigger(self): # noqa: N802
grpc_types.DisableStartTriggerRequest(vi=self._vi),
)

def error_message(self, error_code, error_message): # noqa: N802
self._invoke(
def error_message(self, error_code): # noqa: N802
response = self._invoke(
self._client.ErrorMessage,
grpc_types.ErrorMessageRequest(vi=self._vi, error_code=error_code, error_message=error_message),
grpc_types.ErrorMessageRequest(vi=self._vi, error_code=error_code),
)
return response.error_message

def get_all_named_waveform_names(self): # noqa: N802
response = self._invoke(
Expand Down
6 changes: 3 additions & 3 deletions generated/nirfsg/nirfsg/_library_interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,13 @@ def disable_start_trigger(self): # noqa: N802
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=False)
return

def error_message(self, error_code, error_message): # noqa: N802
def error_message(self, error_code): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
error_code_ctype = _visatype.ViStatus(error_code) # case S150
error_message_ctype = ctypes.create_string_buffer(error_message.encode(self._encoding)) # case C020
error_message_ctype = (_visatype.ViChar * 256)() # case C070
error_code = self._library.niRFSG_ErrorMessage(vi_ctype, error_code_ctype, error_message_ctype)
errors.handle_error(self, error_code, ignore_warnings=False, is_error_handling=True)
return
return error_message_ctype.value.decode(self._encoding)

def get_all_named_waveform_names(self): # noqa: N802
vi_ctype = _visatype.ViSession(self._vi) # case S110
Expand Down
9 changes: 5 additions & 4 deletions generated/nirfsg/nirfsg/session.py
Original file line number Diff line number Diff line change
Expand Up @@ -4833,7 +4833,7 @@ def disable_script_trigger(self):
'''
self._interpreter.disable_script_trigger(self._repeated_capability)

def error_message(self, error_code, error_message):
def error_message(self, error_code):
r'''error_message

Converts an error code returned by an NI-RFSG method into a user-readable string.
Expand All @@ -4845,12 +4845,13 @@ def error_message(self, error_code, error_message):

**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.
Returns:
error_message (str): Returns the user-readable message string that corresponds to the status code you specify.

'''
self._interpreter.error_message(error_code, error_message)
error_message = self._interpreter.error_message(error_code)
return error_message

@ivi_synchronized
def _get_attribute_vi_boolean(self, attribute):
Expand Down
10 changes: 10 additions & 0 deletions generated/nirfsg/nirfsg/unit_tests/_mock_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ def __init__(self):
self._defaults['DisableStartTrigger']['return'] = 0
self._defaults['ErrorMessage'] = {}
self._defaults['ErrorMessage']['return'] = 0
self._defaults['ErrorMessage']['errorMessage'] = None
self._defaults['GetAllNamedWaveformNames'] = {}
self._defaults['GetAllNamedWaveformNames']['return'] = 0
self._defaults['GetAllNamedWaveformNames']['actualBufferSize'] = None
Expand Down Expand Up @@ -393,6 +394,15 @@ def niRFSG_DisableStartTrigger(self, vi): # noqa: N802
def niRFSG_ErrorMessage(self, vi, error_code, error_message): # noqa: N802
if self._defaults['ErrorMessage']['return'] != 0:
return self._defaults['ErrorMessage']['return']
# error_message
if self._defaults['ErrorMessage']['errorMessage'] is None:
raise MockFunctionCallError("niRFSG_ErrorMessage", param='errorMessage')
test_value = self._defaults['ErrorMessage']['errorMessage']
if type(test_value) is str:
test_value = test_value.encode('ascii')
assert len(error_message) >= len(test_value)
for i in range(len(test_value)):
error_message[i] = test_value[i]
return self._defaults['ErrorMessage']['return']

def niRFSG_GetAllNamedWaveformNames(self, vi, waveform_names, buffer_size, actual_buffer_size): # noqa: N802
Expand Down
4 changes: 2 additions & 2 deletions src/nirfsg/metadata/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -1423,9 +1423,9 @@
'use_in_python_api': True
},
{
'direction': 'in',
'direction': 'out',
'documentation': {
'description': 'Returns the user-readable message string that corresponds to the status code you specify.\n\nYou must pass a ViChar array with at least 256 bytes to this parameter.'
'description': 'Returns the user-readable message string that corresponds to the status code you specify.'
},
'name': 'errorMessage',
'size': {
Expand Down
Loading