Closed ComptonAlvaro closed 1 year ago
Not sure about Sharp7, but I would recommend Snap7 library which contains PLC server. When the server is running another PLC can send data to it like to any other PLC, you can subscribe events to that.
Hi Alvaro,
Please apologise my delayed answer.
The scenario you describe is actually not feasible under the plc get/put protocol (rfc1006). This is the protocol Sharp7 and all other similar plc libraries use.
For notification capabilities in the plc world you should better make use of opc ua or further event driven implementations.
For Sharp7 there is an additional library that make the polling transparent for you so that you can you can get a notification whenever data on a data block changes: visit Sharp7.Reactive for details.
Hope that helps.
Best regards, FB
Hello, Federico:
Never it is late to get an asnwer that let me learn more.
OPC UA seems a good alternative to explore, so I appreciate so much your comments.
Hello.
I would like to ask if this is possible. Perhaps I am wrong, but the examples that i have read in the documentation is that from the PC application that uses Sharp7, it can read data and write data, but it is this PC application which has to do it explicitly.
In my case, I would like the contrary, I would like that the PC application is listening the PLC and when the PLC decides to send data to the PC, then the PC could do something.
For example, if the an alarm happens, the PLC could notify to the PC and then, the PC receives the alarm and can do things like send an email to notify, save the alarm in a database and so on.
If this option it is not possible, then the PC has to read data from PLC periodically, that I guess it is a worse solution.
So, is it possible to send data from PLC to PC?
Thanks.