LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Case structure doesn't execute tabs

Hi!
I'm putting multiple choice questions on several tabs (which I'm combining with another program later), and would like each case to run when a certain tab is chosen. After the multiple choice question has been answered, it's supposed to display a dialog box that says "correct" or incorrect", but when I run my VI, it will only work on one tab, and when I switch to the next tab, the case won't run. Can someone tell me what I'm forgetting or what's wrong? It's boggling my mind 😞
Thanks!
0 Kudos
Message 1 of 14
(3,718 Views)

Your VI is coded in such a way that it gets locked in the while loop that first executes based on the default selection before running the VI.

If Page1 is selected before running & then the VI is run, it gets locked into that case & similarly for Page2 also...

Maybe, you ve to recode your VI using Event Structure inside a while loop.

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 2 of 14
(3,717 Views)
Maybe, you can try the attached VI.
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 3 of 14
(3,707 Views)
Hi Partha,

Thanks for your help so far.

Hmm, that almost works, except that when I run it, the first question doesn't appear until I have made a value change to a boolean... and then it runs through the entire program displaying the dialog boxes for each question without allowing me to choose a new boolean.
Any suggestions on how to fix this?

~Nadia
0 Kudos
Message 4 of 14
(3,687 Views)
On the first Value change the program is going to execute all of the code inside the event structure.  Maybe instead of having several cases for each question inside the event stucture you have a different event for each question. 
Mark
NI App Software R&D
0 Kudos
Message 5 of 14
(3,666 Views)
Well, right now I have a different case for each different tab, which I was hoping would allow the specific case to run when the specific tab was chosen (which doesn't seem to work?) Maybe I'm not completely understanding your suggestion, but if I had an event structure for each question, wouldn't the program still not specifically run a certain question when the specific tab was chosen?

Really, I could just put the two cases outside of the case structure, but I was just looking to make it look a little bit tidier... also in the event that I need to add more tabs with additional questions 😞
0 Kudos
Message 6 of 14
(3,641 Views)
What is the purpose of having the two tabs with questions on them.  The whole program would be simplier if you could forgo this feature. 
Mark
NI App Software R&D
0 Kudos
Message 7 of 14
(3,639 Views)
Hi Mark,

Alright, bear yourself... hopefully me explaining all my intentions won't confuse you 🙂

So. This program that I'm making is to educate children about energy and power using an Energy Bike, which will power various household appliances (such as lightbulbs) and has an interactive screen that will engage them with various questions to help them better understand the concepts. The "general view" pertains to general questions about what happens to the energy produced and used when activating various lightbulbs, which is located on the first tab. The second tab is going to be a person running up a slope, and when more loads are applied (i.e. more lightbulbs switched on), the slope will become steeper to indicate that it becomes harder to power. This "module" would also have a set of questions, as would additional tabs if I incorporate more modules.

My initial idea was to have these modules appear as different windows or screens, but I don't know how to do that in LabVIEW or if that was possible (like there be a button instead of a tab). So, I went with the tab control.

Hopefully that clarifies it a bit. Any chance you have any ideas or suggestions on how I can do this?

I appreciate your (or anyone's) feedback 🙂

Thanks,
Nadia
0 Kudos
Message 8 of 14
(3,629 Views)
Please take a look at the following example program I drafted up.  It is not perfect, but it should give you a good starting architecture to use.  In place of your question code I have boolean indicators.  Let me know if you have any questions, and feed back is always welcome.


Message Edited by BLAQmx on 03-21-2008 09:21 AM
Mark
NI App Software R&D
0 Kudos
Message 9 of 14
(3,603 Views)
Mark,

you're amazing. Thank you so much.

Sorry I'm just replying now... was only able to get to LabVIEW today.

Also, how do I leave a positive rating to your message?

Thanks,
Nadia
0 Kudos
Message 10 of 14
(3,543 Views)