LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Student. Extremely new to LabVIEW. Have a very simple question for a project I am doing

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!

0 Kudos
Message 1 of 3
(2,993 Views)

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

Message 2 of 3
(2,987 Views)

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!

Message 3 of 3
(2,982 Views)