Real-time DataLogger 

Available from firmware 2019.3

Use Case

As soon as you record consumption values, need to prove energy feeds, or possibly have to log plant states, you need a reliable data acquisition. With the PLCnext Real-time DataLogger, you now have a convenient way to do all these use cases without any programming effort. Simply parameterize the required variables, and the DataLogger starts with recording values that are synchronous to an ESM task. The data is available directly on the SD card of the controller, or you can rely on OPC UA Historical Access.

In addition, you can decide whether each value or only changed values are being recorded. This is how a simple data logger becomes a powerful event recording system ("Sequence of Events").

Note: When planning a project that depends on task-synchronous real-time data logging, it is highly recommended to select the hardware according to a maximum CPU load of 70 to 80 percent, visible in the PLCnext Engineer cockpit (show where to find the CPU loadshow where to find the CPU load). See ESM for further infomation on effects to the real-time context.

Concept

The DataLogger is a service component of the PLCnext Technology runtime. This component transfers real-time data from the GDS to a database for recording and storage purposes. 

This simplified schematic drawing shows how the DataLogger works:

When starting and stopping the PLCnext Technology runtime, a configured DataLogger session is started and stopped automatically. The DataLogger then collects the values that are synchronous to an ESM task of the configured GDS ports with a given sampling rate and stores them with a time stamp (exact to 1 µs) into a RAM disk.

With the standard settings, the database is stored SQLite-compliant on an SD card in the PLCnext Control. Then you can copy the database at any time, read it out in place via OPC UA Historical Access, or read out entries via a C++ interface (RSC IDataLoggerService2). All essential settings are given by an XML configuration file, no further programming is necessary.

The DataLogger internally uses GDS subscriptions of<SubscriptionKind> Recording which is behaving like RealTime and HighPerformance. This results in values for instance variables that are synchronous to an ESM task. In other words: Within a single record, the values of all instance variables whose related program instance is associated with the same ESM task are stemming from the same execution cycle of that task. Up to firmware 2021.0 LTS, this is the only way to get task-synchronous values: Resource-global variables and component ports do not have such an ESM task and therefore cannot be synchronous to an ESM task.

From firmware 2021.6 on, the DataLogger supports continuous recording with a selected ESM task, using thetaskContext attribute instead of samplingInterval. By specifying an ESM task simply via its name, the values of all kinds of variables will be sampled within this task:

  • resource-global variables and component ports
  • variables instantiated within a program associated to any ESM task

Feature development

Being an extremely useful feature, the Real-time DataLogger of PLCnext Technology is still subject to further development. Some of the features have been implemented only recently, so please make sure to use the suitable firmware release:

Task-synchronous DataLogger

First implemented with 2019.3

Firmware version 2020.0
LTS
2021.0
LTS
2021.6 2021.9 2022.0
LTS
2022.3 2022.6
Logging of GDS ports
File format – SQLite
Mode – Infinite
Mode – On change (Sequence of Event)
Mode – Time frame
Mode – Trigger
C++ API (Remote Service Call – RSC) to query the database
Time stamp according to ISO 8601
Session configuration and management via PLCnext Engineer 
Session configuration and management via RSC IDataLoggerService2 
Sampling values in a specified ESM task 

Where to start

After this short introduction, here you find further information on how to use the DataLogger:

  1. DataLogger configuration – different ways to set up a DataLogger session
  2. DataLogger config flowchart – a guide through the attributes and decisions to make for a configuration
  3. DataLogger examples – configuration sets for often used scenarios 
  4. DataLogger reference – find all the details on attributes and things to know
  5. DataLogger Tutorial videos – what the DataLogger is all about and how to set up  different DataLogger configurations
  6. RSC IDataLoggerService2 – learn about the Remote Service Call (RSC) for setting up and using the DataLogger out of C++ programs

 

 


•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari • 
• Published/reviewed: 2022-09-14 • Revision 046 •