Appendix A. Program Example
The Edlog program is an example only and is not meant to be used verbatim. In application, the concepts illustrated here are likely to be only fragments of a larger program.
The example program reads all 8 ports of an SW8A which is set to address 00. It is read three times per scan, once each for State, Duty Cycle, and Count information. The scan rate is fixed at 1 second, with a 5 minute output of State, average Duty Cycle, and average Count.
To prevent erroneous values from being included in Output Processing routines, the datalogger's Intermediate Processing Disable Flag (Flag 9) is set under the following two conditions.
1.When the SW8A is not responding - If the processor is not responding, a value of
2.When the current scan is the first scan after compiling the datalogger program - If the datalogger program is compiled in the *0 Mode, all Flags are set low following compilation. To detect the first scan after the datalogger is compiled, the state of user Flag 1 is checked. If Flag 1 is low the Intermediate Disable Flag (Flag 9) is set high to prevent the first readings from being included in subsequent Output Processing Instructions. Flag 1 is set high at the end of the first scan.
A flow chart of the example program is presented in Figure