PLCnext API Documentation  22.0.0.43
Public Types | Public Member Functions | Static Public Member Functions | List of all members
Arp::Services::DataLogger::Services::IDataLoggerService2 Class Referenceabstract

The DataLogger provides an interface to log and store variables during firmware runtime. More...

#include <IDataLoggerService2.hpp>

Inheritance diagram for Arp::Services::DataLogger::Services::IDataLoggerService2:
Inheritance graph

Public Types

using Ptr = std::shared_ptr< IDataLoggerService2 >
 
using ListSessionNamesResultDelegate = delegate< void(IRscReadEnumerator< RscString< 512 > > &)>
 
using SetVariablesVariableNamesDelegate = delegate< void(IRscWriteEnumerator< RscString< 512 > > &)>
 
using SetVariablesResultDelegate = delegate< void(IRscReadEnumerator< ErrorCode > &)>
 
using GetLoggedVariablesInfosDelegate = delegate< void(IRscReadEnumerator< VariableInfo > &)>
 
using ReadVariablesDataVariableNamesDelegate = delegate< void(IRscWriteEnumerator< RscString< 512 > > &)>
 
using ReadVariablesDataValuesDelegate = delegate< void(IRscReadEnumerator< RscVariant< 512 > > &)>
 
using GetRotatedFileNamesFilenamesDelegate = delegate< void(IRscReadEnumerator< RscString< 512 > > &)>
 
using GetSessionNamesResultDelegate = delegate< void(IRscReadEnumerator< RscString< 512 > > &)>
 
using SetTriggerConditionTriggerConditionDelegate = delegate< void(IRscWriteEnumerator< TriggerRpnItem > &)>
 
- Public Types inherited from Arp::System::Rsc::Services::IRscService
typedef std::shared_ptr< IRscServicePtr
 

Public Member Functions

 IDataLoggerService2 (void)=default
 Constructs an IDataLoggerService2 instance. More...
 
virtual void ListSessionNames (ListSessionNamesResultDelegate resultDelegate)=0
 List all names of sessions inside the data logger component. More...
 
virtual ErrorCode CreateSession (const RscString< 512 > &sessionName, boolean persistent=false)=0
 Tries to create a new session. More...
 
virtual ErrorCode RemoveSession (const RscString< 512 > &sessionName)=0
 Tries to remove a session. More...
 
virtual ErrorCode StartSession (const RscString< 512 > &sessionName)=0
 Tries to start a logging session. More...
 
virtual ErrorCode StopSession (const RscString< 512 > &sessionName)=0
 Tries to stop a logging session. More...
 
virtual ErrorCode ConfigureSession (const RscString< 512 > &sessionname, const std::vector< SessionProperty > &properties)=0
 (Re)configures a session More...
 
virtual ErrorCode GetSessionConfiguration (const RscString< 512 > &sessionname, std::vector< SessionProperty > &properties, boolean &isPersistent)=0
 Tries to query the current configuration of a session More...
 
virtual ErrorCode GetSessionState (const RscString< 512 > &sessionName, SessionState &state)=0
 Tries to query the state of a session. More...
 
virtual void SetVariables (const RscString< 512 > &sessionName, SetVariablesVariableNamesDelegate variableNamesDelegate, SetVariablesResultDelegate resultDelegate)=0
 Tries to add a variable to a session. More...
 
virtual ErrorCode GetLoggedVariables (const RscString< 512 > &sessionName, GetLoggedVariablesInfosDelegate infosDelegate)=0
 Queries all infos about logged variables of a session. More...
 
virtual ErrorCode ReadVariablesData (const RscString< 512 > &sessionName, DateTime startTime, DateTime endTime, ReadVariablesDataVariableNamesDelegate variableNamesDelegate, ReadVariablesDataValuesDelegate valuesDelegate)=0
 Read the data from the given variable from the session with the session name. More...
 
virtual ErrorCode GetRotatedFileNames (const RscString< 512 > &sessionname, GetRotatedFileNamesFilenamesDelegate filenamesDelegate)=0
 Returns names of all files that have been written by a session More...
 
