IMD SolutionComputing LibraryShop main store

Troubleshooting

Why TLGGetArchiveDataEx returns only OS server data

Edge computing and IIoT Published 7 min read

Short answer

TLGGetArchiveDataEx and the WinCC OLE DB provider both read the archive belonging to the machine they run on, so a PCS 7 OS Client at v8.0 SP2 returns OS server data and cannot return Process Historian 2013 Upd7 data. Commission Information Server against the Process Historian, then validate one known tag over a historian-only interval before trusting any export.

On this page
  1. What each interface is scoped to read
  2. Prove which archive a method reaches
  3. A worked test OS data cannot pass
  4. Commission Information Server against the Process Historian
  5. Other routes when the target is not the OS archive
  6. The decision for each case
  7. Questions asked

A C-script call to TLGGetArchiveDataEx on a PCS 7 OS Client at v8.0 SP2 answers with OS server data, and a WinCC OLE DB provider query from the same machine returns the same thing. That is the scope of both interfaces, not a fault in the client: the ODK archive functions read the archive of the WinCC project runtime they execute in, and the provider answers from the archives of the station it runs on. On an OS client that station is the OS server, so Process Historian 2013 Upd7 stays out of reach for both. The supported route to historian data without the OnlineTrend or OnlineTable controls is Information Server, commissioned against the Process Historian and validated on one known tag before any export is trusted.

What each interface is scoped to read #

TLGGetArchiveDataEx is an ODK function. Siemens documents the ODK archive functions for exporting archive data during the runtime of the WinCC project the script belongs to, with an export and import step when another project's runtime needs the same data. The call has no setting that names a different repository; it works on the archive its own runtime owns.

The WinCC OLE DB provider gives SQL-style access to process value and message archives and decodes the compressed, binary-coded archive data for the query. That scope matches the tested result exactly: on the OS client, the archives the provider can reach are the OS server's, so it produced no historian rows.

Neither result was a misconfiguration. Membership of the client in the same PCS 7 project does not extend either interface to the central historian, because the runtime value path and the historian storage path are separate. Where the runtime archive ends and the central repository begins is the split described in WinCC runtime archives versus a central process historian.

A scripted provider query follows the pattern walked through in the guide to reading WinCC tag logging data via the OLE DB provider script, and every query in that pattern inherits the same local scope. If the provider does not appear on the client at all, that is a separate fault; the documented fix when the WinCC OLE DB provider is missing on a PCS 7 v6.2 SP2 OS client covers it, and until the provider exists the archive question cannot be tested at all.

Retrieval method Where it runs What it reaches Use it for
TLGGetArchiveDataEx (ODK) in the runtime of the WinCC project the script belongs to that project's archive scripted export of OS archive data
WinCC OLE DB provider on the station whose archives it is set up against that station's process value and message archives scripted reads of OS archive data
Information Server on a reporting station the historian its data source names reports and exports from Process Historian

Prove which archive a method reaches #

Work the boundary as five checks, and let the results, not the success status, decide:

  • Record the machine, the method and the destination: which station executes the call or query, and which host the configured data source names.
  • Confirm the stored data first. In the Process Historian's own tools, check one known tag, one value and one timestamp before testing any retrieval path, because no path can return data that was never stored.
  • Choose an interval the OS archive cannot supply; the next section builds one.
  • Run the method under test for that interval and count the rows.
  • Keep three facts apart: connectivity means the host answers, authorization means the identity may read, and repository selection means the host is the historian. A reachable, authorized OS server still answers with OS data, so a query that succeeds has proven an archive was reached, not the archive.

The expected outcome is a written record of which method reaches which archive, so the retrieval choice is made from evidence rather than from hope.

A worked test OS data cannot pass #

Take 1 March 2024 as the test date and an OS server whose archives keep, for example, 14 days: its oldest retrievable row is then from 16 February 2024 (1 March minus 14 days). The test interval is 10 January 2023, 08:00 to 09:00, picked clear of any daylight-saving change so the timestamps stay unambiguous. Its age is 416 days: 365 back reaches 10 January 2024, 31 more reaches 10 February 2024, and 20 more reach 1 March 2024 because February 2024 has 29 days, and 365 + 31 + 20 = 416. That is 402 days past the OS retention window (416 − 14), so a row for this hour cannot come from the OS server.

Assume the tag is logged cyclically at 1 s. One hour then holds 60 × 60 = 3600 stored values, and because interfaces differ in how they bound interval endpoints, treat roughly 3600 rows as the pass mark rather than an exact count.

Run both paths for that hour. The OS-client call under test must return zero rows. The Information Server report aimed at the Process Historian must return about 3600. A method that returns rows for this hour has reached the central historian; one that returns none has not, whatever its status messages claim.

