XLINK 500/100 Operations & Maintenance Manual page # 94
SIN, COS, TAN, ARCTAN, eg COS(90) = 0
SQRT is square root, eg SQRT(9) = 3
To raise a number to a power, multiply it by itself. So, for
example, to find x squared, input x*x.
EXP, if EXP(x) = y, then LN(y) = x, eg EXP(1) = 2.718282
LN, natural log, eg LN(2.718282) = 1
LOG, 10 based log, eg LOG(10) = 1
INT returns the integral portion of a real number
INT(11.456) = 11.000 INT(-1.345) = -1.000
FRACT returns the fractional portion of a real number.
FRACT(11.456) = 0.456 FRACT(-1.345) = -0.345
ABS returns the absolute value of a real number.
ABS(11.456) = 11.456 ABS(-1.345) = 1.345
RND provides random integer number between 1 and x.
RND(100) will produce whole number between 1 and 100
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
MINDAY returns minutes into the day.
SECDAY returns seconds into the day.
VREF returns the exact analog voltage reference.
Comparisons can be performed using <, >, <=, >=, !=, and =. The
result of a comparison is 1 for true or 0 for false.
Modulo can be performed using % operator, e.g., 10%2=0, 10%3=1.
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, eg. (X
AND 128) != 0 results 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.
OUTPUT(A,B,C,D) controls one of the 2 digital outputs or 3
switchable voltages.
A is the conditional. If 0, no output happens; if 1 output
activates.
B is the output (1 = DOUT#1, 2 = DOUT#2, 3 = SWD#1, 4 = SWD#2, 5 =
PROT12
C tells whether to switch (0) or to pulse (1)
if switching (C=0), D is direction to drive (0 open, 1
closed. line is open by default.)
if pulsing (C=1), D is duration of the pulse in ms (20
-
10000)
Equations can also contain references to other sensors: eg. (X +
M4)/2, would add X to the value of measurement M4 and divide by 2.
Use Prev1, Prev2, Prev3.. to access the previously made reading by
said measurement. And, use DeltaT1, DeltaT2, Delta T3.. to access
the amount of time in seconds between the most recent and the
previous measurements.
12:00:00 Measurement M1 has made a reading of 1.0
At this point, we do not have enough data to compute Prev1 or
DeltaT1
12:05:00 Measurement M1 has made a reading of 2.0