-
Notifications
You must be signed in to change notification settings - Fork 37
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
Connection problem with MLS203 thorlabs stage and BBD302 controller #76
Comments
Hi! It looks like the ID you use to connect ( |
Hi Alex, I have been trying this command after seeing the controller is visible in kinesis software, but getting this error repeatedly, I can't connect the BBD 302 controller to the MLS stages too. Everytime I run this code, the controller is not visible by the kinesis software anymore, I have to restart the device again, is there any way to establish this connection and not lose it due after every run? My code: The error: D2XXException Traceback (most recent call last) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\core\devio\comm_backend.py:821, in FT232DeviceBackend._open_instr(self, port, params) File ~\AppData\Roaming\Python\Python311\site-packages\ft232\d2xx.py:127, in D2xx.init(self, port, serial_number, description, baudrate, bytesize, parity, stopbits, timeout, xonxoff, rtscts, writeTimeout) D2XXException: Device Not Opened The above exception was the direct cause of the following exception: ThorlabsBackendError Traceback (most recent call last) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\devices\Thorlabs\kinesis.py:1102, in KinesisMotor.init(self, conn, scale, default_channel, is_rack_system) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\devices\Thorlabs\kinesis.py:277, in KinesisDevice.init(self, conn, timeout, default_channel, is_rack_system) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\devices\interface\stage.py:34, in IMultiaxisStage.init(self, default_axis, *args, **kwargs) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\devices\Thorlabs\kinesis.py:44, in BasicKinesisDevice.init(self, conn, timeout, is_rack_system) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\core\devio\comm_backend.py:1776, in new_backend(conn, backend, defaults, **kwargs) File ~\AppData\Roaming\Python\Python311\site-packages\pylablib\core\devio\comm_backend.py:816, in FT232DeviceBackend.init(self, conn, timeout, term_write, term_read, open_retry_times, datatype, reraise_error) ThorlabsBackendError: backend exception: D2XXException(3) ('Device Not Opened') stage = Thorlabs.KinesisMotor("103387864", is_rack_system=True) C:\Users\nusratc2\AppData\Roaming\Python\Python311\site-packages\pylablib\devices\Thorlabs\kinesis.py:1230: UserWarning: can't recognize motor model BBD302; setting all scales to internal units Can you please help me with it. I am stuck for days. Please help me. |
Hello! Every time after opening the device, you need to close it again: stage = Thorlabs.KinesisMotor("103387864", is_rack_system=True)
# ... do some work ...
stage.close() This signals the OS that other software (e.g., Kinesis) can connect to it. with Thorlabs.KinesisMotor("103387864", is_rack_system=True) as stage:
# ... do some work ...
# the stage closes automatically when the execution is done Also, keep in mind that only one connection can be opened at a time, which means that the code you have right now definitely won't work: it tries to connect to the same device 2 times in a row, so the second line will raise an error. |
Hello, I can't establish a connection with the Thorlabs ML203 board (BBD302 controller).
When I run the following code :
import pylablib.devices.Thorlabs.kinesis
#Connection and list devices connected
from pylablib.devices import Thorlabs
print(Thorlabs.list_kinesis_devices(filter_ids=False))
stage_xy = Thorlabs.KinesisMotor("104390055")
I get this error :
C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\Scripts\python.exe C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\main_stage.py
[('103390054', 'Brushless Motor Controller')]
Traceback (most recent call last):
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\core\devio\comm_backend.py", line 809, in init
self.instr=self._open_instr(port,conn_dict)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\core\devio\comm_backend.py", line 821, in _open_instr
return ft232.Ft232(serial_number=port,**params)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\ft232\d2xx.py", line 127, in init
if status != FT_OK: raise D2XXException(status)
ft232.d2xx.D2XXException: Device Not Found
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\main_stage.py", line 9, in
stage_xy = Thorlabs.KinesisMotor("104390055")
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\devices\Thorlabs\kinesis.py", line 1102, in init
super().init(conn,default_channel=default_channel,is_rack_system=is_rack_system)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\devices\Thorlabs\kinesis.py", line 277, in init
super().init(conn,timeout=timeout,is_rack_system=is_rack_system,default_axis=default_channel)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\devices\interface\stage.py", line 34, in init
super().init(*args,**kwargs)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\devices\Thorlabs\kinesis.py", line 44, in init
instr=comm_backend.new_backend(conn,backend=("auto","ft232"),term_write=b"",term_read=b"",timeout=timeout,
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\core\devio\comm_backend.py", line 1776, in new_backend
return backend(conn,**kwargs)
File "C:\Users\massi_1xn8v1g\PycharmProjects\pythonProject\venv9\lib\site-packages\pylablib\core\devio\comm_backend.py", line 816, in init
raise self.Error(e) from e
pylablib.devices.Thorlabs.base.ThorlabsBackendError: backend exception: D2XXException(2) ('Device Not Found')
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: