FEC1 and FEE5 Byte Ordering (LSB MSB) in decoding
<[email protected]> Mon, 10 Feb 2020 06:37:50 -0600
| Newsgroups | gmane.comp.hardware.bus.can |
|---|---|
| Message-ID | <[email protected]> |
I don't have the standard nearby - I think you're referring to some J1939 messages. J1939 messages are all mapped "little endian" and reference the sequences of bits and bytes as 1 through 8. For most of us, we probably would have preferred referencing them as 0 through 7. So, for your sequence: Bytes 1 thru 8: 73 35 4A 03 FB 6F 4A 03 You indicate the total distance is the byte sequence: 73 35 4A 03. The 32-bit value is then 0x034A3573, or decimal 55,194,995. J1939 parameters also have a SLOT (Scale Limit Offset Transfer) set of attributes. There are several things happening in here - * Most parameters are communicated on the network as an unsigned integer value. * Certain values are "reserved" to communicate special state, error conditions, or complete absence of the data. Starting simple by looking at the highest byte (of an 8-bit, 16-bit, or 32-bit parameter): The value 0xFF means that there is no data available. This could be because a sensor is not installed. For a 16-bit value this would be 0xFFFF, and similarly for 32-bit values 0xFFFFFFFF. The value 0xFE means that there is an error condition. Perhaps the ECU detects a broken circuit. The values 0xFB - 0xFD are special, but rarely used - so look for these rare situations in the standard documents. The value 0x00 - 0xFA represent the normal range from min to max. Extending to a 16-bit value the range becomes 0x0000 - 0xFAFF. And back to your parameter, a 32-bit value has a range of permissible values typically from 0 to 0xFAFFFFFF. The S and O in Slot describe how to translate the value from "network units of measure" to engineering UOM. I don't know the Scale factor for this parameter, but if, for example, this parameter is defined as 1 mm per bit, then you can measure from 0 up to 55,194.995 meters before it rolls over to zero. Temperature, or other parameters that require a negative sign use the "Offset" attribute. Finally, to your specific questions: 1) The data bytes are purely in reverse order from how you would write the more programmer friendly notation. 2) The same for the Engine hours. 3) Yes, this is universal in J1939, unless you find some copies from the mid-90's, where the Diagnostic Trouble Codes were not coded in this pattern (which was corrected in an update also in the 90's). -----Original Message----- From: [email protected] <[email protected]> On Behalf Of CANEnthusiast Sent: Friday, February 7, 2020 8:39 AM To: [email protected] Subject: [CANLIST] FEC1 and FEE5 Byte Ordering (LSB MSB) in decoding Hello All, This question is regarding FEC1 and FEE5 PGN byte ordering. FEC1 is High Resolution Vehicle Distance PGN. It has two data: 1. Total Vehicle Distance (Bytes 1 - 4) 2. Trip Distance (Bytes 5 - 8 ) Example Frame: 73 35 4A 03 FB 6F 4A 03 Questions: 1. Now for Data 1 and 2 How the bytes are to be combined for conversion? Like 034A3573 or 73354A03? 2. And Same how is it with FEE5 Engine hours data? 3. Also does J1939 has universal byte positioning method applicable to all PGN or the method varies with each PGN? Thank you in Advance. -- Sent from: http://can-bus.996267.n3.nabble.com/ -- Archives and useful links: http://groups.yahoo.com/group/CANbus Subscribe and unsubscribe at www.vector.com/canlist/ Report any problems to <[email protected]> -- Archives and useful links: http://groups.yahoo.com/group/CANbus Subscribe and unsubscribe at www.vector.com/canlist/ Report any problems to <[email protected]>