Hi,
I have following C# code to fetch Holdup time from the Oscilloscope.
string visaRsrcAddr = "TCPIP::" + IP.ToString() + "::inst0::INSTR";
var scope = GlobalResourceManager.Open(visaRsrcAddr) as IMessageBasedSession;
using (scope)
{
scope.TimeoutMilliseconds = 60000;
scope.FormattedIO.WriteLine("MEASUrement:IMMed:TYPe DELay");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:DELay EDGE1 FALL");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:DELay EDGE2 FALL");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:SOUrce1 CH4");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:SOUrce2 CH2");
scope.FormattedIO.WriteLine("MEASUrement:IMMed:VALue?");
string val = scope.RawIO.ReadString();
if (float.TryParse(val, out holdup))
{
return true;
}
return false;
}
I see that most of the time val contains junk value or this throws Timeout exception. Occassionally (rarely) it does return the expected holduptime value.
Please suggest what is the issue and what can be done?
Thanks,
Reena