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
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