Skip to main content

KingHistorian

warning

KingHistorian ingestion depends on a client and SDK on the Windows reading host. taosX on Linux must collect through a Windows taosX-Agent with the required dependencies. The point mapping CSV controls both mapping and whether points are enabled. Disabling points may delete the corresponding child tables and historical data; do not use it to stop collection.

Entry point: taosExplorer → Data Ingestion → KingHistorian.

An accessible management UI does not mean that the reading environment is ready.

1. Prerequisites​

Ask the source administrator for the service address, port, account, and one point's type, value, and historical range. First confirm that the actual taosX or taosX-Agent reading host can load the required dependencies. Then have an authorized TDengine TSDB administrator create an independent test database.

PrerequisiteHow to confirm
Reading environmentInstall the matching KingHistorian client/SDK on the Windows reading host. Architecture and actual service identity must meet requirements. A management service on Linux does not replace Windows collection dependencies.
Network and identityCheck the address and site port from the actual reading host. The common port is 5678. The account must be able to browse point groups and read the test point's current values and history.
Point list and modelPrepare one point and its source type, quality, and time semantics. Review target database/table names in the downloaded CSV. Do not reuse files from another site.
Target and verificationA TDengine administrator provides an independent target and write permissions. The source administrator provides original values for the same test window.

1.1 Confirm Windows collection dependencies​

Check the SDK on the Windows taosX or taosX-Agent host actually running collection, not just the browser host. For DLL loading locations and service environment details, see KingHistorian SDK environment. For example, with the default installation location, run the following in Windows PowerShell:

$sdkDll = 'C:\Program Files\KingHistorian\SDK\C\KRTDBAPIx64.dll'
Get-Item -LiteralPath $sdkDll | Select-Object FullName, Length

For a custom installation, replace $sdkDll with the actual path provided by the administrator. A nonempty file should be found, but this proves only that the file exists, not that its dependencies, architecture, service account loading permissions, or source access have passed. Complete the connectivity check, point list download, and data verification in the next section. If the file is missing, check the vendor installation first. Do not copy a same-named DLL from an untrusted directory or assume that changing variables in the current terminal has updated the background service.

2. Configure the point list and start​

Under Data Ingestion, click Create New Task, select KingHistorian, and enter the name, target database, and agent. Under Connection Configuration, enter the source service address and actual port. Under Authentication, enter the source username and password, then click Check Connectivity. The actual Windows reading host must access the address. Do not skip this check because the browser can access the server.

KingHistorian source service address, port, and connection timeout

KingHistorian source username and password

  1. Add a KingHistorian data source, select the target database and agent, enter connection and authentication details, and check connectivity.
  2. Click Download Data Points, select the test point group, points, and tags, then download the CSV. Confirm that it contains only this exercise's objects. Check target supertables, child tables, and columns, then save and upload it.
  3. For historical migration, explicitly set the start, end, and query window. For a real-time task, select real-time collection as needed and set the minimum interval. Test only one mode initially.
  4. Submit and start. Retain the CSV, task identifier, and test boundaries.

Generate and review the CSV from the actual source. Do not replace it with another site's point list. Do not map all points to one numeric type before the target structure is known.

2.1 Review the downloaded point list​

In Download Data Points, select the point group, points, and tags in order. After saving the CSV, check the following. This file defines point-to-table mapping; it is not a historical data file to import.

Point group and name filters do not guarantee the read scope. When no specific group is supplied, the name mask is not used in the query. When a group containing points and a name mask are supplied, results may include points outside the group. After downloading, check actual point names individually. Stop immediately if unauthorized objects appear; do not upload or start. Do not skip CSV review because the filter controls are filled in. The additional Tags option used for browsing is not the list of point names to collect either.

KingHistorian point list upload, empty template, and download entry points

ColumnPurpose and checks
tag_nameRequired. The actual source KingHistorian point name, not an OPC UA NodeId or target table name.
stable / tbnameTarget supertable/child table. Restrict the first test to independent test objects.
enabledEnabled by default. 0 does more than stop reads: it may delete the corresponding target child table and its historical data. Do not use point disabling to clean up production tasks.
value_col / value_transform / typeValue column, numeric expression, and source type. Every point must have an explicit type; do not assume production collection automatically infers missing types. Keep original values first, then verify transformations and precision.
quality_colQuality column. Check against the downloaded template and actual configuration. Do not treat source quality codes as scaled business values.
ts_col / request_ts_col / received_ts_colColumns for source time, request time, and receive time. If multiple time columns exist, the leftmost is the primary key. Explicitly identify the nonempty primary-key source.
ts_transform / request_ts_transform / received_ts_transformCorresponding time transformations. After changes, check units, time zones, and overwrites of identical primary keys.
tag::类型::名称Multiple tag columns are allowed. Types, names, and per-point values must match the target model.

The point list uses enabled, not enable. The figure's help still shows the old spelling; retain the actual downloaded template's column name. The figure also describes type as optional with the source type as default, but production startup requires a valid type for every point and reports missing value_type when it is absent. Successful CSV parsing does not mean startup validation passed. For time column order, CSV quoting, and tag column syntax, see OPC UA point mapping CSV. However, point identifiers must use this source's tag_name; do not copy the UA point-name column.

warning

The empty template puts request_ts_col before ts_col, while the downloaded point list does the opposite. Do not interchange them without checking. Multiple historical rows in a batch for the same point may share a request time. Accidentally selecting request time as the primary key may cause same-key overwrites. Usually, first use the source time column as the primary key, then decide whether to add request/receive time columns according to site needs. Check column order before uploading, and compare historical times and values record by record after previewing.

3. Parameters​

The historical query window specifies a read range. The out-of-order setting specifies how far each window looks back. The query interval specifies the wait between windows. The real-time minimum interval is a subscription setting, not a historical window length. Increasing lookback may add repeated reads; reducing waits may increase source load. Adjust these only after establishing a baseline with a small-scope test.

Under Collection Configuration, when selecting Historical Data Migration, first enter start and end times known to contain data, then reduce the query window. Check the unit on each duration control. Do not combine query window, out-of-order lookback, and waiting into one period.

KingHistorian historical range, query window, out-of-order lookback, and wait settings

After switching to Real-time Data Synchronization, configure Minimum Interval, initially 1000 milliseconds. This setting does not actively generate evenly spaced historical samples. Have the source administrator generate an identifiable new value, then compare actual source times and values.

KingHistorian real-time synchronization and minimum interval

SettingRequirements
Historical start/endThe end must be later than the start. Initially select a small range known to contain data, and check the displayed time zone and source query criteria. If the end is omitted, only the time when this configuration is parsed is used; the task does not become continuous synchronization.
Query windowFor example, 1 minute specifies the historical window step, not starting a task every minute. Use a short positive window initially. For this source, time_range=0 queries the entire range; it does not mean pause.
Out-of-order lookbackMoves each window's left boundary backward. Even the first window reads before the task start. Establish a baseline with 0, then assess the expanded scope, rereads, and same-key overwrites.
Query intervalThe wait after processing each historical window. In this version the control has no unit label. UI value 10 is submitted unchanged as interval=10, which the backend treats as milliseconds: 10 milliseconds. Omitting interval in a direct source DSN defaults to 1000 milliseconds, unlike the form's initial value in the figure.
Minimum intervalEffective only in real-time mode. CLI min_elapsed is in milliseconds and defaults to 1000. It does not indicate historical sampling precision or completeness.

For example, with a task range of 10:00–10:20 in the same time zone, a 10-minute query window, and 2-minute lookback, the actual windows are 09:58–10:10 and 10:08–10:20. Queries include the start and exclude the end. 09:58–10:00 lies before the nominal start, and 10:08–10:10 is reread. Verification cannot simply sum the two windows' returned counts or claim that only data after 10:00 was read. If the original start must be strictly enforced, use zero lookback first and design separate backfill according to business requirements.

Configure connection timeout, query failure retries, and inter-window waits separately. The connection timeout available for production collection is not the fixed 3-second Check Connectivity timeout. The historical query retry budget does not apply to real-time subscriptions either. For parameter names, defaults, units, and browsing/collection differences, see KingHistorian read parameters. Do not directly apply reconnect parameters from other industrial sources.

