The Logging Control has multiple features for logging data in a variety of ways.
Once placed on an interface, the logging configuration window may be opened by double-clicking the control.
Properties and instructions are available for all settings and properties to control via code. Please use F3 to see the properties and the Debug/CLI (F4) or Code Editor for available instructions and values.
Triggers
Data may be logged automatically when any one of the conditions are checked, including logging data based on an interval.
The Log on Trig. Cond 1 - 3 allow up to 3 conditional statements that can trigger logging of data. Some example uses appear by default. Conditional statements can use 'and' and 'or' for multiple trigger events per trigger condition.
Data File
Options provide logging data to a the file and whether a conditional re-triggering will save data - If a value exceeds 100, save just once or the entire time the value received exceeds 100.
The Path/filename may be selected. Log files are typically .txt or .csv files that can be opened as a spreadsheet. The folder must exist - it will not be created.
What to log can be selected as checkboxes or a Log String can be defined to format the logged data. Checking multiple boxes (Analog, Digital, Message) will place them on a single line of comma separated values.
SnapShot
Snapshots of the interface can be automatically performed based on the 3 triggers' conditions. Re-triggering is not recommended unless the data is arriving slowly due to the processing time of snapshots. The interface must be visible on the primary desktop screen for snapshots.
Instructions
There are only a couple specialized instructions available for the logging control:
•logData: Manually logs a string to the log file whether enabled or not. TIme/Data is not automatically added !log.logData [systemDateTimeDash] Temperature alarm turned on
•deleteLog: Deletes and re=opens the empty log file.
Event Code
Event code triggers are the following:
•<load> Triggers on control load or !runLoad instruction.
•<log> Triggers when data is logged to the file.
•<snap> Triggers when a snapshot is taken.
•<cond1>, <cond2>, <cond3> These event triggers are based on if the corresponding trigger condition are true. Logging must be enabled and re-triggering is based on the logging re-trigger, whether or not data logging is enabled.
Additional
The log file may be opened from code using: !fileOpen [log4Meters.fileName]
The last snapshot may be opened from code using:
!fileOpen [lastSnapName]
|