Where Should I Start with My Opc-Ua Client

Where should I start with my OPC-UA client?

If you are just looking to move data from a PLC to a database then take a look at Node-Red. Here is a video that should help you get started. Node-Red can do OPC-UA or just talk direct to the PLC with out the need for OPC in the middle it's your choice. If you need more help just ask!!

https://www.youtube.com/watch?v=LaUmhhMdoyY

Node-Red can also do the GUI.

For the reporting you can use https://grafana.com/.

If you would like a good Database to log to look at https://www.timescale.com/.

Grafana and Timescale work well together!!

What is the best place to do a automatically for the client to do a re-subscribe when OPC UA server restarts

I have read about addSubscriptionListener and do this onSubscriptionTransferFaild - but this is the wrong place, because this is when the connection gets lost - the re-subscribe will fail

This actually is the right place.

When the connection is finally re-established the client will attempt to resume your old Session, which will fail, and then to transfer your previous Subscriptions to your new Session, which will fail. When these Subscription transfers fail the onSubscriptionTransferFailed callback will be invoked for each Subscription.

Need clarity on opc ua server and opc ua client

Where should I need to write logic to read values? OPC Server or Client?

In OPC UA a Server is generally speaking a device or a component which provides data to OPC UA Clients. In your case the OPC UA Server is the SIMATIC S7. An OPC UA Client is then used to read variable values from this server.

For debugging purposes and inspection you can use for example the free (commercial) tool UaExpert. You can only use it to see the current data of the server, you can not use it to program your logic around it.

Finally, to answer your question: You need to use an OPC UA Client SDK to read values from an OPC UA Server and implement your own logic around it.
There are commercial OPC UA stacks available, and open source stacks. A list of open source stacks can be found here: Open Source OPC UA Stacks.

I know that the open62541 stack is able to connect to the Simatic S7 and it can read values from variable nodes.

I am going to use NODE-OPC-UA. Is there any open-source OPC client GUI out there?

OPC client GUI is quite a generic term. What exactly is your goal for the GUI? If you just need it for debugging and inspection, use UaExpert. Since OPC UA is just a Framework and Protocol definition, you need to program the logic behind the values yourself. Currently there's not really a generic OPC UA GUI with which you can easily define your own logic as an OPC UA client. Use any OPC UA client SDK to achieve this.

How to write our own OPC Server for PLC which doesn't have OPC UA
complaint?

This question can not be answered in a generic way. It strongly depends which PLC hardware you are using. E.g., is it possible to directly put your own program onto the PLC? Is it completely closed and you need to use a fieldbus interface to communicate with the PLC?

A generic solution for this would be that you implement an OPC UA Server on an external device, e.g., a PC. This PC is directly connected with the PLC. Inside your implementation you then need to implement the communication with the PLC and then map the received PLC values to the OPC UA Server variables. So basically your OPC UA Server acts as a gateway.

opc ua client to server

The short answer is yes! You can write, read, and subscribe tags available on an OPC UA Server from an OPC UA Client. Actually, that's why we need a client.

I reckon your confusion starts with a misunderstanding of how OPC UA's server/client architecture works. Considering the code shared above, your OPC UA Server does not send any data to your client. Your client requests and reads it from the server. In the same way, you only need to send another request from the same client to the server to write/set value. For instance;

# set/write node value (e.g. 26) by using implicit data type  
Temp = client.get_node("ns=2;i=2")
Temp.set_value(26)

All in all, no need to deploy and set up more servers or clients. Just update your client-side code to support writing tags. Hope this helps!

Opc Ua client documentation

The official (GitHub) website for the .NET implementation of OPC UA can be found here

You will found there some documentation about the .NET and also the whole OPC UA Specifications

EDIT: The GitHub Profile of the OPC Foundation is also here



Related Topics



Leave a reply



Submit