This commit is contained in:
2026-01-22 15:35:17 +01:00
parent 2ed1ec84a3
commit c1dd7d7551
+6 -2
View File
@@ -17,8 +17,9 @@ from __future__ import annotations
import time
from typing import TYPE_CHECKING
from bec_lib.logger import bec_logger
from ophyd import Component as Cpt
from ophyd import Device, Kind
from ophyd import Kind
from ophyd_devices import PSIDeviceBase
from ophyd_devices.utils.controller import Controller, threadlocked
from ophyd_devices.utils.socket import SocketIO
@@ -33,6 +34,8 @@ if TYPE_CHECKING: # pragma: no cover
from bec_lib.devicemanager import ScanInfo
from bec_server.device_server.devices.devicemanager import DeviceManagerDS
logger = bec_logger.logger
class GalilRIOController(Controller):
"""
@@ -146,7 +149,7 @@ class GalilRIO(PSIDeviceBase):
"""Read all 8 analog input channels from the Galil RIO controller."""
# Get number of channels
channels: list[tuple[int, str]] = [()]
res = super().read()
res = {}
# This yields tuples of cpt, signal
for _, signal in self._get_components_of_kind(Kind.normal):
@@ -154,6 +157,7 @@ class GalilRIO(PSIDeviceBase):
# Read all channels in one command
cmd = "MG@" + ",@".join([f"AN[{ii}]" for ii, _ in channels])
logger.info(f"Reading Galil RIO channels with command: {cmd}")
ret = self.controller.socket_put_and_receive(cmd)
timestamp = time.time()
values = [float(val) for val in ret.strip().split(" ")]