28 November 2011

Packetlogger documentation: ASCII raw format explained

In this post we'll go into the format produced by the reader programs and consumed by the analyzer program. Here's a typical example of some typical PGNs that have 8 bytes of data:
2011-11-24-22:42:04.388,2,127251,36,255,8,7d,0b,7d,02,00,ff,ff,ff
2011-11-24-22:42:04.390,2,127250,36,255,8,00,5a,7c,00,00,00,00,fd
2011-11-24-22:42:04.437,2,130306,36,255,8,b1,5c,00,ee,f0,fa,ff,ff
2011-11-24-22:42:04.490,2,127251,36,255,8,7e,0b,7d,02,00,ff,ff,ff
2011-11-24-22:42:04.493,2,127250,36,255,8,01,5a,7c,00,00,00,00,fd

8 bytes is the usual amount because that can be transmitted in a single CAN message. Longer messages are transmitted in multiple CAN messages. The reader programs 'solve' this and only send out coalesced complete PGN messages, for example:
2011-11-24-22:41:10.034,6,129540,36,255,123,24,ff,0a,03,68,03,a2,0d,00,00,ff,ff,ff,7f,f1,05,44,2a,c2,9a,04,10,ff,ff,ff,7f,f2,07,dc,17,e7,28,04,10,ff,ff,ff,7f,f2,08,0a,2f,0a,2f,e4,0c,ff,ff,ff,7f,f2,0a,f4,0c,c3,6d,68,10,ff,ff,ff,7f,f2,0f,f4,0c,9e,c1,10,0e,ff,ff,ff,7f,f2,13,68,03,16,22,00,00,ff,ff,ff,7f,f1,15,7f,07,ef,de,48,0d,ff,ff,ff,7f,f2,1a,dc,26,fb,c2,a0,0f,ff,ff,ff,7f,f2,1c,2e,17,2c,62,10,0e,ff,ff,ff,7f,f2

So what is this format?


The format is a very strict and simple ASCII representation of the binary CAN data. It contains the data in a format that is easy to parse by further programs. It is also still somewhat readable, unlike the CAN binary messages.
It contains one PGN per line, and consists of a fixed set of 6 fields that are always the same, followed by a variable number of data fields. The first fields are:
NumberField
1Timestamp when the message was received
2Priority of the message
3PRN, the identifier that explains what type of message it is
4Source ID of the device that produced the message
5Destination ID, 255 means broadcast
6Number of data bytes to follow
7 ... nData bytes in hexadecimal format

No comments:

Post a Comment