signalsharcscpi.py¶
The class SignalSharkScpi provides access to the different SCPI subclasses and supports some additional functions:
SignalShark SCPI commands container
-
class
nardascripting.base.scpi.signalsharkscpi.
SignalSharkScpi
(com: nardascripting.base.comm.CommTcpIp)¶ SignalShark SCPI commands class
-
abort
()¶ Aborts running measurements and calculations. Sets TASK:STATE to STOP mode.
-
check_add_task
(ttype: nardascripting.base.scpi.enums.TaskTypes, name: str = None, add: bool = True)¶ Checks if task exists and adds a new one if not.
- Parameters
ttype (TaskTypes) – Task type to check/add
name (str) – Task name to check/add or None
add (bool) – Adds a new task with the given type and name, if the task does not already exist and this value is True.
- Returns
Returns True, if task still exists
- Return type
bool
-
check_add_view
(vtype: nardascripting.base.scpi.enums.ViewTypes, reference: int = 1, direction=BELOW, add: bool = True)¶ Checks if view exists and adds a new one if not.
- Parameters
vtype (ViewTypes) – Type of view e.g. ‘SPECTRUM’, ‘PEAK_TABLE’, ‘LEVEL’, ‘SPECTROGRAM’, ‘BEARING’
reference (int) – Index of the reference view to insert the new view next to starting with 1
direction – Position of the new view relative to the reference view (LEFT,RIGHT,ABOVE,BELOW)
add (bool) – Adds a new view with the given type, if the view does not already exist and this value is True.
- Returns
Returns a tuple (Exists, Index). The Exists flag indicates whether the view still exists (True). The Index number returns the index of the view or 0.
- Return type
(bool, int)
-
check_error
()¶ Check for SCPI errors
You can get error detail information by get_error_list(). :return: True, if an error has occurred :rtype: bool
-
check_no_error
()¶ Check whether no SCPI errors has occurred
You can get error detail information by get_error_list(). :return: True, if NO error has occurred :rtype: bool
-
clear_error_list
()¶ Clears the error list
-
property
error_str
¶ SCPI errors as single string
-
get_bearing_signal_settings
()¶ Queries all bearing signal depending settings from the connected SignalShark
- Returns
Bearing signal settings or None
- Return type
-
get_bearing_site_settings
()¶ Queries all bearing site settings from the connected SignalShark
- Returns
Bearing system settings or None
- Return type
-
property
get_error_list
¶ Returns SCPI error list of check_is_error() method
-
hold
()¶ Holds the measurement and initializes if measurement is stopped
-
reset
()¶ Resets the device to default settings and all status data.
This command has a timeout of 10s.
-
run_cont
(reset=False)¶ Starts a new continuous measurement by sending RUN:CONT(:RES)
- Parameters
reset (bool) – Sends :RES if True
-
run_sing
()¶ Starts a new single measurement by sending RUN:SING.
Measurement status must be checked for progress
-
set_bearing_signal_settings
(settings: nardascripting.base.scpi.datatypes.BearingSignalSettings)¶ Applies all given bearing signal settings to the connected SignalShark
- Parameters
settings (BearingSignalSettings) – Bearing signal settings
- Returns
True, if settings applied successfully
- Return type
bool
-
set_bearing_site_settings
(settings: nardascripting.base.scpi.datatypes.BearingSiteSettings, set_atten=True)¶ Applies all given bearing site settings to the connected SignalShark
- Parameters
settings (BearingSiteSettings) – Bearing site settings
set_atten (bool) – Flag that indicates, if the attenuator value should be adapted.
- Returns
True, if settings applied successfully
- Return type
bool
-
shut_down
(value: nardascripting.base.scpi.enums.ShutdownModes = APP_QUIT)¶ Shuts down the instrument by sending SYSTem:SHUTdown APP_QUIT and closes connection
-
stop
()¶ Stops current measurement.
-