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:

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:

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:
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