From c4d05d83f454ab308eb9ccf96a6672c52d8e8657 Mon Sep 17 00:00:00 2001 From: Sven Augustin Date: Tue, 28 Jan 2025 17:36:31 +0100 Subject: [PATCH] handle reference undulator not answering --- undulator.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/undulator.py b/undulator.py index b566bda..8fb7545 100644 --- a/undulator.py +++ b/undulator.py @@ -365,7 +365,10 @@ class ScalerEK: def get_machine_n_und_ref(): - res = PVEnumAdjustable("SARUN:REF-UND").get() + adj = PVEnumAdjustable("SARUN:REF-UND") + res = adj.get() + if res is None: + return None if not res.startswith("SARUN"): return None n = len("SARUN")