Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

computer crashes when calling ibsrc

I'm running VB6 and NI488 version 1.7

My program runs fine the first time I execute it. However, if the program stops for any reason (either normal execution, or from an error), then the entire computer crashes the second time I enter my GPIB initialization code. I've narrowed the problem down to a call to the "ibsrc" function. I can call that function any number of times during the first execution, but never during the second.

The odd thing is that this behavior only seems to occur on NT-based operating systems (seen on Windows 2000 and XP so far), but works fine on Windows 98.

Any help would be appreciated.
0 Kudos
Message 1 of 4
(3,144 Views)
Hello-

There is a problem with VB6 that seems to cause this situation. Windows is set by default to automatically reboot when it crashes, but if this option is disabled, the blue screen, IRQL_NOT_LESS_OR_EQUAL, will probably appear.

This can be avoided simply by adding an ibonl(ud,0) at the end of the VB program and never terminating the program without this command.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,144 Views)
Thanks for the quick response. I had come to the same conclusion myself after seeing the ibonl suggestion relating to a different VB crash. It seems to work fine as long as I can control program exit. But it doesn't help if the program crashes for any reason, since I can't control the exit code in that case.

Also, it may be worth noting that this behavior only occurs in the development environment. Everything is fine if I compile it into an executable file.
0 Kudos
Message 3 of 4
(3,144 Views)
That is quite interesting. Try using VISA to control GPIB. Maybe that will keep VB6 from crashing the system.

Randy Solomonson
Application Engineer
National Instruments
0 Kudos
Message 4 of 4
(3,144 Views)