Showing results for 
Search instead for 
Did you mean: 

Coffee vending machine

Go to solution

Hey, I'm new to this forum and I'm learning Labview for school.

I need to make a coffee vending machine and I have run into an issue where if I don't select the buttons in the correct order the system stops responding. It only works if I turn on my coffee machine and then click Order coffee any other combination of button presses results in the system not responding. I think it has to do with the Boolean logic? I appreciate any input and criticism and look forward to your replies. 

0 Kudos
Message 1 of 19

Sorry, I cannot open LabVIEW 2021 Vis. Please use "save for previous" and reattach. (My wild guess is a dataflow problem, e.g. an event structure with inner interactive loops.)

0 Kudos
Message 2 of 19

Thanks for the reply which version would suit you? I'm sending 2020 just in case

Download All
0 Kudos
Message 3 of 19


Sorry I couldn`t open your vi , Could you please save your vi 2019 so that everyone could see it.

Best Regards

0 Kudos
Message 4 of 19


Thank you for your reply, I made a second version where I removed the power button it worked a lot better but I'm still interested on how I could add a power button in the future. 


Thanks again

0 Kudos
Message 5 of 19

You are making some glaring mistakes using multiple event structures in multiple cases of a case structure. that's a very big no-no! An event structure needs to be in a place where it can actually execute if an event is queued up, so if your code sits in a different case, the event cannot be serviced and since your events lock the front panel until it can complete, you are locked out forever.


Some other glaring mistakes:

  • Make your front panel a reasonable size. There is no reason in the world to maximize it to a gigantic screen making us stare at mostly flat grey instead of much more important other windows, such as the diagram and the LabVIEW help.
  • It seems silly to have all these local variables to update the status string. Just place it behind the case and wire from all cases. If it should not change in some cases, just keep it in a shift register and modify as needed.
  • The use of "secondary int" state makes not a lot of sense. When you run the program, the machine should be on. Use a latch action boolean to turn it off and stop the VI.
  • See how far you get and post back one you are a but further into the project.
Message 6 of 19

the file without the Power button is my finished project and it fulfils all the requirements set by the teacher. was your feedback with regards to that file or the one with a power button. Maybe my screen is bigger but at default size, it's difficult for me to read.

As for the use of local variables I understand they take a toll on your memory but since the teacher required the use of them to indicate the different states I won't change them.

0 Kudos
Message 7 of 19

Thanks for the feedback in any case but I am bound by some requirements set by the teacher and I only have around 5-7 hours of experience with Labview so I appreciate the input. the file below has the assignment in it.

0 Kudos
Message 8 of 19

Ouch.  The suggestion to use local variables as the way to move values around in the application makes me wonder how much LabVIEW experience your teacher has.

(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 9 of 19

OK, the assignment does NOT mention anything about the "secondary int" state, so get rid of it! Makes sure to stick with the requirements!


Vending machines don't have popups, so just use the message indicators. Use a radiobutton to make the drink selection.


The use of local variables just clutters the diagram, but if your teacher wants them, use them!

0 Kudos
Message 10 of 19