LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean to string convertion

HI,
Is there any tool in labview 8 to convert string to boolean or boolean to string . The source is of boolean type and the sink is boolean type.
 
Thanks
SR
 
 
0 Kudos
Message 1 of 6
(4,610 Views)

Hi SR,

There are several functions and possibilities for boolean conversion  Smiley Surprised 

Can you tell what you want to convert into what or post a basic VI with something you have.

0 Kudos
Message 2 of 6
(4,593 Views)
It's true you have lots of options. The easiest way (perhaps) to convert a boolean value to string is to use the Express VI in the String functions palette called Build Text. All you have to do is enter the name of an input variable surrounded by percent signs (for instance, %Boolean Input%), then select in the Express VI what type of input you want. For boolean values you can choose to format the value as a binary text (0 or 1) or as True or False. Here's an example scenario:

Message Edited by Jarrod S. on 07-05-2006 12:23 PM

Jarrod S.
National Instruments
0 Kudos
Message 3 of 6
(4,569 Views)
And why not, I decided to write a couple quick examples for converting both ways. Make sure you examine the code so you understand what it's doing. Hope this helps!
Jarrod S.
National Instruments
Download All
0 Kudos
Message 4 of 6
(4,557 Views)
I don't know why you start a new thread instead of adding to your existing thread here:
 
 
In any case, most answers so far have dealt with formatting a boolean into a humanly readable string and back. Actually, I am not sure if that is what you want, because you talk about converting, not formatting.
 
What exactly do you want to do?
 
For example if you need to send a boolean via TCP, you need to convert it to a string, but it would make little sense to do any fancy formatting, turning a single byte into a longish humanly readable string. In this case you would just typecast to string, then cast it back to a boolean on the other end.
 
The image shows one possibility.
 
 

Message Edited by altenbach on 07-05-2006 10:40 AM

0 Kudos
Message 5 of 6
(4,559 Views)
Duplicate thread. See HERE.
Jarrod S.
National Instruments
0 Kudos
Message 6 of 6
(4,542 Views)