06-18-2010 11:02 AM
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.
Solved! Go to Solution.
06-18-2010 12:09 PM
That is about the easiest way you can do it.
06-18-2010 12:22 PM
@aeastet wrote:
That is about the easiest way you can do it.
You give up too easily...
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.
06-18-2010 12:39 PM
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.
06-18-2010 12:43 PM
06-18-2010 12:47 PM
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.
06-18-2010 12:55 PM
@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.
06-18-2010 12:59 PM