diff --git a/microscope/stages/linkam.py b/microscope/stages/linkam.py index 9caae161..29eb8c2e 100644 --- a/microscope/stages/linkam.py +++ b/microscope/stages/linkam.py @@ -974,10 +974,9 @@ def get_sdk_version(): @staticmethod def init_sdk(): """Initialise the SDK and set up event callbacks""" - try: - __class__._lib = ctypes.WinDLL("LinkamSDK.dll") - except: - # Not tested + if os.name == "nt": # is windows + __class__._lib = ctypes.CDLL("LinkamSDK.dll") + else: # assuming Linux. Not tested. __class__._lib = ctypes.CDLL("libLinkamSDK.so") _lib = __class__._lib """Initialise the SDK, and create and set the callbacks."""