from . import manage_mainframe_settings as _manage_mainframe_settings
from . import manage_recordings_api as _manage_recordings
from . import recorder_api as _recorder
+from . import predefined_configurations_api as _predefined_config
+from . import sweep_api as _sweep
+from . import continuous_api as _continuous
+from . import can_fieldbus_api as _can_fieldbus
from .connection import ConnectionHandler
from .ghsapi_states import (
RETURN_KEY,
@@ -124,7 +133,7 @@ Source code for ghsapi.ghsapi
class GHS:
- """GEN DAQ API object.
+ """GEN DAQ API object.
Attributes:
_con_handle: An unique identifier per mainframe connection.
@@ -135,7 +144,7 @@ Source code for ghsapi.ghsapi
# Connection related API functions.
[docs] def ghs_connect(self, ip_address: int, port_num: int) -> str:
-
"""Establishes a connection to the mainframe.
+
"""Establishes a connection to the mainframe.
Args:
ip_address: IP address needs to be an IPV4 address.
@@ -150,7 +159,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_disconnect(self) -> str:
-
"""Disconnects from a connected mainframe.
+
"""Disconnects from a connected mainframe.
*Results in error when the handle is not valid and / or
mainframe is not connected.*
@@ -162,7 +171,7 @@
Source code for ghsapi.ghsapi
return _connection.disconnect(self._con_handle)
[docs] def ghs_get_client_api_version(self) -> int:
-
"""Client's API version.
+
"""Client's API version.
*This function can be useful when ghs_connect() returns
GHSReturnValue_APIMismatch.*
@@ -174,7 +183,7 @@
Source code for ghsapi.ghsapi
return CLIENT_API_VERSION
[docs] def ghs_get_current_access(self) -> str:
-
"""Current access permission to the mainframe.
+
"""Current access permission to the mainframe.
*The current access permissions might change at any time.
For example, when Perception connects concurrently to the same
@@ -193,7 +202,7 @@
Source code for ghsapi.ghsapi
# Acquisition control related API functions.
[docs] def ghs_start_preview(self) -> str:
-
"""Starts preview mode.
+
"""Starts preview mode.
*The system needs to be idle before calling this function.*
@@ -204,7 +213,7 @@
Source code for ghsapi.ghsapi
return _acquisition.start_preview(self._con_handle)
[docs] def ghs_stop_preview(self) -> str:
-
"""Stops preview mode.
+
"""Stops preview mode.
*The system needs to be in preview mode before calling this
function.*
@@ -216,7 +225,7 @@
Source code for ghsapi.ghsapi
return _acquisition.stop_preview(self._con_handle)
[docs] def ghs_start_recording(self) -> str:
-
"""Start recording on local storage.
+
"""Start recording on local storage.
*The system needs to be idle before calling this function. Note
that the connected mainframe will generate a recording name.
@@ -229,8 +238,44 @@
Source code for ghsapi.ghsapi
return _acquisition.start_recording(self._con_handle)
+
def ghs_start_recording_without_sync_check(self) -> str:
+
"""Starts a recording on local storage without checking synchronization status.
+
+
*The system needs to be idle before calling this function. Note
+
that the connected mainframe will generate a recording name.
+
This command can be executed only successfully when the local
+
storage is set.*
+
+
Returns:
+
* GHSReturnValue - Start recording status.
+
"""
+
+
return _acquisition.start_recording_without_synch_check(self._con_handle)
+
+
[docs] def ghs_start_recording_in_pause(
+
self,
+
ignore_sync
+
) -> str:
+
"""Starts a recording on local storage in Pause mode.
+
+
*The system needs to be idle before calling this function. Note
+
that the connected mainframe will generate a recording name.
+
This command can be executed only successfully when the local
+
storage is set.*
+
Execution of this command can be influenced by Perception setting
+
"Suspend storage at start of recording"
+
+
Returns:
+
* GHSReturnValue - Start recording status.
+
"""
+
+
return _acquisition.start_recording_in_pause(
+
self._con_handle,
+
ignore_sync
+
)
+
[docs] def ghs_pause_recording(self) -> str:
-
"""Pauses a started recording.
+
"""Pauses a started recording.
*The system needs to be recording before calling this function.*
@@ -241,7 +286,7 @@
Source code for ghsapi.ghsapi
return _acquisition.pause_recording(self._con_handle)
[docs] def ghs_resume_recording(self) -> str:
-
"""Resumes a paused recording.
+
"""Resumes a paused recording.
*The system needs to be paused before calling this function.*
@@ -252,7 +297,7 @@
Source code for ghsapi.ghsapi
return _acquisition.resume_recording(self._con_handle)
[docs] def ghs_stop_recording(self) -> str:
-
"""Stops a started recording.
+
"""Stops a started recording.
*The system needs to be recording before calling this function.*
@@ -263,7 +308,7 @@
Source code for ghsapi.ghsapi
return _acquisition.stop_recording(self._con_handle)
[docs] def ghs_trigger(self) -> str:
-
"""Issues a trigger.
+
"""Issues a trigger.
Results in error when the trigger cannot be issued.
@@ -274,7 +319,7 @@
Source code for ghsapi.ghsapi
return _acquisition.trigger(self._con_handle)
[docs] def ghs_get_acquisition_state(self) -> tuple[str, str | None]:
-
"""Returns the Acquisition State of the Mainframe.
+
"""Returns the Acquisition State of the Mainframe.
Returns:
* GHSReturnValue - API return status
@@ -283,10 +328,21 @@
Source code for ghsapi.ghsapi
return _acquisition.get_acquisition_state(self._con_handle)
+
[docs] def ghs_get_extended_acquisition_state(self) -> tuple[str, str | None, int | None]:
+
"""Returns the Acquisition State of the Mainframe.
+
+
Returns:
+
* GHSReturnValue - API return status
+
* GHSExtendedAcquisitionState - The acquisition state @ref GHSExtendedAcquisitionState.
+
* TriggerCount - Trigger Count.
+
"""
+
+
return _acquisition.get_extended_acquisition_state(self._con_handle)
+
[docs] def ghs_get_acquisition_start_time(
self,
) -> tuple[str, int | None, int | None, float | None]:
-
"""Retrieves the absolute time of the start of acquisition.
+
"""Retrieves the absolute time of the start of acquisition.
Returns:
* GHSReturnValue - API return status
@@ -298,7 +354,7 @@
Source code for ghsapi.ghsapi
return _acquisition.get_acquisition_start_time(self._con_handle)
[docs] def ghs_get_acquisition_time(self) -> tuple[str, float | None]:
-
"""Retrieves the current acquisition time relative to the start
+
"""Retrieves the current acquisition time relative to the start
of acquistion.
Returns:
@@ -310,8 +366,8 @@
Source code for ghsapi.ghsapi
# Mainframe APIs
-[docs] def ghs_identify(self, identity_flag: bool) -> str:
-
"""Enable or disable the identification sound of the connected
+
[docs] def ghs_identify(self, enabled: str | int) -> str:
+
"""Enable or disable the identification sound of the connected
mainframe.
Args:
@@ -321,10 +377,10 @@
Source code for ghsapi.ghsapi
* GHSReturnValue - Identify API status.
"""
- return _mainframe.identity(self._con_handle, identity_flag)
+
return _mainframe.identify(self._con_handle, enabled)
[docs] def ghs_get_disk_space(self) -> tuple[str, float | None, float | None]:
-
"""Get total and available mainframe internal disk space.
+
"""Get total and available mainframe internal disk space.
Returns:
* GHSReturnValue - API return status
@@ -335,7 +391,7 @@
Source code for ghsapi.ghsapi
return _mainframe.get_disk_space(self._con_handle)
[docs] def ghs_get_sync_status(self) -> tuple[str, str | None]:
-
"""Determine the mainframe sync status.
+
"""Determine the mainframe sync status.
Returns:
* GHSReturnValue - API return status
@@ -345,7 +401,7 @@
Source code for ghsapi.ghsapi
return _mainframe.get_sync_status(self._con_handle)
[docs] def ghs_get_slot_count(self) -> tuple[str, int | None]:
-
"""Retrieve the number of slots in the mainframe.
+
"""Retrieve the number of slots in the mainframe.
Returns:
* GHSReturnValue - API return status
@@ -355,7 +411,7 @@
Source code for ghsapi.ghsapi
return _mainframe.get_slot_count(self._con_handle)
[docs] def ghs_get_user_mode(self) -> tuple[str, str | None]:
-
"""Retrieve the user mode.
+
"""Retrieve the user mode.
Returns:
* GHSReturnValue - API return status
@@ -365,7 +421,7 @@
Source code for ghsapi.ghsapi
return _mainframe.get_user_mode(self._con_handle)
[docs] def ghs_set_user_mode(self, user_mode: str | int) -> str:
-
"""Set the user mode.
+
"""Set the user mode.
*The system needs to be idle before calling this function.*
@@ -381,7 +437,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_get_mainframe_info(
self,
) -> tuple[str, str | None, str | None, str | None, str | None]:
-
"""Determine type, name, serial number and firmware version
+
"""Determine type, name, serial number and firmware version
information for the connected mainframe.
*The mainframeType, mainframeName, serialNumber and
@@ -400,7 +456,7 @@
Source code for ghsapi.ghsapi
# Manage recordings APIs
[docs] def ghs_delete_all_recordings(self) -> str:
-
"""Deletes all recordings from local mainframe storage.
+
"""Deletes all recordings from local mainframe storage.
*Recordings are deleted asynchronously.*
@@ -411,7 +467,7 @@
Source code for ghsapi.ghsapi
return _manage_recordings.delete_all_recordings(self._con_handle)
[docs] def ghs_delete_last_recording(self) -> str:
-
"""Deletes the most recent recording from local mainframe
+
"""Deletes the most recent recording from local mainframe
storage.
*Recordings are deleted asynchronously.*
@@ -423,7 +479,7 @@
Source code for ghsapi.ghsapi
return _manage_recordings.delete_last_recording(self._con_handle)
[docs] def ghs_get_recording_name(self) -> tuple[str, str | None, int | None]:
-
"""Retrieve the recording base name and recording index of the
+
"""Retrieve the recording base name and recording index of the
last recording file.
*The recording base name parameter is UTF-8 encoded.*
@@ -437,7 +493,7 @@
Source code for ghsapi.ghsapi
return _manage_recordings.get_recording_name(self._con_handle)
[docs] def ghs_get_storage_location(self) -> tuple[str, str | None]:
-
"""Retrieve the storage location.
+
"""Retrieve the storage location.
Returns:
* GHSReturnValue - API return status
@@ -449,7 +505,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_get_high_low_rate_storage_enabled(
self, source: str | int, slot_id: str
) -> tuple[str, str | None, str | None]:
-
"""Retrieve storage enabled status of high and low rate data
+
"""Retrieve storage enabled status of high and low rate data
for the specified recording data source.
Args:
@@ -473,7 +529,7 @@
Source code for ghsapi.ghsapi
high_rate_enabled: str | int,
low_rate_enabled: str | int,
) -> str:
- """Enable/disable storage of high and low rate data for the
+ """Enable/disable storage of high and low rate data for the
specified recording data source.
Args:
@@ -497,7 +553,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_set_recording_name(
self, recording_name: str, recording_index: int
) -> str:
-
"""Set the recording base name and recording index for the next
+
"""Set the recording base name and recording index for the next
recording file.
*The system needs to be idle before calling this function.
@@ -516,7 +572,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_set_storage_location(self, storage_location: str | int) -> str:
-
"""Set the storage location.
+
"""Set the storage location.
*The system needs to be idle before calling this function.*
@@ -534,7 +590,7 @@
Source code for ghsapi.ghsapi
# Manage recordings APIs
[docs] def ghs_apply_persisted_settings(self) -> str:
-
"""A mainframe might contain persisted settings (being applied upon
+
"""A mainframe might contain persisted settings (being applied upon
boot). This method re-applies these settings. In Perception this
maps on the 'Configured boot' feature.
@@ -551,7 +607,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_persist_current_settings(self) -> str:
-
"""Persists the current mainframe settings.
+
"""Persists the current mainframe settings.
*The persisted mainframe settings are applied upon a mainframe
boot.*
@@ -565,7 +621,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_get_current_settings(self) -> tuple[str, bytes | None, int | None]:
-
"""Retrieves the current mainframe settings as a blob.
+
"""Retrieves the current mainframe settings as a blob.
*As this blob can be of variable size, it is upon the caller to
ensure reading the correct amount of memory.
@@ -582,7 +638,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_set_current_settings(self, blob: bytes, blob_size: int) -> str:
-
"""Persists the current mainframe settings.
+
"""Persists the current mainframe settings.
*The persisted mainframe settings are applied upon a mainframe
boot.*
@@ -599,10 +655,145 @@
Source code for ghsapi.ghsapi
self._con_handle, blob, blob_size
)
+
# Predefined Configurations APIs
+
+
[docs] def ghs_apply_configuration(
+
self,
+
config_id: int
+
) -> str:
+
"""Applies one of the predefined configurations as actual configuration of the mainframe.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
config_id: The configuration identification number.
+
+
Returns:
+
* GHSReturnValue - API return status
+
"""
+
+
return _predefined_config.apply_configuration(
+
self._con_handle,
+
config_id
+
)
+
+
[docs] def ghs_get_configuration_info(
+
self,
+
config_type: str | int,
+
config_id: int
+
) -> tuple[
+
str, str | None, str | None, str | None, str | None, str | None, str | None
+
]:
+
"""Returns information of a specified configuration.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
config_type: The configuration type @ref GHSConfigurationType.
+
config_id: The configuration identification number.
+
+
Returns:
+
* GHSReturnValue - API return status
+
* MainframeType - The type of the mainframe.
+
* Boards - The acquisition boards.
+
* Description - The configuration description.
+
* HWCompatibility - The HW compatibility with the given configurations @ref GHSHWCompatibility.
+
* WiringPath - The wiring path of the given configuration.
+
* SchematicPath - The schematic path of the given configuration.
+
"""
+
+
return _predefined_config.get_configuration_info(
+
self._con_handle,
+
config_type,
+
config_id
+
)
+
+
[docs] def ghs_get_current_configuration_id(
+
self
+
) -> tuple[str, int | None]:
+
"""Returns the identification number of the currently loaded configuration.
+
+
*This method will only process requests from the connected client
+
with the most privileges order (Privileges order: 1- Perception,
+
2- GenDaq, 3- Other)*
+
+
Returns:
+
* GHSReturnValue - API return status
+
* ConfigurationId - The configuration identification number.
+
"""
+
+
return _predefined_config.get_current_configuration_id(self._con_handle)
+
+
[docs] def ghs_get_number_of_configurations(
+
self,
+
config_type: str | int
+
) -> tuple[str, int | None]:
+
"""Returns the total number of predefined configurations present on the mainframe.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
config_type: The configuration type @ref GHSConfigurationType.
+
+
Returns:
+
* GHSReturnValue - API return status
+
* TotalConfigurations - The total number of configurations.
+
"""
+
+
return _predefined_config.get_number_of_configurations(
+
self._con_handle,
+
config_type
+
)
+
+
[docs] def ghs_get_persisted_configuration_id(
+
self
+
) -> tuple[str, int | None]:
+
"""Returns the identification number of the currently persisted configuration.
+
* This is the configuration loaded when the mainframe starts.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return status
+
* ConfigurationId - The configuration identification number.
+
"""
+
+
return _predefined_config.get_persisted_configuration_id(self._con_handle)
+
+
[docs] def ghs_set_persisted_configuration(
+
self,
+
config_id: int
+
) -> str:
+
"""Sets the persisted configuration.
+
* This is the configuration loaded when the mainframe starts.
+
+
*This method will only process requests from the connected client
+
with the most privileges order (Privileges order: 1- Perception,
+
2- GenDaq, 3- Other)*
+
+
Args:
+
config_id: The configuration identification number.
+
+
Returns:
+
* GHSReturnValue - API return status
+
"""
+
+
return _predefined_config.set_persisted_configuration(
+
self._con_handle,
+
config_id
+
)
+
# Recorder APIs
-
[docs] def ghs_get_channel_count(self, slot_id: str) -> tuple[str, int | None]:
-
"""Retrieve the number of channels for a recorder.
+
[docs] def ghs_get_channel_count(
+
self,
+
slot_id: str
+
) -> tuple[str, int | None]:
+
"""Retrieve the number of channels for a recorder.
*This method can be called by multiple connected clients at same
time.*
@@ -618,9 +809,11 @@
Source code for ghsapi.ghsapi
return _recorder.get_channel_count(self._con_handle, slot_id)
[docs] def ghs_get_digital_output(
-
self, slot_id: str, digital_output: str | int
+
self,
+
slot_id: str,
+
digital_output: str | int
) -> tuple[str, str | None]:
-
"""Retrieve the Digital Output Mode for a specified Output ID in a
+
"""Retrieve the Digital Output Mode for a specified Output ID in a
recorder.
*This method can be called by multiple connected clients at same
@@ -639,8 +832,55 @@
Source code for ghsapi.ghsapi
self._con_handle, slot_id, digital_output
)
-
[docs] def ghs_get_recorder_enabled(self, slot_id: str) -> tuple[str, str | None]:
-
"""Determine if recorder is enabled or disabled.
+
[docs] def ghs_get_number_analog_channels(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Get number of analog channels in a recorder.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return status
+
* NumberOfAnalogChannels - The digital output mode for that output
+
"""
+
+
return _recorder.get_number_analog_channels(
+
self._con_handle,
+
slot_id
+
)
+
+
[docs] def ghs_get_number_timer_counter_channels(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Get number of timer counter channels in a recorder.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return status
+
* NumberOfTimerCounterChannels - The number of timer counter channels in the recorder.
+
"""
+
+
return _recorder.get_number_timer_counter_channels(
+
self._con_handle,
+
slot_id
+
)
+
+
[docs] def ghs_get_recorder_enabled(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Determine if recorder is enabled or disabled.
*This method can be called by multiple connected clients at same
time.*
@@ -656,9 +896,10 @@
Source code for ghsapi.ghsapi
return _recorder.get_recorder_enabled(self._con_handle, slot_id)
[docs] def ghs_get_recorder_info(
-
self, slot_id: str
+
self,
+
slot_id: str
) -> tuple[str, str | None, str | None, str | None, str | None]:
-
"""Determine type, name, serial number and firmware version
+
"""Determine type, name, serial number and firmware version
information for a recorder.
*The recorderType, recorderName, serialNumber and firmwareVersion
@@ -680,8 +921,33 @@
Source code for ghsapi.ghsapi
return _recorder.get_recorder_info(self._con_handle, slot_id)
-
[docs] def ghs_get_sample_rate(self, slot_id: str) -> tuple[str, float | None]:
-
"""Determine the sample rate for a recorder.
+
[docs] def ghs_get_recorder_sales_type(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Determine sales type for a recorder.
+
+
*This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return status
+
* RecorderSalesType - The sales type of the recorder (type string in 'GNXXXB' format, e.g. GN310B).
+
"""
+
+
return _recorder.get_recorder_sales_type(
+
self._con_handle,
+
slot_id
+
)
+
+
[docs] def ghs_get_sample_rate(
+
self,
+
slot_id: str
+
) -> tuple[str, float | None]:
+
"""Determine the sample rate for a recorder.
*This method can be called by multiple connected clients at same
time.*
@@ -702,7 +968,7 @@
Source code for ghsapi.ghsapi
digital_output: str | int,
digital_output_mode: str | int,
) -> str:
- """Set the Digital Output Mode for a specified Output ID in a
+ """Set the Digital Output Mode for a specified Output ID in a
recorder.
*This method will only process requests from the connected client
@@ -727,7 +993,7 @@ Source code for ghsapi.ghsapi
slot_id: str,
enabled: str | int,
) -> str:
- """Enable or disable a recorder.
+ """Enable or disable a recorder.
*The system needs to be idle before calling this function.*
@@ -752,7 +1018,7 @@ Source code for ghsapi.ghsapi
slot_id: str,
sample_rate: float,
) -> str:
- """Set the sample rate for a recorder.
+ """Set the sample rate for a recorder.
*The system needs to be idle before calling this function.
This function overwrites any previously set sample rate setting for
@@ -782,7 +1048,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_channel_type(
self, slot_id: str, channel_index: int
) -> tuple[str, int | None]:
-
"""Determine the type of a channel.
+
"""Determine the type of a channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -803,7 +1069,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_get_channel_name(
self, slot_id: str, channel_index: int
) -> tuple[str, int | None]:
-
"""Determine the name of a channel.
+
"""Determine the name of a channel.
*The channel name is UTF-8 encoded*
@@ -826,7 +1092,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_set_channel_name(
self, slot_id: str, channel_index: int, channel_name: str
) -> str:
-
"""Set the name for a channel.
+
"""Set the name for a channel.
*The channel name is UTF-8 encoded*
@@ -850,7 +1116,7 @@
Source code for ghsapi.ghsapi
[docs] def ghs_get_channel_storage_enabled(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None]:
-
"""Determine if storage is enabled or disabled for a channel.
+
"""Determine if storage is enabled or disabled for a channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -874,7 +1140,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
enabled: str | int,
) -> str:
- """Enable or disable storage for a channel.
+ """Enable or disable storage for a channel.
*The system needs to be idle before calling this function.*
@@ -898,7 +1164,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_cmd_zeroing(
self, slot_id: str, channel_index: int, ezeroing: str | int
) -> str:
-
"""Perform zeroing in a channel.
+
"""Perform zeroing in a channel.
*The system needs to be idle before calling this function.*
@@ -925,7 +1191,7 @@
Source code for ghsapi.ghsapi
) -> tuple[
str, str | None, float | None, float | None, float | None, str | None
]:
- """Determine the trigger settings for an analog channel.
+ """Determine the trigger settings for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -957,7 +1223,7 @@ Source code for ghsapi.ghsapi
hysteresis: float,
direction: str | int,
) -> str:
- """Set the trigger settings for an analog channel.
+ """Set the trigger settings for an analog channel.
*The system needs to be idle before calling this function.*
@@ -999,7 +1265,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_signal_coupling(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None]:
-
"""Determine the signal coupling for an analog channel.
+
"""Determine the signal coupling for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1023,7 +1289,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
signal_coupling: str | int,
) -> str:
- """Set the signal coupling for an analog channel.
+ """Set the signal coupling for an analog channel.
*If the specified signal coupling mode is not supported by the
recorder, the signal coupling mode remains unchanged.*
@@ -1051,7 +1317,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_input_coupling(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None]:
-
"""Determine the input coupling for an analog channel.
+
"""Determine the input coupling for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1075,7 +1341,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
input_coupling: str | int,
) -> str:
- """Set the input coupling for an analog channel.
+ """Set the input coupling for an analog channel.
*If the specified input coupling mode is not supported by the
recorder, the input coupling mode remains unchanged.*
@@ -1103,7 +1369,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_span_and_offset(
self, slot_id: str, channel_index: int
) -> tuple[str, float | None, float | None]:
-
"""Determine the span and offset for an analog channel.
+
"""Determine the span and offset for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1129,7 +1395,7 @@
Source code for ghsapi.ghsapi
span: float,
offset: float,
) -> str:
- """Set Span and offset for analog channels.
+ """Set Span and offset for analog channels.
*ReadWrite - This method will only process requests from the
connected client with the most privileges order (Privileges
@@ -1156,7 +1422,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_filter_type_and_frequency(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None, float | None]:
-
"""Determine the filter type and frequency for an analog channel.
+
"""Determine the filter type and frequency for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1182,7 +1448,7 @@
Source code for ghsapi.ghsapi
filter_type: str | int,
frequency: float,
) -> str:
- """Set the filter type and frequency for an analog channel.
+ """Set the filter type and frequency for an analog channel.
*This function overwrites any previously set filter settings
for the specified recorder.*
@@ -1216,7 +1482,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_excitation(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None, float | None]:
-
"""Determine the excitation type and value for an analog channel.
+
"""Determine the excitation type and value for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1242,7 +1508,7 @@
Source code for ghsapi.ghsapi
excitation_type: str | int,
excitation_value: float,
) -> str:
- """Set the excitation type and value for an analog channel.
+ """Set the excitation type and value for an analog channel.
*The system needs to be idle before calling this function.*
@@ -1275,7 +1541,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_amplifier_mode(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None]:
-
"""Determine the amplifier mode for an analog channel.
+
"""Determine the amplifier mode for an analog channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1299,7 +1565,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
amplifier_mode: str | int,
) -> str:
- """Set the amplifier mode for an analog channel.
+ """Set the amplifier mode for an analog channel.
*The system needs to be idle before calling this function.*
@@ -1329,7 +1595,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_technical_units(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None, float | None, float | None]:
-
"""Determine the technical units, unit multiplier and unit offset for
+
"""Determine the technical units, unit multiplier and unit offset for
an analog channel.
*The units parameter is UTF-8 encoded.*
@@ -1360,7 +1626,7 @@
Source code for ghsapi.ghsapi
multiplier: float,
offset: float,
) -> str:
- """Set the technical units, unit multiplier and unit offset for an
+ """Set the technical units, unit multiplier and unit offset for an
analog channel.
*The units parameter must be UTF-8 encoded.*
@@ -1392,7 +1658,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_auto_range(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None, float | None]:
-
"""Determine the auto range enable and time settings.
+
"""Determine the auto range enable and time settings.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1418,7 +1684,7 @@
Source code for ghsapi.ghsapi
auto_range_enabled: str | int,
auto_range_time: float,
) -> str:
- """Set Auto range settings for analog channels.
+ """Set Auto range settings for analog channels.
*ReadWrite - This method will only process requests from the
connected client with the most privileges order (Privileges
@@ -1448,7 +1714,7 @@ Source code for ghsapi.ghsapi
channel_index: int,
auto_range_time: float,
) -> str:
- """Command a single shot for auto range.
+ """Command a single shot for auto range.
*The system needs to be acquiring for this function to have any
effect.*
@@ -1484,7 +1750,7 @@ Source code for ghsapi.ghsapi
str | None,
str | None,
]:
- """Retrieve calibration information for an analog channel.
+ """Retrieve calibration information for an analog channel.
*The calibrationDateTime, verificationDateTime,
powerVerificationDateTime, calibrationLab, verificationLab and
@@ -1516,7 +1782,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_timer_counter_gate_time(
self, slot_id: str, channel_index: int
) -> tuple[str, float | None]:
-
"""Determine the gate time for a timer/counter channel.
+
"""Determine the gate time for a timer/counter channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1540,7 +1806,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
gate_time: float,
) -> str:
- """Determine the gate time for a timer/counter channel.
+ """Determine the gate time for a timer/counter channel.
The system needs to be idle before calling this function.
@@ -1571,7 +1837,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_timer_counter_mode(
self, slot_id: str, channel_index: int
) -> tuple[str, str | None]:
-
"""Determine the mode for a timer/counter channel.
+
"""Determine the mode for a timer/counter channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1595,7 +1861,7 @@
Source code for ghsapi.ghsapi
channel_index: int,
mode: str | int,
) -> str:
- """Set the mode for a timer/counter channel.
+ """Set the mode for a timer/counter channel.
*The system needs to be idle before calling this function.*
@@ -1625,7 +1891,7 @@ Source code for ghsapi.ghsapi
[docs] def ghs_get_timer_counter_range(
self, slot_id: str, channel_index: int
) -> tuple[str, float | None, float | None]:
-
"""Determine the range for a timer/counter channel.
+
"""Determine the range for a timer/counter channel.
*Read - This method can be called by multiple connected clients at same
time.*
@@ -1651,7 +1917,7 @@
Source code for ghsapi.ghsapi
lower_value: float,
upper_value: float,
) -> str:
- """Set the range for a timer/counter channel.
+ """Set the range for a timer/counter channel.
*The system needs to be idle before calling this function.*
@@ -1680,6 +1946,612 @@ Source code for ghsapi.ghsapi
lower_value,
upper_value,
)
+
+ # Sweep APIs
+
+[docs] def ghs_cmd_trigger_arm(
+
self
+
) -> str:
+
"""Arm the trigger, so that the next trigger will be accepted.
+
* After the next trigger occurred, triggers are disarmed automatically and need to be
+
* armed explicitly again using this function.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.cmd_trigger_arm(
+
self._con_handle
+
)
+
+[docs] def ghs_get_number_of_sweeps(
+
self,
+
slot_id: str
+
) -> tuple[str, int | None]:
+
"""Determine the number of sweeps for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* NumberOfSweeps - The number of sweeps for the recorder.
+
"""
+
+
return _sweep.get_number_of_sweeps(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_sweep_length(
+
self,
+
slot_id: str
+
) -> tuple[str, int | None]:
+
"""Determine the sweep length in samples for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* SweepLength - The sweep length in number of samples.
+
"""
+
+
return _sweep.get_sweep_length(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_sweep_recording_mode(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Determine the number of sweeps for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* SweepMode - The desired sweep recording mode for the recorder.
+
"""
+
+
return _sweep.get_sweep_recording_mode(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_sweep_trigger_mode(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Gets the sweep trigger mode for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* SweepTriggerMode - The sweep trigger mode.
+
"""
+
+
return _sweep.get_sweep_recording_mode(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_timeout_trigger_enabled(
+
self
+
) -> tuple[str, str | None]:
+
"""Retrieve the timeout trigger enabled status.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
* Enable - Flag to indicate if feature is on.
+
"""
+
+
return _sweep.get_timeout_trigger_enabled(
+
self._con_handle
+
)
+
+[docs] def ghs_get_timeout_trigger_time(
+
self
+
) -> tuple[str, float | None]:
+
"""Retrieve the timeout trigger time.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
* Time - The timeout trigger time in seconds.
+
"""
+
+
return _sweep.get_timeout_trigger_time(
+
self._con_handle
+
)
+
+[docs] def ghs_get_trigger_arm_enabled(
+
self
+
) -> tuple[str, str | None]:
+
"""Retrieve trigger arm enabled status for a recorder.
+
* When enabled, triggers must be armed explicitly before they will be accepted.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
* Enable - Flag to indicate if feature is on.
+
"""
+
+
return _sweep.get_trigger_arm_enabled(
+
self._con_handle
+
)
+
+[docs] def ghs_get_trigger_arm_state(
+
self
+
) -> tuple[str, str | None]:
+
"""Retrieve the current trigger arm state.
+
* This function can be used to synchronize CmdTriggerArm function calls with the user application.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
* TriggerArmState - The current state of trigger arm (e.g. triggers armed or disarmed).
+
"""
+
+
return _sweep.get_trigger_arm_state(
+
self._con_handle
+
)
+
+[docs] def ghs_get_trigger_position(
+
self,
+
slot_id: str
+
) -> tuple[str, float | None]:
+
"""Retrieve the timeout trigger time.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* TriggerPosition - The trigger position in percentage (0% to 100%).
+
"""
+
+
return _sweep.get_trigger_position(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_set_number_of_sweeps(
+
self,
+
slot_id: str,
+
number_of_sweeps: int
+
) -> str:
+
"""Sets the number of sweeps for a recorder.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
number_of_sweeps: The desired number of sweeps for the recorder.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_number_of_sweeps(
+
self._con_handle,
+
slot_id,
+
number_of_sweeps,
+
)
+
+[docs] def ghs_set_sweep_length(
+
self,
+
slot_id: str,
+
number_of_samples: int
+
) -> str:
+
"""Sets the sweep length in samples for a recorder.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
number_of_samples: The desired sweep length in number of samples.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_sweep_length(
+
self._con_handle,
+
slot_id,
+
number_of_samples,
+
)
+
+[docs] def ghs_set_sweep_recording_mode(
+
self,
+
slot_id: str,
+
recording_mode: str | int
+
) -> str:
+
"""Sets the sweep recording mode for a recorder.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
recording_mode: The desired sweep recording mode for the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_sweep_recording_mode(
+
self._con_handle,
+
slot_id,
+
recording_mode,
+
)
+
+[docs] def ghs_set_sweep_trigger_mode(
+
self,
+
slot_id: str,
+
trigger_mode: str | int
+
) -> str:
+
"""Sets the sweep trigger mode for a recorder.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
trigger_mode: The sweep trigger mode to be set.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_sweep_trigger_mode(
+
self._con_handle,
+
slot_id,
+
trigger_mode,
+
)
+
+[docs] def ghs_set_timeout_trigger_enabled(
+
self,
+
enabled: str | int
+
) -> str:
+
"""Enables or disables timeout triggers.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
enabled: Flag to indicate if feature is on.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_timeout_trigger_enabled(
+
self._con_handle,
+
enabled
+
)
+
+[docs] def ghs_set_timeout_trigger_time(
+
self,
+
time: float
+
) -> str:
+
"""Sets the timeout trigger time.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
time: The timeout trigger time in seconds.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_timeout_trigger_time(
+
self._con_handle,
+
time
+
)
+
+[docs] def ghs_set_trigger_arm_enabled(
+
self,
+
enabled: str | int
+
) -> str:
+
"""Enable or disable trigger arm.
+
* When enabled, triggers must be armed explicitly before they will be accepted.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
enabled: Flag to indicate if feature is on.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_trigger_arm_enabled(
+
self._con_handle,
+
enabled
+
)
+
+[docs] def ghs_set_trigger_position(
+
self,
+
slot_id: str,
+
trigger_position: float
+
) -> str:
+
"""Sets the trigger position percentage for a recorder.
+
+
*The system needs to be idle before calling this function.*
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
trigger_position: The desired trigger position in percentage (0% to 100%).
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _sweep.set_trigger_position(
+
self._con_handle,
+
slot_id,
+
trigger_position
+
)
+
+ # Continuous APIs
+
+[docs] def ghs_get_continuous_lead_out_time(
+
self,
+
slot_id: str
+
) -> tuple[str, float | None]:
+
"""Determine the continuous recording lead out time for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* ContinuousLeadOutTime - The continuous recording mode lead out time (post trigger time) in seconds.
+
"""
+
+
return _continuous.get_continuous_lead_out_time(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_continuous_recording_mode(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Determine the continuous recording mode for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* ContinuousRecordingMode - The continuous recording mode @ref GHSContinuousRecordingMode.
+
"""
+
+
return _continuous.get_continuous_recording_mode(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_get_continuous_time_span(
+
self,
+
slot_id: str
+
) -> tuple[str, str | None]:
+
"""Determine the continuous recording time span for a recorder.
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Args:
+
slot_id: The slot containing the recorder
+
+
Returns:
+
* GHSReturnValue - API return values
+
* ContinuousTimeSpan - The time span in seconds for circular and specified time continuous recording modes.
+
"""
+
+
return _continuous.get_continuous_lead_out_time(
+
self._con_handle,
+
slot_id
+
)
+
+[docs] def ghs_set_continuous_lead_out_time(
+
self,
+
slot_id: str,
+
lead_out_time: float
+
) -> str:
+
"""Sets the continuous recording lead out time for a recorder.
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
lead_out_time: The desired continuous recording mode lead out time (post trigger time) in seconds.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _continuous.set_continuous_lead_out_time(
+
self._con_handle,
+
slot_id,
+
lead_out_time
+
)
+
+[docs] def ghs_set_continuous_recording_mode(
+
self,
+
slot_id: str,
+
continuous_mode: str | int
+
) -> str:
+
"""Set the continuous recording mode for a recorder.
+
+
* The system needs to be idle before calling this function.
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
continuous_mode: The desired continuous recording mode.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _continuous.set_continuous_recording_mode(
+
self._con_handle,
+
slot_id,
+
continuous_mode
+
)
+
+[docs] def ghs_set_continuous_time_span(
+
self,
+
slot_id: str,
+
time_span: str | int
+
) -> str:
+
"""Set the continuous recording mode for a recorder.
+
+
* The system needs to be idle before calling this function.
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
slot_id: The slot containing the recorder
+
time_span: The desired time span in seconds for circular and specified time continuous recording modes.
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _continuous.set_continuous_time_span(
+
self._con_handle,
+
slot_id,
+
time_span
+
)
+
+ # CAN Fieldbus APIs
+
+[docs] def ghs_get_can_acq_control(
+
self
+
) -> tuple[str, str | None, int | None, int | None]:
+
"""Get the current setup of CAN acquisition control
+
+
*Read - This method can be called by multiple connected clients at same
+
time.*
+
+
Returns:
+
* GHSReturnValue - API return values
+
* Enable - Flag to indicate if feature is on
+
* MsgID - The one-based index that specifies which CAN controller is used
+
* BusID - Message ID of the CAN acquisition control
+
"""
+
+
return _can_fieldbus.get_can_acq_control(
+
self._con_handle
+
)
+
+[docs] def ghs_set_can_acq_control(
+
self,
+
enabled: str,
+
bus_id: int,
+
msg_id: int
+
) -> str:
+
"""Set up CAN acquisition control.
+
+
* The system needs to be idle before calling this function.
+
+
*ReadWrite - This method will only process requests from the
+
connected client with the most privileges order (Privileges
+
order: 1- Perception, 2- GenDaq, 3- Other)*
+
+
Args:
+
enabled: Flag to indicate if feature is on
+
bus_id: The one-based index that specifies which CAN controller to use
+
msg_id: Message ID of the CAN acquisition control
+
+
Returns:
+
* GHSReturnValue - API return values
+
"""
+
+
return _can_fieldbus.set_can_acq_control(
+
self._con_handle,
+
enabled,
+
bus_id,
+
msg_id
+
)
diff --git a/docs/html/_modules/index.html b/docs/html/_modules/index.html
index 1f49491..5977efd 100644
--- a/docs/html/_modules/index.html
+++ b/docs/html/_modules/index.html
@@ -10,10 +10,11 @@
-
-
+
+
+
@@ -24,11 +25,15 @@