OPC UA
for Rust.
Read a PLC, monitor a production line, or serve your own variables. Embed OPC UA directly in your Rust application.
cargo add opcua-kit --features client
nsu=urn:factory:line-1;s=AxisPositionChoose a protocol role
clientObserve a device
Browse variables, read typed values and subscribe to changes or alarm events.
serverServe your data
Expose application-owned variables for other OPC UA clients to read and monitor.
pubsubExchange datasets
Exchange unsigned scalar key frames over a transport you supply, including on no_std targets with an allocator.
Read a variable
Address a signal by namespace URI and identifier. Each sample carries the server’s status and the available timestamps alongside its value.
Set up the sessionRust · client.read_scalar
use opcua_kit::{NodeId, Sample};
let axis = NodeId::new(
"urn:factory:line-1", "s=AxisPosition",
)?;
let sample: Sample<f64> =
client.read_scalar(&axis).await?;