OPCUAClientBase Class
packages\node-opcua-client\src\client_base.js:39
Constructor
OPCUAClientBase
-
options
Parameters:
-
options
Object-
defaultSecureTokenLiveTime
Numberdefault secure token lifetime in ms
-
[securityMode=MessageSecurityMode.None]
MessageSecurityMode optionalthe default security mode.
-
[securityPolicy=SecurityPolicy.NONE]
SecurityPolicy optionalthe security mode.
-
[serverCertificate=null]
Certificate optionalthe server certificate.
-
[certificateFile="certificates/client_selfsigned_cert_1024.pem"]
String optionalclient certificate pem file.
-
[privateKeyFile="certificates/client_key_1024.pem"]
String optionalclient private key pem file.
-
[connectionStrategy]
Object optional -
[keepSessionAlive=false]
Boolean optional
-
Item Index
Methods
- acknowledgeCondition from Spec 1.03 Part 9 : page 27 The Acknowledge Method is used to acknowledge an Event Notification for a Condition instance state where AckedState is false. Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall also allow Clients to call the Acknowledge Method by specifying ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the AcknowledgeableConditionType Node. A Condition instance may be an Object that appears in the Server Address Space. If this is the case the ConditionId is the NodeId for the Object. The EventId identifies a specific Event Notification where a state to be acknowledged was reported. Acknowledgement and the optional comment will be applied to the state identified with the EventId. If the comment field is NULL (both locale and text are empty) it will be ignored and any existing comments will remain unchanged. If the comment is to be reset, an empty text with a locale shall be provided. A valid EventId will result in an Event Notification where AckedState/Id is set to TRUE and the Comment Property contains the text of the optional comment argument. If a previous state is acknowledged, the BranchId and all Condition values of this branch will be reported.
- addCommentCondition The AddComment Method is used to apply a comment to a specific state of a Condition instance. Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall also allow Clients to call the AddComment Method by specifying ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the ConditionType Node. Notes: Comments are added to Event occurrences identified via an EventId. EventIds where the related EventType is not a ConditionType (or subtype of it) and thus does not support Comments are rejected. A ConditionEvent – where the Comment Variable contains this text – will be sent for the identified state. If a comment is added to a previous state (i.e. a state for which the Server has created a branch), the BranchId and all Condition values of this branch will be reported/.
- confirmCondition from Spec 1.03 Part 9 : page 27 The Confirm Method is used to confirm an Event Notifications for a Condition instance state where ConfirmedState is FALSE. Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service. However, some Servers do not expose Condition instances in the AddressSpace. Therefore all Servers shall also allow Clients to call the Confirm Method by specifying ConditionId as the ObjectId. The Method cannot be called with an ObjectId of the AcknowledgeableConditionType Node.
- connect
- disconnect
- findEndpoint
- findEndpoint
- findServers
- findServers
- getEndpointsRequest
- perform_findServersRequest
Properties
Methods
acknowledgeCondition
from Spec 1.03 Part 9 : page 27
The Acknowledge Method is used to acknowledge an Event Notification for a Condition
instance state where AckedState is false.
Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service.
However, some Servers do not expose Condition instances in the AddressSpace.
Therefore all Servers shall also allow Clients to call the Acknowledge Method by specifying ConditionId as the ObjectId.
The Method cannot be called with an ObjectId of the AcknowledgeableConditionType Node.
A Condition instance may be an Object that appears in the Server Address Space. If this is
the case the ConditionId is the NodeId for the Object.
The EventId identifies a specific Event Notification where a state to be acknowledged was
reported. Acknowledgement and the optional comment will be applied to the state identified
with the EventId. If the comment field is NULL (both locale and text are empty) it will be
ignored and any existing comments will remain unchanged. If the comment is to be reset, an
empty text with a locale shall be provided.
A valid EventId will result in an Event Notification where AckedState/Id is set to TRUE and the
Comment Property contains the text of the optional comment argument. If a previous state is
acknowledged, the BranchId and all Condition values of this branch will be reported.
-
conditionId
-
eventId
-
comment
-
callback
Parameters:
-
conditionId
NodeId -
eventId
Buffer -
comment
String | LocalizedText -
callback
Function-
err
Error | Null
-
confirmCondition
from Spec 1.03 Part 9 : page 27
The Confirm Method is used to confirm an Event Notifications for a Condition instance state
where ConfirmedState is FALSE.
Normally, the NodeId of the object instance as the ObjectId is passed to the Call Service.
However, some Servers do not expose Condition instances in the AddressSpace.
Therefore all Servers shall also allow Clients to call the Confirm Method by specifying ConditionId as the ObjectId.
The Method cannot be called with an ObjectId of the AcknowledgeableConditionType Node.
-
conditionId
-
eventId
-
comment
-
callback
Parameters:
-
conditionId
Object -
eventId
Object -
comment
Object -
callback
Object
connect
-
endpoint_url
-
callback
connect the OPC-UA client to a server end point.
Parameters:
-
endpoint_url
String -
callback
Function
disconnect
-
callback
disconnect client from server
Parameters:
-
callback
Object[Function}
findEndpoint
()
EndPoint
return the endpoint information matching the specified url , security mode and security policy.
Returns:
findEndpoint
()
EndPoint
return the endpoint information matching security mode and security policy.
Returns:
findServers
-
callback
send a FindServers request to a discovery server
Parameters:
-
callback
Object[Function}
findServers
-
options
-
callback
Parameters:
-
options
Object-
[endpointUrl]
optional -
[localeIds]
optionalArray
-
[serverUris]
optionalArray
-
-
callback
Object
getEndpointsRequest
-
[options]
-
[options.localeIds}
-
[options.profileUris}
-
callback
Parameters:
-
[options]
Object optional-
[endpointUrl]
String optionalthe network address that the Client used to access the Discovery Endpoint .
-
-
[options.localeIds}
ArrayList of locales to use.
-
[options.profileUris}
ArrayList of transport profiles that the returned Endpoints shall support.
-
callback
Function-
err
Error | Null -
serverEndpoints
Arraythe array of endpoint descriptions
-
perform_findServersRequest
-
discovery_server_endpointUrl
-
callback
extract the server endpoints exposed by a discovery server
Parameters:
-
discovery_server_endpointUrl
Object -
callback
Object
Properties
bytesRead
Number
total number of bytes read by the client
bytesWritten
Number
total number of bytes written by the client
connectionStrategy
options.connectionStrategy | MaxRetry, initialDelay, maxDelay, randomisationFactor | | MaxRetry: number, initialDelay: number, maxDelay: number, randomisationFactor: number
isReconnecting
Boolean true if the client is trying to reconnect to the server after a connection break.
keepSessionAlive
Boolean
true if session shall periodically probe the server to keep the session alive and prevent timeout
knowsServerEndpoint
Boolean
is true when the client has already requested the server end points.
reconnectOnFailure
Boolean
true if the connection strategy is set to automatically try to reconnect in case of failure
securityMode
MessageSecurityMode
serverCertificate
Certificate
transactionsPerformed
Number
total number of transactions performed by the client
Events
after_reconnection
notify the observers that the reconnection process has been completed
Event Payload:
-
err
Object
close
Event Payload:
-
error
Error
close
connection_reestablished
send when the connection is reestablished after a connection break
receive_chunk
notify the observer that a message_chunk has been received
Event Payload:
-
message_chunk
Object
receive_response
notify the observer that a response has been received from the server.
Event Payload:
-
message
Object
send_chunk
notify the observer that a message_chunk has been sent
Event Payload:
-
message_chunk
Object
send_request
notify the observer that a request has been sent to the server.
Event Payload:
-
message
Object
start_reconnection
notifies the observer that the OPCUA is now trying to reestablish the connection after having received a connection break...
timed_out_request
send when a request has timed out without receiving a response
Event Payload:
-
request
Object