0

I would like to establish bidirectional data communication between client and server. The following example explains what I am trying to acheive.

Ex: Client sends a request to read the value of the two node ids(these node ids are numeric) every sec. Then in the client program it adds these numbers and gives it to the user. Then after 60 seconds ,the server tells the client to multiply the number .So now every second the client is multiplying the values of the node ids. Then after 60 seconds , it switches back to addition again. I am able to request the data from the server through the client but I am trying to figure out how to make server request for data from the client?

Edit: I would like to add some new information to my original question.The reason is to make the post more clearer.The following image describes what I am trying to acheive. enter image description here In the above image,provider can be visualised as a server method and consumer can be visualised as a client method. Now if safety consumer2(client2) is connected to safety provider2(server2),how to pass the data received from safety provider2 to safety provider1.(as client can only be connected to a single server).Does the features of open62541 allow the following data flow: safety provider 2-->safety consumer2 --> safety provider1? If yes, can you provide an example? Thanks

Gopala Krishna
  • 117
  • 1
  • 12
  • OPC UA allows a client to read or write data from a server to which it connects, nothing more. In your diagram you need a server and a client on each side and two independent connections, but OPC UA will never solve how the data is exchanged between those two connections, that must be done by other software that you must program and not related to OPC UA – from56 Apr 01 '21 at 21:54
  • OPC UA is only a communication protocol, it will never solve the operating logic of your system, that is usually done by the machine's PLC, not by OPC UA – from56 Apr 01 '21 at 21:57

2 Answers2

0

That's not really how OPC UA works.

Instead, your client could monitor the Value attribute of some VariableNode in the server and then behave a certain way based on the current value.

Kevin Herron
  • 6,500
  • 3
  • 26
  • 35
  • Is peer to peer network possible in OPCUA ? For ex: Two clients connected to the same server exchanging information? – Gopala Krishna Mar 20 '21 at 15:39
  • Probably not in the sense you're thinking, but they can share information indirectly, e.g. both clients can read/write to the same VariableNode. – Kevin Herron Mar 20 '21 at 16:03
  • Yes, got it. Can the server write value to its node? Or we should make the node writable and then change the value on the client side? How is it done normally in industries? – Gopala Krishna Mar 20 '21 at 16:07
  • Yes, of course the server can write the value to the node as well. That's probably most common. You're asking questions about using OPC UA in ways that are not common. – Kevin Herron Mar 20 '21 at 17:46
  • but once we execute the following statement ´UA_StatusCode retval = UA_Server_run(server, &running)´, we wont be able to update the node value , Am i right? We can only write to the node before we call ´UA_Server_run´ as shown in this example [link](https://github.com/open62541/open62541/blob/master/examples/tutorial_server_variable.c) – Gopala Krishna Mar 20 '21 at 20:30
  • I don't know enough about open62541 to tell you how to do it but I'm certain it's possible for the server to update values after it has been started. Maybe you can ask a question on their issue tracker. – Kevin Herron Mar 20 '21 at 20:51
  • Hi, I have one more question, need your suggestion.Suppose,in industry we have a pick and place robot and there is a safety scanner beneath it.If a person comes too close to the robot, the scanner should pick the signal and should switch off the power supply to robot.Here, should the robot and scanner should be designed as servers? Or can we have a single server for both the robot and scanner? – Gopala Krishna Mar 22 '21 at 22:46
  • Hi, I have edited the question. Can you please have a look? – Gopala Krishna Apr 01 '21 at 15:01
0

The OPC UA protocol does what its documents specify and what you ask is not possible.

But you can make the client read both the values and the multiplier and do the operations you want on the client side, apart from OPC UA

from56
  • 3,976
  • 2
  • 13
  • 23
  • Is peer to peer network possible in OPCUA ? For ex: Two clients connected to the same server exchanging information? – Gopala Krishna Mar 20 '21 at 15:39
  • No, the server is passive, it only responds to client requests. This is how all the protocols that work in Request-Response mode work.. If you want a protocol on which two clients exchange information, look for MQTT – from56 Mar 20 '21 at 18:53
  • Hi, I have one more question, need your suggestion.Suppose,in industry we have a pick and place robot and there is a safety scanner beneath it.If a person comes too close to the robot, the scanner should pick the signal and should switch off the power supply to robot.Here, should the robot and scanner should be designed as servers? Or can we have a single server for both the robot and scanner? – Gopala Krishna Mar 22 '21 at 22:46
  • International IEC standards establish that safety systems must work through wired electromechanical systems, never through digital communications. Failure to follow safety regulations has put people in jail. It seems to me that you should first consult an electrical engineer before thinking about communication protocols. – from56 Mar 23 '21 at 19:31
  • Hi, I have edited the question. Can you please have a look? – Gopala Krishna Apr 01 '21 at 16:24