User`s manual
• For Borland compilers, type:
MAKE <project_name>>.MAK and press Enter
• For Microsoft® compilers used in Windows, type:
NMAKE <project_name>.MAK and press Enter
From the Windows Interface
Select the C/C++ Windows environment and make sure the program to be
compiled and the appropriate libraries are in a project file. Then do the
following:
• For Borland compilers, select:
Project | Open Project to open the project, then
Compile | Build All to compile the program
• For Microsoft compilers used in Windows, type:
Project | Open to open the project, then
Project | Re-build All to compile the program
Typical Visual C/C++
Example Program
Using Agilent SICL
Following is an example program written in Visual C/C++ using the
Agilent Standard Instrument Control Library. The program:
– sends commands to the AFG to generate an arbitrary waveform;
– receives data from the AFG;
– shows how to send coupled commands;
– and performs error checking of the AFG.
// ARBWAVE.C - This program generates a 100 points ramp. The data to generate
// the ramp is transferred to the AFG as voltages
// Include the following header files
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <malloc.h> // Use "alloc.h" for Turbo C(c) or C++(c)
#include <sicl.h> // Included with SICL
#define DEV_ADDR "hpib7,9,10" // Assign the GPIB address
// Functions
void gen_seg(void);
void cmd_exe(char *commands[], int length, char *func_tion);
void rst_clr(void);
void send_data(char *commands, float *Wave_seg, int num_size);
void run_query(void);
void check_error(char *func_tion);
void time_out(char *func_name);
Continued on Next Page
Chapter 1 Getting Started 41