Hi Ben,

Thanks for your kindly and quickly reply.

One more question,

I am using Prosys OPC UA Simulation Server, and the NodeId is: ns=3;i=1002,
NodeClass is Variable, DataType is Double.
So, how to define the field address in PLC4x?
I checked [1],  the example is: DOUBLE_IDENTIFIER = "
ns=2;s=HelloWorld/ScalarTypes/Double";
What is the meaning of  "HelloWorld/ScalarTypes", or, where I can confirm
how to get the needed info of DOUBLE_IDENTIFIER from Prosys OPC UA
Simulation Server?

[1]
https://github.com/apache/plc4x/blob/develop/plc4j/drivers/opcua/src/test/java/org/apache/plc4x/java/opcua/ManualPLC4XOpcua.java

Best,
-----------------------------------
Xiangdong Huang
School of Software, Tsinghua University

 黄向东
清华大学 软件学院


Ben Hutcheson <[email protected]> 于2020年12月18日周五 上午8:41写道:

> 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
> >
> >  黄向东
> > 清华大学 软件学院
> >
>

Reply via email to