I have captured Serial RS-232 data and got HEX value (01 FF). I have tried to convert the HEX value but, I don't understand about this time conversion.
And I want convert these HEX Data to Minutes, Thank you...
@anon57585045 Actually im trying to convert data from machine activity, Caterpillar Mining Equipment 777E,
All data is HEX, From VIMS telemetry port. In telemetry it can be accessed by serial RS-232 and they use the RPC Protocol, the shop manual document is very limited on explanation, and I don't understand this conversion.
The Translated File Automaticaly generated By VIMS and the output file is .csv
@anon57585045 No, that's not the source table from what I posted, There are several methods to retrieve data. the first to download manually using an application from the dealer (And this takes a very long time to download, the output data is a .csv file). The second way, it is done by capturing via the Telemetry Port that has been provided from the Machine (this way data retrieval can be done in real-time, but with RAW HEX data).
This is a RAW data what i captured,
01 62 00 01 00 0f 01 ff 05 64 04 24 00 09 00 ba 08 20 00 15 05 36 40 bb 37 c3 30 30 35 32 38 00 00 37 e0 ac 18 c0
Ah, much better information. It's easy to convert hex to binary and store it in variables. So you can decode the RAW stream. What have you tried so far? You posted a table explaining the purpose of every byte in the message stream. So that is no mystery.
Are you trying to write a program, or just convert a few values manually? You didn't say at all. You also didn't say whether an Arduino is involved, or if so, which one.
No, it's the output from a tractor. It makes sense that it's ASCII, that is very common. The question is self answered, because an explanation of the meaning of the data was posted in a table.
I agree about the struct, that is what I would use.
Not Yet ,
I'm just trying to retrieve data using the RS232 Serial Converter, future plans I will using Arduino Mega 2560 to directly retrieve the data.
If you expect it to be portable to other architectures besides the Mega, don't use the type punning method presented. It's quick and dirty, it works. However, it is not guaranteed to work on all machines because it uses undefined C/C++ storage methods.
It's a great example, though... it can get you started.
The correct way is to use exclusively arithmetical methods based on features of C/C++ that are officially defined.
A tidbit - you can use strtoul() with the right parameters, to read hex values into a variable.