LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Text case failing

I have a switch with two cases: "UpdateComplete" and "default".

 

For some reason, the "UpdateComplete" case is not testing true.  I've tried capturing the input to the switch and replacing the case text with it, but that didn't work.  what could be wrong? 

0 Kudos
Message 1 of 5
(2,842 Views)

Not enough info.  Post a vi or picture of what you're talking about and we can begin to have an idea what you're issue is.

 

Try probing the line coming into the structure to see what it's actually reading.

Message Edited by elset191 on 05-18-2009 11:29 AM
--
Tim Elsey
Certified LabVIEW Architect
0 Kudos
Message 2 of 5
(2,839 Views)

eearle wrote:

I have a switch with two cases: "UpdateComplete" and "default".


I guess by "switch" you mean a case structure. Correct?


eearle wrote:

For some reason, the "UpdateComplete" case is not testing true.  I've tried capturing the input to the switch and replacing the case text with it, but that didn't work.  what could be wrong? 


Check for non-printable characters. Check upper/lower case, etc. Does the input string have the double-quotes or not?

 

Place an indicator on the string, right before the case structure. Run the VI so the new indicator contains what you think is "UpdateComplete". Right-click the indicator and "change to constant". Delete the old source for this wire. If you want, delete everything except the case structure and the new diagram constant. Save the VI under a new name and attach here.

Message 3 of 5
(2,812 Views)
It turned out that my string source was adding a carriage return & line feed.  These didn't show, and my cut and paste didn't capture them either.  However, when I changed the display to include " '\' codes", they did show, so I was able to change my tests accordingly.
0 Kudos
Message 4 of 5
(2,786 Views)
You could also try using the Trim Whitespace VI prior to feeding your string to the case selector.
0 Kudos
Message 5 of 5
(2,774 Views)