AcademicCompanyEventsNI Developer ZoneSupportSolutionsProducts & ServicesContact NIMyNI

Document Type: Example Program
NI Supported: Yes

Feedback


Yes No


Related Categories

Related Links - Developer Zone

Language Interface: 16-bit Microsoft C/C++

0 ratings | 0.00 out of 5
| Print Document
This is the GPIB language interface for Microsoft C/C++ (version 7.0 and higher) with the Microsoft Windows Development Kit (SDK, version 3.1 ), a Windows 3 programming environment for creating 16-bit applications. (Note that version 8.0 is also known as Microsoft Visual C/C++ version 1.0.) Download the Msc.zip file (in the example.zip file, below). This file contains the declaration file WINDECL.H, the language interface file GPIB.LIB, and some sample programs.


How to Use the 16-bit Microsoft C/C++ Language Interface:

I. Overview

The 16-bit GPIB language interface for Microsoft C/C++ contains the following files:

WINDECL.H: Win16 C/C++ include file

GPIB.LIB: Win16 C/C++ language interface module

If you have the GPIB Software for Windows 3 installed, the C/C++ language interface and the sample applications are located in the directory called \C (where is where the GPIB software for Windows 3 is installed). The sample applications are QuickWin applications (see below).


II. Items to Include in Your GPIB Application

You must include the following line at the beginning of your application:

#include "windecl.h" Next you need to include the GPIB.LIB 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 Microsoft C/C++ Environment

[From within the Microsoft environment, you can compile, link, and run your application.

To compile the GPIB sample applications, you need to select QuickWin as the Project type.

[ Note: The required key strokes and menu bar selections needed in order to create, compile, and link a project vary with different versions of that particular compiler. For information about how to add files, compile, link, and run a project, please refer to the manuals 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 QuickWin application, called yourprog, with the C/C++ language interface, GPIB.LIB:

cl /Mq yourprog.c gpib.lib

To run the newly created executable, type in the name of your application on the DOS command line, like so:

yourprog


IV. QuickWin

Microsoft C/C++ has a compiler option called QuickWin (the /Mq switch on the command-line compiler). The GPIB sample programs are of the 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 QuickWin 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.
0 ratings | 0.00 out of 5
| Print Document

Reader Comments | Submit a comment »

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).