Fetching waveform data from Lecroy 620Zi

204 views
Skip to first unread message

Jacob E. Overgaard

unread,
Aug 15, 2018, 10:51:53 AM8/15/18
to python-ivi
Hello everyone

I currently have a script for fetching and saving the PNG of the screen, which works splendidly.

Now I wish to actually get probe data, measurement data and the like, but I haven't yet managed to get it to work.

I currently use the lecroyWR104XIA, as there is no 620Zi library. My implementation is the following:

scope1 = ivi.lecroy.lecroyWR104XIA("TCPIP0::10.59.18.143::INSTR")

res = scope1.channels[0].measurement.fetch_waveform()

with open('test.dat', 'wb') as f:
f.write(res[0])

However this seems to not be working. Do you guys have any suggestions as to how I can "use" the data from the channels?

Best regards Jacob

rmax7

unread,
Aug 15, 2018, 11:38:41 PM8/15/18
to python-ivi
Please post the error / traceback for better help.

Jacob E. Fæster Overgaard

unread,
Aug 17, 2018, 8:24:46 AM8/17/18
to python-ivi
The error code looks the following:

Traceback (most recent call last):

  File "620Zi_save_wvform.py", line 35, in <module>

    saveWform()

  File "620Zi_save_wvform.py", line 28, in saveWform

    res = scope1.channels[0].measurement.fetch_waveform()

  File "/anaconda3/lib/python3.6/site-packages/python_ivi-0.14.9-py3.6.egg/ivi/lecroy/lecroyBaseScope.py", line 1421, in _measurement_fetch_waveform

    pre = self._ask("%s:INSPECT? WAVEDESC" % self._channel_name[index]).split("\r\n")

  File "/anaconda3/lib/python3.6/site-packages/python_ivi-0.14.9-py3.6.egg/ivi/ivi.py", line 2046, in _ask

    return self._interface.ask(data, num, encoding)

  File "/anaconda3/lib/python3.6/site-packages/python_ivi-0.14.9-py3.6.egg/ivi/interface/pyvisa.py", line 103, in ask

    return self.read(num, encoding)

  File "/anaconda3/lib/python3.6/site-packages/python_ivi-0.14.9-py3.6.egg/ivi/interface/pyvisa.py", line 92, in read

    return self.read_raw(num).decode(encoding).rstrip('\r\n')

  File "/anaconda3/lib/python3.6/site-packages/python_ivi-0.14.9-py3.6.egg/ivi/interface/pyvisa.py", line 72, in read_raw

    self.buffer = io.BytesIO(self.instrument.read_raw())

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/messagebased.py", line 363, in read_raw

    return bytes(self._read_raw(size))

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/messagebased.py", line 386, in _read_raw

    chunk, status = self.visalib.read(self.session, size)

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/ctwrapper/functions.py", line 1584, in read

    ret = library.viRead(session, buffer, count, byref(return_count))

  File "/anaconda3/lib/python3.6/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.

Exception ignored in: <object repr() failed>

Traceback (most recent call last):

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/resource.py", line 108, in __del__

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/resource.py", line 243, in close

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/resource.py", line 235, in before_close

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/resource.py", line 252, in __switch_events_off

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/resources/resource.py", line 309, in disable_event

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/ctwrapper/functions.py", line 410, in disable_event

  File "/anaconda3/lib/python3.6/site-packages/pyvisa/ctwrapper/highlevel.py", line 188, in _return_handler

pyvisa.errors.VisaIOError: VI_ERROR_INV_OBJECT (-1073807346): The given session or object reference is invalid.


It seems as if the error happens with the fetch_waveform, since it does not change anything if I remove the last two lines of code.

Best regards
Reply all
Reply to author
Forward
0 new messages