• Skip to main content
  • Skip to header right navigation
  • Skip to site footer
CDP Studio logo

CDP Studio

The no-code and full-code software development tool for distributed control systems and HMI

  • Doc
  • Why CDP
    • Software developers
    • Automation engineers
    • Managers
  • Products
    • Automation Designer
    • HMI Designer
    • CDP Linux
  • Services
  • Use cases
  • Pricing
  • Try CDP

CDP Studio Documentation

EncryptedXMLConf Handler

Framework - External Value Types

External Value Type Support

CDP node values are stored by default in the CDP configuration storage (i.e., in XML files). In some cases, it is useful to store the values in some other storage. For these purposes, CDP provides an external value type support. This support enables seamless integration with databases, files, and other external data sources while maintaining the familiar CDP node value interface.

Overview

External value type support provides a way to:

  • Store property values in external files (e.g. SQLite database)
  • Ensure values persist independently of application XML configuration and its deployment
  • Store sensitive data in secure databases rather than in plain in configuration XML files.
  • Enable advanced data management scenarios, like multiple applications or nodes to access and modify shared data sources.
  • Link properties to external files for binary or large text content

The feature consists of:

  • External Type Provider - The main component that manages external type handlers and stores their global configuration.
  • External Type Handlers - pluggable implementations for different external types (data sources)
  • Core CDP integration for seamless node value behavior and metadata exposure

Currently available external type handlers:

  • EncryptedXMLConf Handler - Handler for storing values in CDP XML configuration in encrypted form
  • SQLiteValue Handler - Handler for storing values seamlessly in SQLite databases
  • File Handler - Handler for linking to external files

There are two types of external type handlers possible:

  • Value Handlers - Handlers that seamlessly replace the node value with a value from an external source (like SQLiteValue Handler)
  • Binary Large Object (BLOB) Handlers - Handlers that manage large binary or text content linked to the node value (like File Handler)

External Type Provider

The External Type Provider is a built-in CDP internal component located at CDP.ExternalTypesProvider that manages all external type handlers and coordinates external data operations. It provides:

  • Asynchronous request processing with configurable worker threads
  • Request aggregation and optimization for performance
  • Error handling and retry mechanisms
  • Cross-thread communication for safe data access

External Type Handlers

External type handlers are pluggable adapters that implement specific logic for interacting with external data sources. Handlers have to be added and configured according to the need under the ExternalType Provider configuration (under node CDP.ExternalTypesProvider) first. Some handlers, like SQLiteValue Handler, are added by default in any new application.

Currently available handlers include:

  • EncryptedXMLConf Handler - Stores property values in encrypted form in CDP XML configuration (available by default)
  • SQLiteValue Handler - Stores property values in SQLite databases (available by default)
  • File Handler - Links properties to external files

Handlers are attached to nodes by their configured names in the External Type Provider configuration, e.g. "SQLiteValue" or "File". There can also be multiple instances of the same handler type with different configurations, under different names like "SQLiteValue", "SQLiteValueWithChangeCount", etc.

Note: Unused handlers are not consuming any CPU at application runtime, nor does removing them release considerable memory. Nevertheless, all unused handlers can be removed from the CDP.ExternalTypesProvider configuration, when desired.

CDP Property Integration

External type can be attached via the handler configured name to any CDP property through the ExternalType model attribute in the property model definition, like this:

<Attribute Name="PropertyName" Type="{any CDP value type}"
 ...
 ExternalType="{external type handler name}{;optional semicolon-separated list of key=value configuration parameters}"
 ...
/>

The ExternalType attribute can also be hooked in C++, at configuration time, using:

node->SetExternalType("{external type handler name}{;optional semicolon-separated list of key=value configuration parameters}");

When a property has some external type value handler assigned, it exhibits the following behaviors:

  • The property value is loaded (asynchornously) using the external type value handler, not directly from XML
  • Value changes are also written (asynchornously) to the storage via the external type value handler, so they are not written to XML
  • Node XML value is still loaded and available as a "InternalValue" metadata entry, and it can also used as the key value to the actual value in the external storage.

