From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

GPIB DDK problem: Get time out error when call ibrd

I am using the GPIB DDK to develop a driver for RTX5.5. There is the Time out error occur when call the ibrd(). I traced into the driver, I found that the problem is occure in the nitn_chw.c, the function name is nitn_rdPIO(). When I set a break point at "if (TNtimedOut() || tng->aborted) {", I found that all the data had been read out from FIFO and the data are valid and complete, but the end condition was not satisfied, so, the time out error comes out.
0 Kudos
Message 1 of 3
(3,364 Views)
That is the expected behavior.

When you perform an ibrd function call, you provide 2 vital pieces of information.
1) A timeout (via ibtmo or ibconfig). This sets up a time that NI-488.2 can abort the transfer if all of the data has not been received.
2) A byte-count. This sets up the maximum number of data bytes that NI-488.2 will receive.

NI-488.2 will continue the transfer until one of the following 3 conditions occurs:
1) You receive the last databyte of a transfer. This data byte will be received with the END condition.
2) You receive the maximum number of bytes that you configured the transfer to receive (i.e., ibrd 100 will return after it reads exactly 100 bytes from the bus)
3) Neither of the first two conditions is true and the timeout
period has elapsed. (i.e., after 10 seconds, you have not received 100 bytes and you have not received a byte with END).

If this is not expected (due to the overall programming), a few questions that come to mind.
1) Are you expecting the End signal? If you are and you are not receiving it, you may want to try a new cable or plug-in a GPIB analyzer to see what is happening on the bus.
2) When you say that all of the data has been read out, does this just mean the FIFOs are empty? Were any bytes actually received? Frequently timeout error occur when no bytes have been received. This means that you are trying to read from and instrument that is not sending you any data. This could be that you did not send it a valid query prior to reading from the device.
Message 2 of 3
(3,364 Views)
Hi,

I guess the first thing to check are the actual function calls your application is doing. What function calls are you using to read the data? You can especify the termination method using ibeos.

If you have an analyzer, does the device assert the EOI line?

When you say that the END condition is not satisfied, Do you mean that the END bit in ISR1 is not set; or that the interrupt routine is not called?.

What hardware are you working with?.

DiegoF
National Instruments.
0 Kudos
Message 3 of 3
(3,364 Views)