DAQ: update aerotech to not use Enum or EnumPv for debugging purposes

This commit is contained in:
2026-01-15 17:09:00 +01:00
parent 6c633a7887
commit f96e34864b
+23 -18
View File
@@ -54,13 +54,13 @@ class AerotechControllerEpics:
self.gmy = MyMotor(try_prefix)
self.gmz = MyMotor(trz_prefix)
self.omega = MyMotor(rotu_prefix)
self.__enable_all = EnumPv(f"{aerotech_pv_prefix}:EnableAll")
self.__disable_all = EnumPv(f"{aerotech_pv_prefix}:DisableAll")
self.__acknowledge_all = EnumPv(f"{aerotech_pv_prefix}:AckAll")
self.__stop_all = EnumPv(f"{aerotech_pv_prefix}:StopAll")
self.__enable_all = PV(f"{aerotech_pv_prefix}:EnableAll")
self.__disable_all = PV(f"{aerotech_pv_prefix}:DisableAll")
self.__acknowledge_all = PV(f"{aerotech_pv_prefix}:AckAll")
self.__stop_all = PV(f"{aerotech_pv_prefix}:StopAll")
self.__task_filename = PV(f"{aerotech_pv_prefix}:TASK:FILENAME")
self.__task_id = EnumPv(f"{aerotech_pv_prefix}:TASK:TASKIDX") # values can be 1 to 4 DO NOT USE 0!!!!
self.__task_run_enum = EnumPv(f"{aerotech_pv_prefix}:TASK:SWITCH") # 0 Stop, 1 Start, 2 Run,
self.__task_id = PV(f"{aerotech_pv_prefix}:TASK:TASKIDX") # values can be 1 to 4 DO NOT USE 0!!!!
self.__task_run_enum = PV(f"{aerotech_pv_prefix}:TASK:SWITCH") # 0 Stop, 1 Start, 2 Run,
# 3 Load, 4 Pause, 5 Reset
self.enable_all()
@@ -81,22 +81,22 @@ class AerotechControllerEpics:
self.__stop_all.put(0)
def __task_stop(self):
self.__task_run_enum.put(AerotechRunEnum.STOP)
self.__task_run_enum.put(0)
def __task_start(self):
self.__task_run_enum.put(AerotechRunEnum.START)
self.__task_run_enum.put(1)
def __task_run(self):
self.__task_run_enum.put(AerotechRunEnum.RUN)
self.__task_run_enum.put(2)
def __task_pause(self):
self.__task_run_enum.put(AerotechRunEnum.PAUSE)
self.__task_run_enum.put(3)
def __task_load(self):
self.__task_run_enum.put(AerotechRunEnum.LOAD)
self.__task_run_enum.put(4)
def __task_reset(self):
self.__task_run_enum.put(AerotechRunEnum.RESET)
self.__task_run_enum.put(5)
def __set_task_id(self, task_id: int):
if task_id not in range(1, 5):
@@ -104,21 +104,26 @@ class AerotechControllerEpics:
self.__task_id.put(task_id)
def home_all(self):
#self.__task_id.put(2)
#self.__task_reset()
self.__task_id.put(2)
self.__task_reset()
print(self.__task_id.get())
self.__task_filename.put("home_all.a1exe")
print(self.__task_filename.get())
self.__task_load()
self.__task_start()
print(self.__task_run_enum.get())
self.__task_run()
print(self.__task_run_enum.get())
if __name__ == "__main__":
beamline = mx_beamline()
print(beamline)
### test on 10S
aerotech = AerotechController(controller_ip="129.129.118.96")
aerotech.enable_motion("X")
aerotech.home_motor("X")
aerotech.disconnect()
#aerotech = AerotechController(controller_ip="129.129.118.96")
#aerotech.enable_motion("X")
#aerotech.home_motor("X")
#aerotech.disconnect()
aerotech_epics = AerotechControllerEpics(beamline)
aerotech_epics.home_all()