GitHub user helloworld121 edited a discussion: Subscribe OPC/UA Node

Hi there, 

I’m working on an OPC UA subscription to a specific node. I already implemented 
this using Eclipse Milo, but now I want to switch to Apache Camel and use 
PLC4X. I’m struggling with the migration :(

The OPC UA server namespace is: ns=1;s=server1

Nodes:
Trigger node: server1.Trigger
Value node 1: server1.Value1
Value node 2: server1.Value2

The goal is: Subscribe to the trigger node and, whenever it changes, read the 
values of server1.Value1 and server1.Value2.

Using Apache Camel, I created a route like this: 
```
public class CamelPlc4xIntegrationTest {

    public static void main(String[] args) throws Exception {
        CamelContext context = new DefaultCamelContext();

        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() {
                String endpoint =
                        "plc4x:opcua:tcp://127.0.0.1:12686" +
                                "?discovery=false" +
                                "&period=1000" +
                                "&tags=myValue:ns=2;s=server1.Trigger";

                from(endpoint)
                        .log("Raw Body: ${body}");
            }
        });

        context.start();
        Thread.sleep(60_000);
        context.stop();
    }
}
```

However, I’m not receiving any data from the endpoint even tho the trigger 
changed.  Now I am a little bit lost.

Could someone help me identify what I’m missing or doing wrong? Many thanks!

GitHub link: https://github.com/apache/plc4x/discussions/2253

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to