Troubleshooting
Query tag history from a remote tag provider
Short answer
Yes: Tag Historian is one module with two jobs — storage and retrieval — so the gateway where system.tag.queryTagHistory runs must license it too. Install and license the module on the querying gateway; from 8.1 a read-only license covers a gateway that only consumes history. Prove the fix by matching row counts between the two gateways.
On this page
- Does the querying gateway need its own Tag Historian license?
- Why does queryTagHistory come back empty instead of erroring?
- What changed between Ignition 8.0 and 8.1?
- How do I separate a storage fault from a retrieval fault?
- Should main pull history over the Gateway Network or read the database directly?
- Is it better to license main or route reports through edge?
- How do I apply the license and prove the fix?
- Questions asked
Yes: the gateway that runs the query needs the Tag Historian module too, not just the gateway that stores the samples. Tag Historian is one module with two jobs — storage, which writes tag values into the history database on the edge gateway, and retrieval, which resolves the history path and assembles the dataset on the querying gateway. Your live values browse and write through the Remote Tag Provider because that path needs no historian module; system.tag.queryTagHistory on main comes back empty because main has no retrieval half. That the trial makes it work is the confirmation. What follows separates this licensing gap from the routing and storage faults that imitate it.
Does the querying gateway need its own Tag Historian license? #
Yes — two gateways in the history path means two licensed modules: the storage half on the gateway that writes samples, and the retrieval half on the gateway where system.tag.queryTagHistory runs.
In your layout, edge collects from the PLCs and writes history, so edge carries the module for storage. Main browses edge's tags through a Remote Tag Provider and executes the query, so main carries the module for retrieval. With the module absent on main, the query returns an empty dataset and raises no error; with the trial active, the same call returns rows. That combination — empty without the module, populated under the trial — is a licensing result, not a configuration one. Do not rebuild the remote provider to chase it.
The decision: install and license Tag Historian on main. Nothing about the remote provider needs to change for licensing reasons.
Why does queryTagHistory come back empty instead of erroring? #
An unlicensed retrieval side fails quietly: the call executes, the provider name resolves, and you get a dataset with no rows and no exception, so nothing in the gateway logs points at licensing.
The empty result has three other causes worth ruling out in the same pass: the tag path points at a provider holding no history for that tag; the date window covers no stored samples; or the window ends exactly at the newest sample time. On that last one, the Ignition user manual notes that a query ending at a time boundary creates a final interval to contain it, and that bucket usually holds nothing yet because there is no future sample. End the window comfortably inside a period you know has data.
Write the paths exactly as the tag browser on main shows them, provider name in brackets: [EdgeRemote]Line1/Flow, where EdgeRemote stands for whatever you named the remote provider. A correct tag under the wrong provider name queries history that was never stored.
What changed between Ignition 8.0 and 8.1? #
The license split: from 8.1 the Tag Historian module can be licensed for read-only operations, which the 8.0 to 8.1 Upgrade Guide documents as the remedy for the license message a history-consuming gateway shows.
In practice this gives main its own seat: a gateway that only queries and charts remote history can carry the module licensed read-only, while edge keeps the storage license. If this architecture was built on 8.0, do not assume the old module placement still satisfies licensing after the upgrade; that guide is the document of record for the change, and the trial test in the next section tells you in one run which side of it you are on.
How do I separate a storage fault from a retrieval fault? #
Run the same query on the edge gateway against its local tag path: rows from edge mean storage is healthy and the fault sits on main, while an empty result on edge means no change on main can help.
Use a Designer script console or a gateway-scoped script on edge, query the local path, and record the row count plus the first and last timestamps. Then work this list:
- On main, open Config > System > Modules and read Tag Historian's state: not listed, running in trial, or licensed.
- On edge, confirm the tags have history enabled and the history provider points at a healthy database connection.
- On edge, check store-and-forward for quarantined or backed-up records; a stuck queue means samples exist but never landed.
- On main, check Status > Connections > Gateway Network for the link to edge; a stale connection can still serve cached live values while history fails.
Worked example with illustrative numbers: a tag stored on a fixed 5 s period, queried over one hour, gives 3600 s ÷ 5 s per sample = 720 expected rows. Suppose edge took a 10-minute gateway restart inside that hour: 600 s ÷ 5 s = 120 samples missing, so edge returns 720 − 120 = 600 rows. After main is licensed, the identical query on main must also return 600 rows with the same boundary timestamps. A different count on main means the request is not reaching the same history source — that is routing, not licensing.
If edge returns nothing at all, fix storage first: no retrieval-side change creates data that was never written. Recovering a period that was never stored means backfilling it from another system that captured it, which is the same task as backfilling trend history from a plant historian.
Should main pull history over the Gateway Network or read the database directly? #
Default to the Gateway Network: main's remote tag provider forwards history requests to edge's provider, which keeps the database credentials on one gateway and adds no schema-sharing risk.
A remote history provider reaches a history provider that lives on another gateway over the Gateway Network — the sharing pattern Inductive University demonstrates for exactly this two-gateway layout. The alternative is a database connection on main pointed at the same history schema edge writes; it removes the network hop and suits sites that already run a central history database, at the cost of a second credential set and a schema both gateways must stay in step with. One security note: if you open that direct connection, scope its account to read-only on the historian tables.
| Routing choice | Path the query takes | What it costs |
|---|---|---|
| Remote history provider over the Gateway Network | main → edge's licensed provider → edge's database | One network hop of latency; depends on the gateway link staying up |
| Direct database connection on main | main → shared history schema | A second credential set on main; schema must match on both gateways |
Either way, retrieval still executes on main, so the module requirement does not go away. The hop is what shapes how quickly trends draw at the operator station, and the factors behind it are covered in what actually decides historian data retrieval speed. Where the remote provider fits in a larger layout, with several edge gateways feeding one main, is a single versus multiple PLC tag provider design question.
Is it better to license main or route reports through edge? #
License main whenever anything on its screens shows a trend, because charts, history bindings, and report components all run on the retrieval half you would otherwise be missing.
The alternative is a gateway message handler on edge: main calls system.util.sendRequest, the handler runs system.tag.queryTagHistory locally where the module is already licensed, and the dataset travels back. It serves only queries that go through your own code — built-in chart components on main stay empty, and you own the timeouts and error handling. Treat it as a fit for a handful of scripted, scheduled reports and nothing else; the vendor's licensing model expects the consuming gateway to carry the module.
How do I apply the license and prove the fix? #
Install Tag Historian on main, confirm under the trial, then activate the license and re-run one fixed query window until main's row count and boundary timestamps equal edge's exactly.
- On main, open Config > System > Modules and install Tag Historian if it is not listed.
- Activate the trial on main and run system.tag.queryTagHistory with the full remote path, such as
[EdgeRemote]Line1/Flow, over the window you already tested on edge. - Note the row count and the first and last timestamps from the edge run — 600 rows in the example above.
- Activate the Tag Historian license on main so the modules page shows it licensed rather than in trial.
- Re-run the identical query on main. The count and both timestamps must match the edge result; when they do, retrieval is fixed.
- Open a chart on main bound to the remote tag and confirm the trend against the same window on edge.
When the trial window closes before the license is applied, queries on main go empty again — that is expected behavior, not a new fault.
Questions asked
Does it matter whether the remote gateway is an Ignition Edge edition?
It changes the licensing conversation, not the diagnosis. A gateway named edge in the Gateway Network can be a full platform install or an Edge edition, and Edge editions bundle and license modules differently, so check the gateway home page to see which one you have. The retrieval rule stands either way: whichever gateway executes the history query carries Tag Historian.
What does a read-only Tag Historian license allow on the consuming gateway?
Retrieval without storage. From 8.1 the module can be licensed for read-only operations, which the 8.0 to 8.1 Upgrade Guide describes as the way to remove the license message a history-consuming gateway otherwise shows. A gateway under that license can query, chart, and report against remote history; its role is consuming, not writing new samples for its own tags.
Why do live tags work on main but history does not?
They travel different paths. Live values browse and write through the Remote Tag Provider over the Gateway Network, and that path needs no historian module on main. History is a separate service: the query executes on main, so main needs the retrieval half of Tag Historian before any rows come back. That is also why the failure shows up with no error message.
How do I keep this from recurring on other gateways?
Record module placement as part of the architecture: every gateway that stores history carries Tag Historian for storage, and every gateway that queries it, even through a remote provider, carries it for retrieval. After any 8.x upgrade, re-read the modules page on each gateway before assuming a module split that predates 8.1 still satisfies licensing.