Skip to content

Commit 26eae26

Browse files
committed
Added try except loop around initial command to check if connected
1 parent 48c330b commit 26eae26

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

microscope/stages/ludl.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,11 @@ def __init__(self, port: str, baudrate: int, timeout: float) -> None:
112112
# We do not use the general get_description() here because
113113
# if this is not a ProScan device it would never reach the
114114
# '\rEND\r' that signals the end of the description.
115-
self.command(b'RCONFIG')
116-
answer = self.read_multiline()
117-
115+
try:
116+
self.command(b'RCONFIG')
117+
answer = self.read_multiline()
118+
except:
119+
print("Unable to read configuration. Is Ludl connected?")
118120
# parse config responce which tells us what devices are present
119121
# on this controller.
120122

0 commit comments

Comments
 (0)