douglas schroeder
douglas schroeder

Reputation: 11

Communicate OPCDA client with OPC UA server

So, it's my first time posting here, so be patient please.(not native English speaker) I'm working in a project where I have to connect a OPC DA client to a OPC UA server (a siemens PLC). Three months ago I had never heard of OPC, PLC, etc. All new to me, and a bit confusing. So far i'm using a Wrapper(OPC Expert) in the OPC DA client that displays it to me as an OPC UA server. So I have two servers in both sides and a client(C# stack) in the middle (that I'm working on) that makes the communication. The clients opens two sessions one for each server and subscribe to the items (tags) of interest on both sides. So I get the changes in one side and write it to the other. At the momment I'm using two threads that read each of the subscriptions and write the changes. I'm using a file that maps the nodes from one server to the nodes in the other server. Between quotes is one line of the file, the (+) is the separator. "ns=3;s=UMUARAMA->OA.OpcOAenterprise.1->Test.Equipment.Motor.CV_E101.EquipmentControlCommand+ns=3;s="MotorControl_CV_E101"."EquipmentCommand"." Currently I'm reading the monitoredItems in the subscription one by one, and if there is any value atached I write the value to the other server. I'm pretty sure there are many less dumb ways to do this. So, I'm asking for some advice. Thanks in advance.

Upvotes: 1

Views: 1077

Answers (1)

Peter
Peter

Reputation: 111

I dont know which api your wrapper has, but in OPC UA you can register an event to the MonitoredItem that was fired when the node value was changed.

You can find an example of the registration and handler in the Github Repository from the OPCFoundation

(line 606)

Upvotes: 1

Related Questions