Ejemplo n.º 1
0
        private void menuItem_Apply_Click(object sender, EventArgs e)
        {
            try
            {
                ABB.Robotics.Controllers.RapidDomain.RapidData boolBlocksiFr1ArcStable = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "GlobalDataModule", "boolBlocksiFr1ArcStable");
                ABB.Robotics.Controllers.RapidDomain.Bool      bBlocksiFr1ArcStable    = new ABB.Robotics.Controllers.RapidDomain.Bool(this.checkBox_boolBlocksiFr1ArcStable.Checked);
                boolBlocksiFr1ArcStable.Value = bBlocksiFr1ArcStable;
                boolBlocksiFr1ArcStable.Dispose();

                ABB.Robotics.Controllers.RapidDomain.RapidData numBlocksiArcStableLength = rwSystem.Controller.Rapid.GetRapidData("T_ROB1", "GlobalDataModule", "numBlocksiArcStableLength");
                ABB.Robotics.Controllers.RapidDomain.Num       nBlocksiArcStableLength   = new ABB.Robotics.Controllers.RapidDomain.Num(Convert.ToDouble(this.numEditor_numBlocksiArcStableLength.Value));
                numBlocksiArcStableLength.Value = nBlocksiArcStableLength;
                numBlocksiArcStableLength.Dispose();

                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numIsometricalSaddleCoefficient", this.numEditor_numIsometricalSaddleCoefficient);
                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numShoulderGrooveCoefficient", this.numEditor_numShoulderGrooveCoefficient);
                this.rwSystem.ApplyTpsControl("T_ROB1", "GlobalDataModule", "numTorchCleanIntervalCount", this.numEditor_numTorchCleanIntervalCount);

                this.menuItem_Apply.Enabled = false;
            }
            catch (Exception ex)
            {
                GTPUMessageBox.Show(this.Parent.Parent, null
                                    , string.Format("An unexpected error occurred when applying RAPID data 'rPipeGrooveModel'. Message {0}", ex.ToString())
                                    , "System Error"
                                    , System.Windows.Forms.MessageBoxIcon.Hand
                                    , System.Windows.Forms.MessageBoxButtons.OK);
            }
        }
Ejemplo n.º 2
0
 public void ApplyTpsControl(string strTaskName, string strModuleName, string strDataName, TpsControl tpsControl)
 {
     if (tpsControl is NumEditor)
     {
         ABB.Robotics.Controllers.RapidDomain.RapidData rapidData = this.controller.Rapid.GetRapidData(strTaskName, strModuleName, strDataName);
         ABB.Robotics.Controllers.RapidDomain.Num       number    = new ABB.Robotics.Controllers.RapidDomain.Num(Convert.ToDouble(((NumEditor)tpsControl).Value));
         rapidData.Value = number;
         rapidData.Dispose();
     }
 }
