-
-
Notifications
You must be signed in to change notification settings - Fork 246
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
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed. #241
Comments
My first guess is that the termination character for either reading or writing is not right. Refer to the manual to find the right characters (you can set them using .write_termination and .read_termination) |
I tried that as well. See below code rm = visa.ResourceManager() rm.list_resources() Error Process finished with exit code 1 |
When setting the read/write termination you should not add them to each read/write call (which you did). I guess you looked up the termination character in the manual, could you try checking that you can communicate using NiMAX, if this fails it means the termination is wrong. |
I installed NiMax and tried to connect using SFP(Soft front panel) but I think it is not connecting there as well. In NI VISA interactive control When tried to write command it works fine but when query or read the same command it gives me timeout error. Also, I am using Keysight bert software. It is not hardware. |
Had same problem for RIGOL1000 oscilloscope, this one needed |
To elaborate on @gasparka, one thing you need to make sure is that the instrument does detect the end of your message when you write otherwise it will keep waiting, and this will not generate any visible error. The easiest way to is to pick a command that has a visible effect on the instrument front panel and check that something happen. |
I think we should add something about this to the documentation, i spent stupid amount of time on this because i was pretty sure that '\n' is the default write termination... |
I just noticed that the docs have some problem currently (wrong tool bar) and I will try to fix it. The docs could use some reorganization. In particular the tutorial, advanced tutorial and writing-reading values could be grouped together. If we do that we could also add a guide on how to proceed for a new instrument. The order would be tutorial, advanced tutorial, new guide, reading-writing values. |
Hello, I use RS232 to communicate with a KISTLER Torque sensor 4700. And I also have the same problem, please help me. import visa rm = visa.ResourceManager() "C:\Program Files\Python37\python.exe" D:/MotorAutoPlatform/VisaFunc/Torquemeter.py Process finished with exit code 1 |
I assume you use the same termination chars than NI-Visa (if not that is the first thing to change). And that you have checked your instrument manual. |
Thank you for your reply. :) |
Try reading a single byte at a time, this way we will know if the instrument answer. For the serial, have a look at #326 |
did you try your command as |
Closing for lack of activity feel free to reopen if necessary. |
Hi,
I am trying to use pyvisa for connecting Keysight's device on my localhost. Following is my script but I am continuously getting error
`import visa
rm = visa.ResourceManager()
rm.list_resources()
instrument = rm.open_resource('TCPIP0::localhost::inst0::INSTR')
instrument.timeout = 4000
print(instrument.query("*IDN?"))
instrument.write(':JITT:HEF:PER:AMPL? "M1.DataOut1"')
print(instrument.read())`
Error:
"C:\Program Files (x86)\Python27\python.exe" C:/Users/disarora/PycharmProjects/untitled2/script
Traceback (most recent call last):
File "C:/Users/disarora/PycharmProjects/untitled2/script", line 8, in
print(instrument.query("*IDN?"))
File "C:\Program Files (x86)\Python27\lib\site-packages\pyvisa\resources\messagebased.py", line 407, in query
return self.read()
File "C:\Program Files (x86)\Python27\lib\site-packages\pyvisa\resources\messagebased.py", line 332, in read
message = self.read_raw().decode(enco)
File "C:\Program Files (x86)\Python27\lib\site-packages\pyvisa\resources\messagebased.py", line 306, in read_raw
chunk, status = self.visalib.read(self.session, size)
File "C:\Program Files (x86)\Python27\lib\site-packages\pyvisa-sim\highlevel.py", line 187, in read
raise errors.VisaIOError(constants.VI_ERROR_TMO)
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Process finished with exit code 1
The text was updated successfully, but these errors were encountered: