Hi Xiangdong, Yes you are right, the example in the opc ua section doesn't look right. I can take a look at updating it tomorrow.
Your best bet would be to follow the getting started - java section. https://plc4x.apache.org/users/getting-started/plc4j.html the connection string format for the opc ua driver is opcua:tcp://127.0.0.1:12686/milo?discovery=false (Discovery option being optional.) Also if you are comfortable the 0.8.0-SNAPSHOT is more stable. You'll have to add the repository to your pom.xml file though. <repositories> > <repository> > <id>apache.snapshots</id> > <name>Apache Snapshot Repository</name> > <url>https://repository.apache.org/snapshots</url> > <releases> > <enabled>false</enabled> > </releases> > </repository> > </repositories> > Specifically with the OPC UA driver we are in the process of merging an update to the 0.8.0-SNAPSHOT to support specifying the data type in the address field. The current address format is:- ns=2;s=HelloWorld/ScalarTypes/Boolean This will change to:- ns=2;s=HelloWorld/ScalarTypes/Boolean:BOOL With the update, however the :BOOL datatype will be optional, unless you need to read/write unsigned values. If you have any more questions let us know. Kind Regards, Ben On Thu, Dec 17, 2020 at 6:59 PM Xiangdong Huang <[email protected]> wrote: > Hi, > > Today I followed the User guide on the website to run PlC4x to collect > data, and then find an issue of the example [1]. > > In the reading data example, the example creates an opcuaReadConnection, > and then uses opcuaConnection. What is worse, opcuaConnection has no such a > read() method but the example calls it.. (version 0.7.0) > > I think the API may change but the document did not keep to update. > > [1] https://plc4x.apache.org/users/protocols/opc-ua.html > > Best, > ----------------------------------- > Xiangdong Huang > School of Software, Tsinghua University > > 黄向东 > 清华大学 软件学院 >
