Logger Action (CSV/ODBC)

<< Click to Display Table of Contents >>

Manual > Server Creation Guide > Action Edition > Action Reference >

Logger Action (CSV/ODBC)

How to read the manual

This chapter is for reference information only.

For construction procedures, please refer to "Using Logger Actions" in the Monitoring System Construction Guide.

 

 

 

 

 

Features of this action

 

attention

There are two actions that provide logging functionality: "Logger Action" (this action) and "Summary Action". Each has its own characteristics. For example, if you want to perform daily report aggregation and form creation in addition to logging, select Summary Action. For the differences between the two, please refer to the comparison table in "Differences with Summary Action" on this page.

 

Logger actions are actions for saving data collected from PLC as historical data in CSV or ODBC databases (for supported databases, see here). Logger actions also include Historical data server functionality, which allows you to retrieve saved logging data via this action. For information on Historical data server functionality, see "Historical data server Actions".

 

Logging by logger actions is performed by triggering an event.

Depending on how you set the conditions for this event to occur (whether you want to perform periodic logging, or output an event log only when the tag value meets certain conditions, etc.), you can meet a variety of logging requirements.

 

The diagram below shows the flow of the logging process.

c_action_logger_0002

 

① Event occurrence

Logger actions are executed when an event occurs as a trigger. Each time a logger action is executed, one record is saved to the database. There are three types of events: "Periodic event", "Scheduled event", and "Tag event". The relationship between each event and logger action is as follows:
 

Periodic event

 

Logging will be performed at the specified interval from the start of online operation.

Scheduled event

 

Logging is performed at a fixed time. Logging can be performed every minute or every hour.

Tag event

 

Logging is done by evaluating a tag value.

 

② Data collection

When a logger action is triggered by an event, it will collect the data you need. You can choose to log by device value or by tag cache value. To do so, use Tag Field Settings.

 

3) Saving log data to cache

Log data collected during data collection is first stored in a cache in memory before being saved to the database. After that, it is saved to the database as needed.

This mechanism allows for stable logging that is not affected by the DB load. For example, when taking event-type logs, if a large amount of data changes at the same time, the log load temporarily increases, but even in such cases, stable logging is possible due to the cache mechanism. The settings are configured in Logger Action Log Details.

 

④ Save to DB

The cache value is saved in the database. When logging to a CSV file, in addition to writing each record to the disk, there is also a function (Flash Settings) that writes multiple records to the hard disk at once to reduce the load on the hard disk.

 

 

Logger Action Types

There are two types of logger actions:

 

kinds

Commentary

Logger (CSV)

Saves the log data to a text file (CSV format).

 

Logger (ODBC)

Log data is saved in a database (ODBC) (for supported databases, see here).

 

 

If you want to save log data to a database, you can use the Logger (ODBC) action. If you are not using a database, use the Logger action that uses a CSV file.

 

 

Difference from Summary Action

Logger Action is a function developed in versions prior to Ver4, and is specialized only for logging processing. On the other hand, Summary Action is a new function added in Ver5, and is a functional configuration that integrates logging function, aggregation processing, and report creation function.

 

If you only want to build a process that logs tag values, you can use either a logger action or a summary action to achieve logging, but they each have the following characteristics. Which action to choose should be based on the specifications and uses of each.

 

Comparison with Logger Action


Logger Actions

Summary Actions

High speed logging function

Logging is possible down to milliseconds.

For example, when saving to a CSV file, logging can be done in about a few tens of milliseconds, although this depends on the writing speed of the HDD and the communication speed with the PLC, etc.

Logging can be done at a maximum interval of 1 second. Logging at millisecond intervals is not supported.

How to set tags for logging

You can set the desired tags by dragging and dropping them on the FA-Server screen.

Each action corresponds to one database (one file for CSV, one table for ODBC). If you want to save to multiple CSV files or tables, you need to define multiple actions in parallel.

Set the tag path to be logged in the summary action configuration file "Tag Field Master" (text file).

Tag field masters are set manually using Excel or Notepad.

Furthermore, by defining the maximum number of columns in the database in advance, the data will be automatically split and generated into multiple databases (multiple files for CSV, multiple tables for ODBC) at runtime.

Log Format

In addition to general time-series logs, it is also possible to generate event-type logs.

 

Only general time-series logs are supported.

 

Aggregation function

none.

 

This action can only be used for logging. Furthermore, historical data generated by this action cannot be aggregated by summary actions.

 

Yes.

 

Based on the historical data (logging data) generated by Summary Action itself, it automatically performs aggregation processing using various statistical methods such as sum, average, maximum, and minimum.

You can also perform calculations between aggregated data from each field and save the results as aggregated data.

 

Reporting

none.

 

This action can only be used for logging. Furthermore, historical data generated by this action cannot be aggregated by summary actions.

 

Yes.

 

Built-in report creation function. Reports are created based on the data collected by Summary Action itself.

 

Historical data server Features

Yes.

 

You can connect to historical data from the client FA-Client and display trend graphs on the screen.

 

Yes.

 

(Same as left)

 

 

Hint

Use a logger action if you want to log at a high-speed interval such as milliseconds, or if you simply want to log. On the other hand, if a logging interval of 1 second or more is OK and you need to perform daily report aggregation, use a summary action (*If you need to perform daily report aggregation, you must select a summary action). For more information about summary actions, see "Summary".

 

 

 

Log data storage format

There are two main formats for saving log data:General log"and"Event-based logging" General logs are a method of saving log data for each field at a fixed interval or at a fixed time. Event logs are a method of saving log data triggered by a change in tag value or when the tag value exceeds a limit value. It is also possible to output a mixture of the two formats mentioned above. This method is called "Mixed Logs"It is called "

 

1.General log

time

ms

Temperature 1

Temperature 2

Temperature 3

pressure

Valve 1

Valve 2

2003/1/1 10:12:00

10

10.5

32.8

40.7

5.5

TRUE

FALSE

2003/1/1 10:12:10

10

10.7

32.6

40.6

5.4

FALSE

TRUE

2003/1/1 10:12:20

10

10.8

32.4

40.8

5.3

TRUE

FALSE

...

...

...

...

...

...

...

...

 

2.Event-based logging

time

tag

value

comment

2003/1/1 15:11:12

Temperature 1

15.1

The upper limit has been exceeded. Please check the device.

2003/1/1 15:21:18

pressure

5

has returned to normal.

2003/1/1 15:23:25

Valve 1

1

Valve OPEN.

2003/1/1 15:28:12

Temperature 1

15

has returned to normal.

...

...

...

...

 

3.Mixed Logs

time

tag

value

comment

Valve 1

Valve 2

2003/1/1 15:11:12

Temperature 1

15.1

The upper limit has been exceeded. Please check the device.

FALSE

FALSE

2003/1/1 15:21:18

pressure

5

has returned to normal.

FALSE

FALSE

2003/1/1 15:23:25

Valve 1

1

Valve OPEN.

TRUE

FALSE

2003/1/1 15:28:12

Temperature 1

15

has returned to normal.

TRUE

FALSE

...

...

...

...

...

...