5-130 Example Program
SR785 Dynamic Signal Analyzer
// ******************************************************
// Example program using Microsoft C v7.0 and
// the Capital Equipment Corp CEC488 GPIB interface card.
// To use another interface card, modify the GPIB subroutines
// where indicated.
// The SR785 is assumed to be at address 10 (default).
// Link this object file with ieee488.lib (or the library for your GPIB card).
// ******************************************************
// Connect the Source output to the Ch1 A and Ch2 A inputs!!
// ******************************************************
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <conio.h>
#include <math.h>
#include <ieee-c.h> //This is the CEC header file
//Use the .h file for your interface card.
//send(), enter(), transmit(), rarray(), tarray() are
//CEC routines defined in ieee-c.h
char recv[80]; //global GPIB receive string
char cmd[80]; //global GPIB command string
float rxBuff[401]; //array of IEEE floats to receive binary data
float txBuff[2048]; //array of IEEE floats to send binary data
int status, length; //CEC interface routines use these variables
#define SR785 10 // default GPIB address for SR785
// subroutines at the end of this listing
// you may need to modify these for your interface card!
void TxGpib (int, char *);
void GetGpib (int);
void TxSR785 (char *);
void GetSR785 (char *);
void WaitAvg (void);
double GetData (int, int);
void WaitIFC (void);
void GetSpace (void);
void main (void);
/* ***************************************************** */
void main (void)
{
// ****************************************************
// You can see the commands received and responses generated by the SR785
// by using [System]<Remote><View Qs> to display the interface buffers
// on the screen.
// ****************************************************
int i, mode, type, number, nlen;
long ack;
double dispAVal, dispBVal, octreal, octimag;
printf ("\nSR785 Example Program\n\n");
// ****** initialize your GPIB card here ******
initialize (21,0);
//controller
settimeout (7500);
//GPIB timeout to 7.5 seconds
// ****** Set the SR785 output interface to GPIB!! ******
TxSR785 ("*CLS"); //clear all status words
TxSR785 ("OUTX0"); //direct SR785 responses to GPIB interface
Содержание SR785
Страница 4: ...ii ...
Страница 10: ...viii ...
Страница 80: ...1 64 Exceedance Statistics ...
Страница 158: ...2 78 Curve Fitting and Synthesis SR785 Dynamic Signal Analyzer ...
Страница 536: ...5 136 Example Program SR785 Dynamic Signal Analyzer ...