OPC DA connection troubleshooting
Troubleshoot OPC DA connections on the actual Windows collection host that can access the source. Use the error code, actual registered ProgID, and runtime identity to distinguish registration, architecture, COM/DCOM permission, and session problems. After recovery, read the test Point with the same service identity and verify target ingestion. Do not diagnose from an error code alone.
Entry point: PowerShell, Windows Services, and Event Viewer on the actual Windows collection host; the taosExplorer OPC-DA connectivity check and task logs.
First record the complete error, failing step, actual Windows host, service identity, Server address and ProgID, and plugin version. Browser connectivity does not mean the collection host can access COM. A successful interactive-user test does not mean the service identity has the same permissions. For general log collection, see Logs and performance.
1. Identify the failure layer
| Symptom or error | Check first | What cannot be concluded directly |
|---|---|---|
0x800401F3 / Invalid class string | Service address parsing, actual registered ProgID, deployment location | It is not equivalent to REGDB_E_CLASSNOTREG, and not all ProgIDs should be changed to space-separated names. |
0x80040154 / Class not registered | Component registration, registry view, client/server architecture, and vendor-supported setup | An existing installation directory does not prove correct registration. |
0x80070057 / The parameter is incorrect | Configuration, Server compatibility, service identity, and session differences | The error code alone does not prove a Session 0 issue. |
0x80080005 / Server execution failed | Server startup state, launch/activation/access permissions, and Windows event logs | Switching to an administrator account or stopping the service is not a universal fix. |
| Connection succeeds but no Point values arrive | Item ID, read permissions, quality, enabled Points, and target mappings | A successful connection does not prove collection and ingestion. |
2. Check the actual registered name and architecture
Ask the Server administrator to check the actual registered ProgID with the vendor's OPC client. Names containing periods, such as Matrikon.OPC.Simulation.1, are valid. Some vendors have spaces in display names, but that is not a naming rule for every ProgID. Copy the registered name exactly; do not construct it from the display name.
Run this read-only check on the Windows collection host, adjusting the path to the actual OPC plugin location:
$pluginPath = 'C:\TDengine\plugins\opc\taosx-opc.exe'
$pluginBytes = [System.IO.File]::ReadAllBytes($pluginPath)
$headerOffset = [BitConverter]::ToInt32($pluginBytes, 0x3C)
$machineType = [BitConverter]::ToUInt16($pluginBytes, $headerOffset + 4)
switch ($machineType) {
0x14c { 'OPC plugin: x86' }
0x8664 { 'OPC plugin: x64' }
default { '无法按 x86/x64 识别,请核对所用发行包。' }
}
Get-CimInstance Win32_Service -Filter "Name='taosx-agent'" |
Select-Object Name, State, StartName, PathName
The output shows plugin architecture and service identity. The administrator must still check vendor COM registration, server form, and supported architectures. Do not arbitrarily reregister DLLs or replace plugins with a different architecture on a production host.
3. Distinguish identity, permissions, and interactive sessions
- Compare the taosX-Agent service
StartNamewith the interactive test user. Check COM/DCOM launch, activation, and access permissions, plus file/configuration access. - Review Windows Application and System events for the same period. Check whether the Server failed to start, rejected the identity, or depends on an interactive desktop.
- If a foreground comparison is needed, schedule it during a maintenance window or on a separate verification agent. First record associated tasks, configuration, the original service identity, and the recovery method. Stop the existing instance before running a single foreground instance. After successful foreground verification, compare identities, environment variables, directories, and sessions to identify differences from the background service.
- After foreground verification, exit the foreground process before restoring the original service or an approved new deployment method. Confirm that the agent is online, original tasks have recovered, and new values reach the target. Never run two taosX-Agent instances with the same configuration simultaneously.
Some older Servers depend on an interactive session. A Windows administrator can evaluate using Task Scheduler with a dedicated account, an at-logon trigger, and Run only when user is logged on. Set the program to the actual taosx-agent.exe, the starting directory to the installation directory, and an explicit configuration file path. This approach depends on user logon. Logging off or restarting without logging on affects collection; it is not an unconditional high-availability solution.
For normal background services, prefer a least-privilege account configured through a vendor-supported method. Do not enable full permissions for Everyone, open all ports, or enable Allow service to interact with desktop for troubleshooting. Changes to identities, service stops, or scheduled tasks require approval and execution by the site administrator. Do not copy commands directly and affect other ingestion tasks.
4. Verification after recovery
After the connectivity check passes, read a test Item ID with the same actual service identity, then start the original task. Check the latest source time, Point value, and quality in the target database. Verify both existing and newly added Points. If the problem persists, submit the full error, redacted configuration, runtime identity, plugin architecture, and corresponding Windows events. For diagnostic materials, see Diagnostic packages and support tickets.