Traceback (most recent call last): File "C:\.work\python\test\main.py", line 15, in…
- User
Traceback (most recent call last): File "C:.work\python\test\main.py", line 15, in Iinput_SMU_equip.write(":SENS:CURR:PROT:LEV 1") ## set device Ilim to 1 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nxf06725\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvisa\resources\messagebased.py", line 196, in write count = self.write_raw(message.encode(enco)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nxf06725\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvisa\resources\messagebased.py", line 156, in write_raw return self.visalib.write(self.session, message)[0] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nxf06725\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvisa\ctwrapper\functions.py", line 2795, in write ret = library.viWrite(session, data, len(data), byref(return_count)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nxf06725\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 226, in _return_handler return self.handle_return_value(session, ret_value) # type: ignore ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "C:\Users\nxf06725\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvisa\highlevel.py", line 251, in handle_return_value raise errors.VisaIOError(rv) pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed. [Finished in 18.2s]
what could cause this ?
- Assistant
The error you're encountering is a
VisaIOErrorwith the messageVI_ERROR_TMO (-1073807339): Timeout expired before operation completed. This error typically indicates that the operation attempted by your script took longer than the specified or default timeout period for the VISA resource. Here are some potential causes and solutions to consider: