09-02-2012 02:20 PM
I am currently an Undergraduate studying Industrial Tech. I am working on a project for LabView and have a simple question. For the project I have to design the front panel of a soda machine. If the amount of money entered is lower than the amount of money needed, it needs to have a numeric indicator displaying the amount needed. I have attached a picture of the problem I'm trying to solve above. I have to subtract the total cost from the amount of money entered. The problem is of course that when I do this, if I have entered more money than needed, the "Amount Needed" box will display a negative number. So I made it run through an absolute value node to make it positive, but of course now it shows that there is money needed even if I put more than is needed. So how can I make the "Amount Needed" indicator only display negative values, while also sending it through an absolute value node to make it a positive value? Any help is greatly appreciated. Thanks!
09-02-2012 02:37 PM
You need something to make a decision. If the difference is negative, then more money is needed. Look on the comparison palette and then use a Case structure.
You should probably have a loop around your code so that the user does not need to enter all the data then run the VI.
Lynn
09-02-2012 03:03 PM
Ah yes, thank you! That did the trick. I attached the solution that I worked out. I appreciate the help, I know how to use case structures now!