omron — 3-1-8 Alarms

Coffee Machine scenario SECTION 3 Advanced Tutorial 3. Create remaining recipes with ingredient quantities as detailed in the list below. Tip: You can Copy and Paste Recipe 11 and the recipe name will automatically be incremented. The Ingredient values may then just be edited. 4. Copy all the previous recipes for the remaining selections (21, 22, 23, 24, 25, 26) and change the sugar ingredient to 50 , and name with a " with Sugar " suffix. 5. Add the code to the Make the Drink script to download the recipe ingredients :

aux_text = ValueToText( selection ) DownloadRecipe (aux_text) Sleep( 1000) 'Take quantities from storage coffee_level = coffee_level - coffee_amount water_level = water_level - water_amount milk_level = milk_level - milk_amount tea_level = tea_level - tea_amount sugar_level = sugar_level - sugar_amount When run, you will see that each time a drink is made the storage tanks are emptied by the correct amount for each ingredient. 3-1-8 Alarms We can provide the mechanism to create an alarm should any of the resources run out. 1, 2, 3… 1. Open the Alarm Editor. 2. Add the alarms with details from the list below.

29 Recipe Name Name Coffee Water Sugar Milk Tea 12 Espresso 50 75 0 0 0 13 White Coffee 50 50 0 50 0 14 Milk 0 0 0 100 0 15 Tea 0 100 0 0 100 16 Water 0 100 0 0 0 Name Expression Raised Message Normal Message coffee level alarm _ _ coffee level Coffee deposit is empty Coffee deposit is refilled water level alarm _ _ water level Water deposit is empty Water deposit is refilled milk level alarm _ _ milk level Milk deposit is empty Milk deposit is refilled