Example of a user-defined format file

The example shows the formatting code for a CSV log file.

This sample is based on KW_Watcher_log.cfg.

Sample configuration

Contents of the format file

Header

When a new file is created, a header with seven rows is placed before the first record.

Explanation

%DEF_SEPARATOR=","

The separator is a comma.

%DEF_FILENAME="%F(%y%m%d_%H%M%S_TRG).csv"

%F creates the file name from the log file name set in Data Logger > Log file settings. Date and time in the specified format as well as the string "_TRG" are included in parentheses and the file extension .csv is added.

Example: file1(200121_145530_TRG).csv

%DEF_INT="S16" to %DEF_ASCII="CHAR2"

Used to specify the data format.

%HEADER="Date","Time",%COLUMNS

User-defined text ("Date", "Time") is followed by the column numbers for all data points (row 1: 1 to 4 for datapoint1 to datapoint4).

%HEADER+=,,%NAMES

%NAMES returns the names of the data points (row 2).

%HEADER+=,,%COMS

%COMS returns the COM port used to read the data (row 3).

%HEADER+=,,%REGISTERS

%REGISTERS returns the data register of each data point (row 4).

%HEADER+=,,%TYPES

%TYPES returns the data type of each data point (row 5).

%HEADER+=,,%DATAFORMATS

%DATAFORMATS returns the data type format as specified by %DEF_INT to %DEF_ASCII (row 6).

%HEADER+=,,%UNITS

%UNITS returns the unit of each data point (e.g. °C, kg). In the example no unit is defined (row 7).

%LOGDATA=%DATE,%TIME,%VALUES

This is the first row of the logged data. It starts with the date specified with %DEF_DATE and the time specified with %DEF_TIME, followed by the data point values.

Related topics:

Modified on: 2022-01-11Feedback on this pagePanasonic hotline