-
Notifications
You must be signed in to change notification settings - Fork 436
[Bug]: Modbus: ModbusOptimizer doesn't check tag specific endianness #2058
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
Comments
Good catch ... yeah ... I think I didn't imeplement that when I implemented the optimizer. But sort of wierd use-case ... could you explain why this is an issue? Do you have a system where some tags are big endian and some little endian? (Or one of the odd modbus cases)? |
I don't have a current use-case, but I ran in to it when implementing the Web of Things Modbus binding in our application, which allows defining the endianness and swapping per property. The only use-case I could imagine is a Modbus Gateway that aggregates different Modbus devices via UnitId - with PLC4X you could have one connection to the gateway and the modbusTags would define the specific UnitId + possible differing endiannes per underlying device. |
Aaah ... ok .. yeah ... that makes sense ... will look into this especially your PR. Thanks for this. I guess this whole "sharing of connections" is really something that we would need the SPI 3.0 for, but that's definitely not going to happen any time soon. |
The fix was so minor that I just added it to the earlier PR already. |
What happened?
ModbusOptimizer.processReadResponses(...)
always uses the connection default endianness when processing the results, instead of checking for tag specific configurations:I believe the byte-order should be taken from the
modbusTag.getByteOrder()
if available, and fallback to the default? I have a fix for this that I can PR, but it's built on top of #2055, which is still under review.Version
v0.13.0-SNAPSHOT
Programming Languages
Protocols
The text was updated successfully, but these errors were encountered: