Querying notifications via RSC INotificationLoggerService

Notifications that have been saved by means of the Notification Logger can be queried via RSC interfaces, and one that is already provided with the PLCnext Runtime System is thisINotificationLoggerService

With the release of the PLCnext Control RFC 4072R which is the first PLCnext Control device made for system redundancy, an additionalINotificationLoggerService2 is provided for all PLCnext Control devices. The newer service type is especially capable of logging the redundancy types and roles at the time of notifying.  For future-proof development, please use theINotificationLoggerService2

Note: TheINotificationLoggerService2  returns only up to 1024 notifications.  Therefore, further queries need to be adapted to what was found in the first query.

You can use filter criteria for the query in order to specify the query. With theNotificationFilter struct object, you can query all archives, or the notifications of one specific archive.

Note: For user-defined notification archives, the access permissions need to be set explicitly by an authorized user because no default configuration is present.

How to

Use the Arp/Services/NotificationLogger/Services/INotificationLoggerService.hpp interface. Further information on the classes and their applications is available directly in the code commentary.

TheQueryStoredNotifications method

Use theQueryStoredNotifications method to query saved notifications. You can limit the query using the following parameters:

Parameter Data type Description
archives String[] List of names of archives to be queried. If this list is empty, all archives with sufficient access rights are queried.
filter NotificationFilter Specification of the filter for the query (see here)
limit int32 Maximum number of notifications to be returned
sortOrder SortOrder Sorting criterion of the query
language String Desired language of user data (en_GB,  de_DE, etc.). Note: This feature is not supported yet.

TheNotificationFilter struct object

If using RSC, the filters are described by a structure with reference values or regular expressions. The limits are part of the specified area. The individual criteria are ANDed. 

TheNotificationFilter struct object includes these fields:

Field Data type Description
StoredIdLowerLimit uint64 Lower limit of the StoredId (> = 1), is ignored if = 0
In the Notification Logger, a notification is clearly identified by a StoredId (uint64). The StoredId is assigned by the Notification Logger when adding the notification to the input buffer.
StoredIdUpperLimit uint64 Upper limit of the StoredId (> = 1, < = 18446744073709551615, max. uint64), is ignored if = 0
NotificationNameRegExp String Regular expression for the notification name. Is ignored if field is empty.
SenderNameRegExp String Regular expression for the sender name. Is ignored if field is empty.
TimestampBefore String

Oldest applicable notification. Is ignored if field is empty. The format complies with ISO 8601 plus indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS

TimestampAfter String Latest applicable notification. Is ignored if field is empty. The format complies with ISO 8601 plus indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS
SeverityLowerLimit String Lowest applicable severity. Is ignored if field is empty.
SeverityUpperLimit String Highest applicable severity. Is ignored if field is empty.

TheStoredNotification struct object

The values are returned via theStoredNotification struct object.

This object includes the following fields:

Field Data type Description
Id uint64 ID of saved notification (StoreId)
Archive String Name of the archive the notification was loaded from.
If the notification is present in several archives, this field contains a list of archives separated by commas.
NotificationName String Name of the notification
SenderName String Name of the sender
TimeStamp String Time stamp of when the notification was sent. The format complies with ISO 8601 plus additional indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS
Severity String Severity of the notification
Payload String[] Translated and formatted representation of user data
PayloadXml String[] User data as XML

The StoredNotification2 struct object

Available from 2022.0 LTS

The values are returned via the StoredNotification2

This object includes the following fields:

Field Data type Description
Id uint64 ID of saved notification (StoreId)
Archives String[] Name of the archives the notification was loaded from.
NotificationName String Name of the notification
SenderName String Name of the sender
TimeStamp String32 Time stamp of when the notification was sent. The format complies with ISO 8601 plus additional indication of microseconds: YYYY-MM-DDThh:mm:ss.SSSSSS
Severity String32 Severity of the notification
Payload String[] Translated and formatted representation of user data
PayloadXml String[] User data as XML
RedundancyType String32 Redundancy type (first or second) of the controller when the notification was sent
RedundancyRole String32 Redundancy role (primary or backup) of the controller when the notification was sent

User roles with access permissions

The following table shows which user role is authorized to what extent to call the methods of the INotificationLoggerService or the INotificationLoggerService2.

Note: To Security notification archives, only SecurityAdmin and SecurityAuditor user roles have access, and can only read values.

User roles that are not contained in these tables do not have access permission. 

INotificationLoggerService

User role QueryStoredNotifications
QueryNotifications
DeleteNotifications ListArchives Other
Admin
Engineer  
Commissioner    
Service    
DataViewer    
DataChanger    
Viewer    

INotificationLoggerService2

Available from 2022.0 LTS

User role QueryStoredNotifications
QueryNotifications
DeleteNotifications ListArchives Other
Admin
SecurityAdmin
SecurityAuditor    
CertificateManager    
UserManager    
Engineer  
Commissioner    
Service    
DataViewer    
DataChanger    
Viewer    

 

 


• Published/reviewed: 2024-10-30   ☀  Revision 074 •