Event Types

Event types are used by Apis Chronical for two purposes. First, each event type defines the fields that can be included in events of that type. Secondly, they define a hierarchy of increasingly more specialized types. For example, the DiscreteAlarm type inherits from/is a specialization of the generic Alarm type. This hierarchy then defines the semantics of each event type, i.e. all subtypes of the Alarm type are also some kind of alarms.

Predefined Types

The following event type hierarchy is predefined in Apis Hive/Chronical:

Event
  ConditionEvent
    Alarm
      DiscreteAlarm
        DataValidationAlarm
        OffNormalAlarm
        QualityAlarm
        WatchdogAlarm
      LimitAlarm
        LevelAlarm
      OpcAlarm
  SystemEvent
    BatchEvent
    DeviceEvent
    ProcessEvent
    TimeSeriesEvent
    TraceEvent
  TrackingEvent
    AdvancedControlEvent
    OperatorChangeEvent
    SecurityEvent
      SessionEvent
        LogonEvent
    SystemConfigEvent
      EventSourceModified

The following event fields are defined by these event types:

Field nameDefined byDatatypeDescription
TimestampEventtime64Date and time of event, 100ns resolution
GenerationEventuint32Internal usage
SequenceEventuint32Internal usage
SourceEventuint32ID of event source
TypeEventuint32ID of event type
StateEventuint32Bitmap of event states
SeverityEventuint16The severity of the event in range 0-1000
MessageEventstringUnstructured information intended for humans
ReceivedEventtime64Date and time when event was received
SourcenameEventstringExtra source description
UserNameEventstringName of related user
CategoryEventuint32ID of classical OPC AE event category
ActiveTimeConditionEventtime64Date and time when the condition became active
CurrentValueConditionEventvariantCurrent observed value of the monitored signal
CurrentQualityConditionEventuint16Current observed OPC quality of the monitored signal
CurrentTimestampConditionEventtime64Current observed date and time of the monitored signal
LastStateConditionEventvariantPrevious event state
LastValueConditionEventvariantPrevious observed value of the monitored signal
LastQualityConditionEventuint16Previous observed OPC quality of the monitored signal
LastTimestampConditionEventtime64Previous observed date and time of the monitored signal
LastSeverityConditionEventvariantPrevious event severity
UnshelveTimeConditionEventtime64Date and time when event should be unshelved
CommentConditionEventstringUser comment given by e.g. Acknowledge
AckTimeConditionEventtime64Date and time when alarm was Acknowledged
ConditionNameOpcEventstringOPC AE condition name
SubconditionNameOpcEventstringOPC AE subcondition name
StartTimeTimeSeriesEventtime64Internal usage
EndTimeTimeSeriesEventtime64Internal usage
SamplesTimeSeriesEventuint32Internal usage
StatusTrackingEventboolIndicates if the requested action was successfull
ClientAuditIdTrackingEventstringAudit ID specified by client
OldNameEventSourceModifiedstringThe old name of the event source
OldFlagsEventSourceModifiedstringThe old flags value of the event source
NewNameEventSourceModifiedstringThe new name of the event source
NewFlagsEventSourceModifiedstringThe new flags value of the event source

Supported Datatypes

The event field datatype is either a scalar or an array of one of the following base types:

  • bool
  • uint8
  • uint16
  • uint32
  • uint64
  • int8
  • int16
  • int32
  • int64
  • time64
  • float32
  • float64
  • string
  • variant

Flags

The following flags can be specified on each event type:

NameDescription
DeletedEvents of this type should not be included in query results
ImmutableEvents of this type are never replaced/updated by newer events

The "Immutable" flag is used if Chronical receives events from another server, and that server generates multiple events with the same Timestamp, Type, and Source, and these events should all be considered valid. The default behaviour in Chronical is to consider such event series as updated/replaced events, meaning that only the last event received with a specific Timestamp, Type, and Source would be retreived on historial reads.

The following flags can be specified on each event field:

NameDescription
DeletedThis field should not be included in query results
StickyEvents without this field inherits the field from the previous event

The "Sticky" flag can be used to attach third-party information on an event that will be automatically preserved on newer events with identical Type and Source where the "Sticky" field is not present.