예제 #1
0
        public void WriteData(RapidData RapidName, object WriteData, int Index = 1, int Llndex = 1)
        {
            switch (RapidName.RapidType)
            {
            case "num":
                Num NumData = new Num();
                NumData.FillFromString(WriteData.ToString());
                if (RapidName.IsArray)
                {
                    if (ArrayRank(RapidName) > 1)
                    {
                        RapidName.WriteItem(NumData, Index, Llndex);
                    }
                    else
                    {
                        RapidName.WriteItem(NumData, Index);
                    }
                }
                else
                {
                    RapidName.Value = NumData;
                }
                break;

            case "bool":
                Bool BoolData = new Bool();
                BoolData.FillFromString(WriteData.ToString());
                if (RapidName.IsArray)
                {
                    if (ArrayRank(RapidName) > 1)
                    {
                        RapidName.WriteItem(BoolData, Index, Llndex);
                    }
                    else
                    {
                        RapidName.WriteItem(BoolData, Index);
                    }
                }
                else
                {
                    RapidName.Value = BoolData;
                }
                break;

            case "string":
                ABB.Robotics.Controllers.RapidDomain.String StrData = new ABB.Robotics.Controllers.RapidDomain.String();
                StrData.FillFromString(WriteData.ToString());
                if (RapidName.IsArray)
                {
                    if (ArrayRank(RapidName) > 1)
                    {
                        RapidName.WriteItem(StrData, Index, Llndex);
                    }
                    else
                    {
                        RapidName.WriteItem(StrData, Index);
                    }
                }
                else
                {
                    RapidName.Value = StrData;
                }
                break;

            default:
                break;
            }
        }
예제 #2
0
        public void WriteData(List <RapidData> LRapidName, List <string> LRValue, int Index = 1, int Lindex = 1)
        {
            for (int i = 0; i < LRapidName.Count; i++)
            {
                switch (LRapidName[i].RapidType)
                {
                case "num":
                    Num NumData = new Num();
                    NumData.FillFromString(LRValue[i].ToString());
                    if (LRapidName[i].IsArray)
                    {
                        if (ArrayRank(LRapidName[i]) > 1)
                        {
                            LRapidName[i].WriteItem(NumData, Index, Lindex);
                        }
                        else
                        {
                            LRapidName[i].WriteItem(NumData, Index);
                        }
                    }
                    else
                    {
                        LRapidName[i].Value = NumData;
                    }
                    break;

                case "bool":
                    Bool BoolData = new Bool();
                    BoolData.FillFromString(LRValue[i].ToString());
                    if (LRapidName[i].IsArray)
                    {
                        if (ArrayRank(LRapidName[i]) > 1)
                        {
                            LRapidName[i].WriteItem(BoolData, Index, Lindex);
                        }
                        else
                        {
                            LRapidName[i].WriteItem(BoolData, Index);
                        }
                    }
                    else
                    {
                        LRapidName[i].Value = BoolData;
                    }
                    break;

                case "string":
                    ABB.Robotics.Controllers.RapidDomain.String StrData = new ABB.Robotics.Controllers.RapidDomain.String();
                    StrData.FillFromString(LRValue[i].ToString());
                    if (LRapidName[i].IsArray)
                    {
                        if (ArrayRank(LRapidName[i]) > 1)
                        {
                            LRapidName[i].WriteItem(StrData, Index, Lindex);
                        }
                        else
                        {
                            LRapidName[i].WriteItem(StrData, Index);
                        }
                    }
                    else
                    {
                        LRapidName[i].Value = StrData;
                    }
                    break;

                default:
                    break;
                }
            }
        }
예제 #3
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;
 }