Reference
OpcEvent Members
Represents a snapshot of a 'Opc.UaFx.OpcEventNode'.
Reference
OpcEvent Members
- Type
- OpcEvent
- Namespace
- Opc.UaFx
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
- Also in
- Opc.UaFx.Client
Constructors
OpcEvent
Initializes a new instance of the OpcEvent class using the dataStore specified.
public OpcEvent(IOpcReadOnlyNodeDataStore dataStore)Public Sub New(dataStore As IOpcReadOnlyNodeDataStore)Parameters
| Name | Type | Description |
|---|---|---|
dataStore | IOpc | The IOpc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The dataStore is a null reference ( |
Properties
DataStore
Gets the IOpcReadOnlyNodeDataStore which contains the data of the OpcEvent instance.
protected IOpcReadOnlyNodeDataStore DataStore { get; }Protected ReadOnly Property DataStore As IOpcReadOnlyNodeDataStoreProperty value
An instance implementing the IOpcReadOnlyNodeDataStore interface containing the event data represented by this OpcEvent instance.
EventId
Gets a value generated by the server to uniquely identify a particular event notification.
public ByteString EventId { get; }Public ReadOnly Property EventId As ByteStringProperty value
The identifier of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.EventId'.
EventType
Gets the type of event.
public OpcEventType EventType { get; }Public ReadOnly Property EventType As OpcEventTypeProperty value
One of the members defined by the OpcEventType enumeration indicating the type of the event represented by the OpcEvent. In case of custom event types the value Event.
EventTypeId
Gets node identifier which describes the specific type of event.
public OpcNodeId EventTypeId { get; }Public ReadOnly Property EventTypeId As OpcNodeIdProperty value
The node identifier of the event type. For more information see 'Opc.UaFx.OpcEventNode.EventTypeId'.
Message
Gets a value which defines a human-readable and localizable text description of the event.
public OpcText Message { get; }Public ReadOnly Property Message As OpcTextProperty value
The message of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.Message'.
NodeId
Gets the identifier of the node from which this event data snapshot has been created.
public OpcNodeId NodeId { get; }Public ReadOnly Property NodeId As OpcNodeIdProperty value
The OpcNodeId of the node this snapshot originates.
ReceiveTime
Gets the time the OPC UA server received the event from the underlying device of another server.
public DateTime ReceiveTime { get; }Public ReadOnly Property ReceiveTime As DateProperty value
The time the server received the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.ReceiveTime'.
Severity
Gets an indication of the urgency of the event.
public OpcEventSeverity Severity { get; }Public ReadOnly Property Severity As OpcEventSeverityProperty value
The severity of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.Severity'.
SourceName
Gets a description of the source of the event.
public string SourceName { get; }Public ReadOnly Property SourceName As StringProperty value
The description of the source of the OpcEvent. For more information see 'Opc.UaFx.OpcEventNode.SourceName'.
SourceNodeId
Gets the node identifier which identifies the node that the event originated from.
public OpcNodeId SourceNodeId { get; }Public ReadOnly Property SourceNodeId As OpcNodeIdProperty value
The node identifier of the node the OpcEvent originates from. For more information see 'Opc.UaFx.OpcEventNode.SourceNodeId'.
Time
Gets the time the event occurred.
public DateTime Time { get; }Public ReadOnly Property Time As DateProperty value
The time the OpcEvent occurred. For more information see 'Opc.UaFx.OpcEventNode.Time'.
Methods
Create
Creates a new OpcEvent instance following the parameters specified.
public static OpcEvent Create(
OpcContext context,
OpcEventFilter filter,
IEnumerable<object> data)Public Shared Function Create(
context As OpcContext,
filter As OpcEventFilter,
data As IEnumerable(Of Object)) As OpcEventParameters
| Name | Type | Description |
|---|---|---|
context | OpcContext | The OpcContext to which the new OpcEvent belongs to. |
filter | OpcEventFilter | The OpcEventFilter whose SelectClause defines the order of the data. |
data | IEnumerable<Object> | A sequence of object values in the same order as the select-clause operands of the filter. Pass null for fields that are not available. |
Returns
A new instance of the event type or of one of its (custom) derivates using the data specified.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The context, filter or data is a null reference ( |
GetValue
Retrieves the value of the event field named by the memberName, e.g. to implement a property of a custom event type.
protected T GetValue<T>(string memberName = "")Protected Function GetValue(Of T)(memberName As String = "") As TType parameters
| Name | Description |
|---|---|
T | The type of the value. |
Parameters
| Name | Type | Description |
|---|---|---|
memberName | String | The name of the field. By default the name of the calling member. Optional, default "". |
Returns
T
The value of the field as an instance of T.
Remarks
A memberName without a namespace is resolved in the namespace of the event type which declares the member, unless the EventTypeId belongs to the default namespace.
RegisterType
| Overload | Description |
|---|---|
| RegisterType< | Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the OpcT specified. |
| RegisterType< | Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the eventTypeId specified. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | The type T does not define the Opc |
RegisterType<T>()
Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the OpcEventTypeAttribute defined on the T specified.
public static void RegisterType<T>() where T : OpcEventPublic Shared Sub RegisterType(Of T As OpcEvent)()Type parameters
| Name | Description |
|---|---|
T | The OpcEvent type to use in case there an event for the event definition equals to event type identifier defined using the Opc |
RegisterType<T>(OpcNodeId)
Registers the type defined by T as the OpcEvent type to create in case there an event instance is to be created for the type definition identified by the eventTypeId specified.
public static void RegisterType<T>(OpcNodeId eventTypeId) where T : OpcEventPublic Shared Sub RegisterType(Of T As OpcEvent)(eventTypeId As OpcNodeId)Type parameters
| Name | Description |
|---|---|
T | The OpcEvent type to use in case there an event for the event definition equals to eventTypeId is to be created. The type needs to provide a public accessible constructor accepting an instance of the IOpc |
Parameters
| Name | Type | Description |
|---|---|---|
eventTypeId | OpcNodeId | The identifier of the type definition for which the T is to be used to create an event instance. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventTypeId is a null reference ( |
Remarks
It is not possible to register the same or a different event type for the eventTypeId specified as long there is already an event type registered for the type definition specified by eventTypeId.
RegisterTypes
| Overload | Description |
|---|---|
| RegisterTypes( | Registers all non-abstract types in the assembly specified which defines the Opc |
| RegisterTypes( | Registers the eventTypes specified as the OpcEvent type to create in case there an event instance is to be created for one of the type definitions identified by the OpceventTypes specified. |
| RegisterTypes( | Registers the eventType and the further specified eventTypes as the OpcEvent types to create in case there an event instance is to be created for one of the type definitions identified by the OpceventType or on one of the eventTypes specified. |
Exceptions (all overloads)
| Exception | Condition |
|---|---|
| Argument | A Type does not define the Opc |
RegisterTypes(Assembly)
Registers all non-abstract types in the assembly specified which defines the OpcEventTypeAttribute and inherit from OpcEvent.
public static void RegisterTypes(Assembly assembly)Public Shared Sub RegisterTypes(assembly As Assembly)Parameters
| Name | Type | Description |
|---|---|---|
assembly | Assembly | The Assembly its types are inspected for subclasses of the OpcEvent class which in addition using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The assembly is a null reference ( |
Remarks
The Type instances to register need to define the OpcEventTypeAttribute and a public accessible constructor accepting an instance of the IOpcReadOnlyNodeDataStore interface. Additionally the Type needs to be a subclass of the OpcEvent class.
RegisterTypes(IEnumerable<Type>)
Registers the eventTypes specified as the OpcEvent type to create in case there an event instance is to be created for one of the type definitions identified by the OpcEventTypeAttribute used on one of the eventTypes specified.
public static void RegisterTypes(IEnumerable<Type> eventTypes)Public Shared Sub RegisterTypes(eventTypes As IEnumerable(Of Type))Parameters
| Name | Type | Description |
|---|---|---|
eventTypes | IEnumerable<Type> | A sequence of Type instances representing subclasses of OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventTypes is a null reference ( |
Remarks
Any null reference (Nothing in Visual Basic) in eventTypes is ignored.
RegisterTypes(Type, params Type[])
Registers the eventType and the further specified eventTypes as the OpcEvent types to create in case there an event instance is to be created for one of the type definitions identified by the OpcEventTypeAttribute used on the eventType or on one of the eventTypes specified.
public static void RegisterTypes(Type eventType, params Type[] eventTypes)Public Shared Sub RegisterTypes(
eventType As Type,
ParamArray eventTypes As Type())Parameters
| Name | Type | Description |
|---|---|---|
eventType | Type | The Type instance representing a subclass of the OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the Opc |
eventTypes | params Type[] | An array of additional Type instances representing subclasses of OpcEvent to use in case there an event for the event definition equals to the event type identifier defined using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventType or eventTypes is a null reference ( |
UnregisterType
| Overload | Description |
|---|---|
| UnregisterType< | Unregisters the previously registered (T as the OpcEvent type to not longer create for the type definition identified by the OpcT specified. |
| UnregisterType< | Unregisters the previously registered (T as the OpcEvent type to not longer create for the type definition identified by the eventTypeId specified. |
UnregisterType<T>()
Unregisters the previously registered (see RegisterType) type defined by T as the OpcEvent type to not longer create for the type definition identified by the OpcEventTypeAttribute defined on the T specified.
public static void UnregisterType<T>() where T : OpcEventPublic Shared Sub UnregisterType(Of T As OpcEvent)()Type parameters
| Name | Description |
|---|---|
T | The OpcEvent type to unregister for the event definition equals to the event type identifier defined using the Opc |
UnregisterType<T>(OpcNodeId)
Unregisters the previously registered (see RegisterType) type defined by T as the OpcEvent type to not longer create for the type definition identified by the eventTypeId specified.
public static void UnregisterType<T>(OpcNodeId eventTypeId) where T : OpcEventPublic Shared Sub UnregisterType(Of T As OpcEvent)(eventTypeId As OpcNodeId)Type parameters
| Name | Description |
|---|---|
T | The OpcEvent type to unregister for the event definition equals to eventTypeId. The type needs to be a subclass of the OpcEvent class. |
Parameters
| Name | Type | Description |
|---|---|---|
eventTypeId | OpcNodeId | The identifier of the type definition for which the T is to be unregistered. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventTypeId is a null reference ( |
UnregisterTypes
| Overload | Description |
|---|---|
| UnregisterTypes( | Unregisters all previously registered types (assembly specified. |
| UnregisterTypes( | Unregisters the previously registered (eventTypes specified. |
| UnregisterTypes( | Unregisters the previously registered eventType and the further specified eventTypes ( |
UnregisterTypes(Assembly)
Unregisters all previously registered types (see RegisterTypes) in the assembly specified.
public static void UnregisterTypes(Assembly assembly)Public Shared Sub UnregisterTypes(assembly As Assembly)Parameters
| Name | Type | Description |
|---|---|---|
assembly | Assembly | The Assembly its types are inspected for subclasses of the OpcEvent class which in addition using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The assembly is a null reference ( |
UnregisterTypes(IEnumerable<Type>)
Unregisters the previously registered (see RegisterTypes) eventTypes specified.
public static void UnregisterTypes(IEnumerable<Type> eventTypes)Public Shared Sub UnregisterTypes(eventTypes As IEnumerable(Of Type))Parameters
| Name | Type | Description |
|---|---|---|
eventTypes | IEnumerable<Type> | A sequence of OpcEvent types to unregister for the event definitions equals to the event type identifiers defined using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventTypes is a null reference ( |
UnregisterTypes(Type, params Type[])
Unregisters the previously registered eventType and the further specified eventTypes (see RegisterTypes).
public static void UnregisterTypes(Type eventType, params Type[] eventTypes)Public Shared Sub UnregisterTypes(
eventType As Type,
ParamArray eventTypes As Type())Parameters
| Name | Type | Description |
|---|---|---|
eventType | Type | The OpcEvent type to unregister for the event definition equals to the event type identifier defined using the Opc |
eventTypes | params Type[] | An array of additional OpcEvent types to unregister for the event definitions equals to the event type identifiers defined using the Opc |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The eventType or eventTypes is a null reference ( |
Events
TypeResolve
Occurs when the resolution of an event type fails. Use this event to manually provide the Type to use for a specific event type definition identifier.
public static event OpcTypeResolveEventHandler TypeResolvePublic Shared Event TypeResolve As OpcTypeResolveEventHandlerEvent type

