EasyManua.ls Logo

HP 54620A - Example Program

HP 54620A
92 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
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 file for printf, etc */
#include <stdlib.h> /* Include file for malloc, etc */
#include "CHPIB.H" /* HPIB Library constant declarations */
#include "CFUNC.H" /* HPIB library function prototypes */
/* 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. It also checks for errors and calls the */
/* errorhandler function above */
void sendstringcmd( char *cmd)
{
error = IOOUTPUTS( analyzer, cmd, strlen(cmd) );
errorhandle("IOOUTPUTS", cmd);
}
int main()
{
isc = 7; /* Assign 7 to isc global */
analyzer = 707; /* Assign device address (707) to analyzer */
error = IORESET ( isc ); /* Reset the isc */
Programming Getting Started
Example program
25

Table of Contents

Other manuals for HP 54620A

Related product manuals