Skip to content

"Add UDP receive callback feature and example for implicit messaging event processing #13

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

pai-bagsid
Copy link

PR - Add UDP callback feature for implicit messaging

Use Case

This PR adds support for user-defined UDP receive callbacks in the EEIP Python package, enabling applications to process implicit messaging events (such as sensor triggers) from a PLC in real time. The main use case is to allow a client application to react to sensor data sent by a PLC using EtherNet/IP implicit messaging, process the data, and optionally send an acknowledgment or response back to the PLC.

Changes Made

  • Callback Functionality:
    Added the ability to register a user-defined callback function via set_udp_receive_callback(). This callback is invoked automatically whenever a UDP implicit message is received from the PLC.
  • Example Script:
    Added examples/example_udp_callback.py, which demonstrates how to use the callback mechanism. The example includes a MessageProcessor class that processes incoming UDP data and sends an acknowledgment back to the PLC when a sensor event is detected.
  • Auto UDP Sending Control:
    When a callback is set, automatic UDP sending is disabled to allow the user full control over outgoing UDP packets in response to received data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant