Campbell Scientific CR9000X Measurement and Control System User Manual

Page 206

Advertising
background image

Section 6. Data Table Declarations and Output Processing Instructions

The output from a LevelCrossing instruction is a one or two dimensional Level
Crossing Histogram. The first dimension is the levels crossed; the second
dimension, if used, is the value of a second input at the time the crossings were
detected. The total number of bins in the histogram = NumLevels*2ndDim.
For a one dimensional level crossing histogram, enter 1 for 2ndDim.

The source value may be the result of a measurement or calculation. Each time
the data table with the Level Crossing instruction is called, the source is
checked to see if its value has changed more then the hysteresis from the
previous value and, if so, has the signal crossed any of the specified crossing
levels
. Only when the value of the first Source element crosses one or more
of the levels set by the Crossing Array, is the count of one or more
(dependent on how many levels were crossed) of the histogram bins
incremented.
The second Source element is compared to the values in the
SecondArray only when a level crossing by the first source element has
occurred.

Histogram's First Dimension: The first dimension of the histogram is broken
up into discrete Crossing Levels according to the values in the Crossing
Array
. The number of Crossing Levels is set by the NumLevels argument.
Therefore, the Crossing Array must be dimensioned to at least the value of the
NumLevels argument.

Histogram's Second Dimension: If a two dimensional Level Crossing
histogram is desired, then the 2ndDim argument (sets the number of Boundary
level values that the second Source element will be compared to) must be
greater than one. The second dimension boundary levels are set by the values
in the 2ndArray. The 2ndArray must be dimensioned to at least the value of
the 2ndDim argument.

Crossing and Boundary Levels: The crossing levels (CrossingArray) for the
first source element and the upper boundary levels (SecondArray) for the
second source element are not specified in the LevelCrossing instruction, but
are contained in variable arrays. This allows the levels to be spaced in any
manner the programmer desires. If a second array is used (SecondDim > 1,
with values loaded into SecondArray), a two dimensional histogram is created.
The levels should be loaded into the arrays sequentially from the lowest
values to the highest.

The array specifying the boundaries of the second dimension is loaded with the
upper limits for each bin. The first bin of the second dimension is always
“open”. Any value less than the specified boundary is included in this bin. The
last bin of the second dimension is always “closed”. It only includes values
that are less than its upper boundary and greater than or equal to the upper
boundary of the previous bin. If you want the histogram to be “open” on both
ends of the second dimension, enter an upper boundary for the last bin that is
greater than any possible second dimension source value.

The hysteresis determines the minimum change in the input that must occur
before a crossing is counted. If the value is too small, “crossings” could be
counted which are in reality just noise. For example, suppose 5 is a crossing
level. If the input is not really changing but is varying from 4.999 to 5.001, a
hysteresis of 0 would allow all these crossings to be counted. Setting the
hysteresis to 0.1 would prevent this noise from causing counts.

6-22

Advertising