Skip to content

Commit 0dc72e9

Browse files
committed
added bms cycles
1 parent 14f97a4 commit 0dc72e9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

bms-pylon-rs485/src/main/java/com/airepublic/bmstoinverter/bms/pylon/rs485/PylonBmsRS485Processor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public class PylonBmsRS485Processor extends BMS {
6363

6464
@Override
6565
protected void collectData(final Port port) throws TooManyInvalidFramesException, NoDataAvailableException, IOException {
66-
final int address = 0x12;
66+
final int address = 0x12 + getBmsId();
6767
for (int packId = 0; packId < getBatteryPacks().size(); packId++) {
6868
sendMessage(port, address, (byte) 0x46, (byte) 0x44, convertByteToAsciiBytes((byte) (packId + 1))); // warnings
6969
}
@@ -338,7 +338,7 @@ private void readCellInformation(final BatteryPack pack, final ByteBuffer data)
338338
remainingCapacitymAh += convertAsciiBytesToShort(new byte[] { data.get(), data.get(), data.get(), data.get() }) * 100;
339339
data.getShort(); // user defined items
340340
ratedCapacitymAh += convertAsciiBytesToShort(new byte[] { data.get(), data.get(), data.get(), data.get() }) * 100;
341-
data.getShort(); // bms cycles
341+
pack.bmsCycles = Math.max(pack.bmsCycles, data.getShort()); // bms cycles
342342
}
343343

344344
pack.numberOfCells = totalNumberOfCells;

0 commit comments

Comments
 (0)