Chapter 3 Programming Your Universal Counter for Remote Operation
Programming Examples
3-92
Programming Guide
To Make a Frequency Measurement (Turbo C) (Continued)
for (i=1; i<=samples ;i++)
{
sendhp("INIT"); /* Start a measurement */
s endhp("FETCH:FREQUENCY?");
IOENTERS(ctr,freq,&length); /* fetch the data */
length=strlen(freq); /* Get length of result so */
freq[length-1]='\0'; /* the linefeed can be removed */
printf ("Frequency %d = %s Hz\n",i,freq);
}
printf("Press a key to continue\n");
getch();
}
/* Function to send command to HP 53131A */
void sendhp(hpib_cmd)
char *hpib_cmd;
{
char hpcmd[80]; /* Variables used by function */
int length;
strcpy(hpcmd,hpib_cmd);
length=strlen(hpcmd);
error=IOOUTPUTS(ctr,hpcmd,length); /* Send command to HP 53131A */
if (error!=0)
printf("Error during HP-IB: %d Command %s\n",error,hpcmd);
}
Summary of Contents for 53131A
Page 1: ...Programming Guide HP 53131A 132A 225 MHz Universal Counter ...
Page 2: ......
Page 13: ...1 1 Before You Start ...
Page 24: ...Chapter 1 Before You Start Related Documentation 1 12 Programming Guide ...
Page 25: ...2 2 Command Summary A Quick Reference ...
Page 68: ...Chapter 2 Command Summary RST Response 2 44 Programming Guide ...
Page 69: ...3 3 Programming Your Universal Counter for Remote Operation ...
Page 167: ...4 4 Command Reference A Dictionary ...
Page 310: ...Chapter 4 Command Reference WAI Wait to Continue Command 4 144 Programming Guide ...
Page 311: ...5 5 Errors ...
Page 329: ......
Page 330: ...H Manual Part Number 53131 90044 Printed in U S A NOVEMBER 1996 ...