Sutron Corporation X-Link Operations & Maintenance Manual, Rev 1.63 5/24/2016 pg. 75
ABS returns the absolute value of a real number.
ABS(11.456) = 11.456 ABS(-1.345) = 1.345
POLY is used to compute up to a 5th level polynomial equation:
POLY(x, A, B, C, D, E, F) equates to A + Bx + Cx^2 + Dx^3 + Ex^4 + Fx^5
STEINHART(x, A, B, C) is used for Steinhart-Hart equations,
where x is the resistance and result is the temperature in Celsius
A, B and C are thermistor specific constants
Steinhart result is computed like so:
1/(A + B*ln(x) +C*(ln(x)^3)) - 273.15
VREF = Internal value of VREF (about 2.5Volts)
X/VREF*355 (for wind direction scaling)
Comparison can be performed using <, >, <=, >=, !=, and =. The result of a
comparison is 1 for true or 0 for false.
The following bitwise Boolean operators are supported: AND, OR, XOR, SHL, and
SHR. The last two are shift-left and shift-right. For instance (X SHL 4) would shift
X left by 4 bits. AND & OR can also be used in logical expressions. For instance
(X>100) OR (X<50)
would result in 1 if X is above 100 or below 50; otherwise it would result in 0.
The NOT operator is logical not bitwise. This means that NOT 0 is 1 and NOT 1 is
0. Also, the NOT of any non-zero number is 0.
E.g. (X AND 128) != 0results in a 1 if bit 7 in X is set or 0 if bit 7 is clear. The bit
mask 128 is 2^7. This assumes bit 0 is the least significant bit. In general, the bit
mask for any bit N is 2^N.
PULSE12(A,B) is used to turn on the X-Link digital output (DOUT) for a short
duration. A is a conditional that must be true in order for the unit to turn on
DOUT. B is the duration to turn on DOUT for in milliseconds, with a 10 second
maximum.
PULSE12(X>10.5, 500) will turn on DOUT for 500 milliseconds if the reading is
greater than 10.5.