LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

HEX String Range check

Solved!
Go to solution

Hi

Please find the enclosed snippet.
string range check.png

Here i'm checking the range of Hex string. The result of the attached snipped suppose to be false. But it is giving the true value.

Kindly explain.

 

Regards,

S Nagaraju

0 Kudos
Message 1 of 5
(3,888 Views)

Hi Sonti,

 

when using strings LabVIEW "tends" to alphabetically ("by dictionary order", my English isn't that good) use them for comparisons.

Your input value is between the range limits!

 

When you want to compare values you need to use numeric datatypes: convert your strings to numbers…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 5
(3,883 Views)

Based on what condition its should be false?

 

Check for the Hex String to Numeric and Find the values of Input Strings.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 3 of 5
(3,881 Views)

Hi PalanivelT,

If I convert the hex string to number, BFFFFFFF ==>  3221225471 (Upper limit)

                                                          81000000 ==> 2164260864 (lower limit)

                                                          810001 ==> 8454145 (Value)

 

For numeric data type the result will be false. But in case of hex string, how the range check is happening??

I have checked with the range between hex values 0 to F and i found the reliable result. What is the issue with this case??

Kindly explain.

 

Regards,

S Nagaraju

0 Kudos
Message 4 of 5
(3,855 Views)
Solution
Accepted by topic author Sonti_11532

Hi Sonti,

 

how the range check is happening??

Did you read my answer?

Strings are sorted by dictionary order!

 

So your "810001" lists AFTER "81000000" and BEFORE "BFFFFFFF" in the dictionary…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 5 of 5
(3,851 Views)