EasyManuals Logo

HP 54620A Programmer's Guide

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
Page #25 background imageLoading...
Page #25 background image
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

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the HP 54620A and is the answer not in the manual?

HP 54620A Specifications

General IconGeneral
BrandHP
Model54620A
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals