Logging large amounts of data using array tags

<< 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 >

Logging large amounts of data using array tags

overview

This article explains how to use array tags to log large amounts of data.

 

It is possible to log large amounts of data by preparing one tag for each logging target, but if there are too many tags to register in the logger action, the setup work may become cumbersome. By using array tags, you can easily log consecutive device areas by registering only one tag.

 

 

 

Download the sample

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

 

The sample can be downloaded from below.

 

 

 

Setup Procedure

Tag settings

 

1.Set a virtual device tag "U01.F01.SD0000" for data collection and define it as an array with the following properties (in this example, an array of 5000 items).
 
This setting defines the consecutive address area from SD0000 to SD04999 as one tag.
 
c_action_logger_0067
 
c_action_logger_0068

 

 


Action Settings

 

1.Add logger action "A01".
 
After setting the time field, drag and drop the array tag "U01.F01.SD0000" you created earlier to set the tag field.
Now set the properties of the tag field as follows:
 
Name: "U01_F01_SD" Number of columns: "5000" Number of digits: "4"
 
c_action_logger_0069
 
c_action_logger_0070

 

 

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

 

 


Event Settings

 

1.Add Periodic event"E01".
 
Set the cycle to 1 second and the execution action to "A01".
 
c_action_logger_0064
 
c_action_logger_0065

 

 

Commentary

Array tags allow you to store a series of devices together, in this example we have defined 5000 consecutive devices.

 

Note that while the field name is not very important when logging to a CSV file, if you are logging to a database via ODBC, please note that the field name definition in the logger must match the table layout. In this example, the name was set to "U01_F01_SD", the number of columns to "5000", and the number of digits to "4" in the field setting screen. This will output each field name in the log data as a consecutive number from "U01_F01_SD0000" to "U01_F01_SD4999".

 

 

Examples of applications of this sample

Array tags can also be included in event-based logs. For example, the following format stores the changes to each tag, one tag per line.

 

time

Tag Name

value

2003/1/1 10:12:00

U01.F01.SD005

81

2003/1/1 10:12:01

U01.F01.SD001

163

2003/1/1 10:12:02

U01.F01.SD004

41

...

...

...

 

By defining each tag as an array tag and setting the number of columns in the field settings to multiple columns, multiple tags can be logged in blocks per line. In this case, logging will occur if even one value changes within the array tag. Note that if the number of arrays for each tag is greater than the number of columns in the field, the array elements that exceed the number of columns in the field will be truncated. Conversely, if the number of arrays is less than the number of columns in the field, the excess fields will be filled with NULL.

 

time

Tag Name

Value 00

...

Value 99

2003/1/1 10:12:00

U01.F01.BLOCK1

81

...

98

2003/1/1 10:12:01

U01.F01. BLOCK3

163

...

54

2003/1/1 10:12:02

U01.F01. BLOCK5

41

...

2

...

...

...

...

...