Instrument Control (GPIB, Serial, VISA, IVI)

Showing results for 
Search instead for 
Did you mean: 

GPIB Hangs on Ibrd

I have a GPIB application communicating with one of our own devices. I'm using version 2.1 of the driver on windows XP Pro. What I'm seeing is that is I send the same command (ibwrt and then ibrd) in a loop over many iterations (approx 30 - 100K), eventually, the driver will become hung. The ibrd is sent (viewed in NI Spy) and never times out, even though a time out is set. Here is a code snippet of what I'm doing:

// OnButton Function...
// get the device id
int devID = ibdev( 0, 6, 0, T10ms, 1, 0 );

for (int i=1;i< m_loopFor;i++)
RawCCDTest( devID );
AtlTrace( "Test %ld\n",i);
m_count = itoa( i, buff, 10);


void CCommunicationTesterDlg::RawCCDTest( int devID)
string command = "Z312,0"; //
command += "\r";

char buff [20];
ibwrt( devID, (void *)command.c_str(), command.size() );

AtlTrace( "Status After Write[%x]\n",ibsta);
AtlTrace( "Reading all 3 Char[%ld]\n",1);
ibrd( devID, buff, 3 ); // o
AtlTrace( "Status After Read[%x]\n",ibsta);
_ASSERT( !(ibsta & ERR) );

Any help/ideas would be appreciated.

J. Martin
JY Horiba, Inc
0 Kudos
Message 1 of 4

I tested a similar program that opens a reference, sends a query and receives data (the DevQuery Example). I ran it for 100K iterations without getting the hang on ibrd.

Could you post the spy capture of your application?.
What GPIB hardware are you using?

I'm attaching the code of the example.

National Instruments
0 Kudos
Message 2 of 4



I am also facing problem with the GPIB ibrd command. I can see that command is sent and it never get the resposne back and it keeps on waiting forever. That makes it to hang.

I have captured the logs using GPIB sniffer


Last command/indication on CMU screen:



Last commands/indications using GPIB sniffer NISpy

READ:SCALar:RXQuality:HACK:EXTended?". Status: completed

GPIB read (ibrd) -- which is not completed (xxxx in ibsta) … GPIB hangs?

Extract from Capture.spy

1432. ibrd(UD15, 0x06146748, 100000 (0x186A0))

Prozess-ID: 0x0000013C Thread-ID: 0x00000638

Starting point: 21:03:33.116

ibsta: 0xXXXX iberr: XX ibcntl: XX(0xXX)

PLease help......

0 Kudos
Message 3 of 4



I had a similar problem to the ones described here, my program did hang upon repeated reads or asynchronous reads of larger data blocks (oscilloscope waveform). I finally found that this was due to an USB cable extension I used to connect the USB GPIB interface, which probably randomly messed up the timing of the USB communication. After removing this extension, everything worked fine.


N. Lotze

0 Kudos
Message 4 of 4