virtual void GetSessionNames (const RscString< 512 > &variablename, GetSessionNamesResultDelegate resultDelegate)=0
 Tries to retrieve names of sessions which log assigned variables More...
 
virtual ErrorCode SetTriggerCondition (const RscString< 512 > &sessionName, const RscString< 512 > &taskName, uint16 preCycleCount, uint16 postCycleCount, SetTriggerConditionTriggerConditionDelegate triggerConditionDelegate)=0
 Sets a trigger condition More...
 
- Public Member Functions inherited from Arp::System::Rsc::Services::IRscService
 IRscService (void)=default
 Constructs an IRscService instance. More...
 
virtual ~IRscService (void)=default
 Destructs this instance and frees all resouces. More...
 

Static Public Member Functions

static IRscServiceProxyFactory & GetProxyFactory (void)
 
- Static Public Member Functions inherited from Arp::System::Rsc::Services::IRscService
static IRscServiceProxyFactory & GetProxyFactory (void)
 Returns a reference to service proxy factory to create a proxy instance of the service More...
 

Detailed Description

The DataLogger provides an interface to log and store variables during firmware runtime.

Constructor & Destructor Documentation

◆ IDataLoggerService2()

Arp::Services::DataLogger::Services::IDataLoggerService2::IDataLoggerService2 ( void  )
default

Constructs an IDataLoggerService2 instance.

Member Function Documentation

◆ ConfigureSession()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::ConfigureSession ( const RscString< 512 > &  sessionname,
const std::vector< SessionProperty > &  properties 
)
pure virtual

(Re)configures a session

Parameters
sessionnameName of session to be created or reconfigured
propertiesCollection of attributes forming the configuration for the session
Returns
<cref name="ErrorCode"> for more details

◆ CreateSession()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::CreateSession ( const RscString< 512 > &  sessionName,
boolean  persistent = false 
)
pure virtual

Tries to create a new session.

Parameters
sessionNameName of session to be created.
persistentIf set to true, the newly created session will not be removed when the RSC connection is closed.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ GetLoggedVariables()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::GetLoggedVariables ( const RscString< 512 > &  sessionName,
GetLoggedVariablesInfosDelegate  infosDelegate 
)
pure virtual

Queries all infos about logged variables of a session.

Parameters
sessionNameName of session to query logged variables
infosIterator which can be used to list logged variables after successful call
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ GetRotatedFileNames()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::GetRotatedFileNames ( const RscString< 512 > &  sessionname,
GetRotatedFileNamesFilenamesDelegate  filenamesDelegate 
)
pure virtual

Returns names of all files that have been written by a session

Parameters
sessionnameName of session from which rotated files should be listed
filenamesIterator to list names of all rotated files on successful call.
Returns
ErrorCode.NoData in case the session has no data sink configured.

◆ GetSessionConfiguration()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::GetSessionConfiguration ( const RscString< 512 > &  sessionname,
std::vector< SessionProperty > &  properties,
boolean isPersistent 
)
pure virtual

Tries to query the current configuration of a session

Parameters
sessionnameName of session to be queried
propertiesCollection of attributes forming the sessions configuration after successfull invocation
isPersistentDetermines if the session will remain (true) when the connection to the server is closed or not
Returns
<cref name="ErrorCode"> for more details

◆ GetSessionNames()

virtual void Arp::Services::DataLogger::Services::IDataLoggerService2::GetSessionNames ( const RscString< 512 > &  variablename,
GetSessionNamesResultDelegate  resultDelegate 
)
pure virtual

Tries to retrieve names of sessions which log assigned variables

Parameters
variablenameName of variable to which corresponding sessions should be found
Returns
Enumeration of names of sessions which log the variable in question

◆ GetSessionState()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::GetSessionState ( const RscString< 512 > &  sessionName,
SessionState state 
)
pure virtual

Tries to query the state of a session.

Parameters
sessionNameName of session to query state of.
stateContainer for state of session, if session exists. The value after return from call is unspecified if the session does not exists.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ ListSessionNames()

virtual void Arp::Services::DataLogger::Services::IDataLoggerService2::ListSessionNames ( ListSessionNamesResultDelegate  resultDelegate)
pure virtual

List all names of sessions inside the data logger component.

Returns
Array of session names.

◆ ReadVariablesData()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::ReadVariablesData ( const RscString< 512 > &  sessionName,
DateTime  startTime,
DateTime  endTime,
ReadVariablesDataVariableNamesDelegate  variableNamesDelegate,
ReadVariablesDataValuesDelegate  valuesDelegate 
)
pure virtual

Read the data from the given variable from the session with the session name.

This service function returns the plain data values from the passed variable names including timestamps and data series consistent flags, which is called a record. In a record the values are in a static order and doesn't contain any type information. Each record starts with the timestamp followed by the values from the given variable by names and the consistent flag. The record ends with a record type describing the cycle the record belongs to.

Example:

Read variables from task A: a1, a2
from task B: b1
Results in:
object[]
timestamp task A, a1, a2, b1, consistent flag, record type
timestamp task B, a1, a2, b1, consistent flag, record type

The number of records depends on the given start and end time. Each values will be returned between the start and end time.

If the start time is zero, all available records until the end time will be returned.

If the end time is zero, all available records from the start time until the last available record is reached will be returned.

If the start and end time is zero, each available record will be returned.

If the start time is greater than the end time, the resulted values are returned in descending order.

Parameters
sessionNameName of session where variable should be read from.
startTimeStart time to be read data.
endTimeEnd time to be read data.
variableNamesName of variables to be read data.
valuesAn enumerator which stores the read values.
Returns
Returns Arp.Services.DataLogger.Services.ErrorCode.None on success.

◆ RemoveSession()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::RemoveSession ( const RscString< 512 > &  sessionName)
pure virtual

Tries to remove a session.

Parameters
sessionNameName of session to be removed.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ SetTriggerCondition()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::SetTriggerCondition ( const RscString< 512 > &  sessionName,
const RscString< 512 > &  taskName,
uint16  preCycleCount,
uint16  postCycleCount,
SetTriggerConditionTriggerConditionDelegate  triggerConditionDelegate 
)
pure virtual

Sets a trigger condition

Configuration of the trigger is done in RPN (Reverse Polish Notation). Each operand or operation is a single Arp.Services.DataLogger.Services.TriggerRpnItem. Only if the condition specified by the trigger is fullfilled values are logged and stored inside the sink.

The amount of cycles that should be stored before the condition was fullfilled can be configured using preCycleCount whereas the amount of cycles that should be recorded afterwards can be configured using postCycleCount. If postCycleCount is set to 0 then the recording continues until IDataLoggerService::StopSession is called or the PLC project is stopped.

Parameters
sessionNameName of session to set trigger condition
taskNameName of task where trigger condition is evaluated
preCycleCountAmount of datasets recorded before the condition was triggered
postCycleCountAmount of dataset recorded ater the condition is triggered (0 means endless)
triggerConditionList of trigger items. All items are evaluated in order of their position inside the list.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ SetVariables()

virtual void Arp::Services::DataLogger::Services::IDataLoggerService2::SetVariables ( const RscString< 512 > &  sessionName,
SetVariablesVariableNamesDelegate  variableNamesDelegate,
SetVariablesResultDelegate  resultDelegate 
)
pure virtual

Tries to add a variable to a session.

Parameters
sessionNameName of session where variable should be added.
variableNamesName of variable to be added to session.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ StartSession()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::StartSession ( const RscString< 512 > &  sessionName)
pure virtual

Tries to start a logging session.

Parameters
sessionNameName of session to be started.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

◆ StopSession()

virtual ErrorCode Arp::Services::DataLogger::Services::IDataLoggerService2::StopSession ( const RscString< 512 > &  sessionName)
pure virtual

Tries to stop a logging session.

Parameters
sessionNameName of session to be stopped.
Returns
Arp.Services.DataLogger.Services.ErrorCode for more information

The documentation for this class was generated from the following file: