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); } }
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(); } }
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(); } }
private void StartProduction() { try { if (controller.OperatingMode == ControllerOperatingMode.Auto) { ABB.Robotics.Controllers.RapidDomain.RapidData rd = controller.Rapid.GetRapidData("T_ROB1", "Module1", "Target_20"); using (Mastership m = Mastership.Request(controller.Rapid)) { //ABB.Robotics.Controllers.RapidDomain.RobTarget robtarget = new ABB.Robotics.Controllers.RapidDomain.RobTarget(); ABB.Robotics.Controllers.RapidDomain.Pos postarget = new ABB.Robotics.Controllers.RapidDomain.Pos(); postarget.X = CameraCapture.armtargetx; postarget.Y = CameraCapture.armtargety; postarget.Z = CameraCapture.rtz; //robtarget.FillFromString2("[[x,0,0],[0.350268087,-0.408874117,0.842669585,-0.006495725],[1,-1,1,0],[9E9,9E9,9E9,9E9,9E9,9E9]]"); //robtarget.Trans.X = CameraCapture.rtx; //robtarget.Trans.Y = CameraCapture.rty; //robtarget.Trans.Z = CameraCapture.rtz; //robtarget.Rot.Q1 = 0.350268087; //robtarget.Rot.Q2 = -0.408874117; //robtarget.Rot.Q3 = 0.842669585; //robtarget.Rot.Q4 = -0.00649572; //robtarget.Extax.Eax_a = 1; //robtarget.Extax.Eax_b = -1; //robtarget.Extax.Eax_c = 1; //robtarget.Extax.Eax_d = 0; //rd.Value = robtarget; this.controller.Rapid.Start(); } } else { MessageBox.Show("Automatic mode is required to start execution from a remote client."); } } catch (System.InvalidOperationException ex) { MessageBox.Show("Mastership is held by another client. " + ex.Message); } catch (System.Exception ex) { MessageBox.Show("Unexpected error occurred: " + ex.Message); } //set targetfound to false CameraCapture.targetfound = false; }
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); } }