0

I am writting a class a Thorlabs Optical Spectrometer. I am using python ctypes to read a provided FTSLib.dll.

Even though the class runs properly, I can engage the instrument, measure, process, and release it I get the following error, which shows up randomly when I try to read from the instrument:

OSError: exception: access violation reading 0x0000000000000004

Any ideas where does this come from?

kostas
  • 101
  • 12
  • 1
    Most likely an *Undefined Behavior* in your code ( https://stackoverflow.com/questions/52268294/python-ctypes-cdll-loadlibrary-instantiate-an-object-execute-its-method-priva/52272969#52272969). But without looking at it, it's hard to guess (please post it, as instructed in [\[SO\]: How to create a Minimal, Complete, and Verifiable example (mcve)](https://stackoverflow.com/help/mcve)). – CristiFati Sep 17 '18 at 15:30
  • If your code is trying to access small-number memory, it probably means some C function returned `NULL` and you failed to check the return value. – Kevin Sep 17 '18 at 16:48

0 Answers0