Beispiel #1
0
        private void BtnPanCtrl_Click(object sender, EventArgs e)
        {
            if (!Panstart)
            {
                Turntable.Instance.Start();


                speed = speed < 1000 ? 1000 : speed;
                PCI408.PCI408_write_SEVON_PIN(Card.cardNo, Card.On);
                PCI408.PCI408_set_profile(Card.cardNo, 1000, speed, Card.acc, Card.acc);
                PCI408.PCI408_vmove(Card.cardNo, 0, Card.maxspeed);
                PCI408.PCI408_write_outbit(Card.cardNo, Card.chuiqizongkaiguan, Card.On);
                BtnPanCtrl.Text = "停止运动";
            }
            else
            {
                Turntable.Instance.Stop();

                PCI408.PCI408_decel_stop(Card.cardNo, Card.acc);
                PCI408.PCI408_write_outbit(Card.cardNo, Card.chuiqizongkaiguan, Card.Off);
                Thread.Sleep(5000);
                BtnPanCtrl.Text = "转盘启动测试";
            }
            Panstart = !Panstart;
        }
Beispiel #2
0
        void lackStop()
        {
            SpeedTime.Stop();
            SpeedTime.Enabled = false;

            PCI408.PCI408_decel_stop(Card.cardNo, Card.acc);
            //PCI408.PCI408_write_outbit(Card.cardNo, Card.chuiqizongkaiguan,Card.Off);
            niulimax = Card.niulimax;
        }
Beispiel #3
0
 public void Stop()
 {
     SpeedTime.Enabled = false;
     //isStart=false;
     PCI408.PCI408_decel_stop(Card.cardNo, Card.acc);
     //PCI408.PCI408_write_outbit(Card.cardNo, Card.chuiqizongkaiguan, Card.Off);
     zhuanPanIsRun = false;
     // PCI408.PCI408_write_SEVON_PIN(Card.cardNo, Card.Off);
 }
Beispiel #4
0
        private void kongzhiwaibu()
        {
            kzwbmlt11 = DateTime.Now;
            kzwbmlts  = kzwbmlt11 - kzwbmlt12;
            int kzwbml;

            kzwbml = kzwbmlts.Days * 86400 + kzwbmlts.Hours * 3600 + kzwbmlts.Minutes * 60 + kzwbmlts.Seconds;
            if (kzwbml > 240)
            {
                Onwuliao();
                baojing = new Thread(bjzx);
                baojing.Start();
                isStart = false;
            }
            djzt = PCI408.PCI408_check_done(Card.cardNo);
            if (djzt == 1)
            {
                if (kzwbhdzt == 1)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.hd, Card.On);
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.shakePan, Card.Off);
                    kzwbhdzt = 0;
                }
                if (kzwbldzt == 1)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.ld, Card.Off);
                    kzwbldzt = 1;
                }
            }
            else
            {
                if (kzwbldzt == 1)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.ld, Card.On);
                    kzwbldzt = 0;
                }
                if (kzwbhdzt == 0)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.hd, Card.Off);
                    kzwbhdzt = 1;
                }
            }
            if (sc == 1)
            {
                s4 = PCI408.PCI408_read_inbit(Card.cardNo, Card.jsqm);
                if (s4 == 0)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.jsqqg, Card.Off);
                    sc = 0;
                }
            }
            if (sc == 0)
            {
                s5 = PCI408.PCI408_read_inbit(Card.cardNo, Card.jsqfw);
                if (s5 == 0)
                {
                    PCI408.PCI408_write_outbit(Card.cardNo, Card.jsqqg, Card.On);
                    sc    = 1;
                    lmxh2 = DateTime.Now;
                }
            }
            lmxhts = lmxh1 - lmxh2;//20170622
            lmxh1  = DateTime.Now;
            int lmxh;

            lmxh = lmxhts.Days * 86400 + lmxhts.Hours * 3600 + lmxhts.Minutes * 60 + lmxhts.Seconds;
            if (lmxh > 60 && sc == 1)
            {
                //baojing = new Thread(bjzx);
                //baojing.Start();
                //isStart = false;
                //lackStop();
                ////zhuanpanStateRuning = false;
                //SpeedTime.Stop();
                //Turntable.Instance.Stop();
                //zhuanpanStateRuning = false;
                ////zhizhenLowSensor.timer.Start();
                //SpeedTime.Enabled = false;
                PCI408.PCI408_decel_stop(Card.cardNo, Card.acc);
                PCI408.PCI408_write_outbit(Card.cardNo, Card.chuiqizongkaiguan, Card.Off);
                //zhuanPanIsRun = false;
                //zhizhenLowSensor.timer.Stop();
            }
        }