/// <summary> /// Old Name: TCP_AutoSetting /// </summary> /// <param name="X"></param> /// <param name="Y"></param> /// <param name="Z"></param> /// <param name="W"></param> /// <param name="P"></param> /// <param name="R"></param> /// <param name="ToolSelected"></param> public void Pns0101SettingToolFrame(float X, float Y, float Z, float W, float P, float R, int ToolSelected) { try { var CurRobotInfo = this.GetCurrRobotInfo(); int UT_Selected = ToolSelected; int[] intValues = new int[1]; bool a; Array xyzwprArray = new float[9]; Array ConfigArray = new short[7]; Array JointArray = new float[9]; xyzwprArray.SetValue(X, 0); //X_distance xyzwprArray.SetValue(Y, 1); //Y_distance xyzwprArray.SetValue(Z, 2); //Z_distance xyzwprArray.SetValue(W, 3); //W_orientation xyzwprArray.SetValue(P, 4); //P_orientation xyzwprArray.SetValue(R, 5); //R_orientation //ConfigArray.SetValue((short)0, 0); //for Index 0 //ConfigArray.SetValue((short)0, 1); //for Index 0 //ConfigArray.SetValue((short)0, 2); //ConfigArray.SetValue((short)0, 3); //ConfigArray.SetValue((short)0, 4); //for Index 0 //ConfigArray.SetValue((short)0, 5); //ConfigArray.SetValue((short)0, 6); this.SetPosRegXyzWpr(1, CurRobotInfo.PosReg, 9, (short)UT_Selected); //Write to PR[1] this.SetRegIntValue(11, UT_Selected); //Set R[11]. Selects TCP number this.SetRegIntValue(10, 1); //Set R[10]. R[10] set to 1 to setting TCP then back to LBL[1] for (int i = 0; i < 1; i++) { intValues[i] = 1; } mobjNumReg.SetValues(1, intValues, 1); //Start to trigger TPE } catch (Exception) { //Log.GetInstance().Write(ex); } }
public void WriteRegValues(int index, int[] vals) { lock (this) mobjNumReg.SetValues(index, vals, vals.Length); }
public void TCP_AutoSetting(float X, float Y, float Z, float W, float P, float R, int ToolSelected) { try { #region code int UT_Selected = ToolSelected; int[] intValues = new int[1]; bool a; Array xyzwprArray = new float[9]; Array ConfigArray = new short[7]; Array JointArray = new float[9]; xyzwprArray.SetValue(X, 0); //X_distance xyzwprArray.SetValue(Y, 1); //Y_distance xyzwprArray.SetValue(Z, 2); //Z_distance xyzwprArray.SetValue(W, 3); //W_orientation xyzwprArray.SetValue(P, 4); //P_orientation xyzwprArray.SetValue(R, 5); //R_orientation //ConfigArray.SetValue((short)0, 0); //for Index 0 //ConfigArray.SetValue((short)0, 1); //for Index 0 //ConfigArray.SetValue((short)0, 2); //ConfigArray.SetValue((short)0, 3); //ConfigArray.SetValue((short)0, 4); //for Index 0 //ConfigArray.SetValue((short)0, 5); //ConfigArray.SetValue((short)0, 6); a = mobjPosReg.SetValueXyzwpr(1, ref xyzwprArray, ref CurRobotInfo.configArray, 9, (short)UT_Selected); //Write to PR[1] for (int i = 0; i < 1; i++) { intValues[i] = UT_Selected; } mobjNumReg.SetValues(11, intValues, 1); //Set R[11]. Selects TCP number for (int i = 0; i < 1; i++) { intValues[i] = 1; } mobjNumReg.SetValues(10, intValues, 1); //Set R[10]. R[10] set to 1 to setting TCP then back to LBL[1] for (int i = 0; i < 1; i++) { intValues[i] = 1; } mobjNumReg.SetValues(1, intValues, 1); //Start to trigger TPE #endregion code } catch (Exception) { //Log.GetInstance().Write(ex); } }