LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to split a hexadecimal string into the required components

I want to get a hexa decimal string to be splitted into components. With each component not exceeding limit of converted decimal number 255. Is there any VI to do this directly (To split the hexadecimal number to its components). help me please in this regard

0 Kudos
Message 1 of 15
(8,700 Views)

Hello,

 

 

What are you trying to get??

 

Is this you want...

 

hex.png

 

Regards,

Bijay

CLD

Message 2 of 15
(8,693 Views)

Bijay,

 

when the string has odd number of characters, the logic might not work correct.

 

we should be grouping HEX characters from left most bit... so, i modified your code as attached.

 

Regards
Freelance_LV
TestAutomation Consultant
Message 3 of 15
(8,683 Views)

No i need if 500 is my decimal number it is mor than the byte range so , the hexadecimal number  corresponding is 1F3. In this 1 as a byte send to the motor and F3 in decimal 244 will go as another byte to the motor. My motor will take any value as three parts each part of a byte. if we have to give one then first iszero then zero then 1. So commonly can I make a VI that will split any hexadecimal as like C350 as C3 and 50 into two hexadecimal parts. Please kindly send me a solution

0 Kudos
Message 4 of 15
(8,655 Views)

Hi

 

In that case, wire the output of String Subset directly to the output. Remove the Hexadecimal string to number function. you will get an array of Hexadecimal strings, of one byte each.

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 5 of 15
(8,646 Views)

without using this for loop can we do it.Is no ohter method is available easier than this. Please reply

0 Kudos
Message 6 of 15
(8,644 Views)

hi

 

it would be better done that way.

else, if you do not want FOR loop, you will have to repeat the 'String subset' function manually till you can get the entire HEX string broken up.

 

but, why do you not want a For loop? what has it done to upset you so?

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 7 of 15
(8,639 Views)

No other way to split the hexa decimal number. No direct VI is available for that. Pleaase reply

0 Kudos
Message 8 of 15
(8,619 Views)

If your number doesnt go too large you could convert the string to a u32 and use split number.

 

 

 

Message 9 of 15
(8,610 Views)

Yes

 

As IanW mentioned, you should definitely know the sixe of the HEX string to code that. if the hex string length can change, it is better to use FOR loop

Regards
Freelance_LV
TestAutomation Consultant
0 Kudos
Message 10 of 15
(8,606 Views)