For BLOB handlers, the property behaves as follows:

  • The property value contains the path to the external file managed by the BLOB handler
  • The BLOB handler manages reading and writing the actual file content (via special BLOB value API or via CDP Studio BLOB handling delegate, like TypeHint="File" delegate)

For both value and BLOB handlers, in addition to property value, metadata (e.g. information about database location, schema, etc.) about the external source becomes available via CDP Node metadata API (also can be inspected in CDP Studio while looking at the value tooltip).

External Type Provider Configuration

Configuration Properties of External Type Provider:

PropertyTypeDefaultDescription
WorkerCountunsigned char3Number of worker threads for parallel external type I/O operations
SamplingIntervalunsigned int1000Minimum interval (in milliseconds) at which subsequent same node variant value updates will be forwarded to the ExternalType backend for write. Increasing the value reduces the ExternalType handler CPU load for fast-changing value nodes. Reducing the value makes value changes appear sooner in the ExternalType backend. This property affects only handlers that support request aggregation, like SQLiteValue Handler.
WorkerKeepaliveunsigned int1Seconds to wait for new ExternalType requests for the same datasource, before closing the thread (and closing the connection to the datasource). For effective CPU usage, set a value larger than the SamplingInterval (note that SamplingInterval is in milliseconds and WorkerKeepalive is in seconds).
WorkerStackSizeunsigned int64Stack size in kB for worker threads (set to 0 to use OS default size)
WorkerPrioritystring"background"CPU priority for worker threads (idle, background, low, normal, high)
NodeValuesLoadedboolfalseRead-only property indicating when the provider has finished loading all initial values for all configured nodes having variant value external type. It can be used to trigger some application logic that should run only after all values are loaded from the external sources.
NodesInErrorstring""Read-only list of nodes with external type errors
Debugint0Enable additional logging for external type operations - 0=errors only, 1=warnings, 2=info, {higher than 2}=debug

Error Handling

The external types system provides comprehensive error handling:

  • Individual node errors are reported through their metadata
  • Errors trigger also HandlerError alarm in External Type Provider
  • Cumulative error tracking via External Type Provider NodesInError property
  • Automatic retry mechanisms for transient failures
  • Errors will be logged into CDP application window

Handler Request Processing

External type operations are processed asynchronously to avoid blocking the main application:

  • Requests are queued and processed by worker threads
  • When handler is configured to allow aggregation (like SQLiteValue Handler) then multiple requests for the same node are automatically aggregated, i.e., when many value changes happen quickly and are in the write queue, then only the latest value change will be posted to the external source
  • Retry mechanisms handle temporary failures
  • Cross-thread communication ensures thread safety

External type handler implementations focus only on the specifics of their data source, while the provider manages threading and request coordination, so that:

  • All blocking external operations happen in worker threads
  • Node value updates are marshalled back to the main thread
  • Thread-safe request queuing prevents data races

Note: Note that when configuring application with CDP Studio, the external type handlers are loaded and active even in offline mode - so the values will be fetched and updated via external type handler even when the application is not running, but of course only when the data source (e.g. database file) is accessible in offline.

EncryptedXMLConf Handler

The content of this document is confidential information not to be published without the consent of CDP Technologies AS.

CDP Technologies AS, www.cdpstudio.com

Get started with CDP Studio today

Let us help you take your great ideas and turn them into the products your customer will love.

Try CDP Studio for free
Why CDP Studio?

CDP Technologies AS
Hundsværgata 8,
P.O. Box 144
6001 Ålesund, Norway

Tel: +47 990 80 900
E-mail: info@cdptech.com

Company

About CDP

Contact us

Services

Partners

Blog

Developers

Get started

User manuals

Support

Document download

Release notes

My account

Follow CDP

  • LinkedIn
  • YouTube
  • GitHub

© Copyright 2026 CDP Technologies. Privacy and cookie policy.

Return to top