diff --git a/src/secop_ophyd/SECoPDevices.py b/src/secop_ophyd/SECoPDevices.py index cfbea59..a9acfc1 100644 --- a/src/secop_ophyd/SECoPDevices.py +++ b/src/secop_ophyd/SECoPDevices.py @@ -505,7 +505,18 @@ async def __go_coro(self): await self.wait_for_idle() def trigger(self) -> AsyncStatus: - return AsyncStatus(awaitable=self.__go_coro()) + + async def go_or_read_on_busy(): + module_status = self.status.get_value(False) + stat_code = module_status["f0"] + + if BUSY <= stat_code <= ERROR: + self.status.get_value(False) + return + + await self.__go_coro() + + return AsyncStatus(awaitable=go_or_read_on_busy()) class SECoPWritableDevice(SECoPReadableDevice):