Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

ildev always returns positive value

 

I call following functions in VB6 to initialize my device

ieee = ilfind("GPIB0")

devHandle  =  ildev%(0, 22, 0, 12, 1, 0)

I expected that  devHandle gets -1 if  device at address 22 can't be accessed. I was suprised that devHandle always returns valid positive value. I tried power off the device, then I unplugged GPIB cable but I never get -1. I even changed board index from 0 to 1, to 2, to 3. Only with board number=4 I received devHandle=-1. Am I doing anything wrong or it works as supposed to be.

 

Thanks 

 



Message Edited by Alex723 on 04-01-2008 06:10 PM
0 Kudos
Message 1 of 3
(4,381 Views)

Hi Alex,

Is there a reason you are using the IL-style calls? Have you tried using the IB-style calls? National Instruments uses the IB-style calls for Visual Basic. 

Hope this information helped!

 
Rasheel
0 Kudos
Message 2 of 3
(4,357 Views)
 

Alex,

Calling ildev simply opens a handle to a device, it does not check the device to see if it is actually present or not. If you wanted to check to see if the device at Primary Address 22 is there, try using illn (or the C like ibln) to detect if it is on the bus or not.

BTW- using il-style calls in Visual Basic is the preferred set of calls to use. They mimic the behavior of the C like ib-style calls. If anything, the article in the KnowledgeBase needs to be updated.

Hope this information helps!

gpibtester

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