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

Thorlabs CCS spectrometer reopen retrives invalid Object #149

Open
mdopy opened this issue Nov 12, 2021 · 0 comments
Open

Thorlabs CCS spectrometer reopen retrives invalid Object #149

mdopy opened this issue Nov 12, 2021 · 0 comments

Comments

@mdopy
Copy link

mdopy commented Nov 12, 2021

Hello,

I'm not sure if this issue is somehow related to the last one but I have still problems with the Thorlabs CCS spectrometer. The first time I run the programm everything is working proper. After I finished the program I close the spectrometer with
dev_spec.close().
When reopening the spectrometer with
dev_spec = thorlabs_ccs.CCS(paramsets[0], reopen_policy='reuse') everything seems to be fine but when trying to acces the spectrometer with an arbitrary command I always receive the same error.

dev_spec.close()
Traceback (most recent call last):

File "C:\Users\dolm\AppData\Local\Temp/ipykernel_9812/1457110140.py", line 1, in
dev_spec.close()

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 190, in close
self._NiceCCS.close()

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\nicelib\nicelib.py", line 701, in call
return self._libfunc._call(args, kwds, niceobj=self._niceobj)

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\nicelib\nicelib.py", line 1171, in _call
return self.sig.extract_outputs(c_args, retval, ret_handler_args)

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\nicelib\nicelib.py", line 219, in extract_outputs
retval = self.ret_handler.handle(retval, ret_handler_kwargs)

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\nicelib\nicelib.py", line 543, in handle
return self.func(retval, **kwargs)

File "C:_Work\WPy64-38100\python-3.8.10.amd64\lib\site-packages\instrumental\drivers\spectrometers\thorlabs_ccs.py", line 64, in ccs_errcheck
raise ThorlabsCCSError(niceobj.error_message(error_code))

ThorlabsCCSError: b'Die angegebene Session oder Objektreferenz ist ung\xfcltig.'

To me it seems that the close() function is not working proper, as I'm not able to open the spectrometer with the reuse_policy='strict'. Furthermore it is not possible to open the invalid object through the variable explorer.

Greetings

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

1 participant