glcj commented on code in PR #1833:
URL: https://github.com/apache/plc4x/pull/1833#discussion_r1865937870
##########
plc4j/drivers/modbus/src/test/java/org/apache/plc4x/java/modbus/base/optimizer/LittleEndianByteSwapTest.java:
##########
@@ -248,7 +249,8 @@ public void testLittleEndianByteSwap() throws Exception {
Map<PlcReadRequest, BaseOptimizer.SubResponse<PlcReadResponse>>
readResponses = new HashMap<>();
readResponses.put(firstRequest, new BaseOptimizer.SubResponse<>(
new DefaultPlcReadResponse(firstRequest, Map.of(
- "coils0", new DefaultPlcResponseItem<>(PlcResponseCode.OK, new
PlcRawByteArray(Hex.decodeHex("3060480c00c084000000000000000000000000000000")))))));
+ //"coils0", new DefaultPlcResponseItem<>(PlcResponseCode.OK,
new
PlcRawByteArray(Hex.decodeHex("3060480c00c084000000000000000000000000000000")))))));
+ "coils0", new DefaultPlcResponseItem<>(PlcResponseCode.OK, new
PlcRawByteArray(Hex.decodeHex("10404004004004000000000000000000000000000044")))))));
Review Comment:
I used the bit pattern from the optimizer test, 175 coils, on two different
devices and they returned the same byte sequence and according to the Modbus
standard, so I used it as a reference.
I want to validate with other devices, but bit (coil) requests are always
answered in BIG_ENDIAN, which is consistent with the standard, but I need to
reconfirm this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]