Historical data server (CSV/ODBC)

<< Click to Display Table of Contents >>

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

Historical data server (CSV/ODBC)

How to read the manual

This chapter is for reference information only.

For construction procedures, please refer to "Using Historical data server" in the Monitoring System Construction Guide.

 

 

 

 

 

Features of this action

The Historical data server action is an action to connect to a database where historical data is stored and obtain the historical data. The database supports CSV and ODBC. This action can be used, for example, to display historical data stored in a database by an external application on a trend graph.

 

c_action_0005

 

 

What is historical data?

 

Historical data refers to historical data recorded in chronological order, including date and time fields. In addition to date and time fields, you can also define MS fields (milliseconds). MS fields are necessary when handling data in ms units (1 second = 1000 ms).

 

 

(MS field not included)

time

DATA00

DATA01

...

DATA98

DATA99

2003/1/1 00:00:00

23

0

...

2

75

2003/1/1 00:00:00

44

1

...

3

34

...

...

...

...

...

...

2003/1/1 23:59:59

54

0

...

4

66

 

 

(MS field included)

time

ms

DATA00

DATA01

...

DATA98

DATA99

2003/1/1 00:00:00

100

23

0

...

2

75

2003/1/1 00:00:00

200

44

1

...

3

34

...

...

...

...

...

...

...

2003/1/1 23:59:59

100

54

0

...

4

66

 

*When handling data with a sampling rate of less than 1 second, please define the MS field.

 

 

hint

By linking Historical data server with the MS field defined to a log data graph, for example, a detailed graph in ms units will be displayed.

 

 

If you want to connect to several different databases to get historical data, define an Historical data server for each DB.

 

c_action_0006

 

 

A single Historical data server can be shared by multiple actions and screens. However, if multiple requests for Historical data server occur simultaneously, the requests will be processed in the order they were received, so subsequent processing may have to wait. In such cases, you can define Historical data server individually for each purpose to perform parallel processing, resulting in faster processing.

 

c_action_0007

 

 

Action Settings

The settings for this action are explained below.

 

Action specifications

Parameters

none

 

dialog

■ Text settings (for Historical data server (CSV))

 

c_action_0008

 

The date is added to the file name
For CSV files, there are two options: splitting the file by date, or not splitting it. If the file is split by date, check the property "Date is added to the file name" in the image above.

 

 

Example: When data is contained in one file

LOG.csv

time

DATA00

...

DATA99

2003/1/1 00:00:00

23

...

75

2003/1/1 00:00:01

44

...

34

...

...

...

...

2003/1/2 00:00:00

43

...

55

2003/1/2 00:00:01

53

...

74

...

...

...

...

 

 

Example: When data files are separated by date

LOG20030101.csv

time

DATA00

...

DATA99

2003/1/1 00:00:00

23

...

75

...

...

...

...

2003/1/1 23:59:59

54

...

66

 

LOG20030102.csv

time

DATA00

...

DATA99

2003/1/2 00:00:00

43

...

55

...

...

...

...

2003/1/2 23:59:59

67

...

86

 

The file name must have the date added to the end. If you enter "LOG.csv" as the file name and specify "yyyymmdd", the actual file name will be in the format LOG20030101.csv.

 

 

Heading exists/Number of heading lines
If you check this item, the specified number of lines will be considered as header lines.

 

Example: If the number of header lines is set to 1, the first line of the CSV file will be the header line.

time

DATA00

...

DATA99

2003/1/1 00:00:00

23

...

75

...

...

...

...

2003/1/1 23:59:59

54

...

66

 

 

 


■ODBC settings (for Historical data server (ODBC))

 

c_action_0010

 

When selecting a database, select "Generic"/"SQLServer"/"Oracle"/"MySQL"/"PosgreSQL". If you specify a non-generic database product, the processing will be optimized for each database, and each process will be faster.

For the data source, specify the ODBC data source name to connect to the database. For information on how to set up the data source, see "ODBC Settings" in the common settings.

For the table name, specify the name of the table in which you want to store the alarm data.
If you want to specify the database schema name to connect, please specify the schema name. Note that if you are using MySQL, do not specify the schema name on this setting screen.

 


■ Time field

 

c_action_0011

 

The "Date/Time field" is automatically determined, so there is usually no need to specify it. This setting should only be specified if a data item contains two or more "Date/Time fields" and you want to specify which field to use as the time series. Also, specify the MS field (millisecond field) only if the database contains a millisecond field. Including the MS field allows the graph to be displayed in milliseconds on the historical trend graph.