Section 9. Programming
86
9.9.4
Expressions in Parameters
Read More!
See
Expressions
(p. 87) for more information on expressions.
Many parameters allow the entry of expressions. If an expression is a
comparison, it will return -1 if the comparison is true and 0 if it is false (
Logical
Expressions
(p. 88)).
CRBASIC EXAMPLE. Use of Expressions in Parameters
(p. 86) shows an example of the use of expressions in parameters in the
DataTable instruction, where the trigger condition is entered as an expression.
Suppose the variable TC is a thermistor temperature:
CRBASIC EXAMPLE 13.
Use of Expressions in Parameters
'DataTable (Name, TrigVar, Size)
DataTable (Temp, TC > 100, 5000)
When the trigger is "TC > 100", a TC temperature > 100 will set the trigger to
true and data is stored.
9.9.5
Arrays of Multipliers and Offsets
A single measurement instruction can measure a series of sensors and apply
individual calibration factors to each sensor as shown in
CRBASIC EXAMPLE.
Use of Arrays as Multipliers and Offsets
(p. 86). Storing calibration factors in
variable arrays, and placing the array variables in the multiplier and offset
parameters of the measurement instruction, makes this possible. The
measurement instruction uses repetitions to implement this feature by stepping
through the multiplier and offset arrays as it steps through the measurement
input channels. If the multiplier and offset are not arrays, the same multiplier
and offset are used for each repetition.
CRBASIC EXAMPLE 14.
Use of Arrays as Multipliers and Offsets
Public Pressure(3), Mult(3), Offset(3)
DataTable (AvgPress,1,-1)
DataInterval (0,60,Min)
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)
'VoltSe instruction using array of multipliers and offsets:
VoltSe (Pressure(),3,1,Mult(),Offset())
CallTable AvgPress
NextScan
EndProg
Содержание CR200
Страница 32: ...Section 2 Quickstart Tutorial 22 ...
Страница 45: ...Section 3 Overview 35 3 3 Specifications ...
Страница 46: ...Section 3 Overview 36 ...
Страница 58: ...Section 4 Sensor Support 48 ...
Страница 62: ...Section 5 Measurement and Control Peripherals 52 ...
Страница 78: ...Section 8 CR200 X Configuration 68 ...
Страница 102: ...Section 9 Programming 92 ...
Страница 138: ...Section 11 Programming Resource Library 128 ...
Страница 156: ...Section 16 Support Software 146 ...
Страница 160: ...Section 17 Care and Maintenance 150 ...
Страница 166: ...Section 18 Troubleshooting 156 18 3 3 Diagnosis and Fix Procedures 18 3 3 1 Battery Voltage Test ...
Страница 167: ...Section 18 Troubleshooting 157 18 3 3 2 Charging Circuit Test Solar Panel ...
Страница 168: ...Section 18 Troubleshooting 158 18 3 3 3 Charging Circuit Test Transformer ...
Страница 169: ...Section 18 Troubleshooting 159 18 3 3 4 Adjusting Charging Circuit Voltage ...
Страница 170: ...Section 18 Troubleshooting 160 ...
Страница 184: ...Appendix A Glossary 14 ...
Страница 190: ...Appendix B Status Table and Settings 20 ...
Страница 192: ...Appendix C Serial Port Pin Outs 22 ...
Страница 211: ......