QuickOPC 2017.1: Resolving Delphi Browse Violations

Jason IP1 min read
OPC / OPC UAOther ManufacturerTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Identify the Version-Dependent Failure

A Delphi Tokyo application built against QuickOPC 2016.2 can fail after QuickOPC 2017.1 is installed, even when the application source code is unchanged. The reported violation occurs while configuring the browsing dialog, before ShowDialog executes.

Interface Dialog class Failing assignment
OPC DA TOpcBrowseDialog BrowseDialog.Mode.MultiSelect := true;
OPC UA TUABrowseDialog BrowseDialog.Mode.SelectElementType := UAElementType_Node;

Trace the Root Cause

The Object Pascal wrapper files are version-specific. Replacing QuickOPC 2016.2 with 2017.1 while continuing to build with wrappers generated from the earlier type libraries creates a mismatch between the compiled interface definitions and the installed QuickOPC assemblies. The unchanged Delphi source does not eliminate this dependency.

The application must use wrappers generated from the type libraries supplied with the selected QuickOPC version. The assemblies from that same version must also be installed and registered.

Update the Wrappers and Rebuild

  1. Select the QuickOPC version that the application will target.
  2. Generate new Object Pascal wrappers from that version's QuickOPC Type Library files.
  3. Replace the previous wrapper files in the Delphi project and rebuild the application.
  4. Confirm that assemblies for the selected QuickOPC version are installed and registered.

Verify the Repair

Run both browse paths after rebuilding. For OPC DA, confirm that assigning Mode.MultiSelect succeeds and the dialog opens. For OPC UA, confirm that assigning Mode.SelectElementType succeeds and the dialog opens. In the reported case, updating the wrapper file resolved the failure.

FAQ

Why does QuickOPC 2017.1 fail with code that worked on 2016.2?

The project can still contain Object Pascal wrappers generated from the QuickOPC 2016.2 type libraries. Generate wrappers from the 2017.1 type libraries and rebuild against them.

Can I switch QuickOPC installations without rebuilding my Delphi project?

No. Select a specific QuickOPC version, generate its Object Pascal wrappers, and rebuild the project with the matching installed and registered assemblies.

How do I verify a QuickOPC wrapper update fixed the browse violation?

Exercise both browse dialogs and verify that the DA MultiSelect assignment and UA SelectElementType assignment complete before each dialog opens.

Back to blog