Commission Information Server against the Process Historian #

  1. Match the release pair, not the product names: Information Server must be a release documented as compatible with Process Historian 2013 Upd7 and PCS 7 v8.0 SP2. Siemens entry 109738439 describes Information Server, and entry 66579062 collects its installation and commissioning documentation.
  2. Inventory before installing: if a station already runs Information Server, record its version and its data sources instead of standing up a second instance first.
  3. Install from media and licensing obtained through Siemens or its authorized channels, and leave the historian side untouched while the runtime is in production.
  4. Configure the data source so it names the Process Historian host. The host in that configuration decides which archive answers, and pointing it at the OS server reproduces the original limitation even though the report itself runs.
  5. Check connectivity and authorization as two separate facts: a host that answers is not a host the account may read, and valid credentials do not correct a wrong host.
  6. Validate end to end: browse to the known tag under the reporting identity, run the historian-only hour, and compare against the roughly 3600-row expectation from the worked test.
  7. Build the real report only after that pass: one tag and a bounded range first, recorded samples versus processed values decided explicitly, and the time basis, local time or UTC, stated in the definition, because a daylight-saving shift can masquerade as missing data.

Commission on a test or maintenance window: repeated full-history queries from a reporting client load the runtime OS, and production is the worst time to discover that.

For historian data without the OnlineTrend or OnlineTable controls, Information Server commissioned against the Process Historian is the supported answer; no re-pointing of the client-side calls crosses the boundary.

Other routes when the target is not the OS archive #

A PCS 7 plant whose central archive is CAS has its own documented path: Siemens publishes an application example for exporting WinCC/CAS archive data with a separate C# application, and the OS-client calls do not reach CAS either. Which central archive a PCS 7 system should run is the comparison in PCS 7 CAS versus Process Historian: which archive to deploy.

The mirror-image fault has its own diagnosis. When the Process Historian is missing values that should have arrived, the write path is to blame, and why WinCC tag data never reaches Process Historian 2014 starts there.

The decision for each case #

  • OS archive data from a script: run TLGGetArchiveDataEx or the provider on the OS server side of the project, where that archive lives. On the OS client both keep answering with OS data, which is correct behavior rather than a fault to chase.
  • Process Historian data without the runtime controls: Information Server, its data source aimed at the historian host, validated on the historian-only hour before any export is trusted.
  • Provider absent on the client: fix that installation fault first, because until the provider exists the archive question cannot be tested at all.
  • Historian missing values that should have arrived: treat it as a write-path failure and start from the arrival diagnosis, not from retrieval.

Questions asked

Can TLGGetArchiveDataEx be pointed at Process Historian from the OS client?

No. The function exports data from the archive of the WinCC project runtime on the machine where the script executes. On a PCS 7 OS Client at v8.0 SP2 that is the OS server's archive, so the call returns OS server data by design; no call parameter selects the central historian. Retrieve Process Historian data through Information Server commissioned against the historian host.

Why does my OLE DB provider query succeed but still return no historian rows?

A successful query proves the provider reached an archive and the account may read it, not that it reached Process Historian. Run the query for an interval older than the OS archive's retention window: zero rows there means the provider answered from the OS server, which is its scope on an OS client, while the same hour returns values through an Information Server report pointed at the historian.

How much OS archive history can the client-side calls reach?

Whatever the OS archive configuration retains; segment count, segment size and logging cycle decide it. With an example retention of 14 days, any hour older than that comes back empty from the client even though the Process Historian still holds it. Pick your test interval from your own retention setting, because anything older than it can only be answered from the central historian.

Does Information Server also replace a scheduled C-script export?

Treat the first deliverable as a report, not a script replacement. Information Server reads the Process Historian through its commissioned data source and renders reports and exports; it is not a drop-in substitute for TLGGetArchiveDataEx inside a runtime script. Whether an unattended scheduled export is available depends on the facilities of the installed Information Server release, so define the tags, time range and output format before relying on automation.

Keep reading

  • Comparison

    PCS 7 CAS versus Process Historian: which archive to deploy

    Deploy the Process Historian on new and upgraded PCS 7 systems: it ships on the PCS 7 media, licenses by archived value count, and lands OS tags, messages and BATCH data in one SQL database. Keep the Central Archive Server only as a read-only archive for OS generations the current collector cannot read.

    Edge computing and IIoT

  • Troubleshooting

    Process Historian connected clients but no stored values

    Connected clients in the PH Management Console prove only the communication link. With Stored Values and Stored Messages frozen and a Com-Exception in SendToProcessHistorian in the WinCC diagnostics, the OS-side send fails after connecting: confirm OS archive generation, run the PHIsReady client configuration on each OS server with an authorized account, check the CCCAPH Server Service logon identity, and prove the fix with a counter delta.

    Edge computing and IIoT

  • How-to

    Transferring old WinCC tag logging data to Process Historian

    Old WinCC tag logging archives do not arrive on a newly commissioned Process Historian PC by themselves. Check version compatibility for your installed releases, back up and freeze the source archives, run the vendor's documented commissioning and historical-transfer procedure, then validate coverage by querying the same tag and interval in both systems.

    Edge computing and IIoT

Why slash aliases in tag historian query return zero rows