From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert a Boolean trigger into text string

Solved!
Go to solution

Hello,

 

I would like to know if it is possible to convert some text buttons into a single variable text string.

 

Let me try to explain:

I have 3 buttons: Simulation, Send, Quit

Now I want to use a case structure, in which it's possible to switch between those 3 options.

So if you press the Send button for a second, I would like to have a Text string with the text: Send.

If I press Quit, that same text string has to change into Quit, so I can connect this string to the case structure.

Is this possible? It seems easy but I can't figure out how to do it in an easy way.

 

The way I made it: Convert Boolean to (0,1), these values multiplied with a number,

for example (1,2,3), than make a case structure with (1,2,3) and write the right text into a text string.

But I think it can be done much more easy, isn't it?

 

Thank you!

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

It's hard to give a solution without knowing what you are doing with the text after you get it, but you may want to consider using an event structure to handle your button presses.  There are several good examples in the LabVIEW help.

0 Kudos
Message 2 of 5
(3,283 Views)

DFGrey,

 

With the text I want to control the case structure. So if I press the Send button,

I want to write a text "Send" in a string, and that string is attached on the case selector.

If I press "Quit", that same string has to contain the text "Quit" so the case stucture changes to the case Quit.

Hope you understand it?

0 Kudos
Message 3 of 5
(3,279 Views)
Solution
Accepted by Stef_vl

Hi,


Check the attached VI. I think this must help you. The mechanical action of the buttons are "Switch untill released". You can change it according to your requirement.

 

The second example is using Event Structure.

Regards,
Nitz

(Give kudos to good answers, Mark it as a solution if your problem is Solved;)) 

Download All
Message 4 of 5
(3,274 Views)

Have you tried Radio Buttons?

RadioButtons.png

Omar
0 Kudos
Message 5 of 5
(3,260 Views)