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")?;Read node’s value attribute
use open62541::{AsyncClient, 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
use futures::StreamExt as _;
use open62541::{AsyncClient, ua::NodeId};
// Create subscription that receives the updates.
let subscription = client.create_subscription().await?;
// Create monitored item to create 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_systypes.
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.