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();