RFmx Is Not Reporting Warnings on Subsequent Runs in .NET/C#

Updated Sep 17, 2025

Reported In

Software

  • RFmx

Programming Language

  • C# .NET

Issue Details

One the first run of my RFmx application in C#, it will report warnings as expected (such as an ADC Overload warning). On subsequent runs, it does not report the warnings. If I attempt to run the same code in LabVIEW, then the warning is shown each run as expected.

 

Is there a modification required in the way a warning query is done in the C# code? 

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.,