Before uploading a modified point list, retain a copy of the original configuration. Check for accidentally removed point rows, changed table names, or enabled set to 0. Verify in an independent target first, then apply to the original task through the maintenance process. Stopping a task does not itself delete target data.

3.1 Check advanced options before submission​

KingHistorian logging, concurrency, batches, raw data, and health settings

The new form initially sets log level to info, concurrency to 0, batch size to 1000, and raw data saving to off. Retain the form's initial values first and record the actual configuration. Common concurrency or batch fields do not necessarily change this source SDK's historical point grouping, query record limit, or real-time subscription interval; check each separately. To reduce source load, first narrow the point scope and historical window, then check source load against target data. For general observation methods, see Tuning and resource control. Health options observe the task; they do not guarantee automatic historical backfill.

After clicking Submit, return to the list, find the original task, and confirm it has started. If source connection, point list, or target writes fail, use logs to locate the affected stage. Do not repeatedly create tasks instead of fixing the issue. Retain the saved CSV and actual table names together for verification in the next section and later maintenance.

4. Verification​

In the taosExplorer Data Browser or taos CLI, query the actual child tables and columns in the CSV. In historical mode, compare the same point, time window, and read criteria. In real-time mode, ask the administrator to generate a new test value and compare its time and value.

Retain at least three groups of evidence for verification:

  1. The actual tag_name, type, database/table names, and primary-key column in the point list. Download/browse filter results do not mean the current task has applied that point list.
  2. Source times, values, and quality for the same point and range, compared individually with target details. With nonzero lookback, also check records before the start and in overlapping ranges. Do not let total row counts hide gaps or overwrites.
  3. The time when a real-time new value occurs and the corresponding target result. Check for continuous updates, not just a subscription-established log. On the real-time path, both request and receive times are recorded when data is received. Do not treat their difference as actual source request round-trip time.

Historical source comparisons must use query criteria consistent with what the vendor SDK actually returns. Do not directly apply AVEVA full retrieval or assume that all client curve displays show original change points. Current historical requests set a limit of 86400000 records, with no guarantee of automatic pagination beyond that limit. For dense or large-range data, reduce the window first and compare source/target details. Task completion does not replace completeness verification.

5. Troubleshooting​

SymptomChecks
Client dependencies fail to loadCheck the actual reading platform, architecture, SDK, and service environment. Do not repeatedly retry on an unconfirmed platform.
Empty point listCheck point group filters and source browsing permissions.
Connected but no dataCheck point list objects, mode, historical range, or changes at the real-time source.
Point list parses but production startup failsCheck that every point has type and whether logs contain missing value_type. Retain downloaded template column names. Do not simply convert all points to one numeric type.
Records before task start or duplicate countsCheck out-of-order lookback and the actual primary key. Verify the expanded windows and overlaps; do not delete target historical data first.
Real-time updates still stop after historical retry configurationThis retry budget is not a real-time automatic reconnect mechanism. Check real-time subscription status and verify new values rather than merely waiting for retries to be exhausted.

For other task, write, and runtime issues, see Troubleshooting by symptom.

6. Stopping, recovery, and limitations​

  1. Before stopping, save the original task, CSV, mode, start/end times, lookback configuration, and last verified source time. Pausing a task differs from setting point list enabled to 0. Do not disable points as a way to stop collection.
  2. After recovering the original task, check logs and actual data. The parameters on this page alone do not make historical reads resume automatically from the last successful window. Rerunning may reread the original range. If a smaller backfill range is needed, confirm the gap with the source administrator first, then verify it in an independent target.
  3. Real-time subscriptions do not automatically backfill history from downtime. Historical retry parameters also do not guarantee resubscription after a disconnection. After confirming that source archives still retain the gap, use a verified historical backfill procedure. Do not change the original real-time task to historical mode or delete and recreate it without checking.

For common interruption evidence, backfill choices, and verification, see Restarts, checkpoints, and store-and-forward. A lookback window is not a complete database backup. Before production deployment, confirm the platform combination supported by the distribution and vendor SDK. Until confirmed, successful task dispatch alone does not establish platform compatibility.