04-20-2013 04:53 PM
Hi, i'm making a washing machine simulator (a really simple one) basically depending on the load size (big or small or medium) the front panel will display how many gallons of water used as well as the water temperature depending on the load type (delicates, whites, colors). Additionally here is a timer that runs for a certain amount of time depending on the load size, once the wash cycle is completed, the dry cycle begins. I have completed the code but it's not working and i don't understand why, the VI shows no errors and i can't see the problem. I am fairly new at labview, please help.
Solved! Go to Solution.
04-20-2013 06:43 PM - edited 04-20-2013 06:44 PM
You have made many of the mistakes we often see from people who are new to LabVIEW.
First is the use of the sequence structure. LabVIEW uses a dataflow paradigm which eliminates the need for most sequence structures.
It looks like your code actually executes, although with the very long Waits you have in the central while loop and in the third frame, it is probably unresponsive most of the time.
I suggest that you look at the State Machine architecture. It is much more flexible, robust, and adaptable for this kind of project.
For testing purposes try reducing the wait times by a factor of 1000 so that things happen in a few seconds rather than 10s of minutes.
Note that the output of the Wait(ms) function is a tick count and not the time which was waited. It is an unsigned integer and the subtraction produces a rollover. I attached a simple VI showing this. Look at the Elapsed Time Express VI. It may be closer to what you want.
Lynn
04-20-2013 06:52 PM
Thank you very much! especially for the wait VI example, I will implement that onto my application.