PyTektronixScope icon indicating copy to clipboard operation
PyTektronixScope copied to clipboard

'USBInstrument' object has no attribute 'ask'

Open lafinney opened this issue 3 years ago • 2 comments

Hi, I am trying to just save data from the tektronix DPO2024B oscilloscope, and am using a pretty simple code, but am getting this error in return: 'USBInstrument' object has no attribute 'ask'. Can someone help me understand how to fix this?

Thank you!

import os import pyvisa os.chdir('C:/Users/Lenovo/Desktop/ThorlabsKinesisControl/PyTektronixScope-master')

from PyTektronixScope import TektronixScope

rm = pyvisa.ResourceManager() J = rm.list_resources()

scope = TektronixScope(J[0]) X,Y = scope.read_data_one_channel('CH2', t0 = 0, DeltaT = 1E-6, x_axis_out=True)

lafinney avatar Sep 20 '21 14:09 lafinney

I'm having the same issue. Were you able to solve this?

mansuen avatar Dec 07 '21 02:12 mansuen

Recent version of visa do not have the ask method. You should replace "ask" by "query" (line 59) and the ask_raw by a "write" and a "read_raw". Note also that line 333-335 could be replace by a query_binary (see https://pyvisa.readthedocs.io/en/1.8/rvalues.html). Unfortunately I don't have the possibility to test those changes right now.

clade avatar Dec 08 '21 12:12 clade