I have a C# app that writes data over the GPIB bus using .NET 4882. When the device is off, I catch the appropriate error and the program continues. When the device gets turned on from being in an off state, the program hangs on the Device.Write() command indefinitely despite the timeout value that the device was initialized with.
When in the off state and I break on the Device.Write() command before it is executed, then turn on the device, wait about 5 seconds or so, then continue execution everything is fine. Data gets written to the device.
Here's my code snippet:
In constructor I init my device:
_GPIBDevice =
new Device(0, (byte)_ChanCfg.GPIBAddress, 0, TimeoutValue.T10s);
Later in my write code:
try
{
_GPIBDevice.Write(senddata);
}
catch()
{.....}
Isn't there something one can do to catch this without a hang?
ScottO