Section 9. Programming
88
CRBASIC EXAMPLE. Use of Variable Arrays to conserve Code
p. 88 shows
example code to convert five temperatures in a variable array from C to F:
CRBASIC EXAMPLE 15.
Use of Variable Arrays to Conserve Code Space
For I = 1 to 5
TempC(I) = TempC(I) * 1.8 + 32
Next I
9.10.3 Logical Expressions
Measurements can indicate absence or presence of an event. For example, an
RH measurement of 100% indicates a condensation event such as fog, rain, or
dew. The CR200(X) can render events into binary form for further processing,
i.e., events can either be TRUE, indicating the condition occurred or is
occurring, or FALSE, indicating the condition has not yet occurred or is over.
Several words are commonly interchanged with True / False such as High /
Low, On / Off, Yes / No, Set / Reset, Trigger / Do Not
Trigger. The CR200(X) understands only True / False or -1 /
0, however. The CR200(X) represents "true" with "-1"
because AND / OR operators are the same for logical
statements and binary bitwise comparisons.
In the binary number system internal to the CR200(X), "-1" is expressed with
all bits equal to 1 (11111111). "0" has all bits equal to 0
(00000000). When -1 is ANDed with any other number, the
result is the other number. This ensures that if the other
number is non-zero (true), the result is non-zero.
Using TRUE or FALSE conditions with logic operators such as AND and OR,
logical expressions can be encoded into a CR200(X) to perform three general
logic functions, facilitating conditional processing and control applications.
1.
Evaluate an expression, then take one path or action if the expression is
true (= -1), and / or another path or action if the expression is false (=
0).
2.
Evaluate multiple expressions linked with AND or OR.
3.
Evaluate multiple and / or links.
Summary of Contents for CR200
Page 32: ...Section 2 Quickstart Tutorial 22 ...
Page 45: ...Section 3 Overview 35 3 3 Specifications ...
Page 46: ...Section 3 Overview 36 ...
Page 58: ...Section 4 Sensor Support 48 ...
Page 62: ...Section 5 Measurement and Control Peripherals 52 ...
Page 78: ...Section 8 CR200 X Configuration 68 ...
Page 102: ...Section 9 Programming 92 ...
Page 138: ...Section 11 Programming Resource Library 128 ...
Page 156: ...Section 16 Support Software 146 ...
Page 160: ...Section 17 Care and Maintenance 150 ...
Page 167: ...Section 18 Troubleshooting 157 18 3 3 2 Charging Circuit Test Solar Panel ...
Page 168: ...Section 18 Troubleshooting 158 18 3 3 3 Charging Circuit Test Transformer ...
Page 169: ...Section 18 Troubleshooting 159 18 3 3 4 Adjusting Charging Circuit Voltage ...
Page 170: ...Section 18 Troubleshooting 160 ...
Page 184: ...Appendix A Glossary 14 ...
Page 190: ...Appendix B Status Table and Settings 20 ...
Page 192: ...Appendix C Serial Port Pin Outs 22 ...
Page 211: ......