Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix IDS uEye support in UC480 driver #26

Open
natezb opened this issue May 30, 2017 · 2 comments
Open

Fix IDS uEye support in UC480 driver #26

natezb opened this issue May 30, 2017 · 2 comments

Comments

@natezb
Copy link
Contributor

natezb commented May 30, 2017

After switching to NiceLib for this driver, we're currently only searching for the Thorlabs version of the header (uc480.h), not the IDS version (uEye.h). I think it's reasonable to implement support for multiple sets of possible headers within NiceLib, just as multiple possible lib binaries are supported.

@eedm
Copy link
Contributor

eedm commented Jul 18, 2017

I havent tried Instrumental since the addition of NiceLib but after cloning the latest version my script for using the Thorlabs CMOS camera (IDS uEye) fails as follows:

from instrumental.drivers.cameras.uc480 import UC480_Camera,list_instruments

error Traceback (most recent call last)
in ()
----> 1 from instrumental.drivers.cameras.uc480 import UC480_Camera,list_instruments

C:\Anaconda3\lib\site-packages\instrumental_lib-0.4.dev0-py3.6.egg\instrumental\drivers\cameras\uc480.py in ()
78
79
---> 80 class NiceUC480(NiceLib):
81 info = info
82 prefix = ('is', 'IS
')

C:\Anaconda3\lib\site-packages\nicelib-0.4.dev1-py3.6.egg\nicelib\nicelib.py in new(metacls, clsname, bases, classdict)
606 for name in dir(lib):
607 try:
--> 608 attr = getattr(lib, name)
609 if ffi and isinstance(attr, ffi.CData) and ffi.typeof(attr).kind != 'function':
610 dir_lib.append(name)

error: symbol 'is_PersistentMemory' not found in library 'C:\Windows\system32\uc480_64.dll': error 0x7f

@natezb
Copy link
Contributor Author

natezb commented Jul 19, 2017

@eedm thanks for the report! This is an interesting error, because several things appear to be going on. As the error suggests, your DLL is missing is_PersistentMemory. However, NiceLib is supposed ignore this issue by catching the AttributeError. This isn't working for you because cffi is raising an FFIError instead (I think this changed between versions of cffi at some point). Commit mabuchilab/NiceLib@7ed5fe9 should hopefully fix this for you, so please give it a try if you get a chance.

What's odd is that this means your header does not match the library you have installed. If I recall correctly, you were using the IDS uEye DLLs before, yet I see that NiceLib is accessing uc480_64.dll. So it could be that it's using a uEye header with an older version of the uc480 lib. It appears that is_PersistentMemory was only added to the API this past January.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants