LK4Dev Chapter 7 Ch7

User Manual: Chapter 7 LookoutDirect Developer’s Manual - AutomationDirect

Open the PDF directly: View PDF PDF.
Page Count: 14

DownloadLK4Dev Chapter 7 Ch7
Open PDF In BrowserView PDF
Logging Data and Events

7

This chapter describes three LookoutDirect methods for logging real-time
system data to disk—Spreadsheet Logger, Citadel Historical Database, and
Event Logger—and report generation.
The Spreadsheet Logger creates standard ASCII text files in comma separated
value (.CSV) file format. You can open and edit these files with common
spreadsheet and database programs. The Citadel Historical Database creates
a historical database that LookoutDirect HyperTrend objects access in real
time. You can retrieve this data using Structured Query Language (SQL). The
Event Logger creates a chronological audit trail of who did what and when.
You might implement all three methods on a single system. They are not
mutually exclusive.
Refer to Chapter 9, Alarms and Events, for more information on the Alarm
Logger, which logs alarms to disk.
Note When your operating system switches in or out of Daylight Savings time,

LookoutDirect corrects for the change relative to universal time so that there is no data
discontinuity or loss in the Citadel database.

Spreadsheet Logger
When you want to create permanent ASCII files that you can later open with
software packages such as Excel, Lotus, and Foxpro, use a Spreadsheet object
to store real-time system data to disk.
You can generate more than one spreadsheet for a single process if you
use multiple Spreadsheet objects in one process file (a .LKP file). You
can have different spreadsheet files in different subdirectories and each might
have different data stored using different logging criteria. For more
information on the Spreadsheet object, refer to the Spreadsheet Logger
description in the online PDF Object Reference Manual or online help.
The following illustration shows the create object dialog box that you use to
configure a spreadsheet object.

© Automationdirect.com

7-1

Developer’s Manual

Chapter 7

Logging Data and Events

Data Location
LookoutDirect stores spreadsheet files in subdirectories specified by the
Citadel Database section of the System Options dialog box illustrated
below.

Developer’s Manual

7-2w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

CSV Files
All LookoutDirect spreadsheet files use the comma-separated value (.CSV)
format. A .CSV file contains text separated by commas. Each line of the file
represents a row of spreadsheet data. The first row lists signal names and
describes the data stored in each column of the file. The first column of the
spreadsheet file specifies the date and time data in each row was logged. The
following illustration shows a Lookout .CSV file opened by Excel.

You can view and edit spreadsheet files using a standard word processing
program, but spreadsheet programs such as Microsoft Excel provide a more
intuitive interface for viewing or editing data and printing custom reports.

File and Disk Errors
If LookoutDirect cannot find the data directory or spreadsheet files or cannot
log data to disk, it generates a priority eight alarm with a descriptive error
message. For example, if your default data location was on
c:\lookout\database, and LookoutDirect was to encounter a full disk
while writing to a file named data.CSV, the alarm text would read
(Disk is full) “c:\lookout\database\data.csv”.

When you correct the problem that caused the alarm, the alarm automatically
resets.

© Automationdirect.com

7-3

Developer’s Manual

Chapter 7

Logging Data and Events

Concurrent File Access
When logging data, LookoutDirect opens the file long enough to add a new
row of data and then closes the file. LookoutDirect can log approximately ten
new rows of data per second. (The time stamps associated with each row are
rounded to the nearest second.) Because LookoutDirect runs under the
Windows multitasking environment, you can open the spreadsheet or
database while LookoutDirect is running. If you have the data file open in a
spreadsheet program such as Excel, LookoutDirect cannot add new rows of
data to the file. If LookoutDirect does not have write access to the file, it
generates an alarm explaining the problem.
Error writing spreadsheet file: Permission denied
[c:\lookout\database\data.csv]

If LookoutDirect cannot log data to the spreadsheet file, it creates a temporary
buffer in memory to which it logs all the spreadsheet data. When you close
the spreadsheet file, LookoutDirect updates it and resets the alarm.

