Skip to content

feat(plc4j/modbus): ModbusOptimizer fixes for discrete-input and endianness #2055

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

Merged
merged 3 commits into from
May 2, 2025

Conversation

IsmoLeszczynski
Copy link
Contributor

@IsmoLeszczynski IsmoLeszczynski commented Apr 9, 2025

Fix for #2054. Like the Coils, Discrete Inputs are also handled like single bits. The current implementation tried to handle them like Registers, which caused issues when the response consisted of a single byte instead of two. This solution merges the handling of Coils and Discrete Inputs as they're technically identical in this respect.

resolves #2054

Fix Discrete Input handling when processing response
@IsmoLeszczynski IsmoLeszczynski changed the title Fix discrete input handling when processing response feat(plc4j/modbus): Fix discrete input handling when processing response Apr 9, 2025
Fixed endianness resolution to check modbusTag overrides
@IsmoLeszczynski
Copy link
Contributor Author

Updated PR to include also a fix for #2058

@IsmoLeszczynski IsmoLeszczynski changed the title feat(plc4j/modbus): Fix discrete input handling when processing response feat(plc4j/modbus): ModbusOptimizer fixes for discrete-input and endianness Apr 16, 2025
@sruehl sruehl requested a review from chrisdutz May 2, 2025 06:57
@sruehl
Copy link
Contributor

sruehl commented May 2, 2025

LGTM, WDYT @chrisdutz?

@chrisdutz
Copy link
Contributor

It does ... haven't had the chance to have a detailed look at it. But as I have never used the discrete-inputs anyway, I'll probably not get to doing it.

@sruehl sruehl merged commit 896c088 into apache:develop May 2, 2025
14 of 15 checks passed
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.

[Bug]: Modbus: Reading single discrete-input throws ArrayIndexOutOfBoundsException
3 participants