|
<< Click to Display Table of Contents >> Navigation: Components > System > File logger |
The file logger is an invisible server component with the ability to log any text, values, events or switching commands in a file.
The log file is written in csv format. It is possible to change the file extension as you like. However, this does not affect the file format.
The values are then entered chronologically.
The individual lines are written in dependence of the parameter 'memory trigger' and then possibly via the input 'memory pulse'.
There are 2 types of storage. If the Logging Type property is set to 'All Channels in Each Line', all values are written to one line for each channel receive or trigger. When the file is opened in Excel the values for each channel are displayed in one column. The column header is the channel name. Each line stores number, date, time and values. Each event writes all channels.
If the Logging Type property is 'One Line Per Channel', the number, channel name, date, time and value are written line by line. There is only one value on each line. This format is particularly suitable for further evaluating the values with automated programs.
Describing the log file can always be switched on or off via the data point 'Active'.
Caution: If a lot of information is received at short intervals, the log file can become very large.
The log file is archived via "Backup Impuls". After triggering the "backup impulse", the log file is saved under the path and name specified under "Backup file name". A date and time stamp is attached to the file name. This is defined under "Backup file date format".
The actual log file is then deleted.
Note: For recording at least 1 channel must be created, the filename defined and the component 'Active' switched.
Data points of the component
Name |
Type |
function |
|---|---|---|
Activ |
Bidirectional |
Indicates whether the recording is active (On) or inactive (Off). The recording can be activated (On) and deactivated (Off) via the data point. |
Backup done |
Output |
If the file was created successfully, it will be "true". |
Backup filename |
Output |
Returns the storage path and filename of the backup file. |
Backup Impulse |
Input |
A backup signal is created with an ON signal. When a backup is created, the actual log file is deleted. |
Diagnosis [Text] |
Output |
The status outputs are formatted as text here. The output is used for diagnosis in the event of a malfunction. Attention: Diagnostic or debug outputs are only intended for use in the event of an error. Please use only after consultation with the support team! If used, these can considerably impair the performance of the service. |
Dynamic |
Folder |
Here, the channels defined in the channel list are displayed and made available as data points for linking to the networks. |
Gateway (data input) |
Input |
Direct connection to a driver gateway data point to log all channels automatically (e.g. from the Modbus master). For this,"One line per channel" must be selected! |
last log entry |
Output |
Here the last recorded value is published |
Change log file name |
Bidirectional |
The name of the log file can be adapted via a character string or file selection. |
Save impulse |
Input |
If the memory pulse is triggered, the current values are written to the log file. The logger must be active in any case. |
Properties
Name |
Default |
function |
|---|---|---|
Channels |
0 |
Call the channel list in which the data points to be stored are created. |
Log-Typ |
All channels in each line |
Here you can choose between two recording methods. 'All channels in each line' or 'One line per channel'. |
Append values to file |
x |
If this entry is set, all incoming data are written to one another in the file. If this entry is not set, the incoming values are always written on the first line. Existing data will be overwritten. |
Separator |
Semicolon |
Selection of the line separator. Possible are semicolon, comma or tabulator |
Date Format |
dd.MM.yyyy |
Format of the date in the log file. see also formatting |
Time format |
HH:mm:ss |
Format of the time in the log file. see also formatting |
Culture Setting |
German (Germany) (de-DE) |
Here the country is determined for which the stored files are intended. Depending on this, time, date and value entries are stored country-specifically. e.g. 24 or 12 hour format; Comma or dot as separator |
Active |
|
Indicates whether the incoming data should be recorded. |
Save trigger |
Save immediatly on channel event |
If the setting 'Save immediately on channel reception' is selected, the values are written to the log file individually on reception. The 'Save at' settings refer to the save impulse input. If the memory pulse receives a value and this is identical to the setting, all values are written to the log file. Alternatively, storage can be carried out every 15/30/60 minutes or once a day (at midnight). |
Filename |
|
Here, the name of the file in which the log messages are stored must be specified. With a mouse click on, "...", open the file "Save As" dialog and specify a storage path and filename. |
Backup filename |
|
Here the name of the backup file in which the log messages are stored can be defined. With a mouse click on, "...", open the file "Save As" dialog and specify a storage path and filename. |
Backup file date format |
yyyyMMddHHmmss |
Format of the time specification appended to the filename |
Zip backup |
|
Set to zip the backup file. |
Auto Backup |
never |
A backup routine can be defined for the selected period. This is always executed at 00:00. |
Log header |
x |
If this entry is set, the column name (number, date, time and channel name) is entered. |
Log number |
x |
If this entry is set, the current line number will be logged in each line. |
Log date |
x |
If this entry is set, the date will be logged in each line. |
Log time |
x |
If this entry is set, the time is logged in each line. |
Channels (Example)
Name |
Faktor |
Formatstring |
|---|---|---|
Power |
1 |
|
Temperature |
0,001 |
#0,0 °C see also formatting |
Name
This name of the input is displayed as a data point name on the component and in the file.
factor
For incoming values these are multiplied by the factor. It is possible, e.g. Wh in kWh by setting the factor 0.001.
The factor must not be set to 0, because then 0 is always logged.
format string
By default, no format string is entered. The received value is saved in raw format.
By using the format string, it is possible to round values and store additional characters with the value.
Examples:
#0,00 kWh
#0,0 °C
#0 W
Import (CSV)
Channels can also be imported with a CSV file. The following structure applies here:
unique channel name; factor as a number; format string.
Example: Name;2,5;FormatString
Example of the logging type "All channels in each line
No. |
Date |
Time |
Channel001 |
Channel002 |
1 |
28.09.2021 |
14:35:04 |
1 |
|
2 |
28.09.2021 |
14:35:05 |
1 |
1 |
3 |
28.09.2021 |
14:35:06 |
0 |
1 |
4 |
28.09.2021 |
14:35:07 |
0 |
0 |
Example for the logging type "One line per channel
No. |
Name |
Date |
Time |
Value |
1 |
Channel001 |
28.09.2021 |
14:35:04 |
1 |
2 |
Channel002 |
28.09.2021 |
14:35:05 |
1 |
3 |
Channel001 |
28.09.2021 |
14:35:06 |
0 |
4 |
Channel002 |
28.09.2021 |
14:35:07 |
0 |