diff options
Diffstat (limited to 'lab_control/sds1000xe.py')
-rw-r--r-- | lab_control/sds1000xe.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lab_control/sds1000xe.py b/lab_control/sds1000xe.py index 67fc29b..7f6d552 100644 --- a/lab_control/sds1000xe.py +++ b/lab_control/sds1000xe.py @@ -4,6 +4,7 @@ Implements partial support for Siglent SDS1000X-E series oscilloscopes. import socket import re + from lab_control.oscilloscope import Oscilloscope def _checkChannel(channel): @@ -15,7 +16,7 @@ class SDS1000XE(Oscilloscope): and port and offer an API to control the device. """ PORT = 5025 - TIMEOUT = 1.0 + TIMEOUT = 5.0 AVAILABLE_CHANNELS = range(1, 5) def __init__(self, address): @@ -24,7 +25,6 @@ class SDS1000XE(Oscilloscope): self._socket.connect((address, SDS1000XE.PORT)) self._socket.settimeout(SDS1000XE.TIMEOUT) - def _measure(self, channel: int, code: str) -> float: _checkChannel(channel) pattern = r"C(?P<responseChannel>\d):PAVA .+,(?P<rawMeasurement>[\d.E+-]+)\w+" @@ -52,3 +52,9 @@ class SDS1000XE(Oscilloscope): def measureFrequency(self, channel: int) -> float: return self._measure(channel, "FREQ") + + def setVoltsPerDivision(self, channel: int, volts: float) -> None: + _checkChannel(channel) + query = f"C{channel}:VDIV {volts:.2E}V\r\n" + self._socket.sendall(query.encode()) + # no response expected |