Expand description
Rust wrapper for the open62541 library.
§Examples
§Connect to server
use open62541::AsyncClient;
let client = AsyncClient::new(
"opc.tcp://opcuademo.sterfive.com:26543",
tokio::time::Duration::from_millis(100),
)?;
§Read node’s value attribute
use open62541::ua::NodeId;
let node_id = NodeId::numeric(0, 2258); // Server/ServerStatus/CurrentTime
let value = client.read_value(&node_id).await?;
println!("Received value: {value:?}");
§Watch node for changes in value attribute
// Create subscription that receives the updates.
let subscription = client.create_subscription().await?;
// Create monitored item to receive node updates.
let mut monitored_item = subscription.create_monitored_item(&node_id).await?;
while let Some(value) = monitored_item.next().await {
println!("Received value: {value:?}");
}
Modules§
- Thin wrappers for
open62541_sys
types.
Structs§
- Connected OPC UA client (with asynchronous API).
- Monitored item (with asynchronous API).
- Subscription (with asynchronous API).
- Type-removed one-shot callback.
- Type-removed stream sender.
- Connected OPC UA client.
- Builder for
Client
.
Enums§
- Generic error.
Traits§
- Transparent wrapper for OPC UA data type.