From 670804c8ec529bacb47b76d352de5f371a6779c1 Mon Sep 17 00:00:00 2001
From: "marcel.bajdel" <marcel.bajdel@helmholtz-berlin.de>
Date: Thu, 6 Jun 2024 11:31:18 +0200
Subject: [PATCH] include asyncio readout

---
 beamlinetools/utils/pbar_bessy.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/beamlinetools/utils/pbar_bessy.py b/beamlinetools/utils/pbar_bessy.py
index 168f459..35b0671 100644
--- a/beamlinetools/utils/pbar_bessy.py
+++ b/beamlinetools/utils/pbar_bessy.py
@@ -104,8 +104,10 @@ class TerminalProgressBar(ProgressBarBase):
 
             #ask the motor position, if smt goes wrong print "n.a."
             try:
-                motor_name=name.replace("_", ".")+".readback.get()"
-                motor_position = np.round(eval(motor_name, self.user_ns),3)
+                axis=name.replace("_", ".")
+                command = f"asyncio.run({axis}.read())"
+                print(f"pbar command: {command}")
+                motor_position = np.round(eval(command, self.user_ns),3)
             except:
                 try:
                     motor_name=name.replace("_", ".")+".user_readback.get()"
-- 
GitLab