Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ibdev hang

If I did not connect the GPIB device to my PC (via USB), when my program execute function ibdev, the program will hang and I have to terminate it.
Based on the GPIB documentation, the function should return negative value. How to solve this problem?

0 Kudos
Message 1 of 6
(3,713 Views)

Hi,

 

Are you sure the problem is ibdev? That function just creates a device descriptor to use in any calls made to the instrument. It returns the device descriptor or -1.

 

You should get an 'EBUS' error on any calls made after the ibdev function. 

 

"EBUS indicates that no devices were detected on the bus.  Verify that your instrument is powered on and properly connected to your GPIB interface."

 

Curt

 

 

0 Kudos
Message 2 of 6
(3,698 Views)

I've put a breakpoint on this line:

 

dev=ibdev(gpib_boardindex,gpib_pad,0,T100ms,1,0);

 

whereby dev, gpib_boardindex and gpib_pad are int variables. In this case, gpib_boardindex and gpib_pad are 0. And I did not connect the USB to GPIB adapter to my PC. When I step over this line (F10), my debugger (Qt MinGW) will pop up error message of Segmentation Fault.

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

You look like using GNU for Windows. How is the problem going when using NI's GPIB interactive app (IBIC) or when writing the same program with Microsoft C/C++? Also, what is your OS platform?

0 Kudos
Message 4 of 6
(3,680 Views)

OS: WIN7 64 bit Home Basic

 

In Mircrosoft Visual Studio 2010, when I step over ibdev (USB to GPIB adapter not connected to my pc), this line occur in the output panel:

 

First-chance exception at 0x76f28dc9 in Read Write.exe: 0xC0000005: Access violation writing location 0x00000014.

0 Kudos
Message 5 of 6
(3,674 Views)

Hi,

 

Try using the ibfind function before the ibdev and see what that returns

 

 

ibfind(GPIB0)

 

Curt

 

 

 

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