Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I abort from ibrd?

I am using the GPIB-32 DLL and if ibrd() is waiting for a response from some instrument and I terminate my application, the process is still running in Task Manager. Is there any way that I can abort from the ibrd() so I can shut down cleanly?

Thanks,

Tim
0 Kudos
Message 1 of 4
(3,358 Views)
Hi,

ibrd is a synchronous function, meaning that it will not return until the operation is done or the timeout expires. You can change the timeout value using ibtmo if you want shorter timeout values.

There is an asynchronuos version of the I/O functions: ibrda and ibwrta. You can use ibstop to abort an async I/O operation.

Also, rememeber that you need to close the device or board unit descriptor using ibonl at the end of your application.

DiegoF
National Instruments.
0 Kudos
Message 2 of 4
(3,358 Views)
Thanks for the answer, Diego. I will try the async versions. I have taken this task over from someone else. Can you tell me where I can find the full list of functions for GPIB-32.dll?

Also, I tried modifying the timeout and it seems not to be a linear function. If I have a timeout value of 13, the timeout lasts 16 seconds. If the timeout value is 12, the timeout lasts 4 seconds...11 lasts 1 second. I want around 10 seconds, but from my observations, it doesn't look like I can set that value.
0 Kudos
Message 3 of 4
(3,358 Views)

Hi,

Your are right, the timeout values are not a linear. Actually, the driver only accepts discrete values for timeout, so the number used in ibtmo is just an index. You can find the timeout values, as well as the rest of the NI-488.2 functions, at NI-488.2 Function Reference Manual for Windows

DiegoF
National Instruments.

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