This is the GPIB language interface for Borland C/C++ (version 4.0 and higher), a Win32 programming environment for creating 32-bit applications. Download the "Borlandc.exe" file (in the example.zip file, below). This file contains the declaration file DECL-32.H, the language interface file BORLANDC_GPIB-32.OBJ, and some sample programs. This download is not necessary when using the latest version of NI-488.2. NI-488.2 includes files for all supported programming environments.
How to Use the 32-bit Borland C/C++ Language Interface:
I. Overview
The 32-bit GPIB language interface for Borland C/C++ contains the following files:
DECL-32.H: Win32 C/C++ include file
BORLANDC_GPIB-32.OBJ: Win32 C/C++ language interface module The Borland C/C++ language interface and the sample applications are located in the directory called "gpibpath" \LangInt\BorlandC (where "gpibpath" is where the GPIB Software for Windows is installed). The sample applications are Console Applications (see below).
II. Items to Include in Your GPIB Application
You must include the following lines at the beginning of your application:
#include
#include "decl-32.h" Next you need to include the BORLANDC_GPIB-32.OBJ file in your application's project file along with your application.
[ Note: The required key strokes and menu bar selections needed in order to add a file to a project can vary with different versions of that particular compiler. For information about how to add files, please refer to the manuals and online help that came with your version of the compiler. ]
III.A. Compiling, Linking, and Running from the Borland C/C++ Environment
From within the Borland environment, you can compile, link, and run your application.
To compile the GPIB sample applications, when you create a new project, you need to make the following selections:
Target Type: Application (.exe)
Platform: Win32
Target Model: Console [ Note: The required key strokes and menu bar selections needed in order to create, compile, and link a project can vary with different versions of that particular compiler. For information about how to compile, link, and run a project, please refer to the manuals and online help that came with your version of the compiler. ]
III.B. Compiling, Linking, and Running from the DOS Command Line
From the DOS command line, type in the following in order to compile and link a Console Application, called "yourprog", with the C/C++ language interface, BORLANDC_GPIB-32.OBJ:
bcc32 -w32 yourprog.c borlandc_gpib-32.obj To run the newly created executable, type in the name of your application on the DOS command line, like so:
yourprog
IV. Console Application
Borland C/C++ has a compiler option called Console Application (the "w32" switch on the command-line compiler). All the GPIB sample programs are of this type. They illustrate how to use the function calls exported by the GPIB driver. It is simple to create Windows applications without knowledge of Windows Graphical User Interface (GUI) programming. A Console Application is a Windows program which uses text-based input and output, not a graphical interface. This allows you to quickly create a Windows application by using simple input and output functions like printf and scanf.
L’exemple de code provenant de l’échange d’exemple de code au sein de la communauté NI détient une licence MIT .