Skip to content

Commit 5962e2a

Browse files
authored
Add interlock query (#1)
2 parents efc181f + 8f49677 commit 5962e2a

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

absscpi/client.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,23 @@ def get_alarms(self) -> int:
477477
self.__check_err(res)
478478
return alarms.value
479479

480+
def get_interlock_state(self) -> bool:
481+
"""Query the system interlock state. When in interlock, the system will
482+
be put into its PoR state and cannot be controlled until the interlock
483+
is lifted.
484+
485+
Returns:
486+
The interlock state.
487+
488+
Raises:
489+
ScpiClientError: An error occurred while executing the query.
490+
"""
491+
state = c_bool()
492+
res = self.__dll.AbsScpiClient_GetInterlockState(
493+
self.__handle, byref(state))
494+
self.__check_err(res)
495+
return state.value
496+
480497
def assert_soft_interlock(self):
481498
"""Assert the software interlock (a recoverable alarm).
482499

0 commit comments

Comments
 (0)