Skip to content
Open
Changes from 1 commit
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
22 changes: 17 additions & 5 deletions src/fixate/drivers/pps/siglent_spd_3303X.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ def __init__(self, instrument):

self.api = [
# Save commands
("save.group1", self.write, "*SAV 1"),
("save.group2", self.write, "*SAV 2"),
("save.group3", self.write, "*SAV 3"),
("save.group4", self.write, "*SAV 4"),
("save.group5", self.write, "*SAV 5"),
("save.group1", self._write_slow, "*SAV 1"),
("save.group2", self._write_slow, "*SAV 2"),
("save.group3", self._write_slow, "*SAV 3"),
("save.group4", self._write_slow, "*SAV 4"),
("save.group5", self._write_slow, "*SAV 5"),
# Recall commands
("recall.group1", self.write, "*RCL 1"),
("recall.group2", self.write, "*RCL 2"),
Expand Down Expand Up @@ -205,6 +205,18 @@ def _write(self, data):
time.sleep(0.02 + len(cmd) / 6000)
self._is_error()

def _write_slow(self, base_str, *args, **kwargs):
"""
The SPD3303X is very slow at saving the current configuration to memory
To correct this, an extra 30 ms is added to the delay between commands.
This function should be identical to _write with the exception of an additional 0.03 s in wait time
"""
cmds = self._format_string(base_str, **kwargs)
for cmd in cmds.split(";"):
self.instrument.write(cmd)
time.sleep(0.02 + len(cmd) / 6000 + 0.03)
self._is_error()

@staticmethod
def _parse_errors(error_response):
"""Parse error string for error code and message
Expand Down
Loading