LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean Text to Array

Solved!
Go to solution

Hello,

 

I'm just wondering if there is a much easier way to do this.  Basically, I have a few boolean check boxes associated with frequencies.  If the user wants to test the frequency, then they can check the box.  I need to take those frequencies and put them into an array.  The example I show has only 3 frequencies.  However, the real program has a lot more.  Is there a faster way to get the Boolean Text Label in order to convert the label to a frequency array.

 

Thanks.

0 Kudos
Message 1 of 8
(4,291 Views)

That is about the easiest way you can do it.

Tim
GHSP
0 Kudos
Message 2 of 8
(4,275 Views)

 


@aeastet wrote:

That is about the easiest way you can do it.


 

You give up too easily...Smiley Wink

 

Since you're using individual controls you have little freedom. You could access the front panel's Controls[] property and auto-index a for-loop to get the ones that are your frequency checkboxes. This isn't difficult, and it would scale nicely since it would be a loop. A simpler method is to use a group control like a cluster. A cluster also has a Controls[] property. I would also suggest using the Caption property as the frequency this way you can convert the Caption property directly without having to typecast the control to the more specific Boolean class. See attached example.

Message 3 of 8
(4,266 Views)

That is the same thing he is doing only easier to maintain because you add more controls to the system easier. To get the name there really isn't and easier wway to do it a property node is the easiest way.

Tim
GHSP
Message 4 of 8
(4,254 Views)
Solution
Accepted by topic author hatemachine

To put only the selected frequencies in the array you can do as in the attached VI.

 

Ben

Message 5 of 8
(4,247 Views)

Thanks for the tips guys.  Actually, I do have the Booleans in a cluster, but I had pulled them out to give the example because I thought I needed to.  Looks like I will need to learn a bit about the controls property for the clusters.  This will probably help me out on a lot of stuff. 

0 Kudos
Message 6 of 8
(4,229 Views)

 


@ben64 wrote:

To put only the selected frequencies in the array you can do as in the attached VI.

 

Ben


And you're comparing a Boolean to a true constant because? Think wire.

 

0 Kudos
Message 7 of 8
(4,204 Views)

Agree with you SMercurio, it is not necessary.

 

Ben64

0 Kudos
Message 8 of 8
(4,196 Views)