LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Number operated menu system

I'm not sure I understand you. Is there any example to show this working in labview?

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

@Raw92 wrote:

I'm not sure I understand you. Is there any example to show this working in labview?


Do you understand what a shift register is? This is a key LabVIEW concept; see the help.

 

Here is my understanding of the sequence you are trying to achieve. Please rewrite this if incorrect.

1) User presses any button

2) System plays the main menu sound

3) User selects a menu option

4) System takes appropriate action for the selected menu option

 

Is this correct?

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

Yes that's correct and before the presses any button to bring up the menu there needs to be a loop that a) displays the current time and b) checks if it's time to turn on the heating.

 

See a problem I'm having is that in my program I have an event structure that registers if a button is pressed but it seems that I can't do that twice becaue they both seem to be looking for the same thing.

 

So you're saying that all I'm going to need is a shift register. I'm quite new to labview so I don't know what a shift register is and will need to try and find an example/ an explanation of what it is so I can implement it.

0 Kudos
Message 13 of 19
(1,204 Views)

Again, a shift register is a fundamental LabVIEW concept. It lets you carry a value from one iteration of a loop to the next. You create one by right-clicking on the edge of a loop and choosing Add Shift Register. It would be well worth your time to work through some of the available online help.

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

Thanks again for your help. Looking through some examples now.

 

Going back to your last comment about using shift registers to define what state it's in. So I should be using a state machine in my program to seperate the first part of the menu and the second? Will that prevent my event structures from looking for the same thing?

0 Kudos
Message 15 of 19
(1,198 Views)

You should have only one event structure. The shift register keeps track of whether this is the initial button press, or the second one.

 

The simplest case is you put store a boolean in the shift register, which you initialize to false. In the button press event case, you check that shift register. If it's false, then it's the first time a button was pressed and you should play the menu. Also pass a true value out of that event case and wire it to the shift register, to set the shift register to true. If the shift register value is true when you enter the event case, then the user is selecting a menu option and you should take appropriate action.

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

event.png

Ok and so this is what the event should look like? Obviously minus the LEDs in there

0 Kudos
Message 17 of 19
(1,188 Views)

@Raw92 wrote:

Ok and so this is what the event should look like? Obviously minus the LEDs in there


The Event structure should be inside a While loop, and I'd use a case structure instead of lots of separate Equals comparisons. Without the LEDs and comparisons there's almost nothing inside that event structure, so I'm not sure what you're asking. It would be more helpful to show the entire program, since I still don't see a shift register anywhere (due to the lack of a while loop).

0 Kudos
Message 18 of 19
(1,184 Views)

Still getting my head around how the overall layout of the program will look like. Going to work through what you have suggested tomorrow and see how I get on.

Cheers Nathan. 

0 Kudos
Message 19 of 19
(1,182 Views)