Chapter 3 Programming Your Universal Counter for Remote Operation
Elements of SCPI Commands
Programming Guide
3-93
To Use Limits to Filter Data Before Measuring Statistics (Turbo
C)
/* This program instructs the counter to determine the statistics of
50 Period measurements that are within programmed test limit values.
Periods that are outside of the limits are not included in the statistics.
The Limit graph is displayed so you can see if measurements are in limit.
To alert the program that the statistics are ready, bit 8 in the Operation
Status Register is used. When statistics are being calculated, this bit is
high, when they are complete, this bit goes low. By using the transition
filters, an SRQ can be generated when statistics are complete (the
transition from high to low of bit 8 in the Operation Status register.)*/
#include <stdio.h> /* used for printf() */
#include <dos.h> /* used for delay() */
#include "CHPIB.H" /* HP-IB library constant declarations */
#include "CFUNC.H" /* HP-IB library function prototypes */
void sendhp(char *); /* function to send command to counter */
/* global data */
long ctr=703; /* Counter is at address 03. HP-IB is at select code 7 */
int error;
void main()
{
long isc=7; /* Select code 7 */
int condition=1; /* Used in IOSTATUS */
int status; /* Used in IOSTATUS */
int state=1; /* Used in IOEOI */
char mean[23]; /* mean variable */
char minimum[23]; /* minimum variable */
char maximum[23]; /* maximum variable */
char sdev[23]; /* standard deviation variable */
int length=23; /* Used in IOENTERS */
clrscr(); /* Clear the computer CRT */
IORESET(isc); /* Clear the HP-IB interface */
sendhp("*RST"); /* Reset the counter */
sendhp("*CLS"); /* Clear event registers and error queue */
sendhp("*SRE 0"); /* Clear service request enable register */
sendhp("*ESE 0"); /* Clear event status enable register */
sendhp(":STAT:PRES"); /* Preset enable registers and transition
filters for operation and questionable
status structures */
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 ...