コード例 #1
0
        public static void GoTo()
        {
            Console.Write(" \n GoToPoint =>  ");
            var v = Plc2.GotoPoint();

            Console.Write("  -- Done -- result ( " + v + " )");
        }
コード例 #2
0
        public static void HangIn()
        {
            Console.Write(" \n HangIn =>  ");
            var v = Plc2.Hang_In();

            Console.Write("  -- Done -- result ( " + v + " )");
        }
コード例 #3
0
        public static void Stop()
        {
            //Tmr.Stop();

            Plc1.Stop();
            Plc2.Stop();
            Plc3.Stop();
        }
コード例 #4
0
        public static void Start()
        {
            Plc2.Start();
            Plc3.Start();

            //Tmr = new TestTimer (CheckStatusOf, 1000);
            //Tmr.Start();
        }
コード例 #5
0
        private static void SetHanging()
        {
            Console.Write(" \n Set Hanging Point To =>  ");
            var a = int.Parse(Console.ReadLine() ?? throw new InvalidOperationException());
            var v = Plc2.SetHanginpoint(a);

            Console.Write("  -- Done -- result ( " + v + " )");
        }
コード例 #6
0
        public static void HangUpTo()
        {
            Console.Write(" \n Hang To =>  ");
            var a = int.Parse(Console.ReadLine() ?? throw new InvalidOperationException());

            Plc2.HangUpToPoint(a);
            ///esli net belya vozvrashaet 0

            Console.Write("  -- Done -- ");
        }
コード例 #7
0
        public static void PrepareBelt1Slot()
        {
            var i = Plc2.GetNowPoint();
            var j = CheckBeltSlot(i);

            //if ( j == i) return;

            //TODO: поменять i++ на j.
            Plc2.SetNowPoint(i + 1);
            Tmr.WaitTime(500);
            Plc2.GotoPoint();

            while (Plc2.DialState())
            {
                Tmr.WaitTime(500);
            }
        }
コード例 #8
0
        public static void SendToSlot()
        {
            Tmr.WaitTime(2000);

            while (!Plc2.GetClotheInHook())
            {
                Console.Write(" - HangIn F");
                Plc2.Hang_In();
                Tmr.WaitTime(1000);
            }

            while (Plc2.GetClotheInHook())
            {
                Console.Write(" - HangIn T");
                Tmr.WaitTime(1000);
            }
            return;
        }
コード例 #9
0
        public static void CheckStatusOf()
        {
            Console.WriteLine("");
            Console.WriteLine("---------------");
            Console.WriteLine("GetBasePoint() => " + Plc2.GetBasePoint());
            Console.WriteLine("GetHanginpoint() => " + Plc2.GetHanginpoint());
            Console.WriteLine("GetNowPoint() => " + Plc2.GetNowPoint());
            Console.WriteLine("GetClotheInHook() => " + Plc2.GetClotheInHook());
            Console.WriteLine("GetWaitHangNum() => " + Plc1.GetWaitHangNum());
            Console.WriteLine("GetClotheReady() => " + Plc1.GetClotheReady());
            var i = 1;

            Tmr = new TestTimer();
            while (i < 100)
            {
                i++;
                Console.WriteLine("HangInState() => " + Plc2.Hang_In_State());
                Tmr.WaitTime(500);
            }
            Console.WriteLine("---------------");
        }
コード例 #10
0
 public static void CheckConnection()
 {
     Console.WriteLine("Plc 1 = " + Plc1.conn(LocalIp, PlcIp1, 9600).ToString());
     Console.WriteLine("Plc 2 = " + Plc2.conn(LocalIp, PlcIp2, 9600).ToString());
     //Console.WriteLine(Plc1.conn(LocalIp, PlcIp3, 9600).ToString());
 }