Information Overload
If you create a Spreadsheet object that logs fifty data fields (object data
members and/or expressions) at five-minute intervals, you generate
14,400 data points per day, or 432,000 data points per month. It can be
difficult to determine which data are critical information.
Carefully consider the importance of each data point and the time interval between
data points to avoid information overload for both you and your spreadsheet program.
If you have logged more than 16,384 rows of data, the current version of
Excel cannot load the entire spreadsheet file. Spreadsheets created with
one-minute intervals generate 44,641 rows of data if the directory tree
location is set to Monthly. Spreadsheets created with two-minute intervals
generate 22,321 rows of data if the directory tree location is set to Monthly.
To decrease the number of data rows, try changing the directory tree location
to Daily, which generates only 1,440 rows of data per day at one-minute
logging intervals. You can also use a text editor to divide the larger file into
smaller files with fewer data rows.

Note

Besides limiting rows to 16,384, Excel limits spreadsheets to 256 columns of
data. One column is reserved for the date and time.

Developer’s Manual

7-4w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

Citadel Historical Database
When you need to view historical information using LookoutDirect
HyperTrend objects or access historical data using Structured Query
Language (SQL), use the Citadel Historical Database to store real-time
numeric and logical data in a compressed format.
LookoutDirect logs data only when the value of a point changes, not at a
timed interval. The logged data accurately reflects the actual behavior of the
point being logged because the same value of a point is not recorded over and
over. With Citadel, disk usage is exactly proportional to the amount of
information recorded.
After the data is stored to disk, you can view it with a HyperTrend object
in LookoutDirect or with SQL. HyperTrend objects serve as windows into
your database. SQL, an industry-standard language supported by most
database packages, enables other applications to directly retrieve data from
Citadel.
Because Citadel uses Universal Coordinated Time (UCT) to time stamp the
data, you do not need to compensate for data logged in different time zones.
The HyperTrend object automatically converts from universal to local time
before displaying a data history.

Default Data Location
The Citadel Database fields in the System Options dialog box specify
the root directory under which all data logging is stored, including the
database. Ordinarily, Citadel creates a special database subdirectory in the
LookoutDirect directory. This subdirectory holds your historical database
files.

© Automationdirect.com

7-5

Developer’s Manual

Chapter 7

Logging Data and Events

If you move or rename the subdirectory or files, you will be unable to access
your data. If you change the default directory, the change does not take effect
until you stop and restart LookoutDirect. This also interrupts data continuity,
and you have to do separate SQL queries to both databases.
Unlike spreadsheet files, only one historical database per LookoutDirect
process exists. If you want to develop multiple processes where each process
file has its own unique historical database on a single computer, specify a
different location for each process database, as explained in the Process Data
Location section of this chapter.

Process Data Location
When you create a process in LookoutDirect, you have an opportunity to set
the default data location for that process in the Create Process dialog box.

Developer’s Manual

7-6w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

When this dialog box first appears, the Use default values checkbox is
selected. This option directs LookoutDirect to log data from this process to
the default location set in the System Options dialog box for the copy of
LookoutDirect running the process. In this way, you can create a process that
logs to the default data location of any copy of LookoutDirect running on any
computer you move the process to.
You can also direct data to a location on a remote computer, as long as that
computer is running the LookoutDirect Citadel service. Deselect the Use
default values option and enter the computer and path you want data logged
to.
Although you can direct data from different processes to different database
directories, proliferating a variety of databases with large numbers of
processes running in one instance of LookoutDirect can degrade
performance, depending on the number of data points being logged.

Creating a Historical Database
Citadel stores historical information using traces. Trace refers to the line of
continuity for a specific data member name or point. A trace connects all the
historical values for a given point, which displays as a continuous line in a
HyperTrend object. If LookoutDirect is unexpectedly interrupted or a data
member is temporarily modified to not log to disk, a trace can be broken. If
the trace is broken, the HyperTrend plots the trace as a continuous line with
void sections to represent gaps in the data. You cannot remove individual

© Automationdirect.com

7-7

Developer’s Manual

Chapter 7

Logging Data and Events