Ejemplo n.º 3
0
 public void RefreshTpsControl(string strTaskName, string strModuleName, string strDataName, TpsControl tpsControl)
 {
     if (tpsControl is NumEditor)
     {
         ABB.Robotics.Controllers.RapidDomain.RapidData rapidData = this.controller.Rapid.GetRapidData(strTaskName, strModuleName, strDataName);
         ABB.Robotics.Controllers.RapidDomain.Num       number    = new ABB.Robotics.Controllers.RapidDomain.Num();
         number.FillFromString(rapidData.Value.ToString());
         ((NumEditor)tpsControl).Value = Convert.ToDecimal(number);
         rapidData.Dispose();
     }
 }
        void update_values()
        {
            DateTime t0 = DateTime.Now;

            rdice   = aTask[0].GetRapidData("MainModule", "dice_txt");
            rangle  = aTask[0].GetRapidData("MainModule", "angle_txt");
            rx      = aTask[0].GetRapidData("MainModule", "x_txt");
            ry      = aTask[0].GetRapidData("MainModule", "y_txt");
            roffset = aTask[0].GetRapidData("MainModule", "roffset");
            try
            {
                if (rx.Value is ABB.Robotics.Controllers.RapidDomain.Num)
                {
                    val = (ABB.Robotics.Controllers.RapidDomain.Num)rx.Value;
                    val.FillFromNum(arr[0]);
                    using (Mastership.Request(this.controller.Rapid))
                    {
                        rx.Value = val;
                    }
                }

                if (ry.Value is ABB.Robotics.Controllers.RapidDomain.Num)
                {
                    val = (ABB.Robotics.Controllers.RapidDomain.Num)ry.Value;
                    val.FillFromNum(arr[1]);
                    using (Mastership.Request(this.controller.Rapid))
                    {
                        ry.Value = val;
                    }
                }
                if (rdice.Value is ABB.Robotics.Controllers.RapidDomain.Num)
                {
                    val = (ABB.Robotics.Controllers.RapidDomain.Num)rdice.Value;
                    val.FillFromNum(arr[2]);
                    using (Mastership.Request(this.controller.Rapid))
                    {
                        rdice.Value = val;
                    }
                }
                if (rangle.Value is ABB.Robotics.Controllers.RapidDomain.Num)
                {
                    val = (ABB.Robotics.Controllers.RapidDomain.Num)rangle.Value;
                    val.FillFromNum(arr[3]);
                    using (Mastership.Request(this.controller.Rapid))
                    {
                        rangle.Value = val;
                    }
                }

                //Register time intervar for updating//
                double   total_D;
                DateTime t1 = DateTime.Now;

                TimeSpan total = new TimeSpan(t1.Ticks - t0.Ticks);
                total_D = total.TotalMilliseconds;
                if (total_D > max)
                {
                    max = total_D;
                }

                textBox2.Text = (max.ToString());
                /////////////////////////////////////
                if (roffset.Value is ABB.Robotics.Controllers.RapidDomain.Num)
                {
                    val = (ABB.Robotics.Controllers.RapidDomain.Num)roffset.Value;
                    val.FillFromNum(total_D);
                    using (Mastership.Request(this.controller.Rapid))
                    {
                        roffset.Value = val;
                    }
                }
            }

            catch (System.Exception ex)
            {
                MessageBox.Show("Reading ERROR: " + ex.Message);
            }
        }
