Specifications
Section 9. CR1000 Programming
9-17
Scan determines how frequently instructions in the program are executed:
EXAMPLE 9.9-2. CRBASIC Code: Scan Syntax
'Scan(Interval, Units, BufferSize, Count)
Scan(1,Sec,3,0)
·
·
·
ExitScan
Scan has four parameters:
Interval is the interval between scans.
Units is the time unit for the interval. Interval is 10 ms < = Interval < = 1 day.
BufferSize is the size (number of scans) of a buffer in RAM that holds the raw
results of measurements. When running in Pipline mode, using a buffer allows
the processing in the scan to lag behind measurements at times without
affecting measurement timing.
Count is 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 in EXAMPLE 9.9-2, the scan is 1 second, three
scans a
re buffered, and measurements and data storage continue indefinitely.
9.10 Program Timing: Slow Sequence Scans
Instructions in a slow sequence scan are executed whenever the main scan is
not active. When running in pipeline mode, slow sequence measurements will
be spliced in after measurements in the main program, as time allows. Because
of this splicing, the measurements in a slow sequence may actually span across
multiple main program scan intervals. When no measurements need to be
spliced, the scan will run independent of the fast scan, so slow sequences with
no measurements can run at intervals ≤ main scan interval (still in 100mS
increments) without skipping scans. When splicing, checking for skipped slow
scans is done after the first splice is complete rather than immediately after the
interval comes true.
In sequential mode, all instructions in the slow sequences are executed as they
occur in the program according to task priority.
Slow sequence scans are declared with the SlowSequence instruction and run
outside the main program scan. They typically run at a slower rate than the
main scan. Up to four slow sequences scans can be defined in a program.
Background calibration is an automatic slow sequence scan.
Read more! Section 06 Self-Calibration.