                                                                   Page 7-1
                          Chapter 7 - History Graphing

OVERVIEW

A history graph is a line chart of history data that is read
from the controller. History data can only be collected from
the controller at regular intervals with an auto process
(see section 2.4). When the history data is collected, it is
stored in a disk file automatically.

A history graph will display up to 8 variables (in two sets
of 4). Each history graph shows 32 samples of each variable.
Each disk file can store up to 365 history graphs.

To quickly setup a history graph with an AC256:

* Select the SYSTEM menu and then select SETUP.
* Select HISTORIES.
* Highlight an empty entry and press [Enter] and then
  select the 'EDIT' button.
* Enter a description, the number of entries to store on
  disk (how many days worth of readings to keep), the
  Andover history page number (1-32), and 0 for both the
  LOW and HIGH entries.
* Select the 'OK' button, then select the 'DONE' button on
  the selection screen.
* You can now select CURRENT HISTORY from the VIEW menu.

Setting up histories for an Infinity controller is more
complex and is explained later in this chapter.


IMPORTANT NOTES

* When you select CURRENT HISTORIES from the VIEW menu,
  nothing is saved to disk. You must use a script file to
  store history data on disk for later viewing.

* Don't forget that there is a second page (set) of history
  variables. You may toggle between these two sets by
  selecting the 'SET' button while viewing histories.

* You may change the scale on the graph by selecting the
  'SCALE' button.

                                                                   Page 7-2

7.1   Infinity History Graph Setup

A history graph must be setup before it can be used. For the
Infinity controller, the following steps should be taken:

* Each variable on a single history graph must be set to
  keep at least 32 log entries. Any time interval may be
  used but all variables on a single graph should be set
  alike. See the Infinity manual for information on how to
  do this.

* The Infinity program provided on The Monitor II program
  diskette must be loaded into the controller. This program
  (HISTORY.PRG) adds a function called MON_HISTORY to the
  controller. This program must not be changed in any way.

* A TIME VARIABLE must be created. This variable will also
  be set to keep at least 32 log entries. The interval for
  this variable should be the same as the other 8
  variables.

* A small looping program in the controller must be created
  to constantly place the time (or date) into this
  variable. The time must be stored in the TIME VARIABLE as
  (HOUR * 100) + MINUTE. The date would be stored as (MONTH
  * 100) + DAY.

  EXAMPLE:  HISTORY_TOD  = (HOUR * 100) + MIN
            HISTORY_DATE = (MONTH * 100) + DAY

  One TIME VARIABLE may be used for any number of history
  graphs that all have the same interval.

* The history graph must be setup in The Monitor II (See
  below).

                                                                   Page 7-3

Select SETUP from the SYSTEM menu, then select HISTORIES.

The following information must be provided:

* DESCRIPTION - This is a 30 character descriptive name. It
  is what will be displayed at the top of the screen when
  the history is being viewed.

* SET # / VAR # - Each history graph may contain up to 8
  variables. The variables are graphed four at a time. Each
  of these graphs are called a 'SET'. While viewing the
  history graph, clicking on the 'SET' button will switch
  between the two sets. Enter the four controller variables
  to display on each set. A full controller path may be
  specified.

* TIME VAR - This is the controller variable that records
  the time (or date) of each history sample.

* TIME/DATE - This specifies whether the TIME VAR should be
  displayed as times or dates.

* ENTRIES - This is the number of entries to store on disk.
  The histories are stored in a circular fashion. If 31
  entries are specified, the 32nd entry will overwrite the
  1st entry, etc. ENTRIES can be set from 1 - 365, to store
  a full year of daily history data.

  NOTE: The size of the history file will be (1,194 *
  ENTRIES) bytes. If 365 entries are specified, the size of
  the file will be 435,810 bytes. Consider the amount of
  disk space needed before setting the ENTRIES too high.


                    ***** IMPORTANT *****

  If the number of entries is changed to a smaller number
  after data has already been stored in the file, some of
  the stored data may be lost.

                    *********************


* SET # LOW / HIGH - These are the scale values for each
  SET of the history graph. Any history value that is
  outside this range will be clipped. If BOTH the LOW and
  HIGH are set to ZERO, The Monitor II will automatically
  scale the graph to the actual lowest and highest values
  read from the controller.

                                                                   Page 7-4

7.2   AC256 History Graph Setup

The Monitor II will read history pages directly from the
controller. After setting up the history page in the
controller, select SETUP from the SYSTEM menu, then select
HISTORIES.

The following information must be provided:

