Specifications

120 Chapter 8
Statistical Analysis of Measurement Results
Sample Program
Sample Program
Example 8-1 shows a sample program that demonstrates how to perform statistical
analysis. You can find the source file of this program, named stat.bas, on the sample
program disk.
The sample program performs statistical analysis on the specified measurement items and
then retrieves and displays the results of the analysis.
The program is described in detail below:
Line 60 Sets the GPIB address.
Lines 80 to 130 Checks the number of measurement data segments for statistical
analysis stored in the volatile memory. If no such data exists, the
program displays a message and terminates.
Lines 150 to 470 Checks whether each measurement item is currently shown or hidden
and stores the names of the currently shown items into the Title(*)
array and the number of the shown items into the Number variable.
The measurement items include measurement parameters 1 through 4,
the monitored values of the test signal current and voltage levels, and
the result of R
dc
measurement.
Lines 490 to 520 If Number is 0, the program displays a message and terminates.
Line 540 Allows the user to return to the entry start line and re-enter the data if
an error (such as an invalid entry) occurs while selecting the numbers
identifying the measurement items on which to perform statistical
analysis.
Lines 560 to 630 Displays the list of items that can be statistically analyzed and prompts
the user to choose one of the items by typing in the appropriate
number.
Line 640 Converts the entered value into an integer and stores it into the Item
variable.
Line 650 If the Item is not an integer between 1 and Number, returns to the entry
start line.
Lines 690 to 700 Displays the names of the measurement items selected for statistical
analysis and then passes control to a subprogram named Stat_ana to
perform statistical analysis and display the results.
The Stat_ana subprogram in lines 760 to 1260, which performs statistical analysis, is
described below.
Lines 810 to 820 Retrieves the list (1)/single-point (0) measurement setting and stores
the setting into the List_stat variables.
Lines 840 to 850 If list measurement is specified (List_stat variable = 1), the program
retrieves the number of measurement points and stores the data into
the Nop variable.
Line 870 If single-point measurement is specified (List_stat 1 variable not equal
to 1), the program stores 1 into the Nop variable.
Lines 900 to 930 Performs the measurement items identified by the Item variable and