Skip to content

VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed. #8

@samtalki

Description

@samtalki

Thank you for the previous reply in regards to clarifying the difference between the PyPI and Github versions of the library. I have now run into a new problem trying to use read_data_one_channel on my Tektronix oscilloscope. Code is as follows:


import pyvisa
from PyTektronixScope import TektronixScope


from tkinter import Tk
import numpy as np
from struct import unpack
from tkinter import filedialog
import pylab
    
rm = pyvisa.ResourceManager('@ni')

#Choose the IP address of Scope to connect

scope1 = '192.168.3.155'
#Check that TCPIP0 is not actually TCPIP
scope = rm.get_instrument('TCPIP0::'+scope1)
print(scope.query("*IDN?"))

scopeObj = TektronixScope('TCPIP0::192.168.3.155::inst0::INSTR')
X,Y = scopeObj.read_data_one_channel('CH4',t0 =0,DeltaT = 1E-6,x_axis_out=True)

pylab.plot(X,Y)
pylab.show()

And when running this code as is I am facing the following errors:


runfile('C:/Users/sat01/Documents/Python Scripts/Scope Scripts/Scope Capture_r2.py', wdir='C:/Users/sat01/Documents/Python Scripts/Scope Scripts')
TEKTRONIX,MDO3014,C041883,CF:91.1CT FV:v1.24

Traceback (most recent call last):

  File "C:\Users\sat01\Documents\Python Scripts\Scope Scripts\Scope Capture_r2.py", line 30, in <module>
    X,Y = scopeObj.read_data_one_channel('CH4',t0 =0,DeltaT = 1E-6,x_axis_out=True)

  File "C:\Users\sat01\Anaconda3\lib\site-packages\PyTektronixScope\PyTektronixScope.py", line 303, in read_data_one_channel
    x_0 = self.get_out_waveform_horizontal_zero()

  File "C:\Users\sat01\Anaconda3\lib\site-packages\PyTektronixScope\PyTektronixScope.py", line 260, in get_out_waveform_horizontal_zero
    return float(self.ask('WFMO:XZERO?'))

  File "C:\Users\sat01\Anaconda3\lib\site-packages\PyTektronixScope\PyTektronixScope.py", line 59, in ask
    return self._inst.ask(cmd)

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\resources\messagebased.py", line 618, in ask
    return self.query(message, delay)

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\resources\messagebased.py", line 613, in query
    return self.read()

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\resources\messagebased.py", line 427, in read
    message = self._read_raw().decode(enco)

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\resources\messagebased.py", line 400, in _read_raw
    chunk, status = self.visalib.read(self.session, size)

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1584, in read
    ret = library.viRead(session, buffer, count, byref(return_count))

  File "C:\Users\sat01\Anaconda3\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 193, in _return_handler
    raise errors.VisaIOError(ret_value)

VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.

Many thanks for your efforts

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions