LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Coffee vending machine

Solved!
Go to solution

Hi ,

you find here an Example that could help you.

 

0 Kudos
Message 11 of 19
(1,239 Views)
Solution
Accepted by topic author Dorime_Z_karen_slayer

I would just keep it simple.... (no popups!!!!!)

 

(And NO, this does not follow the requirements! This is just to give you some ideas in general!)

 

 

altenbach_0-1653241065298.png

 

altenbach_1-1653241100204.png

 

Message 12 of 19
(1,230 Views)

This does look a lot more refined and elegant I will take my time to figure out exactly what you are doing here. the file I sent was purely based on the examples the teacher showed me.

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

@Emna20 wrote:

Hi ,

you find here an Example that could help you.

 


Please don't use unusual file formats (*.rar) that force windows users to install third party software to extract. Nobody will because some random rar extractors found on the internet may contain malware!!!  Zip is built into windows explorer and is perfectly fine for everything!

 

Some comments to your code:

  • There is no need to maximize the panels.
  • If you compare with my code, there is absolutely no need for all these init methods.
  • Static references don't need to be closed. ("This VI" is default, so it does not even need to be wired!)
  • Way too many local variables
  • Not sure why you need a DBL indicator to display an integer.
  • It seems convoluted to carry all these values as strings and do all this song and dance with formatting, scanning, string operations, and juggling commas. By default, LabVIEW uses the system decimal point, so none of this is necessary (... and would also confuse users in other countries).
  • A 500ms global wait makes any user interaction very sluggish.
  • There are better solutions than long ladders of select nodes.
  • All data that should persist across iterations belongs in a single shift register cluster with well-named entries. The use of (un)bundle by name makes the code very self-documenting and avoids mistakes. 
  • ...

 

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

Thanks for your answer and time but I can't open it it shows a text file with weird symbols.

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

@Dorime_Z_karen_slayer wrote:

Thanks for your answer and time but I can't open it it shows a text file with weird symbols.


I assume you are talking about the rar archive. Just don't even bother until it is posted as zip file.

 

(And as you can glean from my earlier comments, the contained code is probably not very useful as a learning tool)

Message 16 of 19
(1,212 Views)

Thanks again I really appreciate the time and help you have given me.

0 Kudos
Message 17 of 19
(1,203 Views)
Solution
Accepted by topic author Dorime_Z_karen_slayer

I just had another few minutes to quickly clean it up, add a dispensing simulation and make it a bit more scalable. Now all drink specs are in a single diagram constant, so to change the price, name of drink, color of drink, or size of drink, all you need is edit the array constant. No need to hunt all over the diagram.

 

Also note that you should never (never ever!) hide terminal labels on the diagram.

 

 

Message 18 of 19
(1,191 Views)

This is so cool I love it. This really gives me the motivation to practice more so I can program like this one day. For now, I'm still going to use the code that I spent a few days on since I don't have enough time to understand how you did it (the deadline is tomorrow and this 1 out of 8 assignments). Many thanks again I would like to know enough one day to help others as you just did :D.

Message 19 of 19
(1,167 Views)