summaryrefslogtreecommitdiffstats
path: root/lab_control/jds6600.py
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2022-05-30 19:52:31 +0200
committerEddy Pedroni <eddy@0xf7.com>2022-05-30 19:55:31 +0200
commit3e6f35592ae6a8b2f242c28e5f20ec7dc079ad87 (patch)
tree9a9adc05b8c3eb02a43200ca6b5ead09c3db7f0d /lab_control/jds6600.py
parent2972db9ee49ae0c20351afd64c04b5cfac9fca72 (diff)
Added function setter to JDS6600
Diffstat (limited to 'lab_control/jds6600.py')
-rw-r--r--lab_control/jds6600.py9
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))