asvela/tektronix-func-gen

Pyvisa raises VI_ERROR_IO (-1073807298) when Tektronix Call Monitor is not open

Cyclical- opened this issue · 3 comments

When trying to control the AFG1022 using python, any script will fail with the error:
pyvisa.errors.VisaIOError: VI_ERROR_IO (-1073807298): Could not perform operation because of I/O error.
unless the Call Monitor application that comes with TekVISA is open and capturing. Here is an example of code that presents an error:

import tektronix_func_gen as tfg
import pyvisa

with tfg.FuncGen('USB::0x0699::0x0353::1720810::INSTR') as fgen:
      fgen.ch1.set_function("SIN")
      fgen.ch1.set_frequency(25, unit="Hz")
      fgen.ch1.set_offset(0, unit="mV")
      fgen.ch1.set_amplitude(0.002)
      fgen.ch1.set_output("ON")
      fgen.ch2.set_output("OFF")
      # alternatively fgen.ch1.print_settings() to show from one channel only
      fgen.print_settings()

Thanks for letting me know. I have only been using the package with NI VISA, and do not have any experience with TekVISA. With NI VISA installed I have not experienced the need to have any VISA related software running to make sure the python package works.

You don't normally need to have the call monitoring app open when interacting with other instruments using pyvisa with TekVISA?

I doubt this is causing the issue, but what happens if you don't reload pyvisa in your code snippet? It is loaded in the tfg package, so it should not be needed.

Issue seems fixed using NI-VISA instead of TekVISA, so it's likely an issue with the TekVISA driver package itself and not this library.

Okay, thanks for testing with NI-VISA. For now I will not further investigate what might be causing the issue with TekVISA, but I'll add a note to the readme.