LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert in hex

hello, i will keep this as simple as possible:
 
I send a textfile that contains:  "01,\n\r"
How should i convert the following to hexadecimal or compare it with the same string i.e.:
 
if "01,\n\r" is equal to "01,\n\r" then true otherwise false????
i want to compare the hex values of the above strings??
 
thankyou
 
 
0 Kudos
Message 1 of 5
(2,779 Views)
0 Kudos
Message 2 of 5
(2,773 Views)
You can use the "String to Byte Array" function (String palette > Conversions) to convert to Hex.
But why do you want to compare the hexadecimal representation?
Does the file contain "\n\r" or newline/carriage return? In either way you can just compare strings, no need for hex conversion.

0 Kudos
Message 3 of 5
(2,771 Views)

Hi

Is there any particular reason that you need to convert the string to a hexadecimal?

I can suggest using a 'match pattern' function , then using the 'Equal?' function to compare the matched pattern to the string you are looking for.

You can input a string into the 'Equal?' function and get a true/false value out.

Let me know if this helps.

Beejal

Beejal S
NI UK & Ireland
0 Kudos
Message 4 of 5
(2,763 Views)

No need to convert anything. Just use the "equal" from the comparison palette and make sure the string contsant you campare it with is in a suitable display format for clarity.

Remember that the display style of the string (normal, passowrd, \codes, hex) has no influence on the underlying data.

Can you attach you text file so we can see what you actually have?

0 Kudos
Message 5 of 5
(2,729 Views)