diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2022-05-30 19:52:31 +0200 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2022-05-30 19:55:31 +0200 |
commit | 3e6f35592ae6a8b2f242c28e5f20ec7dc079ad87 (patch) | |
tree | 9a9adc05b8c3eb02a43200ca6b5ead09c3db7f0d /lab_control/jds6600.py | |
parent | 2972db9ee49ae0c20351afd64c04b5cfac9fca72 (diff) |
Added function setter to JDS6600
Diffstat (limited to 'lab_control/jds6600.py')
-rw-r--r-- | lab_control/jds6600.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lab_control/jds6600.py b/lab_control/jds6600.py index c263c10..6282fd1 100644 --- a/lab_control/jds6600.py +++ b/lab_control/jds6600.py @@ -37,8 +37,8 @@ class JDS6600(FunctionGenerator): response = self._sendRequest("w20", f"{state[0]},{state[1]}") def setFrequency(self, channel: int, frequency: float) -> None: - opcode = f"w{23 + channel - 1}" # TODO implement after testing on actual device + opcode = f"w{23 + channel - 1}" def setAmplitude(self, channel: int, amplitude: float) -> None: if amplitude is None or amplitude < 0.0 or amplitude > 20.0: @@ -48,4 +48,9 @@ class JDS6600(FunctionGenerator): arg = int(amplitude * 1000.0) response = self._sendRequest(opcode, str(arg)) - + def setFunction(self, channel: int, function: int) -> None: + if function is None or function < 0 or function > 16: + return + + opcode = f"w{21 + channel - 1}" + response = self._sendRequest(opcode, str(function)) |