Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with copy_ibvars not working correctly in VB6

I can get my application into a strange mode where my code assumes that all GPIB communication is working fine, except that no communication actually occurs. If I turn on GPIB spy, I get iberr = EBUS(14) on all read and write commands. However, the value returned for iberr from the NI-supplied copy_ibvars is always 0. Has anyone else run into this situation and is there a known solution?

As a further note, it seems to happen after operator actions in the program delete and then re-create my user object which encapsulates the GPIB functionality. So it's possible that I'm registering the GPIB globals twice without properly un-registering them. Stopping the program and then re-starting it clears the problem up,
but I prefer a better solution if possible.
0 Kudos
Message 1 of 3
(3,434 Views)
Hi,

Is there a specific sequence of function that you call that causes this?. Is there a simple way to reproduce it?

I've been looking for any known or previous problem like this, but I haven't found anything.

DiegoF.
National Instruments.
0 Kudos
Message 2 of 3
(3,434 Views)
Actually, I seem to have figured it out. I was using an out-dated copy of the VBIB32.BAS file with the Visual Basic function declarations. That version had a bug in the UnregisterGPIBGlobals sub where it didn't properly clear the GPIBGlobalsRegistered global flag. Because of this, I was failing to re-register the globals when I should have been.

Upgrading the the release 1.7 version of VBIB32 fixed the bug in that routine, and also seems to have fixed my problem.
0 Kudos
Message 3 of 3
(3,434 Views)