Troubleshooting
Fix Citect Historian 2016 CTAPI data source connection error
Short answer
First confirm the machine running the SCADA 2016 runtime is the one Historian sits on, because 127.0.0.1 is loopback. Then set [CTAPI]Remote=1 and [CTAPI]AllowLegacyConnections=0 in that runtime's citect.ini, restart, and retry the data source: Historian 2016's V7.50 CTAPI client needs only Remote=1.
On this page
When Citect Historian 2016 reports "Could not connect primary data source 127.0.0.1" while you add a data source built on a Citect SCADA 2016 project, the correction is two values in the citect.ini the running runtime actually loads: [CTAPI]Remote=1 and [CTAPI]AllowLegacyConnections=0, applied with a restart. The CTAPI client DLLs in the Historian 2016 installation are V7.50, above the V7.20 point where the legacy allowance was deprecated, so that client needs only Remote=1 — and with the legacy path enabled, this pair fails its handshake. Confirm one thing first: 127.0.0.1 is loopback, so it works only when the runtime shares the Historian machine.
What the error names, and what it does not #
The message marks the connection stage of the data source wizard: the Historian tool cannot open a CTAPI connection to the address shown. It says nothing about a tag, a logging rate, or a display binding, so those are not the first places to work.
The address 127.0.0.1 is loopback. It points at the machine running the Historian tool, never at another computer on the network, and that splits the diagnosis in two:
- Same machine for runtime and Historian: loopback is a legitimate target, and the fault sits in the CTAPI settings.
- Runtime elsewhere: no ini edit rescues a data source pointing at itself. Point the data source at the runtime computer, then test again.
If you are still deciding which machine should carry Historian relative to the runtime, where to install Historian alongside Citect SCADA works through that placement.
A memory of connecting Vijeo Citect 7.30 to Historian 4.40 years ago is not evidence about this pair. The client generation differs, and carried-forward compatibility settings from that era are exactly what misleads here.
The two settings that decide the connection #
CTAPI is the client interface Historian uses to reach a runtime. Three parameters in the runtime's citect.ini govern what the runtime will accept:
| Parameter | Section | What it does | Value for this fault |
|---|---|---|---|
| Remote | [CTAPI] | Allows the runtime to accept CTAPI client connections | 1 |
| AllowLegacyConnections | [CTAPI] | Compatibility allowance for pre-V7.20 clients | 0 |
| EarliestLegacyVersion | [LAN] | Replacement for the legacy allowance from V7.20 on | Leave unset unless an old client must connect |
From V7.20 the legacy allowance is deprecated in favor of [LAN]EarliestLegacyVersion. The decision line is the client DLL version: at V7.20 or above, set Remote=1 and keep the legacy allowance off. Only a client demonstrably older than V7.20 justifies a legacy setting.
Working the case: Historian 2016 at 127.0.0.1 against a SCADA 2016 runtime #
Inputs.
- Primary data source address named in the error: 127.0.0.1, taken from the wizard.
- Server: Citect SCADA 2016, runtime running on the same machine as the Historian tool.
- Client: Citect Historian 2016, CTAPI client DLLs at V7.50.
- Deprecation boundary: V7.20, the release from which AllowLegacyConnections is replaced by [LAN]EarliestLegacyVersion.
- File state before the change: AllowLegacyConnections=1 under [CTAPI], Remote not at 1.
Rule. The legacy allowance exists solely to accept CTAPI clients older than V7.20. A client at or above that boundary negotiates over the normal path and needs Remote=1; with the legacy path also enabled, this pair fails the handshake.
Arithmetic. 7.50 - 7.20 = 0.30. The client DLLs sit 0.30 of a version above the deprecation boundary, so nothing in them is legacy and nothing in the handshake needs the allowance.
Result. With Remote=1, AllowLegacyConnections=0 and the runtime restarted, the data source connected on retry — the reported outcome for this exact pair, after the loopback target was confirmed correct.
Decision. Any CTAPI client at V7.20 or above gets Remote=1 with the legacy allowance at 0. Below that, configure the legacy path for the specific client — on a V7.20-or-later runtime, through [LAN]EarliestLegacyVersion.
Check before you edit citect.ini #
- Record the exact error text and the address it names, and leave the data source definition untouched so each later test changes one variable.
- Confirm which machine runs the SCADA 2016 project, and that the project is running — configured and running are different states.
- Open the citect.ini the running runtime loads; another project's copy or an old installation's file changes nothing. The Computer Setup Editor is the documented tool for editing these parameters.
- Read the [CTAPI] section, note the current Remote and AllowLegacyConnections values, and look for duplicate entries that shadow the effective one.
- Back up the file.
Apply the correction #
- Open the active citect.ini in the Computer Setup Editor.
- Under [CTAPI], set Remote=1.
- Change AllowLegacyConnections=1, if present, to AllowLegacyConnections=0.
- Save, then apply with the runtime's documented reload or restart — coordinate that moment with operations, because it interrupts every connected SCADA client.
- Return to Historian and retry the primary data source.
[CTAPI]
Remote=1
AllowLegacyConnections=0
These two values are the correction for the 2016 pair, not a compatibility policy for every client. If a pre-V7.20 client must also connect, set [LAN]EarliestLegacyVersion to the oldest version you must accept, chosen from the product documentation rather than by trial and error.
Tell a connection fault from a tag fault #
| Observation | Layer at fault | Next check |
|---|---|---|
| The same connection error remains | Endpoint or CTAPI acceptance | Target machine, running project, active ini, connection diagnostics |
| Data source connects, a needed tag is absent | Project or tag selection | The runtime contains the tag and Historian selects it |
| Tag present, value or quality wrong | SCADA acquisition | Compare the runtime value against the controller |
| Live values good, history missing | Collection configuration | Collection status, logged tags, requested time range |
Work the layers in that order. Once the connection holds, follow one known changing tag end to end — value, quality and timestamp in the runtime, then in Historian — and confirm new samples land; a successful connection does not by itself prove collection. From there, why Citect alarm logging never reaches SQL Server covers the separate alarm path. And if this 2016 install failed earlier still, at setup, why Citect Historian 2016 setup never installs SQL Server covers that installation-layer fault.
Questions asked
Is Remote=1 still needed when Historian and the SCADA runtime share one computer?
Yes. The reported fault was exactly that layout, with the data source pointing at 127.0.0.1 on a single machine, and the connection still required Remote=1. The parameter governs whether the runtime accepts CTAPI client connections at all, not whether the client sits on another computer. Set it whichever side Historian runs on.
How should EarliestLegacyVersion be set when a genuinely old client must connect?
From V7.20 the runtime replaces AllowLegacyConnections with [LAN]EarliestLegacyVersion. Set it to the oldest client version you truly must accept, taken from the product documentation for your runtime release, and leave AllowLegacyConnections at 0. Choose the value deliberately: each step down widens the range of handshake versions the server will entertain.
The same error still appears after both values are set. What next?
Re-check three things in order: that the data source target really names the computer running the project, since 127.0.0.1 only reaches the Historian machine itself; that the runtime was restarted after the edit, because these parameters apply on restart; and that the file you edited is the one the running runtime loads, since a second citect.ini or a duplicate [CTAPI] entry can shadow the change.
Does a working Vijeo Citect 7.30 and Historian 4.40 setup prove anything here?
No. That pair used a different client generation, and its settings say nothing about a 2016 combination. Judge each pairing by its own client DLL version against the V7.20 boundary: at or above it, Remote=1 with the legacy allowance off; below it, a legacy setting chosen for that specific client.