Section 9. Datalogger Program Creation with CRBasic Editor
The Scan instruction determines how frequently the measurements within the
scan are made:
Scan
(Interval, Units, BufferOption, Count)
Scan(1,MSEC,3,0)
The Scan instruction has four parameters (the CR200 datalogger’s Scan
instruction has only two). The Interval is the time between scans. Units are
the time units for the interval. The BufferSize is the size (in the number of
scans) of a buffer in RAM that holds the raw results of measurements. Using a
buffer allows the processing in the scan to at times lag behind the
measurements without affecting the measurement timing (see the scan
instruction in the CR5000 help for more details). Count is the number of scans
to make before proceeding to the instruction following NextScan. A count of
0 means to continue looping forever (or until ExitScan). In the example the
scan is 1 millisecond, three scans are buffered, and the measurements and
output continue indefinitely.
9.4.10 Numerical Entries
In addition to entering regular base 10 numbers there are 3 additional ways to
represent numbers in a program: scientific notation, binary, and hexadecimal
(Table 9-2).
TABLE 9-2. Formats for Entering Numbers in CRBasic
Format Example
Value
Standard 6.832
6.832
Scientific notation
5.67E-8
5.67X10
-8
Binary: &B1101
13
Hexadecimal &HFF
255
The binary format makes it easy to visualize operations where the ones and
zeros translate into specific commands. For example, a block of ports can be
set with a number, the binary form of which represents the status of the ports
(1= high, 0=low). To set ports 1, 3, 4, and 6 high and 2, 5, 7, and 8 low; the
number is &B00101101. The least significant bit is on the right and represents
port 1. This is much easier to visualize than entering 72, the decimal
equivalent.
9.4.10 Logical Expression Evaluation
9.4.10.1 What is True?
Several different words are used to describe a condition or the result of a test.
The expression, X>5, is either
true
or
false
. However, when describing the
state of a port or flag,
on
or
off
or
high
or
low
is more intuitive. In CRBasic
there are a number of conditional tests or instruction parameters, the result of
which may be described with one of the words in Table 9-3. The datalogger
evaluates the test or parameter as a number; 0 is false, not equal to 0 is true.
9-25
Summary of Contents for PC400
Page 2: ......
Page 16: ...Section 1 Introduction 1 6...
Page 18: ...Section 2 System Requirements 2 2...
Page 46: ...Section 4 The PC400 Main Screen 4 24...
Page 49: ...Section 5 Split 5 3...
Page 82: ...Section 5 Split 5 36...
Page 114: ...Section 6 View 6 14...
Page 132: ...Section 7 Short Cut Program Generator 7 18...
Page 188: ...Section 9 Datalogger Program Creation with CRBasic Editor 9 30...
Page 230: ...Appendix B Table Based Dataloggers B 12...
Page 249: ......