122 Chapter 4 Making Measurements
60 ENTER 722;A !SYN EVENT, ENTER DBM
70 PRINT A !PRINT DBM
80 END
For example, if the input voltage is 10V, the power is:
10
·log
10
(10
2
/8/1 mW)= 40.97dBm
The following program is similar to the preceding program except that it uses
the post-process DBM operation.
10 OUTPUT 722;"PRESET NORM" !PRESET, NRDGS 1,AUTO, DCV 10, TRIG SYN
20 OUTPUT 722;"ACV" !AC VOLTAGE MEASUREMENTS, AUTORANGE
30 OUTPUT 722;"SETACV ANA" !ANALOG ACV METHOD
40 OUTPUT 722;"MEM FIFO" !ENABLE READING MEMORY, FIFO MODE
50 OUTPUT 722;"SMATH RES 8" !WRITE 8 TO RES REGISTER
60 OUTPUT 722;"MMATH DBM" !ENABLE POST-PROCESS DBM OPERATION
70 OUTPUT 722;"TRIG SGL" !TRIGGER READING
80 ENTER 722;A !RECALL READING USING IMPLIED READ,
85 !PERFORM DBM OPERATION
90 PRINT A !PRINT DBM RESULT
100 END
Statistics The STAT math operation performs five calculations on a group of readings
and stores the results in five math registers. The calculations are: standard
deviation, mean, number of samples, largest reading, and smallest reading.
Table 24 shows the STAT registers and their contents. You can read any of
the STAT registers using the RMATH command.
The following program uses the real-time STAT operation to perform five
running calculations on 20 DC voltage readings. After the readings are taken
and transferred to the controller, the standard deviation is read and 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"NRDGS 20" !20 READINGS PER TRIGGER
50 OUTPUT 722;"MATH STAT" !ENABLE REAL-TIME STAT OPERATION
60 ENTER 722 Rdgs(*) !SYN EVENT, ENTER READINGS
70 OUTPUT 722;"RMATH SDEV" !READ STANDARD DEVIATION
80 ENTER 722;S !ENTER STANDARD DEVIATION
90 PRINT S !PRINT STANDARD DEVIATION
100 END
The following program performs the post-process STAT operation on 20
readings stored in memory. The post,-process STAT operation is a batch
Table 24: STAT Registers
Register Stored Result
SDEV Standard deviation
MEAN Average of the readings
NSAMP Number of readings in this group of measurements
UPPER Largest reading in this group of measurements
LOWER Smallest reading in this group of measurements