Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Programming PCI-GPIB with Borland 4.5

I'm upgrading a system from a GPIB-PCIIA to a PCI-GPIB+ using GPIB ver 2.2
 
The compiled Windows code previously is using GPIB.DLL(1992) and windecl.h(1992)
 
Currently this is typical compile line  of one of the several C files in the makefile:
    bcc -c -w -ml! -WDE -3 -O2bceglmpv -Z -d -I$(INCL);$(SYSTEM) -L$(LIB) cds.c
and the link command
    bcc -w -ml! -WDE -3 -O2bceglmpv -Z -d -M -l-c @common.rsp gpib.lib
 
I am having trouble understanding what has to be changed for the new ver 2.2
 
The NI-488.2 User manual (p4.12) says #include <windows.h> and #include "ni488.h"
and link with BorlandC_gpib-32.obj
 
Or would the Direct Entry with C and gpib-32.dll be the better approach.
 
BTW, in a DOS window executing the Make file, BorlandC_gpib-32.obj had to be renamed to 8 characters
 
regards
Scott Youngren
Senior Test Engineer -(sometimes programmer!)
Northrop Grumman Navigation Systems
0 Kudos
Message 1 of 9
(4,875 Views)
 

Hi Scott,

Since you are using version 4.5 of Borland C/C++, I would recommend following the instructions from the NI-488.2 User Manual for Borland C/C++.  Please let me know if you have any questions.

Regards,

Rima

Rima H.
Web Product Manager
0 Kudos
Message 2 of 9
(4,838 Views)

Yes, I am reading the NI488-2 User manual, part of the Version 2.2.

I'm trying to understand the difference between the example on page 4-12 using "borlandC_gpib-32.obj"

and the Direct entry process into the gpib-32.dll.

I compiled my single C file which talks to the gpib card using bcc32 and linking with "borlandC_gpib-32.obj",

But the linker (16bit)  does not like the fact that my new object file has 32bit stuff in it.

So maybe the answer is the Direct-Access method.

Does that help explain my situation?

BTW, CVI examples do work, as does the interactive, with my target instrument (an antique Colorado data Systems).

The REAL problem is that the management won't fund moving into 32bit code: "CVI" or others. So I am forced to keep

"band-aid"ing the Borland code.

thanks

Scott

0 Kudos
Message 3 of 9
(4,835 Views)

Hi Scott,

The 16-bit linker will not work with the Borland method, since the Borland method requires using the 32-bit .obj.  You will need to use the Direct Entry method, but you still may run into problems if you are not able to update to 32-bit code.  There may be an older driver that is compatible with both 16-bit code and the PCI-GPIB+.  The best method in this situation is the Direct Entry method.

Regards,

Rima

Rima H.
Web Product Manager
0 Kudos
Message 4 of 9
(4,822 Views)

Hi Scott,

With versions 2.2 through 2.5 of the NI-488.2 driver, you can enable DOS support, as long as you're not using Windows Vista.  Enabling DOS support will help you use the 16-bit linker with your driver.  To do this, open Measurement & Automation Explorer, then go to Tools >> NI-488.2, and then select DOS Support.

Regards,

Rima

Rima H.
Web Product Manager
0 Kudos
Message 5 of 9
(4,813 Views)

Rina

Yes, I have enabled the DOS support button.

Actually, I have created a small test program compiled for DOS using Borland 4.51, and it works.

I'm going to explore the direct method for the Windows test program. (on Friday 23rd ,a holiday for me, but I'm determined to figure this out.)

Have a nice thanksgiving. and thanks. I'll let you know the progress!

 

Scott Youngren

0 Kudos
Message 6 of 9
(4,810 Views)
 

Scott,

From your first post, you indicated that you were compiling using the header file, windecl.h. and linking in the library, gpib.lib. This means you are compiling and running a Win16 application.

The sample programs and the Language Interfaces that get installed with GPIB version 2.2 for Windows are for Win32 applications.

But all is not lost! You can still compile and run a Win16 application on a Win32 operating system! You can refer to 16-bit Borland C++ web page for more information about how to compile and link. From there you can download a couple of samples along with the header and library files.

Contrary to what Rima said, you do not need to use Direct Entry nor do you need to enable DOS support.

Hope this information helps.

gpibtester

0 Kudos
Message 7 of 9
(4,797 Views)

GPIBTESTER

I wanted to move to the PCI-GPIB card because of limited ISA slots availability.

Is it possible that I should NOT be trying to use the PCI-GPIB+ and ver 2.2?

or, should I use an older GPIB driver version that stays in the Borland 16 bit world?

I do have the DOS/Windows 2.7.1 and the Windows 1.7 s/w.

Maybe one of my problems is understanding what s/w works with what gpib cards.

Meanwhile I will look at the borland page you suggested.

I'll check-in to MY NI  on Friday from home!

thanks

Scott - every little bit/byte of info surely helps.

0 Kudos
Message 8 of 9
(4,793 Views)
Scott,
 
A lot of effort goes into maintaining backward compatibility. You should be able to run your exisiting Borland C++ application with the newer GPIB card and the newer version of the GPIB driver. If you want to compile and link your application, simply download the zip file from the Borland C++ page to get the windecl.h and gpib.lib files that you need.
 
And just because the Version 2.2 driver does not install the Win16 header files and gpib library, it does not mean you cannot compile and run a Win16 application on a Win32 operating system.
 
Hope this helps clear things up.
 
gpibtester
 
0 Kudos
Message 9 of 9
(4,739 Views)