Logs periodically in event-based log format

<< Click to Display Table of Contents >>

Manual > Monitoring system construction guide > Establishing major functions > Logging/trend graph > Using logger actions > Collection of logger action samples >

Logs periodically in event-based log format

overview

This article explains how to perform periodic logging in event-based log format. This method can solve the following needs:

 

For example, in the log format of a general log, the number of fields depends on the number of tags to be logged. Therefore, if you are logging a large number of tags, the number of fields will increase in the general log.

 

(For general logs)

time

U01.F01.SD0001

U01.F01.SD0002

...

U01.F01.SD0999

2003/1/1 10:12:00

81

163

...

1243

2003/1/1 10:12:10

124

1635

...

6243

...

...

...

...

...

 

Therefore, if you want to perform logging at regular intervals but do not want to increase the number of fields for some reason, you can use the Script Ver.1 action to take logs at regular intervals in the following event-type log format.
 

(When logging is done periodically in event-based log format)

time

Tag Name

value

2003/1/1 10:12:00

U01.F01.SD0001

81

2003/1/1 10:12:00

U01.F01.SD0002

163

...

...

...

2003/1/1 10:12:00

U01.F01.SD0999

1243

2003/1/1 10:12:10

U01.F01.SD0001

124

2003/1/1 10:12:10

U01.F01.SD0002

1635

...

...

...

2003/1/1 10:12:10

U01.F01.SD0999

6243

 
In this sample example, SD0000 to SD0999 will be saved every 10 seconds in the above format.

 

 

Download the sample

The creation examples shown on this page are provided with samples.

 

The sample can be downloaded from below.

 

 

 

Setup Procedure

Tag configuration

 

1.Set the tags "U01.F01.SD0000" to "U01.F01.SD0999" for data collection.
 
c_action_logger_0102

 

 


Action Settings

 

1.Add a logger action "A01". Add a time field "F01" and the following event fields:
 
・F02: Field type "Tag name"
・F03: Field type "Value"
 
c_action_logger_0103
 

2.From the Text Settings tab of A01, set the file name and destination of the log file (below is an example setting).
 

p_logger_0001

 

 

3.Add script Ver1 action "A02".
 
Please write the following in the script. This will cause the F01 event to occur every time A02 is executed.
 
c_action_logger_0104
 
 
(script content)

//Event/F01!Fire = 1

 

 

 


Event Settings

 

1.Under Events, create a folder called "F01".
 
c_action_0379
 
 

2.Select the tags "U01.F01.SD0000" to "U01.F01.SD0999" from the multiview and drag and drop them into the "F01" folder above.
 
Then, the Tag event continuous addition wizard (right screen) will be displayed, so check "Manual generation".
By configuring this, events will not be generated even if the value of each tag changes.
 
c_action_logger_0105
 

3.Set the execution action of the folder "F01" to "A01".
 
※Please be careful not to register A01 as the execution action of Tag event.
 

4.Add Periodic event "E01" with a 10 second period to the event and set the execution action to "A02".
 
*Please be careful not to add E01 to the folder "F01".
 
c_action_0380
 
 
c_action_logger_0106
 
c_action_0381

 

 

Commentary

All 1000 Tag event events from SD0000 to SD0999 set in the event folder "F01" have "Manual occurrence" checked. By checking "Manual occurrence", Tag event events will not occur even if the tag value changes. Then, the "A02" script action is executed by Periodic event "E02" which has a 10 second cycle, and the following formula is executed periodically.

 

//Event/F01!Fire = 1

 

Then, the "F01" folder event will occur every 10 seconds, which will cause all Tag event registered in the folder to occur in conjunction with each other. As a result, the "A01" logger action set in "F01" will be executed every 10 seconds, and the following logging will be performed.

 

 

c_action_logger_0107

 

 

 

hint

In this example, "E01!Fire" is a system property that the event has. By manipulating this property, you can force the event to occur.