Campbell Scientific CR9000X Measurement and Control System User Manual
Page 202

Section 6. Data Table Declarations and Output Processing Instructions
The description is appended to the variable's Processing field (e.g. Avg, Smp) in
the Data Table header.
The maximum size of the Processing Field is 64 characters. This leaves up to
60 characters for the description. A compile error is issued if the user’s
description won’t fit.
Histogram (BinSelect, DataType, DisableVar, Bins, Form, WtVal, LowLim,
UpLim)
The Histogram instruction processes input data as either a standard histogram
(frequency distribution) or a weighted value histogram.
The standard histogram is a representation of the frequency distribution, within
a set of sub-ranges or bins, of the BinSelect variable value. A bin value is
incremented whenever the BinSelect input falls within the sub-range associated
with that bin and the DisableVar parameter is false. To create a standard
histogram, enter a constant for the WtValue parameter. Set the WtValue to 1
in order to increment one of the bins by 1 each time the Data Table is called.
At the time of output, the value that is stored to the data table for each bin can
be either, the current incremented value (set the second digit of the Form
variable to 1) or, the value divided by the summation of all the bin values
(second digit of the Form variable is set to 0). Enter 1 for the WtValue
parameter and 0 for the second digit of the Form parameter to output the
fraction of the frequency that the bin select value was within the bin range (sum
of all bin values will be 1). Set WtValue to 100 in order to output in
percentage (sum of all bins will be 100).
Use a variable for the WtVal parameter to create a weighted value histogram. .
The weighted value histogram, instead of adding a constant value to a bin, adds
the current value of the WtVal variable each time the instruction is executed.
The sub-range that the BinSelect's value is in determines the bin to which the
weighted value is added. As with the standard histogram, when the histogram
is stored to the data table, the value accumulated in each bin can be output or,
the bin values can be divided by the summation of all of the bins' values
(determined by the Form argument). A common use of a closed form weighted
value histogram is the wind speed rose. Wind speed values (the weighted value
input) are accumulated into corresponding direction sectors (Bin Select input).
At the user's option, the histogram may be either closed or open. The open
form includes all values below the lower range limit in the first bin and all
values above the upper range limit in the last bin. When the BinSelect
variable's value is NAN, the open form will increment the upper bin. The
closed form excludes any values falling outside the histogram range. It should
be noted that when using closed form, and setting up the histogram to divide by
total counts, that the time that the BinSelect value is out side of the histogram's
range will be ignored.
For example: Histogram is set up as closed form and the WtValue is set at 100.
If the BinSelect value is outside of the histogram's range 50% of the time (50%
of the time, none of the bin values are being incremented), the accumulated
total output of all of the bin's values will still add up to 100. For this example,
let us assume that Bin 4 has a value of 30. This could lead someone to believe
6-18