Section 7. Installation
170
'DataTable(Name, TrigVar, Size)
DataTable
(Temp, TC > 100, 5000)
When the trigger is TC > 100, a thermocouple temperature greater than 100 sets
the trigger to True and data are stored.
7.6.3.16 Programming Expression Types
An expression is a series of words, operators, or numbers that produce a value or
result. Expressions are evaluated from left to right, with deference to precedence
rules. The result of each stage of the evaluation is of type Long (integer, 32 bits) if
the variables are of type Long (constants are integers) and the functions give
integer results, such as occurs with INTDV(). If part of the equation has a
floating point variable or constant (24 bits), or a function that results in a floating
point, the rest of the expression is evaluated using floating-point, 24-bit math,
even if the final function is to convert the result to an integer, so precision can be
lost; for example, INT((rtYear-1993)*.25). This is a critical feature to consider
when, 1) trying to use integer math to retain numerical resolution beyond the limit
of floating point variables, or 2) if the result is to be tested for equivalence against
another value. See Floating-Point Arithmetic
(p. 170)
for limits.
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
'(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.
7.6.3.16.1
Floating-Point Arithmetic
Related Topics:
• Floating-Point Arithmetic
(p. 170)
• Floating-Point Math, NAN, and ±INF
(p. 507)
• TABLE: Data Types in Variable Memory
(p. 137)
All arithmetic in the CR3000, and all declared variables, are single precision IEEE
four-byte floating point.
A few operations are performed as double precision. These are AddPrecise(),
Average(), AvgRun(), AvgSpa(), CovSpa(), MovePrecise(), RMSSpa(),
StdDev(), StdDevSpa(), Totalize(), and TotRun().
Floating-point arithmetic is common in many electronic, computational systems,
but it has pitfalls high-level programmers should be aware of. Several sources
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......