- 24 -
DEFINING AND USING VARIABLES
Note: All numbers except for those associated with the timers, are internally
represented as single precision floating point.
Before it can be used in a program, a variable must be defined. There are two forms
of definition, depending whether the variable is to be an unrestricted general purpose
one, or one with a restricted range of valid values, with units associated.
The unrestricted form is:
VAR TurbAvg;
The restricted form allows the values to be limited to a valid range, with an error
being reported if it falls outside this range. The general form is:
VAR VariableName: LowValue TO HighValue, units;
Example:
VAR Flow:0.0 TO 20.0,Gal/sec;
This defines a variable called Flow whose minimum allowed value is 0.0, the
maximum allowed value is 20.0, and whose units are Gal/sec . The data will be
stored with one decimal place, since only one decimal is shown in the Max and Min
values. A value less than 0.0 will trigger an Under range data error in the stored
value, and a value greater than 20.0 will trigger an Over range data error.
The maximum name length for the variable is 10 characters, and is case sensitive.
The maximum units length is 10 characters.
MATHEMATICAL OPERATIONS
The standard math operators are provided, plus seven functions:
*
multiplication
/
division
+
addition
-
subtraction
MAX(A,B)
maximum
MIN(A,B)
minimum
LN(x)
Natural logarithm
EXP(x)
Natural antilog
SQRT(x)
Square root
POW(A,B)
A raised to the B power, A
B
SteinhC(R)
Thermistor temperature from its resistance
The operator precedence is the normal scientific order, as shown above
(multiplication is highest priority, subtraction is lowest).
Summary of Contents for HDL1
Page 1: ...HDL1 HDL1 G5 Data Logger Operating Manual...
Page 2: ......
Page 8: ...iv THIS PAGE INTENTIONALLY LEFT BLANK...
Page 12: ...4 THIS PAGE INTENTIONALLY LEFT BLANK...
Page 20: ...12 THIS PAGE INTENTIONALLY LEFT BLANK...