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

PLC Modbus TCP Block #951

Merged
merged 8 commits into from
Jan 24, 2025
Merged

PLC Modbus TCP Block #951

merged 8 commits into from
Jan 24, 2025

Conversation

reedajohns
Copy link
Collaborator

Description

Creates a new Modbus TCP communication block. The block uses the pymodbus library to read from and write to PLC registers over Modbus TCP. It supports three modes of operation:

  • read: Reads specified registers from a PLC.
  • write: Writes specified values to PLC registers.
  • read_and_write: Performs both reading and writing operations in one execution.

Adding Modbus TCP support allows workflows to interact with a broader range of PLCs and industrial devices that use the Modbus protocol.

Type of change

  • [ x] New feature (non-breaking change which adds functionality)

How has this change been tested, please provide a testcase or example of how you tested the change?

Tested locally on a PLC with Modbus TCP enabled. Ensured that we can robustly:

  • Connect to a PLC via Modbus TCP
  • Read Registers
  • Write Registers

Created Unit test to simulate Modbus client responses. Tests cover successful read/write operations as well as failure scenarios (connection, read, and write failures).

Any specific deployment considerations

  • The environment must allow network access to the target PLC's IP and Modbus port.
  • Proper configuration of register addresses and values must be provided in workflows.

Docs

NA

@grzegorz-roboflow
Copy link
Contributor

@reedajohns it seems tests fail because pymodbus cannot be installed:

ERROR: No matching distribution found for pymodbus==3.8.3

@grzegorz-roboflow grzegorz-roboflow merged commit e6b03cf into main Jan 24, 2025
35 checks passed
@grzegorz-roboflow grzegorz-roboflow deleted the plc_modbus branch January 24, 2025 11:29
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.

3 participants