LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple check boxes as case selectors

Hi,

I have a case structure with 5 separate tests that can be selected. Currently I select each case through a dropdown enum selector. This is fine for selecting one test (case) to run but I want to be able to select multiple tests(cases) to run consecutively by checking each test with a checkbox.

 

I created an example VI to try to show what I am aiming for. For example, if I check the Add, Multiply and Power checkboxes, cases 0, 2 and 4 will run one after another. Is this possible?

Many thanks

0 Kudos
Message 1 of 22
(4,970 Views)

You can expand upon the enum concept by creating an array of those enums (take a look at the attached example).  The array of enums will represent the sepuence of tests to be executed.  All you have to do is auto index that array into a for loop containing a case structure.

0 Kudos
Message 2 of 22
(4,960 Views)
What you are wanting to do is very possible. If you haven't been through the online tutorials, now is the time to do that.

If you have been through the tutorials, I would be looking at an event-driven structure with the check box values being accumulated into an array. When you click the button to start testing, this array of enables would drive a queued state machine (built in the event structure's timeout event) that would step through the array executing the steps needed to perform the tests associated with the enables that are set to 'true'.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 22
(4,943 Views)

JGar,

 

Thank you for your suggestion but I'd quite like to utilise check boxes for ease of use unless the implementation is much more difficult than enum dropdowns. Is something as simple as your solution possible with checkboxes?

 

Mike,

 

I cannot watch tutorial videos on my machine, could you possibly make a short example VI of using check boxes with event-driven structures and a state machine? I do not have any experience using event driven structures or state machines.

 

Kind Regards,

 

Parker

0 Kudos
Message 4 of 22
(4,886 Views)

Parker,

 

Mikes suggestion is deffinitely more modular than mine and would be the best route to go.  Here is a link that does a pretty good job of describing what the queued state machine is and how to implement it.

 

https://decibel.ni.com/content/docs/DOC-32964

 

You should understand how this architecture works before trying to implement it.  After you have read the article let us know if you have any specific questions about implementing your idea.

Message 5 of 22
(4,874 Views)

You could use a ListBox with selection mode set to "1 or More"

 

Test Select ListBox.png

This will return an array of the index's of the selected items [0,1,4]

Then use an auto index For Loop with your case structure inside.

This is pretty basic stuff and all covered in the tutorials. The none video tutorials.

Omar
Message 6 of 22
(4,852 Views)

Listboxes with check boxes you say?

 

https://decibel.ni.com/content/docs/DOC-42155

 

Also supports Multicolumn Listboxes and Trees.

Message 7 of 22
(4,831 Views)

Hi Guys,

 

Thank you all for your suggestions.. as I only started working with LabVIEW last week I think the QSM architecture is too complex for me at this stage, the vast majority of that document goes over my head with an almighty wooosh. As such I will just stick with Omar's suggestion for now as it suits my needs however I will revisit this topic when I become more confident with LabVIEW and am in a better position to understand such architecture.

 

Many thanks,

 

Parker

0 Kudos
Message 8 of 22
(4,786 Views)
If you are new to LabVIEW, check out some of the free training on line. Some are in my signature in the forum rules and guidelines.
0 Kudos
Message 9 of 22
(4,735 Views)

try a queued state machine (QSM), your selection will be added to an array. start the process and peel an element off that case statement array ,one by one. pass the value on the shift register. look at the CLD car wash solution

0 Kudos
Message 10 of 22
(4,721 Views)