top of page
/**
* @brief Waiting for wire seek to complete.
* @return Error code.
*/
int WireSearchWait(string name).
14.60. Write wire search contact to database.
/**
* @brief Welding wire seek contacts written to database.
* @param [in] varName Contact name "RES0" ~ "RES99".
* @param [in] pos contact data [x, y, x, a, b, c]
* @return Error Code
*/
int SetPointToDatabase(string varName, DescPose pos);
14.61. Robot Welding Wire Position Finding Code Example
private void button53_Click(object sender, EventArgs e)
{
DescPose toolCoord=new DescPose(0, 0, 200, 0, 0, 0);
robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);
DescPose wobjCoord=new DescPose(0, 0, 0, 0, 0, 0);
robot.SetWObjCoord(1, wobjCoord, 0);
int rtn0, rtn1, rtn2 = 0;
ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
DescPose descStart = new DescPose(216.543, 445.175, 93.465, 179.683, 1.757, -112.641);
JointPos jointStart = new JointPos(-128.345, -86.660, 114.679, -119.625, -89.219, 74.303);
DescPose descEnd = new DescPose(111.143, 523.384, 87.659, 179.703, 1.835, -97.750);
JointPos jointEnd = new JointPos(-113.454, -81.060, 109.328, -119.954, -89.218, 74.302);
robot.MoveL(jointStart, descStart, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese);
robot.MoveL(jointEnd, descEnd, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese);
DescPose descREF0A = new DescPose(142.135, 367.604, 86.523, 179.728, 1.922, -111.089);
JointPos jointREF0A = new JointPos(-126.794, -100.834, 128.922, -119.864, -89.218, 74.302);
DescPose descREF0B = new DescPose(254.633, 463.125, 72.604, 179.845, 2.341, -114.704);
JointPos jointREF0B = new JointPos(-130.413, -81.093, 112.044, -123.163, -89.217, 74.303);
DescPose descREF1A = new DescPose(92.556, 485.259, 47.476, -179.932, 3.130, -97.512);
JointPos jointREF1A = new JointPos(-113.231, -83.815, 119.877, -129.092, -89.217, 74.303);
DescPose descREF1B = new DescPose(203.103, 583.836, 63.909, 179.991, 2.854, -103.372);
JointPos jointREF1B = new JointPos(-119.088, -69.676, 98.692, -121.761, -89.219, 74.303);
rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
robot.MoveL(jointREF0A, descREF0A, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese); //起点
robot.MoveL(jointREF0B, descREF0B, 1, 1, 100, 100, 100, -1, exaxisPos, 1, 0, offdese); //方向点
rtn1 = robot.WireSearchWait("REF0");
rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
robot.MoveL(jointREF1A, descREF1A, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese); //起点
robot.MoveL(jointREF1B, descREF1B, 1, 1, 100, 100, 100, -1, exaxisPos, 1, 0, offdese); //方向点
rtn1 = robot.WireSearchWait("REF1");
rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
robot.MoveL(jointREF0A, descREF0A, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese); //起点
robot.MoveL(jointREF0B, descREF0B, 1, 1, 100, 100, 100, -1, exaxisPos, 1, 0, offdese); //方向点
rtn1 = robot.WireSearchWait("RES0");
rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
rtn0 = robot.WireSearchStart(0, 10, 100, 0, 10, 100, 0);
robot.MoveL(jointREF1A, descREF1A, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese); //起点
robot.MoveL(jointREF1B, descREF1B, 1, 1, 100, 100, 100, -1, exaxisPos, 1, 0, offdese); //方向点
rtn1 = robot.WireSearchWait("RES1");
rtn2 = robot.WireSearchEnd(0, 10, 100, 0, 10, 100, 0);
string[] varNameRef = { "REF0", "REF1", "#", "#", "#", "#" };
string[] varNameRes = { "RES0", "RES1", "#", "#", "#", "#" };
int offectFlag = 0;
DescPose offectPos = new DescPose(0, 0, 0, 0, 0, 0);
rtn0 = robot.GetWireSearchOffset(0, 0, varNameRef, varNameRes, ref offectFlag, ref offectPos);
robot.PointsOffsetEnable(0, offectPos);
robot.MoveL(jointStart, descStart, 1, 1, 100, 100, 100, -1, exaxisPos, 0, 0, offdese);
robot.MoveL(jointEnd, descEnd, 1, 1, 100, 100, 100, -1, exaxisPos, 1, 0, offdese);
robot.PointsOffsetDisable();
}
bottom of page