Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make calls to my NI GPIB-PCI board using VC++ 1.52?

Solved!
Go to solution

I am trying to make calls to my new NI GPIB-PCI board using an application that was developed using MSVC++ 1.52 on a Windows 98 OS. Using MAX I can see the board and communication to instruments on the GPIB works fine but when I try to use my application it keeps telling me that it can't find the device. I think the problem is that the application can't find the GPIB board. I decided to rebuild the application using the new API but then I realized that the new API is for 32 bit environments. MSVC++ 1.52 is a 16 bit environments. Any ideas how I can make this happen?

 

Thanks

0 Kudos
Message 1 of 21
(5,542 Views)

Hey Kuhlman,

 

Just for clarification I'd like to make sure we understand the issue.  So your PCI-GPIB card is installed in a machine running Windows 98, you have a MSVC++ program that can't see the device.  You developed a new program using a new API, but that new program is now a 32-bit application and won't run on the Windows 98 machine?  Is that a correct overall description of the problem?  Also, what new API did you use to the develop the new program?

 

Thanks,

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
Message 2 of 21
(5,527 Views)

I guess I need to state the problem more carefully,

 

I installed a new PCI-GPIB board in a Windows 98SE system which I hope to use to communicate with an Elgar power supply. I have also installed the accompaning  NI-488.2 software (v2.2) to drive the GPIB board. Communication between the MAX included with this software and the power supply works fine. The problem is that I need to run a program that was written in MSVC++ 1.52 that does not seem to recognise the GPIB board. I can rebuild the test program in MSVC++ 1.52 but I do not want to spend time porting the code to a new MS platform (this will likely take months). The test program that I have uses an old GPIB board driver that was intended for use on Windows 3.1 with a GPIB-PCII/IIA interface board. That is, the test program is linked to the GPIB.lib that came with the original GPIB-PCII/IIA interface board. Is the problem that I am having due to the fact that the NI-488.2 software (v2.2) is 32-bit and the test program is 16-bit (I think MSVC++ 1.52 is a 16 bit based application)? Can I rebuild the test program providing a link to the GPIB-32.obj? I have already tried this and MSVC++ 1.52 got very upset I think because this is a 32-bit app and MSVC++ 1.52 is a 16-bit program.Is there another earlier driver package for the PCI-GPIB board that will work?

0 Kudos
Message 3 of 21
(5,519 Views)

Hey Kuhlman,

 

Can you provide the model number or serial number off of the GPIB card you're wanting to use? This will help us determine whether or not there's a 16-bit driver available for that card that you could possible use.  I'm also currently looking into what options you have for meshing the 16-bit app with the 32-bit driver.


Thanks,

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 4 of 21
(5,503 Views)

Hey Kuhlman,

 

I found this KnowledgeBase article that addresses the exact thing you need.  Try reviewing the information and see if this helps you determine how to fix your 16-bit and 32-bit incompatibility issue.

 

Thanks,

David Pratt
Group Manager for Application Engineering Specialists | Automated Test
NIC
0 Kudos
Message 5 of 21
(5,494 Views)

David,

 

Thanks for the info about the links. I have read most of those notes before and tried the appropriate suggestions (including turning on DOS support) without success.

 

My GPIB board serial number is 0x01378950.

 

I think the basic problem is that my application does not make calls to the gpib.dll. I have confirmed this by running NI Spy and no calls to the dll are made. To remedy this I would normaly link the dll to my source code in the build process. MSVC++ 1.52 does not seem to allow me to link to dlls.When I try to include the gpib-32.obj file included with NI-488.2 v2.2 I get an error. I think this error is because this is a 32 bit object file and MSVC++ 1.52 is a 16 bit application but I am not sure. I was hoping an earlier version of the NI-488.2 code might have a 16 bit object file that I can link to my application and rebuild.

 

Thanks for all your help.

 

Erich

 

0 Kudos
Message 6 of 21
(5,478 Views)

Erich,

 

The 16-bit version of the Language Interface is available for MSVC++ 1.52! Please refer to Language Interface: 16-bit Microsoft C/C++ to download the Language Interface files and a couple of sample programs. The web page also contains information about what you need to include in your application when compiling.

 

Hope this information helps!

 

gpibtester

Message Edited by gpibtester on 02-12-2009 09:29 AM
0 Kudos
Message 7 of 21
(5,469 Views)

gpibtester,

 

Your recommendation:

 

"The 16-bit version of the Language Interface is available for MSVC++ 1.52! Please refer to Language Interface: 16-bit Microsoft C/C++ to download the Language Interface files and a couple of sample programs. The web page also contains information about what you need to include in your application when compiling."

 

Is exactly what I am doing in the code but I still have no communication to the GPIB board.

 

I have tested the board response using MAX and the "Getting Started Wizard" and both checkout fine. Is there any chance that I need to change the resource settings?

 

This is getting very frustrating.

 

Erich

 

 

0 Kudos
Message 8 of 21
(5,456 Views)

Erich,

 

I am sorry to hear that you are still having problems!

 

In an effort to figure out why you are able to see the Instrument in MAX (Measurement & Automation Explorer) but not with your code, I am asking you to do a favor for me.

 

I would like to see a case of where MAX recognizes your Instrument:

 

1. Setup NI Spy to start capturing (Performing a Good NI Spy Capture for Debugging/Troubleshooting)

2. In MAX, select the GPIB Interface. Next right-click on it. In the drop-down list, select Scan for Instruments.

3. Stop the NI Spy capture.

4. Save the file.

5. Attach the file to this thread.

 

Next, I would like you to send a code snippet that shows how you open a handle to a Board or Device along with the read/write calls.

 

With the above requested information, I think we will be able to figure out what's awry.

 

Thanks for bearing with us as we try to figure this out together!

 

gpibtester

0 Kudos
Message 9 of 21
(5,451 Views)

gpibtester,

 

I will definitely do exactly what you asked. I have run the NI Spy in the past to see activity. Unfortunately I have to meet my tax guy right now so I won't be able to give you that info til tomorrow. I look forward to working with you to try to find a solution.

 

Thanks again,

Erich

0 Kudos
Message 10 of 21
(5,447 Views)