I am using C in Labwindows CVI 8.5.
I convert the float to ASCII Hex(this part is already done):
#include <stdio.h>
#include <string.h>
int main () {
char K_char[20], K_ASCII[20];
int a = 30; //30 degree Celsius
int i, len ;
float k = a + 273.15; //Temperature Celsius to Kelvin
sprintf(K_char, "%.2f", k); //Temperature K convert to char array
len = strlen(K_char);
for(i = 0; i<len; i++){
sprintf(K_ASCII+i*2, "%02X", K_char[i]); //char array convert to ASCII Hex
}
printf("%s\n", K_ASCII);
return(0);
}
The result from above code is 3330332E3135.
Now I want to extract each byte from above string like this :
a[0] = 0x33
a[1] = 0x30
a[2] = 0x33
a[3] = 0x2E
a[4] = 0x33
a[5] = 0x35
Can someone give me some advice? Thanks for any help.