Question Hex to string

Joined
Mar 1, 2011
Messages
14
Programming Experience
Beginner
Hi
i work with scale weight(tec1600).
I get weight in 5byte ----> 98 00 00 00 00 = 0 weight
how i convert hex to number or string?
Sorry for my bad english
 
BitConverter.ToInt32 will work with a maximum 4-byte number, so either the MSB or LSB would be dropped depending on endian order. (it looks like little-endian to me?) You could probably use BitConverter.ToInt64 (which will assume your data is little-endian) or take the brute force approach and iterate through a loop, multiplying by the correct values.

There might be a better way to do this. If anyone has a better way, please share it.
 
Back
Top