Computing Library
Earlier articles
How-to
Get the last N stored records from an Ignition tag history query
A positive returnSize in system.tag.queryTagHistory splits the window into that many time buckets and aggregates each one, so it never yields the newest N stored events. Query raw history with no fixed return size and noInterpolation=True over a bounded window ending at a fixed cutoff, count rows, and step back through earlier windows until you reach N.
Explainer
Tier 2 AVEVA Historian requirements: Advanced, not SQL Enterprise
No, a Tier 2 AVEVA Historian 2023 R2 that receives replicated data needs Advanced Edition (the former Enterprise Edition), not SQL Server Enterprise. SQL Server Enterprise has never been a general requirement; only InSQL 9.0 Enterprise ever needed SQL Server Cluster support. Pick the SQL Server edition by workload.
How-to
Setting up Sparkplug B on an edge gateway controller
Sparkplug B runs on the 1152 and 2152 through the Sparkplug driver in PLCnext Edge Gateway, installed from the web with the Edge Deployment tool. Back up the PLCnext project first: the install forces 2022 LTS firmware and a type 1 reset that wipes it. Expose tags by marking them HMI and enabling the PLCnext API, then validate NCMD and DCMD writes and test store-and-forward before go-live.
Troubleshooting
Legacy PLC timeout over a VMware serial port
The timeout is a port-number problem, not a PLC problem: the host's COM2 never crosses into the guest, which numbers the virtual serial port itself — a guest with one serial port shows COM1. Point the programming software at the COM number the guest lists, then isolate the USB adapter, the cable pinout and the serial parameters one change at a time.
Troubleshooting
Fix Ignition custom historian aggregates that return zeros
A zero-filled result from an Ignition custom historian aggregate means the callback failed, not that every stored value was zero. The Gateway log names the cause: NameError: global name 'shared' is not defined, raised in pyaggimpl. Select the project that contains your aggregate's script library as the Gateway Scripting Project, publish it, and rerun the query.
Selection guide
Choosing a site historian for a PC-based SCADA host
Start with the historian your SCADA host already licenses; add a separate engine only when an external consumer (enterprise rollup, SSRS-style reporting, cloud analytics) demands one. Keep cross-vendor history on OPC-HDA, move real-time cross-vendor data onto an MQTT bridge instead of OPC-DA COM, and benchmark anything above the reported 10,000-tag field ceiling before committing.
Troubleshooting
Why Ignition tag history records only every 10 seconds
History that lands only every 10 seconds, dropping peaks shorter than that, is the historical scan class at work: in the case traced here the Default Historical scan class sat at a 10-second interval while 1 second was expected. SQL Express, Windows 7 and the hardware were not involved. Read the interval on the tag's assigned scan class, set it to the rate your data needs, and prove the fix with a brief test peak in a history query.
Troubleshooting
Historian shows a real value hours off: check the UTC offset
A historian value that is real in the raw data but displayed hours late is a timestamp-basis mismatch: the store keeps UTC and the client reads it as local time. Confirm the record exists, convert it with the offset in force on the event date, and correct the conversion layer — never edit the stored history.
How-to
Reduce stored historian data older than six months to ten seconds
Summarize one pilot daily table with set-based PostgreSQL aggregation, verify it through a historian query on a known tag, then rename it in place inside one transaction. Going forward, record new history at ten seconds in a secondary provider and cap the one-second provider's retention at six months. At 28,000 tags, ten-second storage removes about 90% of stored rows.
Explainer
Handling Java concurrency on an edge gateway without a database
No database engine is documented for the embedded Java runtime on this class of edge gateway, and string tags are not supported there. Keep shared in-memory state in a synchronized Vector, run every read-modify-write sequence and every file update through one synchronized single-writer boundary, and leave integer and float tags to process values.
Troubleshooting
Why Auto deadband style delays Double tag history storage
Under Auto, the historian gives Float and Double tags analog compression: a changed value becomes a stored record only when a later sample leaves the compression window, so the newest history row can lag the live value. Set the tag's Deadband Style to Discrete and size the deadband to the change magnitude when every qualifying change must be recorded immediately.
How-to
Ignition historian deadband threshold timing test
Historian deadband compression is lossy: two signals can leave the same stored points yet differ in time above a threshold. Capture one analog tag upstream of the deadband, compute the exceedance duration from both records with identical rules, and accept the settings only when the error stays inside your stated limit. The worked example hides a 5 s excursion under a 2 °C deadband.