Solution
RFmx .NET don't have event subscription mechanism for warning. Warning code will be returned as a status code from method.
As per the design, GetWarning method will clear the warning message after retrieving. You can use GetErrorString method instead to read the warning/error message without being cleared.
You can follow the below approach to effectively capture all warnings.
public string checkWarning(int code)
{
string warningMsg = "";
if (code > 0) //Read the warning
{
instrSession.GetErrorString(code, out warningMsg);
return warningMsg;
}
return warningMsg;
}
Then, for all APIs for which you are interested to capture the warning message, you can call the API like:
checkWarning(Initiate),
checkWarning(WaitForMeasurementComplete),
checkWarning(FetchIQ),
etc.,