Hi all,
while working on the tests for the Proxy protocol, I stumbled in some pits
regarding the encoding of the BitString values.
So, the IEC61131ValueHandler didn't utilize the BitString PlcValue types, but
use the PlcBYTE, which is generally identical to PlcUSINT.
I know some drivers correctly used the bit strings for the IEC types (as the
IEC spec describes them) ... after fixing this I noticed some other drivers
going red (Modbus, OPC-UA, ...)
I fixed the issue in the Modbus test-suite as this was not 100% correct, but
with OPC-UA I'm a bit unsure (However it does use the IEC61131ValueHandler too)
... I am not sure if here the same naming convention is expected as here, I can
see this:
case "BYTE":
case "BITARR8":
case "USINT":
case "UINT8":
case "BIT8":
List<Short> tmpBYTE = new ArrayList<>(length);
for (int i = 0; i < length; i++) {
tmpBYTE.add((short) valueObject.getIndex(i).getByte());
}
If you ask me, BYTE and BITARR8 should be BitStrings too (Especially BITARR8
... and obviously also the 16, 32 and 64 bit versions)
Would it be ok to streamline this throughout our drivers?
Chris