LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

String to ASCII comparison help

Solved!
Go to solution

Hi dear Pro-Users and Labview-Masters alike,

 

I assumed my problem would be fairly straight forward to solve. 
I want to a) light up the LED when ever a string of Upper case letter is pressed (from A-Z). Is there a subVI I can use for this with something that can interpret each element in the array for each case of input? So basically to compare the string input to the ASCII equivalent.

in b) I intend to make a version with String to byt earray as subVi. 

 

Any guidence is highly apreciated.

 

0 Kudos
Message 1 of 3
(2,732 Views)

I don't understand your description of user interaction since you are talking about pressing a letter, but are doing operations on strings.

 

I'll cover the "Is a character an upper case letter?" question.  Convert the string to a U8 array.  (String to Byte Array).  Look at each element in the array  (auto-indexing, For Loop), by feeding it into an In Range And Coerce for a range of 65 to 90.  (Set the limits to include the upper and lower end.)  Those are the ASCII values for the upper case letters.  You will have a True anytime that byte is in that range.

Message 2 of 3
(2,716 Views)
Solution
Accepted by topic author Chrisus86

And if you don't want to use the ASCII- Table, this could be the lazy approach:

Is UpperCase.png

Greets, Dave
Message 3 of 3
(2,715 Views)