diff --git a/CHANGELOG.md b/CHANGELOG.md index c656478e..b64a49b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ However, please read through all changes to be aware of what may potentially imp - A configuration function provides the ability to set different logging levels for stdout and file logging. - The config file and environment variable can also be used to control the logging functionality. - The debug logging from the `pyvisa` package is also included in the log file by default. +- Updated `get_buffers()` in `TSPControl` to not error out if query returns with empty string. ### Removed @@ -97,6 +98,7 @@ However, please read through all changes to be aware of what may potentially imp - `collectgarbage()` is now called during cleanup of `TSPControl` children. - Added USBTMC Support for the AFG31K and MDO3 drivers. +- --- diff --git a/src/tm_devices/driver_mixins/device_control/tsp_control.py b/src/tm_devices/driver_mixins/device_control/tsp_control.py index 26ff0caa..d9f69a9a 100644 --- a/src/tm_devices/driver_mixins/device_control/tsp_control.py +++ b/src/tm_devices/driver_mixins/device_control/tsp_control.py @@ -116,7 +116,9 @@ def get_buffers(self, *args: str) -> Dict[str, List[float]]: if buffer_name.endswith(attr_name): buffer_size_name = buffer_name.rstrip(attr_name) break - buffer_str = self.query(f"printbuffer(1, {buffer_size_name}.n, {buffer_name})") + buffer_str = self.query( + f"printbuffer(1, {buffer_size_name}.n, {buffer_name})", allow_empty=True + ) buffer_data[buffer_name] = [float(x) for x in buffer_str.split(", ") if buffer_str] return buffer_data