top of page
New in version C#SDK-v1.0.7.
/**
* @brief UDP extended axis jog start
* @param [in] axisID Axis number [1-4]
* @param [in] direction Rotation direction 0-reverse; 1-forward
* @param [in] vel Speed (mm/s)
* @param [in] acc Acceleration (mm/s2)
* @param [in] maxDistance Maximum jog distance
* @return Error code
*/
int ExtAxisStartJog(int axisID, int direction, double vel, double acc, double maxDistance);
13.29. UDP extended axis jog stop
New in version C#SDK-v1.0.7.
/**
* @brief UDP extended axis jog stop
* @param [in] axisID axis ID[1-4]
* @return Error code
*/
int ExtAxisStopJog(int axisID);
13.30. UDP extended axis configuration and jog code example
private void btnJog_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);
rtn = robot.ExtAxisSetHoming(1, 0, 10, 2);
Console.WriteLine("ExtAxisSetHoming 1 rtnn is " + rtn);
Thread.Sleep(2000);
rtn = robot.ExtAxisSetHoming(2, 0, 10, 2);
Console.WriteLine("ExtAxisSetHoming 2 rtnn is " + rtn);
Thread.Sleep(4000);
rtn = robot.SetRobotPosToAxis(1);
Console.WriteLine("SetRobotPosToAxis rtn is " + rtn);
rtn = robot.SetAxisDHParaConfig(10, 20, 0, 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 2 rtn is " + rtn);
Thread.Sleep(3000);
robot.ExtAxisStartJog(1, 0, 10, 10, 30);
Thread.Sleep(1000);
robot.ExtAxisStopJog(1);
Thread.Sleep(3000);
robot.ExtAxisServoOn(1, 0);
Thread.Sleep(3000);
robot.ExtAxisStartJog(2, 0, 10, 10, 30);
Thread.Sleep(1000);
robot.ExtAxisStopJog(2);
Thread.Sleep(3000);
robot.ExtAxisServoOn(2, 0);
Thread.Sleep(3000);
robot.ExtDevUnloadUDPDriver();
}
bottom of page