top of page
New in version C#SDK-v1.0.7.
/**
* @brief Set extended axis coordinate system reference point - four-point method
* @param [in] pointNum Point number [1-4]
* @return Error code
*/
int ExtAxisSetRefPoint(int pointNum);
13.32. Calculate extended axis coordinate system - four-point method
New in version C#SDK-v1.0.7.
/**
* @brief Calculate extended axis coordinate system - four-point method
* @param [out] coord Coordinate system value
* @return Error code
*/
int ExtAxisComputeECoordSys(DescPose& coord);
13.33. Apply extended axis coordinate system
New in version C#SDK-v1.0.7.
/**
* @brief Apply extended axis coordinate system
* @param [in] applyAxisId Extended axis ID bit0-bit3 correspond to extended axis ID 1-4. For example, if extended axes 1 and 3 are applied, the value is 0b 0000 0101, which is 5
* @param [in] axisCoordNum Extended axis coordinate system ID
* @param [in] coord Coordinate system value
* @param [in] calibFlag Calibration flag 0-no, 1-yes
* @return Error code
*/
int ExtAxisActiveECoordSys(int applyAxisId, int axisCoordNum, DescPose coord, int calibFlag);
13.34. Set the calibration reference point in the end coordinate system of the positioner
New in version C#SDK-v1.0.7.
/**
* @brief Set the calibration reference point in the end position coordinate system of the positioner
* @param [in] pos Position value
* @return Error code
*/
int SetRefPointInExAxisEnd(DescPose pos);
13.35. Set the reference point of the positioner coordinate system
New in version C#SDK-v1.0.7.
/**
* @brief Set the reference point in the positioner coordinate system
* @param [in] pointNum Point number [1-4]
* @return Error code
*/
int PositionorSetRefPoint(int pointNum);
13.36. Positioner coordinate system calculation - four-point method
New in version C#SDK-v1.0.7.
/**
* @brief Positioner coordinate system calculation - four-point method
* @param [out] coord Coordinate system value
* @return Error code
*/
int PositionorComputeECoordSys(DescPose& coord);
13.37. Get extended axis coordinate system
New in version C#SDK-V1.1.3: Web-3.8.2
/**
* @brief Get extended axis coordinate system
* @param [out] coord Extended axis coordinate system
* @return Error code
*/
int ExtAxisGetCoord(ref DescPose coord);
13.38. Extended axis coordinate system calibration code example
New in version C#SDK-V1.1.3: Web-3.8.2
private void button66_Click(object sender, EventArgs e)
{
int rtn = robot.ExtDevSetUDPComParam("192.168.58.88", 2021, 2, 100, 3, 200, 1, 100, 5,1);
Console.WriteLine("ExtDevSetUDPComParam rtn is " + rtn);
string ip = ""; int port = 0; int period = 0; int lossPkgTime = 0; int lossPkgNum = 0; int disconnectTime = 0; int reconnectEnable = 0; int reconnectPeriod = 0; int reconnectNum = 0;
rtn = robot.ExtDevGetUDPComParam(ref ip, ref port, ref period, ref lossPkgTime, ref lossPkgNum, ref disconnectTime, ref reconnectEnable, ref reconnectPeriod, ref reconnectNum);
string param = "\nip " + ip + "\nport " + port.ToString() + "\nperiod " + period.ToString() + "\nlossPkgTime " + lossPkgTime.ToString() + "\nlossPkgNum " + lossPkgNum.ToString() + "\ndisConntime " + disconnectTime.ToString() + "\nreconnecable " + reconnectEnable.ToString() + "\nreconnperiod " + reconnectPeriod.ToString() + "\nreconnnun " + reconnectNum.ToString();
Console.WriteLine("ExtDevGetUDPComParam rtn is " + rtn + param);
robot.ExtDevLoadUDPDriver();
rtn = robot.ExtAxisServoOn(1, 1);
Console.WriteLine("ExtAxisServoOn axis id 1 rtn is " + rtn);
rtn = robot.ExtAxisServoOn(2, 1);
Console.WriteLine("ExtAxisServoOn axis id 2 rtn is " + rtn);
Thread.Sleep(2000);
robot.ExtAxisSetHoming(1, 0, 10, 2);
Thread.Sleep(2000);
rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
Console.WriteLine("ExtAxisSetHoming rtnn is " + rtn);
Thread.Sleep(4000);
rtn = robot.SetRobotPosToAxis(1);
Console.WriteLine("SetRobotPosToAxis rtn is " + rtn);
rtn = robot.SetAxisDHParaConfig(1, 128.5f, 206.4f, 0, 0, 0, 0, 0, 0);
Console.WriteLine("SetAxisDHParaConfig rtn is " + rtn);
rtn = robot.ExtAxisParamConfig(1, 1, 1, 1000, -1000, 1000, 1000, 1.905f, 262144, 200, 1, 0, 0);
Console.WriteLine("ExtAxisParamConfig axis 1 rtn is " + rtn);
rtn = robot.ExtAxisParamConfig(2, 1, 1, 1000, -1000, 1000, 1000, 4.444f, 262144, 200, 1, 0, 0);
Console.WriteLine("ExtAxisParamConfig axis 1 rtn is " + rtn);
DescPose toolCoord = new DescPose(0, 0, 210, 0, 0, 0);
robot.SetToolCoord(1, toolCoord, 0, 0, 1, 0);
JointPos jSafe = new JointPos(115.193f, -96.149f, 92.489f, -87.068f, -89.15f, -83.488f);
JointPos j1 = new JointPos(117.559f, -92.624f, 100.329f, -96.909f, -94.057f, -83.488f);
JointPos j2 = new JointPos(112.239f, -90.096f, 99.282f, -95.909f, -89.824f, -83.488f);
JointPos j3 = new JointPos(110.839f, -83.473f, 93.166f, -89.22f, -90.499f, -83.487f);
JointPos j4 = new JointPos(107.935f, -83.572f, 95.424f, -92.873f, -87.933f, -83.488f);
DescPose descSafe = new DescPose();
DescPose desc1 = new DescPose();
DescPose desc2 = new DescPose();
DescPose desc3 = new DescPose();
DescPose desc4 = new DescPose();
ExaxisPos exaxisPos = new ExaxisPos(0, 0, 0, 0);
DescPose offdese = new DescPose(0, 0, 0, 0, 0, 0);
robot.GetForwardKin( jSafe, ref descSafe);
robot.MoveJ( jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
Thread.Sleep(2000);
robot.GetForwardKin( j1, ref desc1);
robot.MoveJ( j1, desc1, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
Thread.Sleep(2000);
DescPose actualTCPPos = new DescPose();
robot.GetActualTCPPose(0, ref actualTCPPos);
robot.SetRefPointInExAxisEnd(actualTCPPos);
rtn = robot.PositionorSetRefPoint(1);
Console.WriteLine("PositionorSetRefPoint 1 rtn is " + rtn);
Thread.Sleep(2000);
robot.MoveJ( jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.ExtAxisStartJog(1, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.ExtAxisStartJog(2, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.GetForwardKin( j2, ref desc2);
rtn = robot.MoveJ( j2, desc2, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
rtn = robot.PositionorSetRefPoint(2);
Console.WriteLine("PositionorSetRefPoint 2 rtn is " + rtn);
Thread.Sleep(2000);
robot.MoveJ( jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.ExtAxisStartJog(1, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.ExtAxisStartJog(2, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.GetForwardKin( j3, ref desc3);
robot.MoveJ( j3, desc3, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
rtn = robot.PositionorSetRefPoint(3);
Console.WriteLine("PositionorSetRefPoint 3 rtn is " + rtn);
Thread.Sleep(2000);
robot.MoveJ( jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
robot.ExtAxisStartJog(1, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.ExtAxisStartJog(2, 0, 50, 50, 10);
Thread.Sleep(1000);
robot.GetForwardKin(j4, ref desc4);
robot.MoveJ(j4, desc4, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
rtn = robot.PositionorSetRefPoint(4);
Console.WriteLine("PositionorSetRefPoint 4 rtn is " + rtn);
Thread.Sleep(2000);
DescPose axisCoord = new DescPose();
robot.PositionorComputeECoordSys(ref axisCoord);
robot.MoveJ(jSafe, descSafe, 1, 0, 100, 100, 100, exaxisPos, -1, 0, offdese);
Console.WriteLine("PositionorComputeECoordSys rtn is {0} {1} {2} {3} {4} {5}", axisCoord.tran.x, axisCoord.tran.y, axisCoord.tran.z, axisCoord.rpy.rx, axisCoord.rpy.ry, axisCoord.rpy.rz);
rtn = robot.ExtAxisActiveECoordSys(3, 1, axisCoord, 1);
Console.WriteLine("ExtAxisActiveECoordSys rtn is " + rtn);
}
13.39. Extended axis motion via UDP
New in version C#SDK-V1.1.5: Web-3.8.4
/**
* @brief Extended axis motion via UDP
* @param [in] pos Target position
* @param [in] ovl Speed percentage
* @param [in] blend Smoothing parameter (mm or ms)
* @return Error code
*/
int ExtAxisMove(ExaxisPos pos, double ovl, double blend=-1);
13.40. UDP extended axis movement code example
private void button66_Click(object sender, EventArgs e)
{
ExaxisPos axisPos;
axisPos.ePos[0] = 20;
axisPos.ePos[1] = 0;
axisPos.ePos[2] = 0;
axisPos.ePos[3] = 0;
robot.ExtAxisMove(axisPos, 50);
}
bottom of page