Specifications

Section 9. CR1000 Programming
9-22
EXAMPLE 9.12-3. CRBASIC Code: Use of Arrays as Multipliers and Offsets
Public Pressure(3), Mult(3), Offset(3)
DataTable (AvgPress,1,-1)
DataInterval (0,60,Min,10)
Average (3,Pressure(),IEEE4,0)
EndTable
BeginProg
'Calibration Factors:
Mult(1)=0.123 : Offset(1)=0.23
Mult(2)=0.115 : Offset(2)=0.234
Mult(3)=0.114 : Offset(3)=0.224
Scan (1,Sec,10,0)
'VoltSe instruction using array of multipliers and offsets:
VoltSe (Pressure(),3,mV5000,1,True,0,_60Hz,Mult(),Offset())
CallTable AvgPress
NextScan
EndProg
Read more! More information is available in CRBASIC Editor Help topic
“Multipliers and Offsets with Repetitions”.
9.13 Expressions
An expression is a series of words, operators, or numbers that produce a value
or result. Two types of expressions, mathematical and programming, are used
in CRBASIC. A useful property of expressions in CRBASIC is that they are
equivalent to and often interchangeable with their results.
Consider the expressions:
x = z * 1.8 + 32 (a mathematical expression)
If x = 23 then y = 5 (programming expression)
The variable x can be omitted and the expressions combined and written as:
If z * 1.8 + 32 = 23 then y = 5
Replacing the result with the expression should be done judiciously and with
the realization that doing so may make program code more difficult to
decipher.
9.13.1 Floating Point Arithmetic
Variables and calculations are performed internally in single precision IEEE 4
byte floating point with some operations calculated in double precision.