VI_ERROR_TMO (-1073807339) Timeout #157

Closed
dillharr opened this Issue May 15, 2015 · 15 comments

Projects

None yet

5 participants

@dillharr

I am having a timeout issue that will occur at the same point in a python script every time. It is very confusing, because it is giving me this error even though the Satellite Simulator that I am sending SCPI commands to acts like it received the command. I tried extending the timeout to 5 seconds, but this didn't help. Any ideas of what could be causing this. Below is the error output PowerShell gives me.

Traceback (most recent call last):
File ".\GNSS_FUNC_TEST.py", line 235, in
box.write('sour:scen:cont start')
File "C:\Python34\lib\site-packages\pyvisa-1.6.3-py3.4.egg\pyvisa\resources\messagebased.py", line 184, in write
count = self.write_raw(message.encode(enco))
File "C:\Python34\lib\site-packages\pyvisa-1.6.3-py3.4.egg\pyvisa\resources\messagebased.py", line 162, in write_raw
return self.visalib.write(self.session, message)
File "C:\Python34\lib\site-packages\pyvisa-1.6.3-py3.4.egg\pyvisa\ctwrapper\functions.py", line 1849, in write
ret = library.viWrite(session, data, len(data), byref(return_count))
File "C:\Python34\lib\site-packages\pyvisa-1.6.3-py3.4.egg\pyvisa\ctwrapper\highlevel.py", line 180, in _return_handler
raise errors.VisaIOError(ret_value)
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
PS C:\python34\Lib\Framework\Resource\TestDevice>

@MatthieuDartiailh
Contributor

Have you correctly set the read_termination character ? Visa looks for this character(s) at the end of the instrument answers. If it does not find it a timeout will occur as it will go on waiting for it.

@dillharr

Yes I have. I tried changing the read_termination from '\n' to '\r' but it didn't help. I still experience the timeout. The really strange thing is that it has the timeout on a command that works without any issues earlier in the python script that I am running.

@hgrecco
Owner
hgrecco commented May 15, 2015

But it seems that you are getting a write timeout, right? Can you give more information about the device

@dillharr

Yes it appears I am getting a write timeout even though the device appears to take the command and starts the scenario I had it load. The device is a Spectracom GSG-62 Multi-GNSS Simulator. I am using pyvisa to issue SCPI commands to the device to load, start, and stop satellite simulations. I am communicating with the device through USB.

@hgrecco
Owner
hgrecco commented May 16, 2015

try to put that command first to find out if a previous command is affecting the ability of your device to receive further instructions.

@dillharr

I have tried moving it farther up the script. When I do this the next command that talks to the GSG-62 experiences the same timeout. I will try contacting Spectracom to see if they have heard of this as well. I'm almost starting to think it might be something with GSG-62 and not pyvisa.

@hgrecco
Owner
hgrecco commented May 18, 2015

try the same sequence win NI-MAX and let us know.

@dillharr

I finally found what was causing my issue. There were a couple of issues actually. One of them was a setting issue on the satellite simulator. The other issue was a timing problem in my code. Thanks for all your help.

@dillharr dillharr closed this May 20, 2015
@rakansha

what was the timing problem and how did you rectify it?
I have an operation timed out error too
#221 (comment)

@dillharr

@rakansha sorry it took so long to get back to you. I reviewed my notes on this issue and it appears I was issuing SCPI command to change the plan and then start the plan without a small delay between them. These satellite simulators we have are quite old and don't seem to like a bunch of commands just thrown at them.

@rakansha

@dillharr Thanks my issue then seems to be different than you. the first command itself shows Operation timed out. And plus as of now I didn't even execute a set of commands, only tried interacting with instrument.

@csagar
csagar commented Jun 29, 2016

@rakansha Can you share you code snippet to better understand the issue? The termination character is key.

@rakansha

#221 (comment)

Here..I have posted that problem in the above link..it contains the code snippet

@csagar
csagar commented Jun 29, 2016

Hmm... I assume you have also added the termination character in that snippet.

Also checking this Timeout issue it seems there is an open issue on Linux machines using PyVisa for USB. The author posted his code snippet which is similar to yours but is on MacOS. You might want to give a try with a different OS may be, if that is even an option.

@rakansha

@csagar I will look into it.thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment