Flexible SCADA Help
Data

Value archive

The archive keeps the history of values for trends and reports. Only the variables you mark are written — so the disk is not filled with what nobody looks at.

What is archived

How it is written: variable settings

When “Write to archive” is on, the variable window shows the recording settings (per OPC UA Part 11). An empty field means the default of the chosen archive (it is shown in grey in the field).

SettingValuesMeaning
Archivethe server archives: “Main” and your own groupswhich group to write to — groups have their own retention. Under the field: how long data is kept and how long the hourly values
Archive deadbanda number in the variable units or in % of the range (the “units” / “% of range” switch)a smaller change is not written. The main way to reduce the volume: 0.1 bar for a 0…16 bar pressure — dozens of times fewer records without losing meaning
Not more often than, sseconds; default 1 swithin this period the last value is written — fast fluctuations do not flood the archive
Not less often than, minminutes; default 10 mina constant value is still written once per period — the trend shows the connection was there

Server archives

The Archives section in the tree (under the server) and in the admin panel shows the server archives: how many variables are written, volume, depth and free space. An archive group has its own retention and its own defaults for the deadband and intervals. For example: “Metering” — 5 years for meters, “Process” — 90 days for fast signals.

Archives in the admin panel: groups, retention, volume, depth, compression.
Archives in the admin panel: groups, retention, volume, depth, compression.
Archive settingValuesMeaning
Archivetextthe name — the archive is chosen by it in a variable
IdLatin lettersthe archive code in the files; the main one is main
Keep, daysdefault 90how long exact values are kept; older ones are deleted
Limit, GBdefault 20how much disk the archive may take; at the limit the oldest days are deleted (the “Trimmed by limit” column)
Deadband, % of rangedefault 0the default deadband for the archive variables
Not more often than, sdefault 1the default “not more often” interval
Not less often than, mindefault 10the default “not less often” interval
Hourly, daysdefault 1095how long hourly values (average, min, max) are kept — for reports and trends over years

Add archive — a new group, Save archives — apply. The “Archives on disk” table shows for each: how many variables are written, the space taken, the daily volume before compression, how many days the space will last (“Fits”), the compression ratio. The Write history to disk checkbox turns writing off completely (memory only).

How it is stored

Values first accumulate in memory and once a second are written to the write journal on disk — a power loss loses at most a second. Then the journal is laid out into daily files and compressed (several times smaller than the original); compression runs in the background and does not disturb trends. “Recording gaps” show whether the archive has been continuous. With server redundancy the archive is backfilled from the pair for the downtime.

Besides the disk there is in-memory history: the last 36,000 points of every archived variable — from it a trend instantly shows the last hour. The server takes the memory for it at start-up: 17 bytes per point, so 2,000 variables × 36,000 points ≈ 1.2 GB, and occupies it as points are written (the server's working set grows during the first hours — that is the ring filling up, not a leak). The ceiling is in the project's historian settings (2,048 MB by default): on a large project the ring becomes shorter by itself.

A volume estimate: a variable that changes once a second, without a deadband — about 1 MB a day before compression. With a deadband and “not more often than 5 s” — 10–50 times less.

Writing to external databases

For MES, ERP, BI and enterprise reports the project also writes data to the enterprise database: PostgreSQL (and Postgres Pro), MS SQL Server, ClickHouse, InfluxDB (1.x and 2). The project's own archive does not depend on it. Connections are in the project tree, the Databases section; a new one — right-click the project root → Create ▸ → Database connection (requires the Administration right).

FieldMeaning
Namethe connection name in the project — it is chosen at the variable
Database typePostgreSQL / Postgres Pro, MS SQL Server, ClickHouse, InfluxDB; default ports 5432, 1433, 8123, 8086
Write to this databaseoff — the connection exists but does not write
Server address, PortMS SQL — an instance works too: server\SQLEXPRESS
DatabaseInfluxDB 2 — the bucket, 1.x — the database
User, PasswordInfluxDB 2 — organisation and token; MS SQL without a user — Windows sign-in (the Flexible SCADA service account). The password is stored encrypted with the server key; when the project moves to another server the password is entered again
Encryption (TLS / HTTPS)a protected channel to the database; “Trust the database server certificate” — for an MS SQL server's own certificate
Additionalconnection string parameters for PostgreSQL and MS SQL: Key=Value;…
What to writevariable values (those marked “Write to the database”), alarms (raised, cleared, acknowledged, shelved), the audit log (who changed what and when); each into its own table
Create tables if they do not existneeds the CREATE right; without it the database administrator creates the tables by the pattern below
Keep in the database, daysolder rows are deleted hourly; 0 — keep everything. ClickHouse — the table TTL, InfluxDB — the bucket retention
When to write (default for variables)“on change (deadband)” or “every period”; how often to check, the deadband in the variable's units, “Not less often, min” — a constant value is still written every N minutes
Queuerows in one insert; disk buffer, MB — with no connection to the database rows accumulate here and are written later

A variable can have its own settings: the variable window → Processing → Write to the database (connection, when to write). Test connection connects and shows the database version.

Tables (the names can be changed in the connection):

TableColumns
scada_values — valuests (time, UTC), server, project, tag, value (number), text (string value), quality; index on (tag, ts)
scada_alarms — alarmsts, server, project, alarm_id, name, event (raised, cleared, acknowledged…), priority, area, object, message, value, username, note
scada_audit — audit logts, server, project, username, ip, action, target, details, ok, error

The server column lets several servers write into one database. The connection list shows the link state, what is written, how much, per minute, the queue and the disk buffer, rows lost, the last error. Only the active server of a redundant pair writes; an engineering station in “Engineering without plant connection” mode and the program's development server (“This computer — development”) do not write at all. PostgreSQL receives values with COPY — thousands of rows per exchange.