11-20-2018 07:38 AM - edited 11-20-2018 07:40 AM
I use NationalInstruments.VisaNS.dll to communicate with Tektronix oscilloscope. There are many types of measurement.
For example, below code is for frequency measurement.
string response;
tekResource.Write("MEASUREMENT:MEAS1:TYPE FREQUENCY");
tekResource.Write("MEASUREMENT:MEAS1:SOURCE1 CH1");
tekResource.Write("MEASUREMENT:MEAS1:VALUE?");
response = tekResource.ReadString();
The issue is that when I request the value immediately after setting the measurement type, it returns 9.9E+37 (infinity). If I wait about two seconds, than it returns correct value.
Is there graceful way to get frequency value without polling the device in a while loop? Polling the device looks not robust approach because sometimes it returns me the previously measured value.
Solved! Go to Solution.
11-21-2018 01:43 AM
Seems I was using wrong measurement method.
Programmer manual says:
"The best method for taking measurements over the computer interface is to use the MEASUREMENT:IMMED commands and queries. The immediate measurement has no front-panel equivalent, and the oscilloscope never displays immediate measurements."
string response;
tekResource.Write("MEASUREMENT:IMMED:TYPE FREQUENCY");
tekResource.Write("MEASUREMENT:IMMED:SOURCE1 CH1");
tekResource.Write("MEASUREMENT:IMMED:VALUE?");
response = tekResource.ReadString();
10-30-2025 12:28 PM
@RaspberryIceCream wrote:
Seems I was using wrong measurement method.
Programmer manual says:
"The best method for taking measurements over the computer interface is to use the MEASUREMENT:IMMED commands and queries. The immediate measurement has no front-panel equivalent, and the oscilloscope never displays immediate measurements."
string response; tekResource.Write("MEASUREMENT:IMMED:TYPE FREQUENCY"); tekResource.Write("MEASUREMENT:IMMED:SOURCE1 CH1"); tekResource.Write("MEASUREMENT:IMMED:VALUE?"); response = tekResource.ReadString();
This info saved me after hours of debugging. The vendor-provided LabVIEW drivers for this instrument return 9.9E+37 and an entirely unhelpful error message
2200 Measurement error, Measurement system error
That I'm including in my reply here so it hopefully bubbles up in search results. As far as I can tell the documentation is basically lying when it says "This is the same value as displayed on-screen" when using measurement slots 1-6 as it will error most of the time on the visible slots but never on immediate, specifically when doing a delay r-r measurement.