Hi,
It s my first message on the forum so I hope wrote on the good section on the forum and that my explanations will be clear enough .
The program we are trying to build with labview is to read the two waveforms sent by a Function Generator (Tek AFG3021C) on an oscilloscope (Tek DPO7254C) after averaging x times the two signals (Function Generator Output sent to Channel 2 and TTL Output sent to Channel 1; oscilloscope trigger setup on Channel 1). We encountered no problems with setting up the function generator so I will only discuss the issues we have with programming the oscilloscope. In manual mode, we can also do what we want, the problem comes when we want to extract the waveforms to the computer with labview.
Here is the setup we are using:
NI Labview 2016 (32-bits)
NI-VISA 2016
Tektronix AFG3021C Function generator (connected by ethernet)
Tektronix DPO7254C Oscilloscope (connected by ethernet)
Windows 7 Professional Edition (SP1)
The full program controlling the oscilloscope is attached (in the zip file): “Oscillo Control Test 2.vi”.
In this VI, the oscilloscope is first setup in a vi called “Oscillo Setup parameters (Sub VI).vi”, also attached, where we first setup the two channels, the time, the trigger and then the acquisition mode (single, Hi-Res or Average). I used sub VIs from the Tek7000 series library and a self made one for the acquisition mode (see also attached “Oscillo Set Measurement Mode (Sub VI).vi” ), as I could not find one example in the library. Also attached are the several control cluster ctrl def that I created to "simplify" programming.
In the main program, after setting up the oscilloscope, the measurement is initiated (initiate.vi), then I added a wait for "Wait for Operation complete.vi" and the two waveforms should be extracted in a for loop (with N={ch1, ch2}) before closing the connection. I tried first with the ”Read (multiple waveforms).vi” I found in the Tektronix 7000 Series library but I observed the same problem.
My program works ok if the total acquisition time is below 5 or 10 sec. However, if I want to extract 25 averages of signals (set at 1 Hz), I get this error:
Error -1074000000 occurred at Tektronix 7000 Series.lvlib:Error Query.vi
Instrument reports:
402,"Operation complete"
2241,"Waveform requested is invalid; Waveform data not available; CURV?"
410,"Query INTERRUPTED"
0,"No events to report - queue empty"
As we would like to acquire quite slow signal after several averages, this is a serious problem for us. The problem we experienced is related, I guess, to the sub VI "Wait for Operation complete.vi". which does not wait to complete the averages before I fetch the two waveforms.
Is there a way we can wait for the averages to be completed, before we extract the waveforms? I could not find any example in the library or on the forum. Should I add a little subvi asking the equipment if it is ready (writing command lines such as BUSY?, *WAI) until I can read a BUSY 0 before fetching the curves ? I did not try yet as I thought there was maybe a more elegant method (and less demanding to the computer) to solve ou problem.
Many thanks for your help,
Florian