Page 1 of 1

Timeout/Protocol Error and NI IO Trace interference

Posted: November 19th, 2019, 6:38 am
by quexor
Hi there,
(this is a cross-post from NI Forums)

I am using a Tektronix MSO5204B oscilloscope (firmware 10.8.3 build 3) and a Tektronix AFG3022C (Version 1.0.2) function generator. The scope is connected over USB and the function generator over the USB-GPIB adapter. PyVisa with the NI-Visa driver as a backend is used to interface with the scope and the tkafg3k driver for the function generator.

I have a python program that does some measurements (a couple of mean voltage levels and step response waveforms). If I run the program for the first time after booting the scope, everything runs through smoothly. However, on consequent runs, I get the following warning: VI_WARN_UNKNOWN_STATUS (1073676421) on viOpen().

Then the program sporadically fails with the following error: VI_ERROR_INP_PROT_VIOL (-1073807305).

If I try to record the error with NI IO Trace, things get funny: The function generator takes very long (~2s per parameter) to configure and the protocol error does not occur! So somehow NI IO Trace is interfering with the communication.

I tested the program with another scope, the Tektronix DPO7104C, and everything works fine there, even on multiple runs.

Furthermore I tried with the MSO5204B connected over ethernet, and while the error behaves identically, it gets reported as VI_ERROR_TMO (-1073807339). This time I was able to record the problem with NI IO Trace, which is the trace packed as a zip attached below (I wasn't able to create a minimum example, but I reduced the code to execute only the setup for the measurements, so that is why there aren't any measurements happening).

So, does anyone have an idea why this timeout/protocol error is thrown, even though the statement's syntax is correct (concluding from the runs that go smoothly)? Is there a relevant difference between the two scopes? Is the timing between direct USB and over the USB/GPIB adapter different?

And how can I stop NI IO Trace from interfering with USB communication? Especially the slow configuration of the function generator is annoying.

Thanks a lot for your help!