Reputation: 1
I am trying to read the waveform data from a Teledyne LeCroy Wavesurfer 3054 using a pyvisa package I found on GitHub (https://github.com/SengerM/TeledyneLeCroyPy/tree/main). The problem is, when the script calls the get_waveform() method which then calls self.resource.read_raw() the program then halts on that line. I have also tried using pyvisa methods like read_binary_values() but the same problem occurs.
When I restart the oscilloscope then run the code I sometimes get the error: struct.error: unpack_from requires a buffer of at least 4 bytes for unpacking 4 bytes at offset 0 (actual buffer size is 0).
But the vast majority of time the code just get stuck on self.resource.read_raw()
Here is the script I'm running. It is just the first example from the above link.
import TeledyneLeCroyPy
o = TeledyneLeCroyPy.LeCroyWaveRunner('USB0::blah::blah::blah::9.1.0')
print(o.idn) # Pings e.g. LECROY,WAVERUNNER9254M,LCRY4751N40408,9.2.0
print('Waiting for trigger...')
o.wait_for_single_trigger() # Halt the execution until there is a trigger.
data = o.get_waveform(n_channel=1)
print(data['waveforms'])
I cannot for the life of me figure out why if anyone has a solution that would be greatly appreciated.
Upvotes: 0
Views: 67
Reputation: 21
I frequently download oscilloscope curve data using pyvisa. Twice I did run into trouble:
So make shure the oscilloscope is not acquiring new data while doing the download and try using a network cable instead of the USB-Port.
Upvotes: 0