LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert 0 to "fail" and 1 to "pass"

Solved!
Go to solution

Is there an easy way to convert the numeric, 1 to the string "pass" or convert the numeric 0 to the string "fail"?

0 Kudos
Message 1 of 14
(4,076 Views)
Use a case structure, but be sure to wire up a default case!
0 Kudos
Message 2 of 14
(4,073 Views)

 You could use a case statement with the numeric as its selector.

 

 

EDIT:  D'oh, a few lousy seconds. 

Message Edited by OlderJohn on 03-24-2009 01:59 PM
0 Kudos
Message 3 of 14
(4,073 Views)
Solution
Accepted by topic author chuck72352

This is a simple way, you could also use a case structure if more code is involved.

 

 

 

 

Ahh, got beat on the case structure!!!
Message Edited by Chris_VH on 03-24-2009 02:01 PM
Chris Van Horn
Applications Engineer
Message 4 of 14
(4,068 Views)
Be careful if using the DBL datatype, I don't know where the 0 and 1 are coming from but you made need to build in a tolerance with that equal function.
0 Kudos
Message 5 of 14
(4,063 Views)
Very valid point, I just created a control off the function. I was trying to race for first reply! Smiley Very Happy
Chris Van Horn
Applications Engineer
0 Kudos
Message 6 of 14
(4,057 Views)

Here's a Select with an integer input.

 

Message Edited by Dennis Knutson on 03-24-2009 01:04 PM
Message 7 of 14
(4,054 Views)

Thank you, I was looking for a method other than using a case statement.  Your suggestion works well for me.

 

Chuck M.

0 Kudos
Message 8 of 14
(4,040 Views)

I wasn't aware that a string could be wired to a "Select" function.

 

Thanks again.

0 Kudos
Message 9 of 14
(4,016 Views)

Hi,

 

just want to mention the "Append True/False String" function (which has a boolean case selector) Smiley Wink

Message Edited by GerdW on 03-24-2009 08:16 PM
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 10 of 14
(4,015 Views)