How to call OPCUA Method using Camel Milo?

0

I'm newer in Camel Milo, and I'm trying to call a method but as result i obtain the parameter that i gave in input.

This is my code:

Variant[] params = new Variant[1];
params[0] = new Variant(13);

String  endpointUri = "milo-client:opc.tcp://milo.digitalpetri.com:62541/milo?node=RAW(ns=2;s=Methods)"&method=RAW(ns=2;s=Methods/sqrt(x))";
return producerTemplate.requestBody(endpointUri, params, "await", true, Variant.class);

The returned object is the same as I input, even if looking at the log I see that the function call is executed correctly:

 2021-mag-20 11:14:07.613 TRACE [milo-netty-event-loop-1] o.e.m.o.s.c.t.t.OpcTcpTransport - Write succeeded for request=PublishRequest, requestHandle=16
 2021-mag-20 11:14:07.598 DEBUG [milo-shared-thread-pool-1] o.a.c.c.m.c.i.SubscriptionManager - Call to node=ExpandedNodeId{ns=2, id=Methods, serverIndex=0}, method=ExpandedNodeId{ns=2, id=Methods/sqrt(x), serverIndex=0} = [Variant{value=13.0}]-> CallMethodResult{StatusCode=StatusCode{name=Good, value=0x00000000, quality=good}, InputArgumentResults=[StatusCode{name=Good, value=0x00000000, quality=good}], InputArgumentDiagnosticInfos=[], OutputArguments=[Variant{value=3.605551275463989}]}

This are my dependencies :

<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-spring-boot-starter</artifactId>
  <version>3.9.0</version>
</dependency>        
<dependency>
  <groupId>org.apache.camel.springboot</groupId>
  <artifactId>camel-milo-starter</artifactId>
  <version>3.9.0</version>
</dependency> 
methods
apache-camel
opc-ua
milo
asked on Stack Overflow May 20, 2021 by marcello cappelli • edited May 20, 2021 by marcello cappelli

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0