OPC UA Server
Heisenware allows setting up an own OPC UA server locally to provide data to existing OPC UA clients. The OPC UA server can be configured via the cloud platform.
Subscriptions
onSet
Register a handler that is triggered whenever a client writes a value to a specific variable in the OPC UA server.
Inputs:
variablePath: (String) — The path to the variable you want to monitor for incoming "set" requests (e.g.,
"myDevice/sensor:threshold"
).listener: (Function) — The function that handles the incoming value from the client.
Use this function if you want to take action when a client writes a new value to a variable (such as logging or validation).
onRequest
Registers a handler to respond when a client requests the current value of a variable.
Inputs:
variablePath: (String) — The path to the variable for which the server should respond to a read request.
listener: (Function) — The function to define how the server should provide the variable’s value.
setValue
Set a new value for a variable on the server and notify all connected clients.
Inputs:
variablePath: (String) — The full path to the variable you want to update.
value: (Any Type) — The new value you want to assign to the variable.
onServerUpdate
Register a handler to get notified whenever the server updates any of its internal variables.
Inputs:
listener: (Function) — A function to handle server update notifications. The server will pass the update timestamp and the updated variable path.
Functions
start
Starts the OPC UA server and makes it available for client connections. Returns the server's endpoint URL if the server starts successfully.
stop
Stops the OPC UA server and releases all resources.
isStarted
Checks if the OPC UA server is currently running. Returns true
if the server is running, false
otherwise.
Last updated