traces from the database, but you can add new traces to the database by
configuring a new point.
You can log any numeric or logical data member of any object to the historical
database. Use the following procedure to add a trace to the Citadel database:

Developer’s Manual

1.

Select Object»Edit Database and an object that contains data you want
to log. A dialog box similar to the following appears.

2.

Identify the value you want to log in the Member data field. If the value
was previously configured, select it from the Configured points list.

3.

Check the Log to historical database checkbox and choose an
appropriate Lifespan. See Logging Criteria for an explanation of time
span settings.

4.

Enter a value in the Deviation field. See Logging Criteria for an
explanation of Deviation settings.

5.

Click on the Save or Update button. (If you are modifying an existing
configured point, the button automatically changes to Update.)

6.

Configure all the object data members that you want logged to the
Citadel database.

7.

Click on the Select object button and select the next object containing
data you want to log.

8.

Repeat steps 2 through 6 until you have created the traces that you need.

9.

Click on Quit.

7-8w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

Logging Criteria
To create a new trace in the Citadel historical database, LookoutDirect needs
the following information: data member name (Alias), Deviation,
and Lifespan.
•

Data member name (Alias)—LookouDirectt must name each trace in the
historical database for archiving and retrieval purposes. If Alias is not
specified, LookoutDirect uses the native data member name as displayed
in the Member field. If an alias is assigned to the native data member,
LookoutDirect uses the Alias name instead. The name used for the trace
is the same name saved to the Configured points list box.

•

Deviation—If an analog value surpasses or equals the Deviation setting,
LookoutDirect saves a new value to disk in the database. If you
implement Scaling parameters, LookoutDirect compares the Deviation
setting to changes in the Eng. units values to determine when to log
a new point. If you leave the Scaling parameters blank, LookoutDirect
compares the Deviation setting to the raw (unscaled) signal. The
Deviation parameter is not available on logical signals because
LookoutDirect logs all state transitions of logical values to disk.

•

Lifespan—LookoutDirect needs to know how long you want to
maintain this trace of data in the historical database. LookoutDirect
maintains the data for at least the time span specified in the Log to
historical database parameters.
LookoutDirect does not discard old data immediately. Disk space
containing old data is reused when new data is logged.

Alarm Information Overload
Because LookoutDirect creates and maintains the historical database in 1 MB
chunks, you must have a least 1 MB of available disk space to begin logging
data. When the first 1 MB file fills up with data, LookoutDirect creates a
second 1 MB file in the same directory. When the second fills up,
LookoutDirect continues to create 1 MB files until all traces can be
maintained on disk for the time spans specified in the Log to historical
database lifespan data field. LookoutDirect monitors the status of your hard
drive and generates an alarm when your disk falls below 500 KB of available
space.
Use discretion when determining Deviation settings on each trace of data. If
Deviation is not specified, any change of an analog value results in a new
point being logged to disk, and you might generate too much data. If the
Deviation setting is too large, very little information might be saved to disk.

© Automationdirect.com

7-9

Developer’s Manual

Chapter 7

Logging Data and Events

Event Logger
When you want to create a chronological schedule of events or an audit trail,
log LookoutDirect events.You can log all events: operator commands, Event
objects, and all global events (running LookoutDirect, closing
LookoutDirect, opening a process file, closing a process file, entering edit
mode, exiting edit mode, and logging on and off).
LookoutDirect system events, such as logging on and logging off, or entering
and exiting edit mode, are automatically logged as events by LookoutDirect.
Other events, such as adjusting the value of a Pot object, are only logged if
you select the Log events option when you create or modify the object.
When LookoutDirect logs an event, it also logs the account name (the
operator), date and time of the event, name of the object adjusted, and the
previous and subsequent settings of the object. Because all of this information
is logged, you create an exhaustive audit trail for that specific workstation.
Use the Event object class to define and log your own event messages based
on a user-defined trigger. For additional information, refer to the Event object
class in the online help or the PDF LookoutDirect Object Reference Manual.

