简体   繁体   English

客户端和服务器之间的双工通信 open62541(OPC-UA)

[英]Duplex communication between Client and server open62541(OPC-UA)

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.例如:客户端每秒发送一个请求以读取两个节点 ID(这些节点 ID 是数字)的值。 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.然后在 60 秒后,服务器告诉客户端乘以这个数字。所以现在客户端每秒都在乘以节点 ID 的值。 Then after 60 seconds, it switches back to addition again.然后在 60 秒后,它再次切换回加法。 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.编辑:我想在我原来的问题中添加一些新信息。原因是为了让帖子更清晰。下图描述了我想要实现的目标。 在此处输入图像描述 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?现在如果安全消费者2(客户端2)连接到安全提供者2(服务器2),如何将从安全提供者2接收到的数据传递给安全提供者1。(因为客户端只能连接到单个服务器)。open62541的功能是否允许以下数据流:安全提供者2-->安全消费者2-->安全提供者1? If yes, can you provide an example?如果是,你能举个例子吗? Thanks谢谢

That's not really how OPC UA works. OPC UA 的工作原理并非如此。

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.相反,您的客户端可以监视服务器中某个 VariableNode 的 Value 属性,然后根据当前值以某种方式运行。

The OPC UA protocol does what its documents specify and what you ask is not possible. OPC UA 协议执行其文档指定的操作,而您要求的操作是不可能的。

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但是您可以让客户端读取值和乘数,并在客户端执行您想要的操作,除了 OPC UA

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM