top of page
private void btnConvert_Click(object sender, EventArgs e)
{
Robot robot = new Robot();
robot.RPC( "192.168.58.2");
DescPose pos1 = new DescPose(0, 0, 0, 0, 0, 0);
DescPose pos2 = new DescPose(0, 0, 0, 0, 0, 0);
pos1.tran.x = -351.175;
pos1.tran.y = 3.389;
pos1.tran.z = 431.172;
pos1.rpy.rx = -179.111;
pos1.rpy.ry = -0.241;
pos1.rpy.rz = 90.388;
pos2.tran.x = -333.654;
pos2.tran.y = -229.003;
pos2.tran.z = 404.335;
pos2.rpy.rx = -179.139;
pos2.rpy.ry = -0.779;
pos2.rpy.rz = 91.269;
int rtn = -1;
double[] cmp = new double[3] { 0, 9.99, 0};
rtn = robot.ConveyorCatchPointComp(cmp);
if(rtn != 0)
{
return;
}
Console.WriteLine($"ConveyorCatchPointComp: rtn {rtn}");
rtn = robot.MoveCart(pos1, 0, 0, 100.0f, 180.0f, 100.0f, -1.0f, -1);
Console.WriteLine($"MoveCart: rtn {rtn}");
rtn = robot.ConveyorIODetect(10000);
Console.WriteLine($"ConveyorIODetect: rtn {rtn}");
robot.ConveyorGetTrackData(1);
rtn = robot. ConveyorTrackStart(1);
Console.WriteLine($"ConveyorTrackStart: rtn {rtn}");
rtn = robot.ConveyorTrackMoveL( "cvrCatchPoint", 0, 0, 100.0f, 0.0f, 100.0f, -1.0f, 0, 0);
Console.WriteLine($"ConveyorTrackMoveL: rtn {rtn}");
rtn = robot.MoveGripper(1, 59, 43, 21, 30000, 0);
Console.WriteLine($"MoveGripper: rtn {rtn}");
rtn = robot.ConveyorTrackMoveL( "cvrRaisePoint", 0, 0, 100.0f, 0.0f, 100.0f, -1.0f, 0, 0);
Console.WriteLine($"ConveyorTrackMoveL: rtn {rtn}");
rtn = robot.ConveyorTrackEnd();
Console.WriteLine($"ConveyorTrackEnd: rtn {rtn}");
rtn = robot.MoveCart(pos2, 0, 0, 100.0f, 180.0f, 100.0f, -1.0f, -1);
Console.WriteLine($"MoveCart: rtn {rtn}");
rtn = robot.MoveGripper(1, 100, 43, 21, 30000, 0);
Console.WriteLine($"MoveGripper: rtn {rtn}");
}
11.35. End Sensor Configuration
/**
* @brief End Sensor Configuration
* @param [in] idCompany Manufacturer, 18-JUNKONG; 25-HUIDE
* @param [in] idDevice Type, 0-JUNKONG/RYR6T.V1.0
* @param [in] idSoftware Software version, 0-J1.0/HuiDe1.0 (not yet available)
* @param [in] idBus Mounting location, 1-End 1 port; 2-End 2 port... 8-Endpoint 8 port (not yet available)
* @return Error code
*/
int AxleSensorConfig(int idCompany, int idDevice, int idSoftware, int idBus);
11.36. Get endpoint sensor configuration
/**
* @brief Get terminal sensor configuration
* @param [out] idCompany Manufacturer, 18-JUNKONG; 25-HUIDE
* @param [out] idDevice Type, 0-JUNKONG/RYR6T.V1.0
* @return Error code
*/
int AxleSensorConfigGet(ref int idCompany, ref int idDevice);
11.37. End-of-line sensor activation
/**
* @brief End-of-line sensor activation
* @param [in] actFlag 0-reset; 1-activate
* @return Error code
*/
int AxleSensorActivate(int actFlag);
11.38. End Sensor Register Write
/**
* @brief End Sensor Register Write
* @param [in] devAddr Device Address Number 0-255
* @param [in] regHAddr High 8 bits of the register address
* @param [in] regLAddr Low 8 bits of the register address
* @param [in] regNum Number of registers 0-255
* @param [in] data1 Value to write to the register 1
* @param [in] data2 Value to write to the register 2
* @param [in] isNoBlock 0-blocking; 1-non-blocking
* @return Error code
*/
int AxleSensorRegWrite(int devAddr, int regHAddr, int regLAddr, int regNum, int data1, int data2, int isNoBlock);
11.39. End Sensor Code Example
private void button2_Click_1(object sender, EventArgs e)
{
robot.AxleSensorConfig(18, 0, 0, 1);
int company = -1;
int type = -1;
robot.AxleSensorConfigGet(ref company, ref type);
Console.WriteLine( "company is " + company + ", type is " + type);
int rtn = robot.AxleSensorActivate(1);
Console.WriteLine( "AxleSensorActivate rtn is " + rtn);
Thread.Sleep(1000);
rtn = robot.AxleSensorRegWrite(1, 4, 6, 1, 0, 0, 0);
Console.WriteLine( "AxleSensorRegWrite rtn is " + rtn);
}
11.40. Obtain robot peripheral protocol
New in version C#SDK-v1.0.6.
/**
* @brief Get robot peripheral protocol
* @param [out] protocol Robot peripheral protocol number 4096-Extended Axle Control Card; 4097-ModbusSlave; 4098-ModbusMaster
* @return Error code
*/
int GetExDevProtocol(ref int protocol);
11.41. Set robot peripheral protocol
New in version C#SDK-v1.0.6.
/**
* @brief Set robot peripheral protocol
* @param [in] protocol Robot peripheral protocol number 4096-Extended Axis Control Card; 4097-Modbus Slave; 4098-Modbus Master
* @return Error code
*/
int SetExDevProtocol(int protocol);
11.42. Example program for setting robot peripheral protocol
private void btnSetProto_Click(object sender, EventArgs e)
{
int protocol = 4096;
int rtn = robot.SetExDevProtocol(protocol);
Console.WriteLine( "SetExDevProtocol rtn " + rtn);
rtn = robot.GetExDevProtocol(ref protocol);
Console.WriteLine( "GetExDevProtocol rtn " + rtn + " protocol is: " + protocol);
}
11.43. Get end-point communication parameters
/**
* @brief Get terminal communication parameters
* @param param Terminal communication parameters
* @return Error code
*/
int GetAxleCommunicationParam(ref AxleComParam getParam);
11.44. Set terminal communication parameters
/**
* @brief Set terminal communication parameters
* @param param Terminal communication parameters
* @return Error code
*/
int SetAxleCommunicationParam(AxleComParam param);
11.45. Set terminal file transfer type
/**
* @brief Set the terminal file transfer type
* @param type 1-MCU upgrade file; 2-LUA file
* @return Error code
*/
int SetAxleFileType(int type);
bottom of page