Event Data Location
LookoutDirect stores event files in the same Citadel database that holds
LookoutDirect alarms and LookoutDirect data for any LookoutDirect
process.
To view events in real time, select the Show Events or the Show Alarms &
Events option in the Alarm Filters dialog box. Print events the same way
you print alarms, using the appropriate alarm filter settings.

Event Information Overload
The event logger can store information on an individual object instance for
Switches, Pots, and Pushbuttons. Every time you flip a Switch, adjust a Pot,
or depress a Pushbutton, LookoutDirect logs the event to disk. If you enable
the Event Logger for all instances of these object classes, you might collect
more data than you need.
By selectively enabling the Event Logger on critical Switches, Pots, and
Pushbuttons, you cut down on the amount of information logged to the event
file. For example, you might place a dozen Switches on a control panel, but
only one of those twelve requires data logging. Rather than log events for all
12 Switches, enable the Event Logger only on that single switch.

Developer’s Manual

7-10w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

Report Generation
Control Panel Reports
Panel objects have a special data member named print. When print
changes from FALSE to TRUE, LookoutDirect copies a picture of the control
panel and sends that copy to your printer using the Windows Print Manager.
You could use this to record the status of a particular panel at a particular
time. For more information, refer to the Panel description in the online PDF
Object Reference Manual or the online help.
To configure your custom report, design a control panel and connect a logical
trigger signal to the panel. You can connect any logical expression to the
print member. The control panel does not have to be visible to be printed.
Therefore, an operator can view one screen (panel) while printing another
screen. For more information about making connections, refer to the
LookoutDirect Getting Started Guide.
LookoutDirect determines the printed panel size based on dimensions entered
in the Revise control panel settings dialog box. There are several ways to
access this dialog box. First, make sure you are in edit mode. Then, do one of
the following:
•

Right-click on a panel title bar.

•

Right-click on a panel in the Object Explorer and select Properties.

•

Select Object»Modify, then select a panel from the list.

When Panel type is set to Normal, LookoutDirect assumes that the panel is
maximized. Even though your control panel might be maximized,
LookoutDirect prints only the area defined by your Panel object Width and

© Automationdirect.com

7-11

Developer’s Manual

Chapter 7

Logging Data and Events

Height settings. For example, you might have a panel that looks like the
following when maximized.

The panel shown above has a specified Height of 300 pixels and a Width of
400 pixels. At a video resolution of 800 × 600, the printed panel would look
something like the following figure.

Modify the Height and Width dimensions of your Panel object to match your
screen resolution. This problem applies only to Normal style panels. Popup

Developer’s Manual

7-12w

ww.Automationdirect.com

Chapter 7

Logging Data and Events

and Popup no icon style panels print according to the WYSIWYG principle
(What You See Is What You Get).

Third-Party Reports
You can generate reports using LookoutDirect and a third-party spreadsheet
program. Current spreadsheet software provides extensive macro command
capabilities you can use to quickly generate reports from LookoutDirect. You
can write Excel macros that prompt you for the report date, automatically
open the correct spreadsheet file(s), extract the data, and print reports with
combinations of numeric tables and graphs. You can launch these macros
from LookoutDirect or automatically invoke them using predefined timers.

© Automationdirect.com

7-13

Developer’s Manual

Chapter 7

Logging Data and Events

Developer’s Manual

7-14w

ww.Automationdirect.com



Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.5
Linearized                      : Yes
Page Count                      : 14
XMP Toolkit                     : XMP toolkit 2.9.1-13, framework 1.6
About                           : uuid:1768342d-d3f4-47a3-8278-e867eaf318a3
Modify Date                     : 2005:08:01 14:23:37-04:00
Create Date                     : 2005:08:01 14:23:22-04:00
Metadata Date                   : 2005:08:01 14:23:37-04:00
Document ID                     : uuid:5c8fed84-ad05-491a-9291-ac3b3c08dc51
Format                          : application/pdf
Title                           : LK4Dev.book
Creator                         : ADOBEPS4.DRV Version 4.31
Author                          : ADKJ
Producer                        : Acrobat Distiller 4.0 for Windows
EXIF Metadata provided by EXIF.tools

Navigation menu