Umrechnen der hex. Datenbytes in dezimale Zahlen

This forum covers issues concerning multiple software products.
Post Reply
michaelgierer3
Posts: 6
Joined: Sun 25. Jun 2017, 18:04

Umrechnen der hex. Datenbytes in dezimale Zahlen

Post by michaelgierer3 » Fri 7. Jul 2017, 18:20

Hallo,

wie werden die hexadezimalen Daten-Bytes auf nutzbare, dezimale Werte umgerechnet?

Als Beispiel nehme ich die Motordrehzahl (Leerlauf, vlt. 900 upm) her. (Daten aus "J1939 Companion Spreadsheet")
PGN: 61444 = F004
Byte-Position: 4-5
Länge: 16 Bit
Einheit: 0,125 RPM


Hier die ausgelesene Message:

1592) 1926.5 Rx 0CF00400 8 0C FF 7D D0 03 27 F0 86

Nun müssen das 3. und 4. Byte vom Hex.-System ins Dez.-System umgerechnet werden und mal 0,125 multipliziert werden: D0 03 = 53251 * 0.125 = 6656,375.

Wie ersichtlich, ist eine Motordrehzahl von 6.656 nicht realistisch.

Was habe ich daran falsch gemacht?

Beste Grüße, Michael

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Umrechnen der hex. Datenbytes in dezimale Zahlen

Post by PEAK-Support » Fri 21. Jul 2017, 16:11

Sind die Werte als INTEL oder Motorola Format codiert?

0xD0 0x03 (Motorola) --> Dezimal 53.251* 0.125 --> 6.656
0x03 0xD0 (Intel) --> Dezimal 976 * 0.125 --> 122

Intel ist korrekt:
J1939_Support.JPG
J1939_Support.JPG (50.98 KiB) Viewed 4085 times
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

Post Reply