LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a "front page menu"

Solved!
Go to solution

Ah ok I'll give that a go. So with event structures I don't need to physically attach the push buttons to the structure.

 

I did core 1 and 2, wa s abit intense so didn't retain everything but can go back over event structures. Seems fairly straight forward.

 

Let's see how I get on

0 Kudos
Message 11 of 19
(1,429 Views)

In your example, you put the five booleans inside the event structure. Doersn't that mean they will only be visible in one of the event cases?

0 Kudos
Message 12 of 19
(1,419 Views)

No, the reason for putting the actual control inside the event structure is so that the terminal is 'read' in the event structure and this resets the button back to off (depending on the type of mechanical action on the button) - that's all.

 

The event is fired when the button is pressed - you can either have a different case of the event structure for each button (and therefore you immediately know which button was pressed) or one for all (which means there is less code but you need to do something to figure out which button was pressed.

 

Having controls/indicators inside structures has no impact on whether or not they are visible. Even putting them in a diagram disable structure (which essentially 'comments out' the code) doesn't hide them.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 13 of 19
(1,407 Views)

The event structure seems to have messed up the subpanel for some reason.

 

Can you take a look at my code?

 

Btw I should rephrase my previous question.

 

If you plave the booleans inside one of the 5 event cases, doesn't mean they will only be able to influence one of the five event cases?

0 Kudos
Message 14 of 19
(1,392 Views)

Ok, you really need to learn how to use the event structure. Did you look at any of the examples?

 

For one, the event structure always needs to be inside a while loop or it will only be able to handle one event - notice how even in my thrown together 'snippet' screenshot there was a while loop there? It was important!

 

Secondly, you went for the first option I showed (one case for each button) and yet you put all of the terminals into one of the event cases like the second option.

 

Thirdly (and most importantly as to why your code doesn't work), you need to get rid of the while loops *inside* the event structure. The event structure is supposed to handle an event (button press) - in your case by running and inserting the VI into the subpanel and then wait until the next event comes along (e.g. changing page). 

 

Fourthly, as a nice bonus - if you create another event case for your 'stop' button, you can use that to wire a true to the stop condition of the while loop outside your event structure to stop your program, instead of having lots of stop buttons for each case.

 

At some point you will need to figure out what to do with the VI references and how you will handle the VIs in the subpanel - i.e. should you run/start all of the VIs at the beginning and just switch them in/out of the subpanel, how do you tell them to stop and when should they stop (i.e. when removed from the panel or only when you shutdown).

 

I think I mentioned it in one of my earlier posts - but there is lots to think about when using subpanels and it's going to be a tough climb if you're not that experienced with things like event structures!


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 15 of 19
(1,385 Views)

Ok I will have a good go through the core 1 and 2 material and implement everything you suggested and then come back with where I get to. Thanks

0 Kudos
Message 16 of 19
(1,382 Views)

OK

 

+I've taken the while loop out of my subpanel. I got that from the following tutorial:

http://zone.ni.com/reference/en-XX/help/371361F-01/lvhowto/loading_panel_in_subpanel/

Not sure why they put it there or whether removing it affects my code.


+I've worked through the core 1 content on event structures (including the bonus question). I've attached it as a zip file called events.


+I have put the relevant boolean in the respective event case.


+I have encased the event structure in a while loop


+I have created a stop event.

 

I have attached my most recent code. It is still not running. The error I am getting relates to the invoke node. It worked when there was just one VI running in the subpanel, so not sure why it not longer works.

 

Download All
0 Kudos
Message 17 of 19
(1,350 Views)

hi,

     how can i add multiple button value change in single event.like this

 

2015-09-21_10-05-10.png

0 Kudos
Message 18 of 19
(1,190 Views)
Creating new cases is just a right click option. Please complete some of the basic LabVIEW tutorials.
Message 19 of 19
(1,165 Views)