
- 23 -
COMMENTS
Comments may be inserted into the program to make understanding easier or to
identify the program. A comment is any text following a double slash: // up to the
end of the line. This means that a comment cannot be inserted into the middle of
data logger commands, as everything after the comment marker will be ignored up to
the end of the line. Comments do take up program space when stored in the data
logger, so be careful about their usage.
Examples:
// Turbidity sampling for Hazel Creek -- written July 17, 1998
EVERY 360
//sample every 6 minutes
DEFINING TIMERS
Up to 8 timers can be defined. The general form is as follows:
EVERY 60 AT 30
{
// Code to be executed every 60 seconds goes here
}
All times are defined in seconds and are referenced to midnight.
The EVERY portion defines how frequently the code inside the curly braces is to be
executed (60 seconds, in the above example). The value following the EVERY can
be from 1 to 86400s (1 day).
The AT portion is optional, and is used to set an offset, if needed. For example
EVERY 60 without a following AT will log data on the minute 01m 00s, 02m 00s, and
so on. With the AT statement as shown above, the data will be logged with an offset
of 30 seconds from the minute at 00m 30s, 01m 30s, 02m 30s.
In practice, the AT statement is rarely needed. Its main use is to set up an action
such as turning on a sensor, that needs to be done some known time before the
sensor is read.
Timers cannot be nested, and variables cannot be used for the times. Timers can not
be put inside IF() tests.
Some useful time conversions to seconds for the timers:
Minutes
to seconds
Hours
to seconds
Days
to seconds
1
60
1
3600
1
86400
5
300
2
7200
10
600
3
10800
15
900
6
21600
30
1800
12
43200
Summary of Contents for HDL1
Page 1: ...HDL1 HDL1 G5 Data Logger Operating Manual...
Page 2: ......
Page 8: ...iv THIS PAGE INTENTIONALLY LEFT BLANK...
Page 12: ...4 THIS PAGE INTENTIONALLY LEFT BLANK...
Page 20: ...12 THIS PAGE INTENTIONALLY LEFT BLANK...