Command 10 advanced data reduction – Vernier LabPro User Manual
Page 49

Revision Date: 08/02/02
LabPro Technical Manual
49
Command 10
Advanced Data Reduction
This command sets up LabPro to process certain time-intensive algorithms instead of processing them in
the host. This allows large data sets to be processed much more quickly.
Syntax: {10, channel, alg, P1, P2, P3}
Parameter List:
channel
– indicates the channel on which this command operates. The possible values are
Channel number
Description
1 – 4
Analog channels 1 through 4
alg
– algorithm to process..
Alg value
Description
1
At the time this document was written, only the HeartBeat algorithm which
works as follows:
1.
LabPro starts by finding the maximum and minimum points of the
data set. The lower threshold is set at P1 percent of the maximum
point, and the upper threshold is set at P2 percent of the minimum
point.
2.
LabPro checks the difference between the maximum point and
minimum point against P3. If the difference is less than P3, the
algorithm is aborted and a 0.0 is returned. (This is the case where the
user expected the input data to have a certain variation but, for some
reason, the variation was not found.)
3.
LabPro then finds the number of “rising edges” where the data in the
data set is increasing from below the upper threshold and the number
of “falling edges” where the data is decreasing to below the lower
threshold. The total number of rising edges and falling edges is
stored.
4.
Next LabPro determines how many samples are between the first
edge and the last edge. The frequency is then determined as the
number of edges divided by the number of samples and is returned to
the host.
5.
The user program is responsible for taking the result from LabPro
and dividing it by the sample time to get the true frequency in Hz.
P1
– value determines when data transitions from “high” to “low.” This value can be an
integer between zero (0) and one hundred (100) corresponding to 0 to 100 percent of the
lower threshold.
P2
– value determines when data transitions from “low” to “high.” This value can be an
integer between zero (0) and one hundred (100) corresponding to 0 to 100 percent of the
lower threshold. P2 must be greater than P1.
P3
– value determines the minimum difference in data between UpperThld and LowerThld. This
value can be a real value in the units of the channel selected.
Return values: The value returned is result of the algorithm’s calculation.