Chapter 4 Making Measurements 123
operation. That is the readings do not have to be recalled from memory in
order to perform the STAT operation. Also notice that the readings must be
stored before enabling the post-process STAT operation (if not, the
MEMORY ERROR will occur).
10 OUTPUT 722;"PRESET NORM" !PRESET, NRDGS 1,AUTO, DCV 10, TRIG SYN
20 OUTPUT 722;"MEM FIFO" !ENABLE READING MEMORY, FIFO MODE
30 OUTPUT 722;"NRDGS 20" !20 READINGS PER TRIGGER
40 OUTPUT 722;"TRIG SGL" !TRIGGER READINGS
50 OUTPUT 722;"MMATH STAT" !PERFORM POST-PROCESS STAT OPERATION
60 OUTPUT 722;"RMATH SDEV" !READ STANDARD DEVIATION
70 ENTER 722;S !ENTER STANDARD DEVIATION
80 PRINT S !PRINT STANDARD DEVIATION
90 END
Pass/Fail The PFAIL math operation tests each reading against the limits set in the
MAX and MIN registers. If a boundary is exceeded, the hi/low bit of the
status register is set. Also, the number of readings that passed the PFAIL
operation before a failure was encountered are logged in the PFAILNUM
register. The default value is 0 for both the MAX and MIN registers. You
can change the value in either register using the SMATH command.
The following program uses the real-time PFAIL operation to check 20 DCV
readings against the high and low limits of 11V and 9V. After the readings
have been triggered, the HI/LO LIMIT bit of the status register (bit 2) is
checked. If one or more failures occurred, the PFAILNUM register is queried
and its contents returned.
10 OPTION BASE 1 !COMPUTER ARRAY NUMBERING STARTS AT 1
20 DIM Rdgs(20) !DIMENSION ARRAY FOR 20 READINGS
30 OUTPUT 722; "PRESET NORM" !PRESET, NRDGS 1,AUTO, DCV 10, TRIG SYN
40 OUTPUT 722;"MATH PFAIL" !ENABLE REAL-TIME PFAIL OPERATION
50 OUTPUT 722;"SMATH MIN 9" !LOWER LIMIT = 9(V)
60 OUTPUT 722;"SMATH MAX 11" !UPPER LIMIT = 11(V)
70 OUTPUT 722;"CSB" !CLEAR STATUS REGISTER
80 OUTPUT 722;"RQS 2" !ENABLE HI/LO STATUS REGISTER BIT
90 OUTPUT 722;"NRDGS 20" !20 READINGS/TRIGGER
100 ENTER 722;Rdgs(*) !SYN EVENT, ENTER READINGS
110 OUTPUT 722; "STB?" !QUERY SET BITS IN STATUS REGISTER
120 ENTER 722;A !ENTER QUERY RESPONSE
130 IF BINAND(A,2) THEN !IF BIT 2 IS SET:
140 PRINT "HI/LOW LIMIT TEST FAILED"!PRINT FAILURE MESSAGE
150 OUTPUT 722; "RMATH PFAILNUM" !QUERY PFAILNUM REGISTER
160 ENTER 722;B !ENTER QUERY RESPONSE
170 PRINT "NUMBER OF READINGS THAT PASSED BEFORE FAILURE WERE";B
175 !PRINT PFAILNUM RESPONSE
180 ELSE!IF BIT 2 WAS NOT SET:
190 PRINT "HI/LOW LIMIT TEST PASSED"!PRINT TEST PASSED MESSAGE
200 END IF
210 END
The following program is similar to the preceding program except that it uses
the post-process PFAIL operation on 20 readings stored in memory. The post
process PFAIL operation is a batch operation. That is, the readings do not
have to be recalled from memory in order to perform the PFAlL operation.
Also notice that the readings must be stored before enabling the post process
PFAIL operation (if not, the MEMORY ERROR will occur).