07-08-2022, 01:09 am
我希望通过使用c# RoboDK API来修改RoboDK中的现有程序。我发现我可以使用InstructionList函数调用获得指令列表(尽管指令类型似乎与INS_TYPE_*定义不一致)。我希望在程序中的某个位置添加一个新的指令,虽然似乎有一种设置运动指令的方法,但API似乎不完整,无法添加其他类型的指令。我的第一个目标是添加一组速度命令来改变程序的速度,但这似乎是不可用的。setInstruction似乎只允许移动命令的参数。您能否提供如何通过API将其他命令插入到现有程序中(例如,在程序中途更改速度)的见解?
public void setInstruction(int ins_id, string name, int insttype, int movetype, bool isjointttarget, Mat target, double[]关节)
{
link._check_connection ();
link._send_Line(“Prog_SIns”);
link._send_Item(这个);
link._send_Int (ins_id);
link._send_Line(名称);
link._send_Int (instype);
if (insttype == INS_TYPE_MOVE)
{
link._send_Int (movetype);
链接。_send_Int (isjointtarget ?1: 0);
link._send_Pose(目标);
link._send_Array(关节);
}
link._check_status ();
}
public void setInstruction(int ins_id, string name, int insttype, int movetype, bool isjointttarget, Mat target, double[]关节)
{
link._check_connection ();
link._send_Line(“Prog_SIns”);
link._send_Item(这个);
link._send_Int (ins_id);
link._send_Line(名称);
link._send_Int (instype);
if (insttype == INS_TYPE_MOVE)
{
link._send_Int (movetype);
链接。_send_Int (isjointtarget ?1: 0);
link._send_Pose(目标);
link._send_Array(关节);
}
link._check_status ();
}