Open alexkish opened 2 months ago
KeyError Traceback (most recent call last) File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:236, in _ResourceManager.get_interface_and_endpoint(self, device, endpoint_address) 235 try: --> 236 return self._ep_info[endpoint_address] 237 except KeyError:
KeyError: 2
During handling of the above exception, another exception occurred:
USBError Traceback (most recent call last)
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/core/devio/comm_backend.py:34, in reraise.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/core/devio/comm_backend.py:1349, in PyUSBDeviceBackend.write(self, data, flush, read_echo, read_echo_delay, read_echo_lines) 1348 data=data+py3.as_builtin_bytes(self.term_write) -> 1349 self.instr.write(self.ep_write,data,timeout=self._timeout()) 1350 self.cooldown("write")
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:986, in Device.write(self, endpoint, data, timeout) 980 fn_map = { 981 util.ENDPOINT_TYPE_BULK:backend.bulk_write, 982 util.ENDPOINT_TYPE_INTR:backend.intr_write, 983 util.ENDPOINT_TYPE_ISO:backend.iso_write 984 } --> 986 intf, ep = self._ctx.setup_request(self, endpoint) 987 fn = fn_map[util.endpoint_type(ep.bmAttributes)]
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:113, in synchronized.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:228, in _ResourceManager.setup_request(self, device, endpoint) 226 endpoint_address = endpoint --> 228 intf, ep = self.get_interface_and_endpoint(device, endpoint_address) 229 self.managed_claim_interface(device, intf)
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:113, in synchronized.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:238, in _ResourceManager.get_interface_and_endpoint(self, device, endpoint_address) 237 except KeyError: --> 238 for intf in self.get_active_configuration(device): 239 ep = util.find_descriptor(intf, bEndpointAddress=endpoint_address)
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:113, in synchronized.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/usb/core.py:255, in _ResourceManager.get_active_configuration(self, device) 254 if cfg is None: --> 255 raise USBError('Configuration not set') 256 self._active_cfg_index = cfg.index
USBError: [Errno None] Configuration not set
The above exception was the direct cause of the following exception:
NewportBackendError Traceback (most recent call last) File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/devices/Newport/picomotor.py:55, in Picomotor8742.init(self, conn, backend, timeout, multiaddr, scan) 54 try: ---> 55 self.get_id() 56 except instr.Error:
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/core/utils/general.py:1120, in muxcall.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/devices/Newport/picomotor.py:91, in Picomotor8742.get_id(self, addr) 90 """Get the device identification string""" ---> 91 return self.query("*IDN?",addr=addr)
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/devices/Newport/picomotor.py:77, in Picomotor8742.query(self, comm, axis, addr, read_reply) 76 comm=addr_header+comm ---> 77 self.instr.write(comm) 78 if read_reply is None:
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/core/devio/comm_backend.py:45, in logerror.
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/core/devio/comm_backend.py:37, in reraise.
NewportBackendError: backend exception: USBError(None, 'Configuration not set') ('[Errno None] Configuration not set')
During handling of the above exception, another exception occurred:
NewportError Traceback (most recent call last) Cell In [7], line 1 ----> 1 stage1 = Newport.Picomotor8742()
File /Applications/xapps/miniconda3/envs/scipy/lib/python3.9/site-packages/pylablib/devices/Newport/picomotor.py:58, in Picomotor8742.init(self, conn, backend, timeout, multiaddr, scan) 56 except instr.Error: 57 self.close() ---> 58 raise NewportError("error connecting to the Picomotor controller") 59 if multiaddr: 60 if scan:
NewportError: error connecting to the Picomotor controller
What can I try to modify in the code to make it work with the 2-axis controller model 8743-CL?
These are the commands that work and the responce to them: