10-31-2019 06:41 AM
Hi Everyone!
I progressed now able to communicate with my inverter, I would like to represent the data that is received from the inverter in decimals. The strings that will be received would be in this format(more or less), for example "0203 0400 1800 0049 34". I want to omit the first 6 digits and last 4 digits which I had done it by using the string subset function twice(omitting the beginning, inverting and omitting and inverting again) which leaves the "00 18 00 00" part so here I want to represent the things that are not 00 in decimals. 18 in hex supposed to be 24 need to make a VI somehow.
First 6 and last 4 digits needs to be omitted can be done by only one "string subset" function if the mid part is a certain length which can be done because the length of the data part is in the hex message where( 02 is the address in hex, 03 is the function in hex and 04 is the amount of bytes which means 00 18 00 00 would be the data part and the last 4 digits/2 bytes is crc16 error check. So I can extract 04 in hex but can not convert it to an integer. below I'm attaching my VI which I tried couple of different things which no one had worked.
Thanks for help in advance
Solved! Go to Solution.
10-31-2019 07:13 AM - edited 10-31-2019 07:14 AM
You are getting caught up in what a string is. The Hexadecimal String To Number is for strings that are encoded in an ASCII format. You have raw data. So all you really need to do is use the String To Byte Array and then it is simple array manipulations to get what you want.
10-31-2019 07:30 AM
Beautiful=)