Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Random GPIB timeout error in .NET application.

Solved!
Go to solution

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

 

GPIB Log

 

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 

 

0 Kudos
Message 1 of 4
(4,629 Views)
Solution
Accepted by topic author DanQuist

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

Message 2 of 4
(4,618 Views)

Thanks for the suggestion. I will try this out when I field test again tomorrow.

0 Kudos
Message 3 of 4
(4,616 Views)

This worked. Thanks again.

 

Dan 

0 Kudos
Message 4 of 4
(4,599 Views)