Ejemplo n.º 5
0
 public void listmethod()
 {
     ////data1 = objController.Rapid.GetTask("T_ROB1").GetModule("SWDEFUSR").GetRapidData("Version_SWDEFUSR"); //string
     //data1.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data1_ValueChanged);
     data2 = objController.Rapid.GetTask("T_ROB1").GetModule("URUN_M1").GetRapidData("W_00049"); //robtarget //robot punta pozisyon bilgisi
     data2.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data2_ValueChanged);
     //data3 = objController.Rapid.GetTask("T_ROB1").GetModule("SWDEFUSR").GetRapidData("MAX_DEFLECTION"); //num
     //data3.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data3_ValueChanged);
     //data4 = objController.Rapid.GetTask("T_ROB1").GetModule("SPOTSRV").GetRapidData("nToplamAsinma"); //num
     //data4.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data4_ValueChanged);
     //data5 = objController.Rapid.GetTask("T_ROB1").GetModule("BASE").GetRapidData("wobj0"); //wobjdata
     //data5.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data4_ValueChanged);
     //data6 = objController.Rapid.GetTask("T_ROB1").GetModule("BASE").GetRapidData("load0"); //loaddata
     //data6.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data4_ValueChanged);
     //data7 = objController.Rapid.GetTask("T_ROB1").GetModule("HOME_KONTROL").GetRapidData("delta_position1"); //jointtarget
     //data7.ValueChanged += new EventHandler<DataValueChangedEventArgs>(data4_ValueChanged);
     data8 = objController.Rapid.GetTask("T_ROB1").GetModule("SPOTSRV").GetRapidData("bRobot_FrezePrograminda");                   //bool
     data8.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data9 = objController.Rapid.GetTask("T_ROB1").GetModule("SWDEFUSR").GetRapidData("spot1");                                    //spotdata
     data9.ValueChanged  += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data10               = objController.Rapid.GetTask("T_AutoBackup").GetModule("MainModule").GetRapidData("bCycleOn");          //bool
     data10.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data11               = objController.Rapid.GetTask("T_AutoBackup").GetModule("MainModule").GetRapidData("nHataKodu");         //num
     data11.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data12               = objController.Rapid.GetTask("T_ROB1").GetModule("SPOTSRV").GetRapidData("force_bileme");               //forcedata //firezeleme kuvveti
     data12.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data13               = objController.Rapid.GetTask("T_AutoBackup").GetModule("MainModule").GetRapidData("bKaynakTamamlandi"); //bool
     data13.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     data14               = objController.Rapid.GetTask("T_ROB1").GetModule("URUN_M1").GetRapidData("nProgNo");                    //num
     data14.ValueChanged += new EventHandler <DataValueChangedEventArgs>(data4_ValueChanged);
     _string1             = (ABB.Robotics.Controllers.RapidDomain.String)data1.Value;
     string1              = _string1.Value;
     _robTarget1          = (ABB.Robotics.Controllers.RapidDomain.RobTarget)data2.Value;
     robTarget1           = _robTarget1.Trans;
     _num3         = (ABB.Robotics.Controllers.RapidDomain.Num)data3.Value;
     num3          = _num3.Value;
     _num4         = (ABB.Robotics.Controllers.RapidDomain.Num)data4.Value;
     num4          = _num4.Value;
     _wobjData1    = (WobjData)data5.Value;
     wobjData1     = _wobjData1.Oframe;
     _loadData1    = (LoadData)data6.Value;
     loadData1     = _loadData1.Aom;
     _jointTarget1 = (JointTarget)data7.Value;
     jointTarget1  = _jointTarget1.RobAx;
     _bool1        = (Bool)data8.Value;
     bool1         = _bool1.Value;
     label4.Text   = data9.Value.ToString();
     _bool2        = (Bool)data10.Value;
     bool2         = _bool2.Value;
     _num5         = (ABB.Robotics.Controllers.RapidDomain.Num)data11.Value;
     num5          = _num5.Value;
     _bool3        = (Bool)data13.Value;
     bool3         = _bool3.Value;
     label9.Text   = data12.Value.ToString();
     _num6         = (ABB.Robotics.Controllers.RapidDomain.Num)data14.Value;
     num6          = _num6.Value;
     dataGridView1.Rows.Add(data1.Symbol.Scope[0], data1.Symbol.Scope[1], data1.Symbol.Scope[2], string1);
     dataGridView1.Rows.Add(data2.Symbol.Scope[0], data2.Symbol.Scope[1], data2.Symbol.Scope[2], robTarget1);
     dataGridView1.Rows.Add(data3.Symbol.Scope[0], data3.Symbol.Scope[1], data3.Symbol.Scope[2], num3);
     dataGridView1.Rows.Add(data4.Symbol.Scope[0], data4.Symbol.Scope[1], data4.Symbol.Scope[2], num4);
     dataGridView1.Rows.Add(data5.Symbol.Scope[0], data5.Symbol.Scope[1], data5.Symbol.Scope[2], wobjData1);
     dataGridView1.Rows.Add(data6.Symbol.Scope[0], data6.Symbol.Scope[1], data6.Symbol.Scope[2], loadData1);
     dataGridView1.Rows.Add(data7.Symbol.Scope[0], data7.Symbol.Scope[1], data7.Symbol.Scope[2], jointTarget1);
     dataGridView1.Rows.Add(data8.Symbol.Scope[0], data8.Symbol.Scope[1], data8.Symbol.Scope[2], bool1);
     dataGridView1.Rows.Add(data10.Symbol.Scope[0], data10.Symbol.Scope[1], data10.Symbol.Scope[2], bool2);
     dataGridView1.Rows.Add(data11.Symbol.Scope[0], data11.Symbol.Scope[1], data11.Symbol.Scope[2], num5);
     dataGridView1.Rows.Add(data12.Symbol.Scope[0], data12.Symbol.Scope[1], data12.Symbol.Scope[2], data12.Value);
     dataGridView1.Rows.Add(data13.Symbol.Scope[0], data13.Symbol.Scope[1], data13.Symbol.Scope[2], bool3);
     dataGridView1.Rows.Add(data14.Symbol.Scope[0], data14.Symbol.Scope[1], data14.Symbol.Scope[2], num6);
     dataGridView1.AutoGenerateColumns = false;
 }