CDP Logger Configuration Manual
Introduction
This manual describes the CDP Logger component in CDP Studio, the independent automation software for open PC-based real-time distributed control systems.
The CDP Logger is a component for logging values and events. It is designed for long-term storage of high-frequency numeric data. Depending on the selected datastore, data is either stored to a local file or a remote server, see the Choosing a Datastore page for more information. CDP Logger also contains a server for remote access to logged data, see Viewing Data.
Note: The CDP Logger is a licensed feature. See the CDP Runtime License manual for more information.
Usage
To set up a CDP Logger for an application, simply add it as a subcomponent. Next, add a Datastore to the CDP Logger component (e.g. CDPCompactDatastore). To actually log something, add LoggedValue nodes and set the Routing attribute to any signal or property in the system. Alternatively, you may right-click on any signal or property and select Add to Logger...
Example
See the How to Setup Logging in Automation System page for a step-by-step example.
Features
- Delta logging. Value changes are logged only when a change is larger than configured Delta.
- Size alarm. Set by SizeAlarmGB property. When the limit is exceeded, an alarm is set, notifying that the datastore has grown too large.
- Tagging data. For example, store the unit and description of the logged value as metadata.
- In-memory logging. When enabled no data is added to the datastore, but instead to temporary buffers. When switching the logger to 'LogToOutput', the content of the buffer is written to the datastore (buffer span is configurable). This feature could be used to save disk space by only activating the logger when some interesting event occurs. Logger state can be changed by sending a Message to the logger component.
- Built-in server. Used by Studio Analyze mode and Database Graph Widget to query data from datastore.
Note: Some features like data retention policies are defined in the settings of the selected Datastore.
Configuration
Here is a list of configuration options specific to this component.
LoggedValue
LoggedValue represents the node (signal or property) that is logged.
Property | Description |
---|---|
Name | Unique identifier for the logged value. Also used as a friendly name when viewing logged data. |
Routing | Full path of the signal or property we want to log. |
RoutingStatus | Shows whether connecting to the node specified by the Routing property was successful. |
Delta | Value change is only logged if it changes more than 'Delta'. Use this to save disk space. |
Tags | Semicolon-separated key-value list of metadata associated with the logged value (e.g. "tag1=val1;tag2=val2"). Note, that this will override any tags fetched by TagLookup. |
EffectiveTags | During runtime, displays the combination of tags set directly on this LoggedValue and tags found by TagLookup rules. |
EffectiveTagSources | During runtime, displays the full path of source nodes for tags found by TagLookup rules. For example, when using a TagLookup rule with SearchType='Node in scope', this property will allow us to determine on which level the tag was found. |
Datastore
Datastore is the backend used by CDP Logger, usually some database. The default is CDPCompactDatastore.
For more information about datastores, see the Choosing a Datastore page.
TagLookup
TagLookup defines a tag that should be fetched for each LoggedValue (if available) and for each node that emits a CDP event (when Event Logging is enabled) and saved to the chosen Datastore as metadata for the node. The tag for a LoggedValue is fetched once during startup while for an event sender, it is fetched when it emits the first event.
For example, a TagLookup with SearchType='DirectChild' and Value='Unit' means that for each logged value, if the value has a child named "Unit", it will be saved at startup.
Note: When a tag for a node is not found on a subsequent startup anymore, what happens will depend on the chosen datastore implementation. The default CDPCompactDatastore will delete missing tags and only keep the most up-to-date information. Other implementations are recommended to do the same.
Property | Description |
---|---|
Name | Name of the tag key. |
Value | Either the direct child of the target node or a node in scope that is used to retrieve the tag value (for example 'Unit') or a constant value. In the case of SearchType being "Direct child" or "Node in scope", the Value can refer to any child of the logged value but also to the following node intrinsic attributes: Name, Model, Value, Type (the value type, e.g. "double"). |
SearchType | Configures how to look for the node specified by Value. The options are:
|
Enabled | Allows to enable/disable fetching of a tag. |
TagNameOverride | Normally a tag name is taken from the Name property but in case the desired tag name is a reserved word or contains characters that can't appear in the Name property, this property can be used to set the tag name. Leave this empty to use Name as the tag name. |
By default, the following tags are fetched for each LoggedValue and each event sender:
- unit - the unit of a logged value (if available).
- description - the description of a logged node (if available).
- metric - a container for related values from a single measurement or device (e.g. "weather_sensor" metric can contain "temperature" and "humidity" values). It is used by some Datastores when creating the schema (for example, the metric could become a table name in a database). By default, it is the Model of the logged node's parent.
- label - the type of the logged data, e.g. "temperature" or "humidity" (it does not have to be unique). It is used by some Datastores when creating the schema (for example, the label can become a column name in a table). By default, it is the short name of the logged node.
- group - the Group property of a CDPAlarm. Useful for filtering logged alarm events.
If the default TagLookup rules are not suitable, they can be disabled by setting the Enabled property to false
.
Event Logging
When enabled, the logger will subscribe to CDPAlarm (Set, Clear, Acknowledge) and other CDP events and log them to the selected Datastore.
Property | Description |
---|---|
IgnoreReprises | A reprise event is a repetition of a CDP event that has been reported before - courtesy for late subscribers. For example, CDPAlarms periodically report that they are still active. Ignoring reprises will reduce datastore size but when a datastore reaches its size limit and starts deleting older data, the reprises can be used to determine that an alarm is still active. Note: Each application has an internal buffer for a few thousand events by default, so if the logger application is started after the event has been reported, it will still be logged. |
SenderPathRegex | Regular expression to match the event sender's full path for the event to be logged. If empty, all events from all applications will be logged. |
Note: CDP does not currently provide any widgets for browsing logged event data (e.g. CDPAlarm Set, Clear and Acknowledge events). Datastore-specific third-party tools must be used. If necessary, use the EventLogReader sequencer block and connect it to a LogWriter block to export event data to a different datastore, for example to CSV - see the example here.
Signals
Signal | Description |
---|---|
SamplesDroppedLastMinute | The number of samples the logger skipped when the application was overloaded during the last 60 seconds. This can happen when the datastore is too slow to keep up with the logging frequency. An alarm is set when a sample is dropped. |
Properties
Property | Description |
---|---|
BufferSpanMinutes | When logging to buffer (LogToBuf state), this sets the buffer length. Use 0 for default. Can be configured only when PeriodicLogFrequency is set. |
InMemoryLogging | Start the logger in LogToBuf state. When false, the logger is started in LogToOutput state. |
PeriodicLogFrequency | Logging frequency in Hz. Set to 0 to log every value change instead of periodically. Decreasing the logging frequency will save disk space and improve performance when logging thousands of values. |
ServerInterface | A network interface defined in the application node. The selected interface will be used by the CDPLogger's built-in server which provides remote access to logged data. Leave empty to listen on all interfaces. |
ServerPort | Port of CDPLogger's built-in server that provides remote access to logged data. |
SizeAlarmGB | Sets an alarm when the datastore has exceeded the specified size. Use 0.0 for no limit. |
SizeGB | During runtime displays the current size of a datastore in gigabytes. |
Viewing Data
CDP Logger contains a server for remote access to the logged data that can be used to view data no matter which datastore is used.
There are several options to view logged data through the log server:
- Using CDP Studio Analyze mode Historic Data functionality which will detect a running CDP Logger or LogServer and connect to it. The Analyze mode can also be used to export the logged data to CSV format.
- Making your own GUI application that includes Database Graph Widget.
- Python code can query values from a running CDP Logger or LogServer using the PythonCDPLoggerClient.
- The ValueLogReader and EventLogReader sequencer blocks can be used to extract and process logged data.
The selected Datastore might provide other custom ways to view logged data. See the manual for the selected datastore to get specific information on that.
Note: CDP does not currently provide any widgets for browsing logged event data (e.g. CDPAlarm Set, Clear and Acknowledge events). Datastore-specific third-party tools must be used. If necessary, use the EventLogReader sequencer block and connect it to a LogWriter block to export event data to a different datastore, for example to CSV - see the example here.
Get started with CDP Studio today
Let us help you take your great ideas and turn them into the products your customer will love.