Program template for gpib – GW Instek GDS-800 Series Programming Manual User Manual

Page 81

Advertising
background image

GDS-806/810/820/840 Programming Manual

80

6. Program Template for GPIB

/* Filename - gds820ex1.c

*

* This is an example program written in C. We use a NI's GPIB interface

* card and one X86 PC to control GDS-806/810/820/840. This program could

* get the waveform data from GDS-806/810/820/840, and save them to a file.

* You can use Microsoft Visual C++ or Borland C++ Builder to compile this

* file. And you must link this file with an object file

* (BORLANDC_GPIB-32.OBJ) for Borland C++ or GPIB-32.OBJ for Visual C++ )

* that provided by National Instruments Corporation. DECL-32.H is a

* Win32 C/C++ include file, that contains NI-488.2 function prototypes

* and various pre-defined constants. It's also provided by NI.

*

* Copyright GOOD WILL INSTRUMENT

* All Rights Reserved.

*/

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

/*

* Include the WINDOWS.H and DECL-32.H files. The standard Windows

* header file, WINDOWS.H, contains definitions used by DECL-32.H and

* DECL-32.H contains prototypes for the GPIB routines and constants.

*/

#include <windows.h>

#include "decl-32.h"

#define ARRAYSIZE 1100 /* Size of read buffer */

#define BDINDEX 0 /* Board Index */

#define PRIMARY_ADDR_OF_DMM 7 /* Default primary address of GDS-

806/810/820/840*/

#define NO_SECONDARY_ADDR 0 /* Secondary address of device */

#define TIMEOUT T3s /* Timeout value = 5 seconds */

Advertising