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

ThorlabsBackendError: backend exception: 'read returned less data than expected' ('read returned less data than expected') #81

Open
Atharvhardikar43 opened this issue Apr 6, 2024 · 1 comment

Comments

@Atharvhardikar43
Copy link

Atharvhardikar43 commented Apr 6, 2024

Hi,
I am new to this. I tried to follow the docs. But getting this error when i run this code :
from pylablib.devices import Thorlabs
stage = Thorlabs.KinesisMotor("74000948")
stage.get_position()
Error: ThorlabsBackendError: backend exception: 'read returned less data than expected' ('read returned less data than expected')
There is a solution mentioned in the docs: "is_rack_system=True". But i am still getting this error. Can someone please help? And give more detailed instructions?
Thanks,
Atharv

@AlexShkarin
Copy link
Owner

Dear Atharv,

Can you specify which device is that?
Regarding setting the rack system: I know that at least some devices will completely freeze if you try to communicate with them using the wrong is_rack_system parameters. Therefore, I would suggest completely power cycle the device between the attempts, ideally by disconnecting the power supply, since the on/off button on some of the devices such as K-cubes is software-controller and won't do anything when the device is frozen.

Hence, I would do something like power cycling the device, then running this code:

from pylablib.devices import Thorlabs
with Thorlabs.KinesisMotor("74000948",is_rack_system=False) as stage:
    print(stage.get_device_info())

then power cycling the device again, and running

from pylablib.devices import Thorlabs
with Thorlabs.KinesisMotor("74000948",is_rack_system=True) as stage:
    print(stage.get_device_info())

Make sure that no other software using the device (such as Thorlabs Kinesis) is running at the same.

Sincerely,

Alexey.

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