HP E1340A User Manual page 27

Arbitrary function generator
Hide thumbs Also See for E1340A:
Table of Contents

Advertisement

27
Getting Started with the HP E1340A
/* ARB_GEN.C - This program generates a 4096 points ramp. The data to */
/*
generate the ramp is transferred to the AFG as voltages */
/* Include the following header files */
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <cfunc.h>
#define ISC 7L
#define ADDR 70910L /*
/* Functions */
void gen_seg(void);
void cmd_exe(char *commands[], int length);
void run_query(void);
void rst_clr(void);
void send_data(char *commands, float *Wave_seg, int num_size);
void check_error(char *func_tion);
/*********************************************************************************/
void main(void)
{
rst_clr();
gen_seg();
run_query();
}
/*********************************************************************************/
void gen_seg(void)
{
char static *set_commands[] =/* Use "set_commands" to setup the AFG */
{
"SOUR:ROSC:SOUR INT;"
":SOUR:FREQ:FIX 1e3;"
":SOUR:FUNC:SHAP USER;"
":SOUR:VOLT:LEV:IMM:AMPL 5.1V",
"SOUR:LIST:SEGM:SEL a"
},
Continued on next page
/* Use "alloc.h" for Turbo C(c) or C++(c) */
/* This file is from the HP-IB Command Library Disk */
/* Assigns the HP-IB select code */
Assign an I/O path between the computer and the AFG
/* Run the program */
/* Reset the AFG */
/* Generate segment list and output sequence */
/* Query waveform segment memory */
/* Select the Ref. Oscillator */
/* Set waveform frequency */
/*
Command to select the user function
/* Set the amplitude */
/* Select the segment name */
*/
*/
Chapter 1

Advertisement

Table of Contents
loading

Table of Contents