Hi Julian, Two bytes would be a register so you could read it like that („register:7"): https://github.com/apache/incubator-plc4x/blob/master/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualPlc4XModbusTest.java <https://github.com/apache/incubator-plc4x/blob/master/plc4j/protocols/modbus/src/test/java/org/apache/plc4x/java/modbus/ManualPlc4XModbusTest.java>
All in all it seems that this driver is only able to read one register/coil at a time a would need some work after the refactoring. Types of addresses can be found here: https://github.com/apache/incubator-plc4x/tree/master/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/model <https://github.com/apache/incubator-plc4x/tree/master/plc4j/protocols/modbus/src/main/java/org/apache/plc4x/java/modbus/model> Sebastian > Am 18.09.2018 um 08:01 schrieb Julian Feinauer <[email protected]>: > > Hi all, > > I am currently migrating some code to the new plc4j API and are a bit unsure > what to do. > The current code is > > PlcReadRequest plcReadRequest1 = new PlcReadRequest(); > ReadRequestItem<byte[]> readRequestItem1 = new > ReadRequestItem<>(byte[].class, > plcConnection.parseAddress(someAddressStringHere), 2); > plcReadRequest1.addItem(readRequestItem1); > > So we fetch 2 bytes from Modbus. > How do I tell him to fetch an array of length 2 in the new API? > > Thanks! > Julian
