Пример #1
0
 public AGVManager()
 {
     GModbusItme       = new GetModbusItme();
     GModbusItme.DevID = AGVID;
     GModbusItme.initUshort(40);//初始化个数
     SModbusItme       = new SetModbusItme();
     SModbusItme.DevID = AGVID;
 }
Пример #2
0
        //接收信息
        public void GetContext(GetModbusItme VText)
        {
            if (this.InvokeRequired)
            {
                this.BeginInvoke(new CbDelegate <GetModbusItme>(this.GetContext), VText);
            }
            else
            {
                if (VText.DevID.ToString() == ShowID)
                {
                    this.richTextBox1.Text = "设备编号:" + VText.DevID.ToString() + GetStringTo(VText.ResUshort);
                    LocalPoint             = VText.ResUshort[26].ToString();
                    LocalFW = VText.ResUshort[25].ToString();

                    GoCMD   = VText.ResUshort[0].ToString();
                    GoPoint = VText.ResUshort[1].ToString();
                    GoQD    = VText.ResUshort[9].ToString();
                }
                ushort[] Val = VText.ResUshort;
                if (VText.DevID.ToString() == "1")
                {
                    if (VText.ResUshort[0].ToString() == "0")
                    {
                        textBox3.Text = "暂停";
                    }
                    else
                    {
                        textBox3.Text = "行驶";
                    }
                    textBox1.Text = Val[1].ToString(); textBox6.Text = Val[10].ToString(); textBox8.Text = GetValue(Val[26].ToString()) + "_" + Val[26].ToString();
                    SetPoint(GetValue(Val[26].ToString()));
                }
                else if (VText.DevID.ToString() == "2")
                {
                    if (VText.ResUshort[0].ToString() == "0")
                    {
                        txtRN1.Text = "暂停";
                    }
                    else
                    {
                        txtRN1.Text = "行驶";
                    }
                    txtRN2.Text = Val[1].ToString(); txtRN3.Text = Val[26].ToString(); txtRN4.Text = Val[10].ToString();
                }
                else if (VText.DevID.ToString() == "3")
                {
                    if (VText.ResUshort[0].ToString() == "0")
                    {
                        txtRM1.Text = "暂停";
                    }
                    else
                    {
                        txtRM1.Text = "行驶";
                    }
                    txtRM2.Text = Val[1].ToString(); txtRM4.Text = Val[10].ToString(); txtRM3.Text = Val[26].ToString();
                }
            }
        }
Пример #3
0
 //接收信息
 public void GetContext(GetModbusItme VText)
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke(new CbDelegate <GetModbusItme>(this.GetContext), VText);
     }
     else
     {
         if (DevID == VText.DevID.ToString())
         {
             this.richTextBox1.Text = "设备编号:" + VText.DevID.ToString() + GetStringTo(VText.ResUshort);
         }
     }
 }
Пример #4
0
 //接收信息
 public void GetContext(GetModbusItme VText)
 {
     if (this.InvokeRequired)
     {
         this.BeginInvoke(new CbDelegate <GetModbusItme>(this.GetContext), VText);
     }
     else
     {
         if (VText.DevID.ToString() == "1")
         {
             this.richTextBox1.Text = "设备编号:" + VText.DevID.ToString() + GetStringTo(VText.ResUshort);
             SetPoint(VText.ResUshort[26].ToString());
             LocalFW = VText.ResUshort[25].ToString();
         }
         else if (VText.DevID.ToString() == "2")
         {
             this.richTextBox2.Text = "设备编号:" + VText.DevID.ToString() + GetStringTo(VText.ResUshort);
         }
         else if (VText.DevID.ToString() == "3")
         {
             this.richTextBox3.Text = "设备编号:" + VText.DevID.ToString() + GetStringTo(VText.ResUshort);
         }
     }
 }