cversek / python-FLI

Python bindings for Finger Lakes Instrumentation (FLI) cameras and peripherals.
MIT License
10 stars 11 forks source link

FLIList error #7

Closed thiosady closed 8 years ago

thiosady commented 8 years ago

I have this error with FLIList while testing lib.py:

>>>domain = flidomain_t(FLIDOMAIN_USB)
>>>names = POINTER(char_p)()
>>>libfli.FLIList(domain, byref(names))

                File "C:/Users/.../pythonFLI/lib.py", line 335, in chk_err
                                raise FLIError(msg)

              FLIError: Invalid argument

Therefore, I tried:

>>> names = POINTER(POINTER(char_p))()
>>> libfli.FLIList(domain, names)
                WindowsError: exception: access violation writing 0x0000000000000000

Any hints?

cversek commented 8 years ago

Take a look at the find_devices method of the USBDevice class for an example of how to call FLIList

thiosady commented 8 years ago

It raises the same error when I run device.py:

  File "C:/Users/...I/device.py", line 89, in <module>
devs = USBDevice.find_devices()
  File "C:/Users/.../device.py", line 51, in find_devices
    cls._libfli.FLIList(cls._domain, byref(tmplist))      #allocates memory 
  File "lib.py", line 335, in chk_err
    raise FLIError(msg)
lib.FLIError: Invalid argument
cversek commented 8 years ago

It's quite possible that FLI has changed their API since I wrote that code, so I would check their documentation. I am not associated with FLI, nor do I currently have access to any of their devices. If everything seems to be the same, I would suggest that there might be an issue with the behavior of ctypes on Windows. I developed the code mainly to work on Linux (~3 years ago) and the project was sidelined by the US government shutdown.

thiosady commented 8 years ago

Got it. I will check their documentation to see if there are any changes and post the solution, once I find it. Thank your for sharing the project, it is very helpful.