diff --git a/profile_bluesky/startup/28-protection_plc.py b/profile_bluesky/startup/28-protection_plc.py index e0c6c3e0..de69864d 100644 --- a/profile_bluesky/startup/28-protection_plc.py +++ b/profile_bluesky/startup/28-protection_plc.py @@ -28,7 +28,7 @@ def wait_for_interlock(self, verbose=True): t0 = time.time() msg = "Waiting %g for PLC interlock, check limit switches" while not self.interlocked: - time.sleep(self.SLEEP_POLL_s) + yield from bps.sleep(self.SLEEP_POLL_s) if verbose: print(msg % time.time()-t0) @@ -39,8 +39,10 @@ def stop_if_tripped(self, verbose=True): # TODO: should be a Bluesky suspender print("Fix PLC protection before any move. Stopping now.") print("Call beamline scientists if you do not understand.") print("!!!!!! DO NOT TRY TO FIX YOURSELF !!!!!!") - ti_filter_shutter.close() - user_data.collection_in_progress.put(0) # notify the GUI and others + yield from bps.mv( + ti_filter_shutter, "close", + user_data.collection_in_progress, 0, # notify the GUI and others + ) plc_protect = PlcProtectionDevice('9idcLAX:plc:', name='plc_protect')