Explainer
Why Edge-to-Central synced history can't fill a custom SQL table
Short answer
Central exposes no hook between sync receipt and historian insert, so synced Edge history can only land in the standard narrow tables. Build wide rows at the source with a Standard gateway's SQL Bridge historical group or a scripted store-and-forward insert, or expose the custom shape as a view or API over the standard tables. Central-side SQL Bridge sampling loses every outage window.

On this page
There is no hook to fill a custom SQL table from the Central side of an Edge history sync. The sync carries historian records, and Central writes each one straight into its standard historian tables — one tag value per row, each with its own timestamp — with no event, script or staging step between receipt and insert. A wide row can only be built where the values are sampled together: at the source, on a Standard gateway writing through a store-and-forward database connection with a SQL Bridge historical group or a scripted prepared update. The fallback is to keep the standard tables and expose the custom shape as a view or API. Central-side SQL Bridge sampling is the one design to avoid, because it loses every outage window — the exact failure your current sync does not have.
Where the synced record stops #
Follow one record from the PLC. On the Edge gateway, a tag with history enabled is stored on change, and Edge keeps roughly a week of history storage as its sync cache, forwarding the backlog over the Gateway Network once the link returns — the load pattern covered in how store and forward carries data from Ignition Edge stations.
On Central, the realtime half of the sync appears as a remote tag provider you create under Gateway Config > Tags > Realtime, where Create new Realtime Tag Provider offers the Remote Tag Provider (Gateway Network) type — the setup walked through in pulling Ignition Edge tags to the main gateway with a remote tag provider. The history half takes a different road: Central writes the received records straight into its own historian store. No service, script hook or intermediate table sits on that road, and that is the whole answer to your question. This behavior is stated for the 8.1 line; the reference installation runs Edge 8.1.44 against Central 8.1.43.
What the standard historian format requires #
The governing standard is the platform's own historian schema, fixed in its database table reference. Values land in time-partitioned sqlt_data tables; sqlth_partitions registers each table's start and end times, and sqlth_drv ties the partitions to the history provider. Every row holds one tag's value with its quality and its own timestamp, recorded on change under that tag's deadband and history settings.
The consequences follow directly. Two values read in the same PLC scan become two rows with different timestamps. A tag that did not change contributes no row at all. No shared scan timestamp exists to join on, so a wide row assembled afterward is a reconstruction: you choose a time bucket, an aggregation or interpolation rule, and a policy for empty buckets. Downstream tools do this constantly — converting a narrow CSV export into wide columns with a pivot table is the same operation — but it is modeling, not reformatting.
Run the check before anything else: query Central's historian database for two tags from the same PLC over the same minute. Each value sits on its own row and the timestamps do not line up. If that is what you see, the rest of this article applies.
Why every Central-side workaround fails #
| Attempt | What you see | Why |
|---|---|---|
| SQL Bridge group on Central reading the Edge tags | Wide rows while connected, a hole for every outage | The group samples live values on Central; during an outage there are none, and Edge backfills the historian only |
Database trigger on Central's sqlt_data tables |
One fire per tag value, misaligned timestamps, bursts after a reconnect | The trigger sees the same narrow rows, and the partition receiving new rows changes as time passes |
| A custom table written on the Edge gateway | Not configurable | Edge has no database connection and no SQL Bridge |
| A hook on the sync receive path | Nothing to attach to | Central writes received records into historian format directly |
If a transaction group already runs on Central, prove the gap on your own system: stop Central's services for a measured interval — 30 minutes is enough — then compare. After the restart the historian backfills the window from the Edge cache; the group's table keeps a 30-minute hole, permanently. Schedule that test in a maintenance window, because reports and anything else watching Central record the same gap.
Building the source-side insert #
The component Edge lacks is a database connection with a store-and-forward engine. On a Standard gateway both the Tag Historian and SQL Bridge write through that engine, so records queue locally while the database is unreachable and flush on reconnect. A plain prepared update that bypasses the engine goes straight to the database and fails during the outage — never log with one. The trade between the two writers is covered in Tag Historian versus SQL Bridge storage for a short-term trend database.
- License a Standard gateway with the base platform and the SQL Bridge module — no visualization module needed — and install it at the site, on the Edge unit's hardware if resources allow or in place of it.
- Recreate the PLC device connection and confirm it from the gateway's device status before touching the database.
- Create the database connection to the database that will hold the custom table, and confirm it reports valid.
- Raise that connection's store-and-forward buffer for your outage target, sized in the next section.
- Build a historical transaction group: target the custom table, map each tag to a column, set the timestamp column and the trigger (a fixed rate or a PLC handshake), and bind the group to the store-and-forward-backed connection.
- When the row needs logic a group cannot express, script the insert instead.
system.db.runSFPrepUpdate is the script function that writes through the same engine: pass the prepared statement, the parameter list and the store-and-forward-enabled connection name. Everything below the comments is illustrative — table, columns, connection name and values:
# Gateway Timer script on the Standard gateway, fixed rate, for example 1000 ms.
# Table, columns, connection name and values are illustrative.
import java.util.Date # standard Java class
rowStamp = Date() # java.util.Date, this execution's time
lineSpeed = 12.4 # float, example value read from the speed tag
oilTemp = 63.0 # float, example value read from the temperature tag
insertSql = "INSERT INTO line1_log (t_stamp, line_speed, oil_temp) VALUES (?, ?, ?)"
insertArgs = [rowStamp, lineSpeed, oilTemp] # list, one entry per ? in order
system.db.runSFPrepUpdate(insertSql, insertArgs, "CentralLog")
Prove it the way you proved the sync. With the timer running, cut the database for 10 minutes — 600 executions at this rate — and watch the store-and-forward cache count climb. Restore the link and run:
SELECT COUNT(*) FROM line1_log
WHERE t_stamp BETWEEN '2025-04-08 02:00:00' AND '2025-04-08 02:10:00';
Expect 600 rows, discounting only timer jitter at the edges. When that count comes back, the wide row survives exactly the outage your sync survived.
Sizing the store-and-forward buffer #
Worked example. Your target is the outage the Edge cache already covered: 7 days. Buffer need is row rate multiplied by outage seconds, and the row rate is your own choice, set by the group's trigger.
- One row every second: 7 × 24 × 3,600 = 604,800 seconds, so 604,800 records.
- One row every 10 seconds: 604,800 ÷ 10 = 60,480 records.
Open that connection's store-and-forward settings, read the current record limits, and raise them above the figure for your rate with headroom. Point the disk cache at storage that survives a power loss, since a network outage and a power event often arrive together.
The decision for each case #
| Path | Where the wide row forms | During an outage | What it costs |
|---|---|---|---|
| A. Standard gateway at the site: SQL Bridge historical group or scripted store-and-forward insert | At the source, values sampled together | Records queue locally and flush on reconnect | A new license (base plus SQL Bridge) and a short commissioning |
| B. Scheduled scripts on Central repackaging historian data | After the fact, from time-bucketed queries | Late backfill must be detected and reprocessed | No license change; open-ended scripting and permanent maintenance |
| C. A SQL view or WebDev API over the standard tables | At query time | Inherits historian completeness automatically | No new data store; the API variant needs the WebDev module |
- The next processing step needs physical, scan-aligned rows — one row per machine cycle or handshake: Path A. It is the only path that samples the values together, and the two sections above are its commissioning.
- The consumer accepts fixed-interval buckets and can read a view or an HTTP endpoint: Path C. It is the cheapest fix and inherits every backfill the historian performs.
- A new license is off the table and the consumer insists on physical bucketed rows: Path B — and write the maintenance budget down first, because every outage window must be found and reprocessed by hand for the life of the system.
Your sync already proved the outage behavior you need. Path A moves row assembly to the only place it can happen without giving that behavior up; Path C keeps the sync untouched and answers the requirement at query time.
Questions asked
Is a SQL view over the historian tables fast enough?
Query cost scales with the time range and tag count requested, not with how long the data has been stored. A view pivoting a day of one-second data for hundreds of tags is heavy; a shift's worth for a handful of tags is routine. Size the view's window to what the downstream step actually reads, and aggregate older data instead of pivoting raw rows.
How long does Edge hold history while the link to Central is down?
About a week of storage serves as the sync cache, and the backlog flushes to Central once the Gateway Network connection returns. That cache serves history sync only. Edge has no database connection of its own, so nothing buffered on the Edge side can be steered into a custom table there.
What timestamp does a historical transaction group write?
One timestamp per row, taken from the group's execution, so every column in that row shares it, which is the property narrow history can never offer. If the PLC publishes its own clock or cycle counter, log that in a second column so downstream joins do not depend on the gateway's clock.
Why not keep the transaction group on Central and patch outage gaps by hand?
Because the repair never ends and the damage is silent. Every disconnection leaves a window the group never sampled, and nothing flags it until someone compares the group's table with the historian. The patched rows are also reconstructions rebuilt from narrow history, quietly mixed into a table meant to hold sampled rows.


