diff --git a/Cargo.lock b/Cargo.lock index e5f2ff6..27f568d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,7 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +version = 3 + [[package]] name = "aho-corasick" version = "0.7.18" @@ -718,8 +720,7 @@ checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "opcua-client" version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0517d6a4a439bf6d6313d7b25940c968e1dbb5205a47778061e4c2e5d615bd9c" +source = "git+https://github.com/kristoferb/opcua?branch=0.8.1#627478c91c3a17730ea29142bf5f426f22ac670e" dependencies = [ "chrono", "futures 0.1.31", @@ -740,8 +741,7 @@ dependencies = [ [[package]] name = "opcua-core" version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e8d353c0c84f917917e7de65c745377a43c042656e7b56b7ae7b4397b87ad1" +source = "git+https://github.com/kristoferb/opcua?branch=0.8.1#627478c91c3a17730ea29142bf5f426f22ac670e" dependencies = [ "bytes 0.4.12", "chrono", @@ -762,8 +762,7 @@ dependencies = [ [[package]] name = "opcua-crypto" version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff552d5920b3462073aa8c00ca37145e76e85f5fd3c447bd12f8dedfa448d70" +source = "git+https://github.com/kristoferb/opcua?branch=0.8.1#627478c91c3a17730ea29142bf5f426f22ac670e" dependencies = [ "bytes 0.4.12", "chrono", @@ -779,8 +778,7 @@ dependencies = [ [[package]] name = "opcua-types" version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3117a07c654ac2d5a652e28cec632d1b031ec5d7f09761455082329d4190be63" +source = "git+https://github.com/kristoferb/opcua?branch=0.8.1#627478c91c3a17730ea29142bf5f426f22ac670e" dependencies = [ "base64", "bitflags", diff --git a/Cargo.toml b/Cargo.toml index a8383a4..f78223e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,5 +8,5 @@ edition = "2018" r2r = "0.5.3" futures = "0.3.15" tokio = { version = "1", features = ["full"] } -opcua-client = "0.8" +opcua-client = {git = "https://github.com/kristoferb/opcua", branch = "0.8.1"} serde_json = "1.0" diff --git a/README.md b/README.md index 343d012..ea28413 100644 --- a/README.md +++ b/README.md @@ -18,3 +18,8 @@ Or simply ``` cargo run -- --ros-args -p server_address:="opc.tcp://192.168.1.33:4840/" -p node_ids:=["ns=4;i=45","ns=4;i=46","ns=4;i=47","ns=4;i=94","ns=4;i=306"] ``` + +Another example +``` +cargo run -- --ros-args -p server_address:="opc.tcp://192.168.100.10:4840/" -p node_ids:=["ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_from_plc_1","ns=4;s=|var|CODESYS CONTROL FOR Raspberry Pi MC SL.Application.IO.bool_to_plc_1"] +``` \ No newline at end of file diff --git a/src/main.rs b/src/main.rs index 4d1d3fa..7c37c36 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,8 +261,8 @@ async fn main() -> Result<(), Box> { let state = Arc::new(Mutex::new(HashMap::new())); let (session, _kill) = setup_opc(&server_address, node_ids, state.clone()).expect("could not connect to opc server"); - let sub = node.subscribe::("command")?; - let publisher = node.create_publisher::("measured")?; + let sub = node.subscribe::("opc_command")?; + let publisher = node.create_publisher::("opc_measured")?; let state_task = state.clone(); let handle = tokio::task::spawn_blocking(move || loop {