hi guys..
i have been searching and trying bits of code for a while without much luck..
I'm trying to receive HEX strings (stream) from an RS232 serial device
its sent in INT16 - Big Endian and I need to parse the values into variables for use.
the HEX strings are formatted as follows
16 cf 00 00 00 00 00 00 01 4d 00 00 00 18 00 59 0c b4 05 8d 00 01 00 00 00 00 00 04 00 03 00 02 90 04
16 cf is the same start and always ends with the 04
how would I go about reading this from the serial port, convert DEC
and save into variables as this int or float?
var HEX DEC
A 16 CF 5839
B 00 00 0
C 00 00 0
D 00 00 0
E 01 4D 333
F 00 00 0
G 00 18 24
H 00 59 89
I 0C B4 3252
J 05 8D 1421
K 00 01 1
L 00 00 0
M 00 00 0
N 00 04 4
O 00 03 3
P 00 02 2
Q 90 04 -28668
any help / pointers would be greatly appreciated
Rune