
Section 7. Installation
7.8.2.2.1 Inserting Comments into Program
Comments are non-executable text placed within the body of a program to
document or clarify program algorithms.
As shown in CRBasic example
Inserting Comments
(p. 126),
comments are inserted
into a program by preceding the comment with a single quote (
'
). Comments can
be entered either as independent lines or following CR1000 code. When the
CR1000 compiler sees a single quote (
'
), it ignores the rest of the line.
CRBasic Example 2.
Inserting Comments
'This program example demonstrates the insertion of comments into a program. Comments are
'placed in two places: to occupy single lines, such as this explanation does, or to be
'placed after a statement.
'Declaration of variables starts here.
Public
Start(6)
'Declare the start time array
BeginProg
EndProg
7.8.2.2.2 Conserving Program Memory
One or more of the following memory-saving techniques can be used on the rare
occasions when a program reaches memory limits:
•
Declare variables as
DIM
instead of
Public
.
DIM
variables do not require
buffer memory for data retrieval.
•
Reduce arrays to the minimum size needed. Arrays save memory over the
use of scalars as there is less "meta-data" required per value. However, as a
rough approximation, 192000 (4 kB memory) or 87000 (2 kB memory)
variables will fill available memory.
•
Use variable arrays with aliases instead of individual variables with unique
names. Aliases consume less memory than unique variable names.
•
Confine string concatenation to
DIM
variables.
•
Dimension string variables only to the size required.
Read More
More information on string variable-memory use and conservation is
available in
String Operations
(p. 282).
7.8.3 Sending CRBasic Programs
The CR1000 requires that a CRBasic program file be sent to its memory to direct
measurement, processing, and data-storage operations. The program file can have
the extension cr1 or .dld and can be compressed using the GZip algorithm before
sending it to the CR1000. Upon receipt of the file, the CR1000 automatically
decompresses the file and uses it just as any other program file. See the appendix
Program and OS Compression
(p. 463)
for more information.
Options for sending a program include the following:
•
Program Send
(p. 524)
command in
datalogger-support software
(p. 95)
•
Program
send command in
Device Configuration Utility
(
DevConfig
(p. 111))
•
Campbell Scientific
mass storage device
(p. 653)
or memory card
126
Summary of Contents for CR1000
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 36: ......
Page 38: ......
Page 40: ......
Page 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Page 96: ......
Page 98: ...98 ...
Page 302: ......
Page 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Page 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Page 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Page 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Page 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Page 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Page 478: ......
Page 506: ......
Page 536: ......
Page 636: ......
Page 642: ......
Page 644: ......
Page 676: ......
Page 677: ......