Compiling And Linking; The Complete Application Program In C - National Instruments GPIB-PCII Getting Started

Hide thumbs Also See for GPIB-PCII:
Table of Contents

Advertisement

Writing an Advanced Program Using NI-488.2 Routines

Compiling and Linking

To create an executable program, complete the following steps:
1. Copy the QuickBASIC 4.5 language interface (QBIB.OBJ) from the
C:\GPIB-PC directory, which was set up during installation, into your
QuickBASIC directory (C:\QB45 in this example).
2. Compile the application program (assume the example program you just
created is in a file called ACVOLTS.BAS).
bc /o acvolts.bas;
3. Link in the language interface by entering the following command:
link acvolts.obj+qbib.obj;
link creates an executable file named ACVOLTS.EXE.
4. If you have a Fluke 45 DVM, run the program by entering the following
command:
acvolts

The Complete Application Program in C

The same program written in Microsoft C is shown below for those of you who
are programming in C.
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "c:\gpib-pc\decl.h"
#define
MAVbit
bit.*/
char buffer[101];
int loop, m;
int num_listeners;
double sum;
unsigned int instruments[32], result[32], fluke;
unsigned int statusByte;
int SRQasserted;
PCII/IIA and NI-488.2 MS-DOS
0x10
/* Position of the Message Available
3-12
<Enter>
<Enter>
<Enter>
© National Instruments Corp.
Chapter 3

Advertisement

Table of Contents
loading

This manual is also suitable for:

Gpib-pciia181065-01181065-02

Table of Contents