Example Program - HP 54620A Programmer's Manual

Logic analyzer
Hide thumbs Also See for 54620A:
Table of Contents

Advertisement

Example program

This C program demonstrates the basic command structure used to program
the logic analyzer, and how that command structure is embedded into the C
language.
/*HP Instrument C program using the HP-IB interface
#include <stdio.h>
#include <stdlib.h>
#include "CHPIB.H"
#include "CFUNC.H"
/* Globals used throughout the program */
long isc;
long analyzer;
int
error;
/* errorhandle - This function prints an error message of the screen
/*
regarding the command that caused the error.
void errorhandle( char *function, char *cmdcause )
{
if ( error != NOERR )
{
printf("HPIB error in call to %s with %s, error = %s\n",
function, cmdcause, errstr(error) );
exit(1);
}
}
/* sendstringcmd - this function interfaces to the actual hpib output
/*
functions.
/*
errorhandler function above
void sendstringcmd( char *cmd)
{
error = IOOUTPUTS( analyzer, cmd, strlen(cmd) );
errorhandle("IOOUTPUTS", cmd);
}
int main()
{
isc = 7;
analyzer = 707;
error = IORESET ( isc );
/* Include file for printf, etc */
/* Include file for malloc, etc */
/* HPIB Library constant declarations */
/* HPIB library function prototypes */
It also checks for errors and calls the
/* Assign device address (707) to analyzer */
Programming Getting Started
/* Assign 7 to isc global */
/* Reset the isc */
Example program
*/
*/
*/
*/
*/
*/
25

Advertisement

Table of Contents
loading

This manual is also suitable for:

54620c

Table of Contents