* DESCRIPTION - This is a 30 character descriptive name. It
  is what will be displayed at the top of the screen when
  the history is being viewed.

* ENTRIES - This is the number of entries to store on disk.
  The histories are stored in a circular fashion. If 31
  entries are specified, the 32nd entry will overwrite the
  1st entry, etc.

ENTRIES can be set from 1 - 365, to store a full year of
daily history data.

NOTE: The size of the history file will be (1,194 *
ENTRIES) bytes. If 365 entries are specified, the size of
the file will be 435,810 bytes. Consider the amount of
disk space needed before setting the ENTRIES too high.

                  ***** WARNING *****

If the number of entries is changed to a smaller number
after data has already been stored in the file, some of
the stored data may be lost.

* PAGE # - This is the history page number in the AC256
  controller to read for this history graph.

* SET # LOW / HIGH - These are the scale values for each
  SET of the history graph. Any history value that is
  outside this range will be clipped.

If BOTH the LOW and HIGH are set to ZERO, The Monitor II
will automatically scale the graph to the actual lowest
and highest values read from the controller.

                                                                   Page 7-5

7.3   Viewing History Graphs

There are two history selections under the VIEW menu:

* CURRENT HISTORY - This will immediately read the history
  data from the controller and display this data in a
  history graph. The data will not be saved to disk, and
  must be re-read each time that it is selected.

* STORED HISTORY - This will not read the data from the
  controller, but will read from the history data stored on
  disk, starting with the most recent reading (see section
  7.4 for information on saving history data to disk).

After selecting the desired history graph to view, the graph
will be displayed.

The history screen may divided into four distinct sections:

1. THE HEADER - This displays (from left to right):

* The current history entry being viewed.

* The total number of entries stored.

* The descriptive name specified in the HISTORY SETUP.

* The date and time (from the controller) that the
  history data was read.

  NOTE: #1 & #2 are shown only with the VIEW STORED
  HISTORY menu selection, not the VIEW CURRENT HISTORY
  menu selection.

2. THE GRAPH - This displays the line chart of the history
   data. It also contains a time bar (white line) that may
   be moved to follow the variables value through time by
   pointing the mouse or by pressing the LEFT and RIGHT
   arrow keys.

3. VARIABLE DISPLAY - This displays the actual variables
   name and the value of the variable at the intersection
   of the time bar.

                                                                   Page 7-6

4. BUTTONS - The function of each button is as follows:

* NEXT - View next history graph entry from disk. When
  the last entry is viewed, NEXT will wrap around to
  the first entry. The Page Up key may be pressed to
  skip over the next ten entries.

* PREVIOUS: View previous history graph entry from
  disk. When the last entry is viewed, PREVIOUS will
  wrap around to the first entry. The Page Down key
  may be pressed to skip over the last ten entries.

NOTE: NEXT and PREVIOUS are shown only with the VIEW
STORED HISTORY menu selection, not the VIEW CURRENT
HISTORY menu selection.

* SCALE - This will allow you to change the default
  high and low limits of the graph. This change is
  temporary and will revert back to the default the
  next time the graph is viewed.

* SET - This will switch between the two sets of four
  variables on each history graph.

* PRINT - This will print out raw history data to your
  printer. The data is formatted as an AC256 history
  page, even if connected to an Infinity.

* DONE - This will cancel the VIEW HISTORY function
  and clear the screen.


7.4   Saving History Data to Disk

To save history data to disk, a script file must be
executed. This could be done manually by selecting EXECUTE
SCRIPT from the system menu, through the CUSTOM MENU, or
automatically through an auto process. This script file must
be written  and stored in the \MONITOR\SCR directory.

An example script file for storing histories on disk is on
the following page. An example is also included on your
original disk, in the \MONITOR\SCR directory. The filename
is 'HISTORY.SCR'

                                                                   Page 7-7

EXAMPLE SCRIPT FILE FOR STORING HISTORY DATA ON DISK:


'THE COMMENTS AFTER THE APOSTROPHE ( ' ) DO NOT HAVE TO BE
'TYPED IN.

CONNECT "COLLEGE"   'PUT PART OF THE CONTROLLER DESCRIPTION
                    'HERE, OR TAKE THIS LINE OUT IF ALREADY
                    'CONNECTED.

IF @CONNECTED = 0 THEN END  'MUST BE CONNECTED

HISTSTORE 1                 'THE NUMBER GIVEN IS THE
                            'HISTORY DIRECTORY ENTRY NUMBER
                            '(1-50)

IF @SUCCESS = 0 THEN PRINT "Cannot read history."

END

See chapter 10 for more information on script file
programming.



