Introduction to the Historian

The Historian Manager is used to configure the recording of Tags from the I/O Data Server using two different data recording engines:

 

 

Both data recording engines record tag values on Database but using two different criteria for doing so which correspond to tow different table formats.

 

 

 

 

Historians

The Historian records associated Tags on the event of value variations.

For each variable value association, that satisfied the criteria configured in the Historian, a row will be recorded in the Database table containing: the date and time, current variable value, previous variable value and other information.

 

 

When the Historian has been associated 10 variables that all change their value at the same time, 10 rows will be recorded on the database table, one for each variable.

 

The use of the Historian is therefore efficient and ideal for keeping track of Tag value changes that do not frequently happen or of those Tags whose trend we cannot predict beforehand and therefore difficult to estimate a fixed recording interval.

 

DB Connection

Historians connect to the database by means of the Xpo Provider using the "Historian Default Connection" string for default set in the I/O Data Server's general properties.  As an alternative, a different string can be specified for each Historian.

For further information, please refer to the paragraph dedicated to "Xpo Provider connection strings (Historian)" in the topic on "Database Connections".

 

 

 

 

Using SQL Server Express as database

When you use the Microsoft SQL Server Express the table generated by Movicon.NexT will be set with the 'Simple' recovery model option.

The log file space in this mode is automatically recovered to limit the disk space requisites and, therefore, to avoid having to manage the space in the transactions log.

The recovery model switches from 'Simple' to 'Complete' only when the 'Enable data protection' for the CFR21 management is enabled.

In this way, all modifications made to the table created by Movicon.NExT will be traced and you will need to instigate a log file backup plan in order to manage the transactions log's disk space.  In cases where no backup plan is instigated, there might be a risk that the transactions log file will increase in size to occupy all the space available on the disk.

 

Using SQL Server as database

When you use the SQL Server, the tables generated by Movicon.NExT will be set with the 'Complete' recovery model option.

In this way, all modifications made to the table created by Movicon.NExt will be traced and you will, therefore, need to instigate a log backup plan to manage the transactions log's fixed disk space.

 

 

If a backup plan is not implemented, the transactions log file might increase in size to then occupy all the fixed disk space available.

 

SQL Server CE

As previously mentioned, the standard SQL Server version is installed during the Movicon.NExT setup unlike the Compact Edition of this program which must be downloaded from the Microsoft website using this link:

 

https://www.microsoft.com/it-it/download/details.aspx?id=30709  

 

SQL CE installation is indicated for low performing devices or those which have less memory available.  In addition, it provides access protection to data on the database through the use of passwords which can be set using the connection string in accordance with the cf-21 requirements.   

Various programs can be used, like the one below, to consult data using external tools:

 

http://www.linqpad.net/

 

Data Flush

If the connection to the Database in which data is being recorded is interrupted, the Historical will unload data on to xml files with a name using the following syntax:

 

Historical_yyyyMMddHHMM.FlushedData

 

These files are copied in the project's "UFUAServer\Historian" subfolder  and then removed after the pending queries have been executed.

 

Unavailable DB Connections

In cases in which the connection to the DataBase on which data is being recorded becomes unavailable, the Historian Manager will load the data onto xml files whose names will use the following syntax:

 

<HistorianName>_yyyyMMddHHMM.SafeDataHisLog

 

These files are saved in the project's "<ProjectName>\UFUAServer\Historian" subfolder and will be deleted and flushed data saved to the database by executing the pending query.

 

Mapping on DB

According to the type of Tag data defined in the DataLogger, a field will be defined in the SQL Server database to contain the Movicon.NExT data. The data correspond to each other as follows:

 

Movicon

SQL Server

Boolean

bit

Byte

tinyint

SByte

smallint

Int16

smallint

Uint16

int

Int32

int

Uint32

BigInt

Int64

BigInt

Uint64

BigInt

Float

Real

Double

float

String

nvarchar