ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib, wait does not return after timeout

I use this code line:

 

gpibDevice.Wait(GpibStatusFlags.DeviceServiceRequest | GpibStatusFlags.Timeout);

 

I want to wait for a Service Request or a Timeout.

The IOTimeout is set to 1s, but the Wait function does not return after 1s.

What is the problem? Do I have to set any other timeout?

 

0 Kudos
Message 1 of 6
(6,267 Views)

Hi,

 

pleasy refer to this documentation:

 

GPIB Wait Function

http://zone.ni.com/reference/en-XX/help/371361J-01/lvinstio/gpib_wait/http://zone.ni.com/reference/e...

 

Beste Regards

0 Kudos
Message 2 of 6
(6,233 Views)

Hi Gregor,

I am sorry but this link that you send, did not help me. I am using this code within a c# application. This is a bit

different to LabView. Here is my full code:

 

gpibAddress = 1;

timeoutValue = TimeoutValue.T1s;

 

gpibDevice = newDevice( 0, gpibAddress , 0 , timeoutValue );

gpibDevice.IOTimeout = timeoutValue;

gpibDevice.Clear();

gpibDevice.DefaultBufferSize = receiveBufferSize;

gpibDevice.SerialPollResponseTimeout = timeoutValue;

 

gpibDevice.Wait(GpibStatusFlags.DeviceServiceRequest | GpibStatusFlags.Timeout);

 

And I still have the Problem, that this Wait Function does not return after the

timeout value - here 1s. Do I have to configure anything else from the GPIB device?

 

0 Kudos
Message 3 of 6
(6,204 Views)

hi,

 

what is the state you get back from the gpibdevice.wait function? Is it 0? If not, what is it?

0 Kudos
Message 4 of 6
(6,182 Views)

Hi Gregor,

the problem that I have is that this device.wait function does not return because of a timeout. It is like a blocking call.

So I can not say what the result is.

 

Another problem that I have is when a device is connected and this device sends a SRQ, then

the wait function only returns when the timout value is larger than 1s.

 

Are this two problems connected?

 

When I set the timeout to 10s and a device sends a SRQ then I get

 

GpibStatusFlags.DeviceServiceRequest

and

GpibStatusFlags.IOComplete

 

What can be the problem???????????????????

 

0 Kudos
Message 5 of 6
(6,177 Views)

Hi OnkiDonki,

 

If you use an OR operator in a condition, you should use the conditionnal Operator "||"

 

You can try :

 

gpibDevice.Wait(GpibStatusFlags.DeviceServiceRequest || GpibStatusFlags.Timeout);

 

 

Marc

0 Kudos
Message 6 of 6
(6,113 Views)