我需要使用 python 2.7 与示波器进行通信,Agilent Infiniium DCA-J 86100C。Keysight 公司提供各种 python 代码,虽然我试图运行其中一个来帮助我学习,但它崩溃了。我正在使用 GPIB 和 pyvisa 进行连接。
我已经尝试更改为终止字符,但它没有改变任何东西。我不确定我可以尝试什么频段速率。
SCOPE_VISA_ADDRESS = "GPIB0::7::INSTR"
rm = visa.ResourceManager('C:\\Windows\\System32\\visa32.dll')
KsInfiniiVisionX = rm.open_resource(SCOPE_VISA_ADDRESS)
KsInfiniiVisionX.clear()
KsInfiniiVisionX.query(':SYSTEM:DSP "";*OPC?')
KsInfiniiVisionX.write(":HARDcopy:INKSaver OFF")
KsInfiniiVisionX.write(":DISPlay:DATA? PNG,SCReen,COLor")
my_image = KsInfiniiVisionX.read_raw()
Traceback (most recent call last):
File "X:\...\Get_screen_image_VISA_Python_modified\InfiniiVision_Save_ScreenShot_to_PC_Python-2.7_modified.py", line 201, in <module>
my_image = KsInfiniiVisionX.read_raw()
File "C:\Python27\lib\site-packages\pyvisa\resources\messagebased.py", line 306, in read_raw
chunk, status = self.visalib.read(self.session, size)
File "C:\Python27\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1582, in read
ret = library.viRead(session, buffer, count, byref(return_count))
File "C:\Python27\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 188, in _return_handler
raise errors.VisaIOError(ret_value)
VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.