Overview

This chapter describes the steps required for configuring the variables in the namespace of the TwinCAT OPC UA Server for Historical Access (HA).

Historical Access is an OPC UA function in which (historical) variable values are stored in a memory (e.g. a file or a database) and made accessible to clients via a standardized interface. Here you can configure how the TwinCAT OPC UA Server reads and saves the variable values.

Overview 1:

Requirements

This configuration can be carried out for variables from any runtime system (e.g. TwinCAT PLC or TwinCAT 3 C++, ...). As a prerequisite, the respective variable must first be enabled for OPC UA. You can find out how to do this in our Quick Start tutorial.

Memory types

The individual memory types are configured as so-called "HistoryAdapters" in the TwinCAT OPC UA Server. This is done via the TwinCAT OPC UA Server configurator. Each HistoryAdapter (except for the adapter type "Main memory" (Volatile)) can be used multiple times, e.g. if the historical values for individual variables are to be stored in different data memories.

Sampling of the variable values

The TwinCAT OPC UA Server can receive variable values in two different ways:

1. Using its own sampling engine and
2. From an OPC UA client (via the so-called "HistoryUpdate" function)

The sampling rate at which the variable is to be sampled from the lower-level real-time system and stored in the memory is configured for each variable in the separate sampling engine. The time at which the server read the variable value from the real-time is used as the timestamp.

With the HistoryUpdate function, on the other hand, the server receives both the variable value and the timestamp from a connected OPC UA client and therefore does not perform its own sampling.