2
Ich versuche, eine Oszilloskopdatei von Tektronix auf den PC zu übertragen. Leider bekomme ich immer einen TIMEOUT Fehler. Meine Arbeit schreibt, aber wenn ich das rohe Format lese, stecke ich fest. Hier ist mein Code:PyVISA Timeout-Fehler
import visa
import time
scope = visa.ResourceManager()
tek = scope.open_resource('GPIB::1::INSTR')
tek.timeout=100000 # timeout 100s
print(tek.query('*IDN?'))
tek.write('FILESYSTEM:FRINT "C:\EDIR\EDIR_812\140mV.png", GPIB')
time.sleep(6)
data = tek.read_raw()
time.sleep(6)
fid = open('C:/Users/svpxi01/Desktop/GPIB read/my_image.png', 'wb')
fid.write(data)
fid.close()
tek.close()
print('Done')
und Debug-Log:
TEKTRONIX,TDS5034B,B052776,CF:91.1CT FV:2.0.11
2016-03-29 17:28:38,119 - pyvisa - DEBUG - viWrite(60710720, b'FILESYSTEM:FRINT "C:\\EDIR\\EDIR_812`mV.png", GPIB\r\n', 50, 'c_ulong(50)') -> 0
2016-03-29 17:28:44,130 - pyvisa - DEBUG - GPIB::1::INSTR - reading 20480 bytes (last status <StatusCode.success_max_count_read: 1073676294>)
2016-03-29 17:30:58,366 - pyvisa - DEBUG - viRead(60710720, <ctypes.c_char_Array_20480 object at 0x0389FF30>, 20480, 'c_ulong(0)') -> -1073807339
2016-03-29 17:30:58,406 - pyvisa - DEBUG - GPIB::1::INSTR - exception while reading: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.
Traceback (most recent call last):
File "C:\Users\SyedM03\python\tekwrite.py", line 20, in <module>
data = tek.read_raw()
File "C:\Python34\lib\site-packages\pyvisa\resources\messagebased.py", line 306, in read_raw
chunk, status = self.visalib.read(self.session, size)
File "C:\Python34\lib\site-packages\pyvisa\ctwrapper\functions.py", line 1582, in read
ret = library.viRead(session, buffer, count, byref(return_count))
File "C:\Python34\lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 188, in _return_handler
raise errors.VisaIOError(ret_value)
pyvisa.errors.VisaIOError: VI_ERROR_TMO (-1073807339): Timeout expired before operation completed.