1 program structure, 1 program, Structure -4 – Campbell Scientific PC400 Datalogger Support Software User Manual

Page 140

Advertising
background image

Section 8. Datalogger Program Creation with Edlog

the other tables. Most users find they can write the entire program in Program
Table 1, avoiding complications associated with synchronizing two tables.
Program Table 2 is normally used only when portions of the program require a
different execution interval (placed in Program Table 2).

Program tables in this section refer strictly to sections of the
datalogger program. Do not confuse these program sections with
the data tables created in table-based dataloggers using P84 to
store output data.

NOTE

When the program is complete, select File | Save from the Edlog menu. A
standard file dialog box will appear in which to type a file name. Edlog
supports long file names for the datalogger programs. Use descriptive names
to help document the program’s function. After saving the file, you will be
prompted to compile the program. When a program is compiled the code will
be checked for errors. After compiling, the datalogger program can be sent to
the datalogger from the Clock/Program tab.

8.1.1.1 Program Structure

While Edlog is not a structured programming language there are some standard
programming practices that will help you and others understand what the
datalogger program is intended to do.

Comments – Edlog provides the ability to add comments on any blank line
and to the right of all instructions. Liberal use of descriptive comments makes
the program clearer and will help you remember what you were doing when
you come back to it a year or two later. Especially useful are descriptions of
what sensors are connected and how they are wired to the datalogger.

Program Flow – It is easier to follow a program that is written in distinct
sections, each of which handles a specific type of instruction. The
recommended sequence is:

− Measure Sensors – In this first section put all the instructions that get data

from the sensors attached to the datalogger. The sensor readings are stored
in input locations, ready for the next section.

− Process Measurements – In this section do all the calculations and data

processing to prepare the data for output.

− Control – Do any control of external hardware or devices.

− Output Data – Check to see if it is time, or a condition exists, to trigger

output data to be saved in final storage.

Descriptive Labels – Use input location and final storage labels that are
meaningful for the data they contain.

8-4

Advertising