简体   繁体   中英

Convert J1939 message to raw CAN

I'm receiving J1939 CAN messages trough a class that uses IsoAgLib as framework. On the receiver side I have these J1939 messages that need to get transmitted to the CAN network by using Qt's "QCanBusDevice" and "QCBusFrame".

My question is: how can I convert a message in J1939 protocol to a raw can message and vice-versa?

J1939 is only a protocol layer, so you first need to create the CAN ID based on the priority, PGN and source address of the J1939 message, The CAN ID is 29bit length use the following structure as example:

-priority 0x18

-PGN 0xFECA

-Source address 0x00

The structure above it is an example of one of the J1939 messages ID, the raw ID will be the same 0x18FECA00. J1939 only dictates how to interpret the raw information.

Now to assemble the payload will depends on the parameter length in bits, the start bit and the offset.

-Identify the data length -assemble all the bytes according to the J1939 signal information You can find this on the SAE J1939-71 and SAE J1939-73 documents.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM