public static void Stop()
 {
     Globals.Tags.WashTimer.Value    = 0;
     Globals.Tags.CycleTimer.Value   = 0;
     Globals.Tags.InCycleTimer.Value = 0;
     Globals.Tags.LoopCounter.Value  = 0;
     PrewashScript.Stop();
     WashingScript.Stop();
     WashDryingScript.Stop();
     CycleTimerScript.Stop();
     Globals.Tags.Automatic_Washing.ResetTag();
     Globals.Tags.Washing_Pump.ResetTag();
     Globals.Tags.Pressure_Valve.ResetTag();
     Globals.Tags.Yellow_Light.SetTag();
     Globals.Tags.Buzzer.SetTag();
     Globals.Tags.Green_Light.ResetTag();
     BuzzerScript.Start();
     try {
         timer1.Enabled = false;
     }
     catch (Exception) {}
 }
        public static void TimeOut1(Object myObject, EventArgs myEventArgs)
        {
            Globals.Tags.WashTimer.Value    = Globals.Tags.WashTimer.Value - 1;
            Globals.Tags.Washing_Time.Value = Globals.Tags.WashTimer.Value / 60;
            Globals.Tags.CycleTimer.Value   = Globals.Tags.CycleTimer.Value - 1;
            Globals.Tags.InCycleTimer.Value = Globals.Tags.InCycleTimer.Value - 1;
            int cycleInfo = Globals.Tags.Cycle_Info.Value;

            if (Globals.Tags.WashTimer.Value > 0)
            {
                if (Globals.Tags.CycleTimer.Value <= 0)
                {
                    if (cycleInfo == 1)
                    {
                        PrewashScript.Start();
                    }
                    else if (cycleInfo == 2)
                    {
                        PrewashScript.Stop();
                        WashingScript.Start();
                    }
                    else if (cycleInfo == 3)
                    {
                        WashingScript.Stop();
                        WashDryingScript.Start();
                    }
                    else
                    {
                        Stop();
                        WashDryingScript.Stop();
                    }
                }
            }
            else
            {
                Stop();
            }
        }