There goes app that meant for basic control and monitoring of values from battery management systems.
Client at first only wanted to design UI and stated his programmer will do the rest. Which I delivered to the clients satisfaction.
Project grew into full app anyway.
App incorporates client’s basic logic written in C++ into it’s own Java logic.
Java calls C++ when it needs data and translates it into UI human readable form.
It’s not most efficient way but it was one the requirements.
Most interesting experience about developing this app was reading binary communication sent via BMS protocol.
For those interested what is BMS communication like. Communication consists of frames.
# | Frame unit | L. | note |
---|---|---|---|
1 | STX | 2 | Start frame: 0x4E(78″N”) 0x57(87″W”) |
2 | LENGTH | 2 | The length of the frame |
3 | BMS terminal number | 4 | 4 bytes ID |
4 | Command word | 1 | Refer to the command word description, |
5 | The frame source | 1 | BMS,1. Bluetooth,2.GPS,3. PC PC |
6 | Transport type | 1 | 1. Response frame 2.BMS active upload |
7 | Frame information unit | N | The information domain BMS sets the data identifier code |
8 | Record number | 4 | High 1 byte is random code meaningless (reserved for encryption), low 3 bytes is Record the serial number |
9 | End of identity | 1 | 0X68 |
10 | The checksum | 4 | Accumulated checksum(high 2 bytes forCRC notyet enabledto fill 0, low 2 Byte for cumulative check) |
Each frame is basically bunch of bits, and when I say bunch in this case I mean hundreds. By grouping bits we get bytes, combining bytes makes real chunks of data readable. Communication frame has structure that has beginning, body and ending. By reading combinations of bits bunched into bytes we get to find data identifiers within long line of zeros and nulls.
Data Identifiers allows us to pinpoint starting points of data like voltage of battery cell 1,2,.. , etc . Then we just follow logic that is defined for each identifier to convert data into needed format. More about this concrete communication format can be found in the BMS communication protocol .