User Tools

Site Tools


vedirect_protocol:faq

This is an old revision of the document!


Table of Contents

VE.Direct Protocol FAQ

More information on the VE.Direct protocol is available here:

FAQ

How do I calculate the HEX checksum?

I have been able to get the data I need from the sensor (BMV-700H), as show in your examples (im quoting your last email below): Consider the following example:

Get Battery Capacity
:70010003E<LF>     -> Command; checksum 0x55 – 0x7 – 0x0 – 0x10 – 0x0 = 0x3E
:7001000C80076<LF> -> Response; checksum 0x55 – 0x7 – 0x0 – 0x10 – 0x0 – 0xC8 – 0x0 = 0x76

So, this works fine when the code of the operation is less than 55 (for instance, 0x10 and 0x00 = 0x1000), and I get the same checksums as you do. However, to ask for the SOC of the batteries, Im not being able to understand how to construct the request, since the code is 0x0FFF, which is greater than 0x55. Can you provide me with an example of a request, for the SOC of the batteries? I would be much appreciated.

Anwser: VE.Direct/VE.Hex data is encoded as little endian. The checksum needs to be a byte, therefore you need to wrap it while calculating the checksum.

So in code you can loop through the message as in the following pseudo code: byte checksum = 0x55; byte message[] = { 0x7, 0xff, 0x0f, 0x00 }; for (int i =0; i < sizeof(message); i++)

              checksum -= message[i];

Get command: :7<register id><flags><checksum>\n

Get Soc, register 0x0FFF :7FF0F0040\n → Checksum = 0x55 – 7 – 0xFF – 0xF – 0 = 0x40

DISQUS

~~DISQUS~~

vedirect_protocol/faq.1440060929.txt.gz · Last modified: 2015-08-20 10:55 by mvader

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki