to parse a variable number of hex2 chars I use this
Code:
where U_RXBUFF[] contains the string to be parsed
k contains the length of the input string
STR_inx contains the length of the OUTPUT string
txbuff[] contains the PARSED the OUTPUT string
get_data:
STR_inx=0
k.0=0 ;must be even
while k
ARRAYREAD U_RXBUFF ,[SKIP ((STR_inx+1)<<1),hex2 txbuff[STR_inx] ]
'Debug "k ",#k,9,#STR_inx,9,hex txbuff[STR_inx],13,10
STR_inx=STR_inx+1
k=k-2
wend
RETURN
IF your fomat is fixed just
serin2 .... [hex2 var1,hex2 var2,.........]
Bookmarks