01-11-2012 12:13 PM - edited 01-11-2012 12:16 PM
Hi,
I am creating a .NET4 application that communicates with Marconi Instruments 2023 signal generator over GPIB. When I tested it under Windows 7 x64 it all works fine.
However when we run the application on the user's Windows XP computer, I get an ocassional and random GPIB timeout error. I ran NI I/O Trace and determined that the error is taking place when the computer sends a query to see if there have been any errors on the device and attempts to read back a respsonse. I have included a screenshot which shows where the error take place. The application then throws an exception with the message "Time limit exceeded to complete operation."
As you can see, there have been nearly 7000 GPIB commands before the error took place but it is not always this many. Sometimes it is thousands, sometimes hundreds. It happens randomly.
The C# code is shown here where the exception is generated.
// Check for any errors
SignalGenerator.Write("ERROR?");
String Temp = SignalGenerator.ReadString();
Another intersting point is that the signal generator throws the following error -
UNTERMINATED (error 451) occurs when the controller attempts to read a response without
having sent a query.
As you can see from the log, this error message never gets transmitted over the GPIB.
So I'm kind of stuck here. It works fine on my development computer after running it many many times. The application runs successfully everytime on my computer but has yet to complete once on the XP computer. Also, the same NI drivers are installed on both computers.
Ideas? Any input would be appreaciated.
Dan
Solved! Go to Solution.
01-11-2012 03:15 PM
Hi,
Try this after you send the "ERROR?" query.
SignalGenerator.Wait(GpibStatusFlags.IOComplete);
or
Since the only error you're getting is when you look for one, why not just get rid of the error query.
Curt
01-11-2012 03:31 PM
Thanks for the suggestion. I will try this out when I field test again tomorrow.
01-13-2012 11:46 AM
This worked. Thanks again.
Dan