After sending the subscription, the OPC-UA Connector will subscribe the given nodes for monitoring requests. Every change will be sent through the websocket to the client and can be received by the onMessage function, which has been described here.
Request JSON
var requestData = {
"operation": String,
"nodes": Array of String,
"namespaceIndices": Array of String,
"publishingInterval": Float,
"clientHandlingID": Integer,
"samplingInterval": Float,
"queueSize": Integer,
"discardOldestItem": Boolean,
"monitoringMode": String,
"returnedTimestamps": String
}
The operation, which should be done by the asynchronous OPC-UA connector. Only the following options are valid at the moment.
- MONITORING_SUBSCRIBE
nodes
The names of the nodes, which should be subscribed. The name is one of two parts, which defines a node Id.
NOTE: If more than one item should be subscribed with one request, then the amount of nodes must be the same as the amount of namespaceIndices.
namespaceIndices
The namespace indices where the nodes resides
NOTE: If more than one item should be subscribed with one request, then the amount of namespaceIndices must be the same as the amount of nodes.
publishingInterval
The interval, in which the OPC-UA server will publish the changes in the subscribed nodes. According to the queueSize all changes, which are still stored in the queue will be published. The used timeunit are milliseconds.
clientHandlingID
An internal unique handling key for the OPC-UA server to distinguish the monitoring subscriptions.
NOTE: Each request must have an unique clientHandlingID or else only message from the latest subscription will be returned.
samplingInterval
The interval in which the OPC-UA server will sample the subscribed nodes for changes. This parameter will be only used if SAMPLING is the chosen monitoringMode. The used timeunit are milliseconds.
queueSize
The size of the queue that logs all changes of the subscribed nodes. Each node has an own queue. If the queue is full and new changes occurs, then the oldest changes are discarded automatically.
discardOldestItem
If this option is selected, then the oldest entry in the queue of each subscribed node will be discarded regardless whether the queue is not full or not.
monitoringMode
The monitoring mode. The following two modes are available:
- Reporting: Reports all changes after a defined publishing interval.
- Sampling: Samples the nodes after a defined interval and then returns the changes.
returnedTimestamps
This option decides what timestamps are returned in each message. The application server timestamp will be returned every time. For now the following options are allowed:
- Both: The timestamp of the OPC-UA Server as well as the source will be returned.
- Neither: Only the application server timestamp will be returned.
- Server: The timestamp of the OPC-UA server will be returned.
- Source: The timestamp of the source of the node will be returned.