Measurement Studio for VB6

cancel
Showing results for 
Search instead for 
Did you mean: 

VB6 application using GPIB fails in Windows 7

I have a measurement application written in VB6 that communicates with instruments via the GPIB-USB-HS.

It works fine in Windows XP but fails in Windows 7.  Is there any information on this problem?

Message 1 of 26
(13,234 Views)

Hi ClarkH,

 

Could you please clarify what you mean by not working?  Do you have NI's Measurement and Automation Explorer (MAX) installed?  If you do can you verify you can communicate with the device through MAX.  When your VB6 program fails does it throw any error messages or codes at you?

 

It is possible you might just need to update your NI-488.2 driver for windows 7. You can find the newest driver here.

Regional Account Manager
NI
0 Kudos
Message 2 of 26
(13,227 Views)

Yes, I have MAX installed using your CD labeled NI488.2 ver 2.7.3 (newly purchased).  MAX shows my GPIB-USB-HS and locates all the instruments that I need to communicate with. So really this is not your problem but I was hoping you might have some advice.   My application has code that searches for the GPIB controller and gives the error message "GPIB not working".  This code was created from your examples by another programmer about 8 years ago.  It is a bit opaque to me. I have the source code.  I believe that the problem occurs in modIO.bas (I think this is NI code) but for some reason I cannot view this code and I can't single step through it. I think it sets a variable OK488 = False which leads to my error message.

0 Kudos
Message 3 of 26
(13,216 Views)

Hi ClarkH,

 

Have you tried any of the 488.2 examples?  They should be located in C:\Documents and Settings\All Users\Documents\National Instruments\NI-488.2\Examples\Visual Basic (if you are using XP). Or Start>All Programs>National Instruments>NI 488.2>Examples.

 

Also, are you communicating with a 3rd party instrument?  Is it possible they may have some VB examples for their device?

Regional Account Manager
NI
0 Kudos
Message 4 of 26
(13,208 Views)

My application incorporates your  modules NIGlobal.bas and VBIB-32.bas dated ~2004.  These modules call functions in GIPB-32.dll.  These calls generate file not found errors.

On my XP machine, GPIB-32.dll is in c:\WINNT\System32
On the Windows 7 machine it is in c:\Windows\System32

It is unclear to me how VB knows where to look for this file.

0 Kudos
Message 5 of 26
(13,200 Views)

I replaced the VBIB-32.bas and NIGlobal.bas with the newer files in the NI Examples.  I still get the same error:

"File not Found: GPIB-32.dll"  coming from this call "RegisterGPIBGlobalsforThread(....."

Thanks for your help

ClarkH

0 Kudos
Message 6 of 26
(13,198 Views)

Hmm this is strange, I'm going to pull some resources to hopefully come up with a solution.

 

I also found a similar DF: http://forums.ni.com/t5/Instrument-Control-GPIB-Serial/Using-VB6-GPIB-in-Windows-7/m-p/1330440?requi...

 

Regional Account Manager
NI
0 Kudos
Message 7 of 26
(13,195 Views)

 I have found that Gpib-32.dll is not registered.  I tried the command to register it: Start > Run > regsvr32  c:\windows\System32\Gpib-32.dll.  This produces the message  "The module c:\Windows\System32\gpib-32.dll failed to load.  The specified procedure could not be found."  In explorer I can clearly see that the file is there.

I believe this is the root of the problem but why isn't gpib-32.dll registered and how do I fix it?

ClarkH

0 Kudos
Message 8 of 26
(13,177 Views)

Clark,

 

Did you try the solution from the link to the other discussion forum in the previous post? It has a link to the NI-488.2 2.8 driver that is compatible for Windows 7 and it apparently solved the other poster's problem. Let me know if that works!

 

Regards,

Joe S.

0 Kudos
Message 9 of 26
(13,163 Views)

At first I didn't understand the link.  So now I have downloaded and installed NI488.2 2.8.  I assume that it overwrites the previous installation from the CD rom included with my GPIB-USB-HS.  The original gpib-32.dll was dated May 22, 2003.  After the reinstall it is July 27,2010.  Measurement and Automation works as before showing my device in the tree.

 

When I run my application, the first GPIB command crashes the computer and forces a restart.  It seems we are going backwards on this problem.

0 Kudos
Message 10 of 26
(13,157 Views)