Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to listen the PLC instead to have to read the data from it? #31

Closed
ComptonAlvaro opened this issue Nov 27, 2022 · 3 comments
Assignees
Labels
question Further information is requested

Comments

@ComptonAlvaro
Copy link

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.

@somapatrik
Copy link

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.

@fbarresi
Copy link
Owner

fbarresi commented Dec 5, 2022

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

@ComptonAlvaro
Copy link
Author

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.

@fbarresi fbarresi added the question Further information is requested label Jul 30, 2023
@fbarresi fbarresi self-assigned this Jul 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants