top of page
/**
* @brief Enable LUA execution at the end
* @param enable 0-Disabled; 1-Enabled
* @return Error code
*/
int SetAxleLuaEnable(int enable);
11.47. End LUA file exception error recovery
/**
* @brief End-of-file LUA file exception error recovery
* @param status 0-do not recover; 1-recover
* @return Error code
*/
int SetRecoverAxleLuaErr(int status);
11.48. Get the enable status of the terminal LUA execution
/**
* @brief Get the enable status of the terminal LUA execution
* @param [out] status 0-disabled; 1-enabled
* @return Error code
*/
int GetAxleLuaEnableStatus(ref int status);
11.49. Set the enable type of the terminal LUA terminal device
/**
* @brief Set the enable type of the terminal LUA terminal device
* @param [in] forceSensorEnable Force sensor enable status, 0-disabled; 1-enabled
* @param [in] gripperEnable Gripper enable status, 0-disabled; 1-enabled
* @param [in] IOEnable IO device enable status, 0-disabled; 1-enabled
* @return Error code
*/
int SetAxleLuaEnableDeviceType(int forceSensorEnable, int gripperEnable, int IOEnable);
11.50. Get the enable type of the end-of-line LUA device
/**
* @brief Get the enable type of the end LUA device
* @param [out] forceSensorEnable Force sensor enable status, 0-disabled; 1-enabled
* @param [out] gripperEnable Gripper enable status, 0-disabled; 1-enabled
* @param [out] IOEnable IO device enable status, 0-disabled; 1-enabled
* @return Error code
*/
int GetAxleLuaEnableDeviceType(ref int forceSensorEnable, ref int gripperEnable, ref int IOEnable);
11.51. Get the currently configured end device
/**
* @brief Get the currently configured end device
* @param [out] forceSensorEnable Force sensor enable device number 0-disabled; 1-enabled
* @param [out] gripperEnable Gripper enable device number, 0-disabled;1-enabled
* @param [out] IODeviceEnable IO device enable ID, 0-disabled; 1-enabled
* @return Error code
*/
int GetAxleLuaEnableDevice(ref int[] forceSensorEnable, ref int[] gripperEnable, ref int[] IODeviceEnable);
11.52. Set enable gripper action control functionality
/**
* @brief Set enable claw action control function
* @param [in] id claw device number
* @param [in] func func[0]-claw enable; func[1]-claw initialization; 2-position setting;3-Set speed; 4-Set torque; 6-Read gripper status; 7-Read initialization status; 8-Read fault code; 9-Read position; 10-Read speed;11-read torque
* @return Error code
*/
int SetAxleLuaGripperFunc(int id, int[] func);
11.53. Get enable claw action control function
/**
* @brief Get enable claw action control function
* @param [in] id Gripper device ID
* @param [out] func func[0]-Gripper enable; func[1]-Gripper initialization; 2-Position setting; 3-Speed setting; 4-Torque setting; 6-Read gripper status; 7-Read initialization status; 8-Read fault code; 9-Read position; 10-Read speed; 11-Read torque
* @return Error code
*/
int GetAxleLuaGripperFunc(int id, ref int[] func);
11.54. Writing robot Ethercat slave file
/**
* @brief Writing robot Ethercat slave file
* @param [in] type Slave file type, 1-upgrade slave file; 2-upgrade slave configuration file
* @param [in] slaveID Slave ID
* @param [in] fileName Upload file name
* @return Error code
*/
int SlaveFileWrite(int type, int slaveID, string fileName);
11.55. Upload terminal Lua open protocol file
/**
* @brief Upload end Lua open protocol file
* @param filePath Local lua file path name ".../AXLE_LUA_End_DaHuan.lua"
* @return Error code
*/
int AxleLuaUpload(string filePath);
11.56. Robot Ethercat slave enters boot mode
/**
* @brief Robot Ethercat slave enters boot mode
* @return Error code
*/
int SetSysServoBootMode();
11.57. Robot End-of-Arm LUA File Operation Code Example
private void button41_Click(object sender, EventArgs e)
{
ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
robot.AxleLuaUpload("D://zUP/AXLE_LUA_End_JunDuo_Xinjingcheng.lua");
AxleComParam param = new AxleComParam(7, 8, 1, 0, 5, 3, 1);
robot.SetAxleCommunicationParam(param);
AxleComParam getParam = new AxleComParam();
robot.GetAxleCommunicationParam(ref getParam);
Console.WriteLine("GetAxleCommunicationParam param is {0} {1} {2} {3} {4} {5} {6}",
getParam.baudRate, getParam.dataBit, getParam.stopBit, getParam.verify,
getParam.timeout, getParam.timeoutTimes, getParam.period);
robot.SetAxleLuaEnable(1);
int luaEnableStatus = 0;
robot.GetAxleLuaEnableStatus(ref luaEnableStatus);
robot.SetAxleLuaEnableDeviceType(0, 1, 0);
int forceEnable = 0;
int gripperEnable = 0;
int ioEnable = 0;
robot.GetAxleLuaEnableDeviceType(ref forceEnable, ref gripperEnable, ref ioEnable);
Console.WriteLine("GetAxleLuaEnableDeviceType param is {0} {1} {2}", forceEnable, gripperEnable, ioEnable);
int[] func = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
robot.SetAxleLuaGripperFunc(1, func);
int[] getFunc = new int[16];
robot.GetAxleLuaGripperFunc(1, ref getFunc);
int[] getforceEnable = new int[16];
int[] getgripperEnable = new int[16];
int[] getioEnable = new int[16];
robot.GetAxleLuaEnableDevice(ref getforceEnable, ref getgripperEnable, ref getioEnable);
Console.WriteLine("\ngetforceEnable status : ");
foreach (int i in getforceEnable)
{
Console.Write(i + ",");
}
Console.WriteLine("\ngetgripperEnable status : ");
foreach (int i in getgripperEnable)
{
Console.Write(i + ",");
}
Console.WriteLine("\ngetioEnable status : ");
foreach (int i in getioEnable)
{
Console.Write(i + ",");
}
Console.WriteLine();
robot.ActGripper(1, 0);
Thread.Sleep(2000);
robot.ActGripper(1, 1);
Thread.Sleep(2000);
robot.MoveGripper(1, 90, 10, 100, 50000, 0, 0, 0, 0, 0);
int pos = 0;
while (true)
{
robot.GetRobotRealTimeState(ref pkg);
Console.WriteLine("gripper pos is " + pkg.gripper_position);
Thread.Sleep(100);
}
}
11.58. Get SmartTool button status
New in version C#SDK-V1.1.3: Web-3.8.2
/**
* @brief Get SmartTool button status
* @param [out] state SmartTool handle button status; (bit0: 0 - communication normal; 1 - communication disconnected; bit1 - cancel operation; bit2 - clear program;
bit3 - A key; bit4 - B key; bit5 - C key; bit6 - D key; bit7 - E key; bit8 - IO key; bit9 - manual/automatic; bit10 - start)
* @return Error code
*/
int GetSmarttoolBtnState(ref int state);
11.59. Code example
New in version C#SDK-V1.1.3: Web-3.8.2
private void button11_Click(object sender, EventArgs e)
{
ROBOT_STATE_PKG pkg = new ROBOT_STATE_PKG();
int state = 0;
while (true)
{
int rtn = robot.GetSmarttoolBtnState(ref state);
string binaryString = Convert.ToString(state, 2).PadLeft(32, '0');
Console.WriteLine($"GetSmarttoolBtnState rtn (binary): {binaryString}");
Thread.Sleep(100);
}
}
11.60. Upload Open Protocol Lua File
New in version C#SDK-V1.1.7: Web-3.8.5
/**
* @brief Upload Open Protocol Lua File
* @param filePath Local open protocol lua file path name
* @return Error code
*/
public int OpenLuaUpload(String filePath)
11.61. Get Slave Board Parameters
New in version C#SDK-V1.1.7: Web-3.8.5
/**
* @brief Get Slave Board Parameters
* @param type 0-Ethercat, 1-CClink, 3-Ethercat, 4-EIP
* @param version Protocol version
* @param connState 0-Disconnected 1-Connected
* @return Error code
*/
public int GetFieldBusConfig(int[] type, int[] version, int[] connState)
11.62. Write Slave DO
New in version C#SDK-V1.1.7: Web-3.8.5
/**
* @brief Write Slave DO
* @param DOIndex DO number
* @param wirteNum Number to write
* @param status Value to write, max 8
* @return Error code
*/
public int FieldBusSlaveWriteDO(int DOIndex, int wirteNum, int[] status)
11.63. Write Slave AO
New in version C#SDK-V1.1.7: Web-3.8.5
/**
* @brief Write Slave AO
* @param AOIndex AO number
* @param wirteNum Number to write
* @param status Value to write, max 8
* @return Error code
*/
public int FieldBusSlaveWriteAO(int AOIndex, int wirteNum, int[] status)
bottom of page