API 说明 ============================ Denso 工控机主控支持的 API ++++++++++++++++++++++++++++++++++++++++++ +--------+-------------------------+----------+ | 指令号 | 命令 | 支持情况 | +========+=========================+==========+ | 100 | 获取机械臂程序版本号 | 支持 | +--------+-------------------------+----------+ | 101 | 发送速度数据 | 支持 | +--------+-------------------------+----------+ | 102 | 发送加速度数据 | 支持 | +--------+-------------------------+----------+ | 103 | 发送圆滑过渡参数 | 支持 | +--------+-------------------------+----------+ | 104 | 发送工具坐标系(TCP)参数 | 支持 | +--------+-------------------------+----------+ | 105 | 设置数字量输出 | 支持 | +--------+-------------------------+----------+ | 106 | SetJointsMovej | 支持 | +--------+-------------------------+----------+ | 107 | SetCartMovel | 支持 | +--------+-------------------------+----------+ | 108 | SetJoinsMovel | 支持 | +--------+-------------------------+----------+ | 109 | SetCartMovej | 支持 | +--------+-------------------------+----------+ | 110 | MovejSequence | 支持 | +--------+-------------------------+----------+ | 111 | MovelSequence | 支持 | +--------+-------------------------+----------+ | 112 | SetJointsMovejDo | 不支持 | +--------+-------------------------+----------+ | 113 | SetCartMovelDo | 不支持 | +--------+-------------------------+----------+ | 114 | SetJointsMovelDo | 不支持 | +--------+-------------------------+----------+ | 115 | SetJointsMovejGroupDo | 不支持 | +--------+-------------------------+----------+ | 116 | SetCartMovelGroupDo | 不支持 | +--------+-------------------------+----------+ | 117 | SetJointsMovelGroupDo | 不支持 | +--------+-------------------------+----------+ | 118 | MovelUntil | 不支持 | +--------+-------------------------+----------+ | 119 | 获取数字量输入状态 | 支持 | +--------+-------------------------+----------+ | 120 | 获取数字量输出状态 | 支持 | +--------+-------------------------+----------+ | 121 | 获取模拟量输入口数值 | 不支持 | +--------+-------------------------+----------+ | 122 | 获取机械臂当前角度 | 支持 | +--------+-------------------------+----------+ | 123 | 获取机械臂当前位姿 | 支持 | +--------+-------------------------+----------+ | 200 | 机械臂后台发送状态 | 支持 | +--------+-------------------------+----------+ Denso 机械臂主控支持的 API +++++++++++++++++++++++++++++++++++ denso 支持传入变量传出。在 denso 的编程语言(PacScript)中数组下标从零开始。 通过 Dim 指令生成数组时,需要在变量处填写的数值为数组长度减一。例如:Dim aaa(3) As Integer 则表示声明一个长度为4的整数型数组。 .. function:: Sub xyzMasterConnect() :noindex: 连接到工控机 .. function:: Function xyzSwitchTask(task_codename As String) As Integer :noindex: 切换应用 :param task_codename: 应用名称 :type task_codename: String :return: err_code :rtype: Integer .. function:: Function xyzSwitchTool(tool_id As Integer) As Integer :noindex: 切换工具 :param tool_id: 工具编号 :type tool_id: Integer :return: err_code :rtype: Integer .. function:: Function xyzCallVisionCmd(vs_id As Integer, vision_codename As String) As Integer :noindex: 呼叫视觉 :param vs_id: 视觉服务id :type vs_id: Integer :param vision_codename: 呼叫视觉的指令名称 :type vision_codename: String :return: err_code :rtype: Integer .. function:: Function xyzReqGraspPose(vs_id As Integer, ByRef token As Integer) As Integer :noindex: 请求抓取位姿 :param vs_id: 需要获取抓取点位的工作空间id :type vs_id: Integer :param token: 返回的用于获取目标点位时使用的token :type token: Integer :return: err_code :rtype: Integer .. function:: Function xyzGetGraspPose(token As Integer, ByRef num As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef grasp_pose As Position, ByRef out_ints(5) As Integer) As Integer :noindex: 获取抓取位姿 :param token: 求抓取目标点位时返回的token :type token: Integer :param num: 可供抓取的点数量 :type num: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param grasp_pose: 抓取位姿 :type grasp_pose: Position :param out_ints(5): 可以task中自定义含义 :type out_ints(5): Array of Integer :return: err_code :rtype: Integer .. function:: Function xyzReqObjPose(vs_id As Integer, ByRef token As Integer) As Integer :noindex: 请求物体位姿 :param vs_id: 需要获取物体位姿的工作空间id :type vs_id: Integer :param token: 物体位姿识别的token :type token: Integer :return: err_code :rtype: Integer .. function:: Function xyzGetObjPose(token As Integer, ByRef num As Integer, ByRef obj_pose As Position, ByRef object_name As String, ByRef out_ints(5) As Integer) As Integer :noindex: 获取物体位姿 :param token: 请求物体位姿时得到的token :type token: Integer :param num: 物体数量 :type num: Integer :param obj_pose: 物体位姿 :type obj_pose: Position :param object_name: 当前返回的物体 pose 类型 :type object_name: String :return: err_code :rtype: Integer .. function:: Function xyzResetTask() As Integer :noindex: 重置任务 :return: err_code :rtype: Integer .. function:: Function xyzSendCurrentJoints(cur_jnt As Joint) As Integer :noindex: 发送机械臂当前角度:j1~j6: 机械臂当前的角度信息,如果机械臂轴数小于6轴,则需要对应位置补零,依旧发送六个数。 :return: err_code :rtype: Integer .. function:: Function xyzSendCurrentCartPose(cur_pos As Position) As Integer :noindex: 发送机械臂法兰当前位姿 :return: err_code :rtype: Integer .. function:: Function xyzSendCurrentExtJoints() As Integer :noindex: 发送机械臂外部轴角度信息 :return: err_code :rtype: Integer .. function:: Function xyzReqPickPlace(vs_id As Integer) As Integer :noindex: 请求抓放规划 :param vs_id: 请求规划的工作空间id :type vs_id: Integer :return: err_code :rtype: Integer .. function:: Function xyzGetPickin(vs_id As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef num As Integer, ByRef traj As Variant) As Integer :noindex: 获取取料入框轨迹 :param vs_id: 需要获取取料入框点位的工作空间id :type vs_id: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param num: 可供抓取的点数量 :type num: Integer :param traj: 路径点数据 :type traj: Variant :return: err_code :rtype: Integer .. function:: Function xyzGetPickout(vs_id As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef num As Integer, ByRef traj As Variant) As Integer :noindex: 获取取料出框轨迹 :param vs_id: 需要获取取料出框点位的工作空间id :type vs_id: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param num: 可供抓取的点数量 :type num: Integer :param traj: 路径点数据 :type traj: Variant :return: err_code :rtype: Integer .. function:: Function xyzGetPlacein(vs_id As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef num As Integer, ByRef traj As Variant) As Integer :noindex: 获取放料入框轨迹 :param vs_id: 需要获取放料入框点位的工作空间id :type vs_id: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param num: 可供抓取的点数量 :type num: Integer :param traj: 路径点数据 :type traj: Variant :return: err_code :rtype: Integer .. function:: Function xyzGetPlaceout(vs_id As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef num As Integer, ByRef traj As Variant) As Integer :noindex: 获取放料出框轨迹 :param vs_id: 需要获取放料出框点位的工作空间id :type vs_id: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param num: 可供抓取的点数量 :type num: Integer :param traj: 路径点数据 :type traj: Variant :return: err_code :rtype: Integer .. function:: Function xyzUpdateTotePose(vs_id As Integer) As Integer :noindex: :param vs_id: 料箱重定位工作空间id :type vs_id: Integer :return: err_code :rtype: Integer .. function:: Function xyzUpdateObjPoseOnHand(ByRef pos As Position) As Integer :noindex: 工件在上手的二次定位 :param pos: :type pos: Position :return: err_code :rtype: Integer .. function:: Function xyzSwitchItem(vs_id As Integer, item_codename As String) As Integer :noindex: 切换工件 :param vs_id: 视觉空间id :type vs_id: Integer :param item_codename: 工件代号 :type item_codename: String :return: err_code :rtype: Integer .. function:: Function xyzCalculateGraspPose(vs_id As Integer, ByRef num As Integer, ByRef pipe_num As Integer, ByRef regi_num As Integer, ByRef grasp_pose As Position, ByRef out_ints(5) As Integer) As Integer :noindex: 计算抓取目标点位 :param vs_id: 需要获取抓取点位的工作空间id :type vs_id: Integer :param num: 可供抓取的点数量 :type num: Integer :param pipe_num: 运动流程编号 :type pipe_num: Integer :param regi_num: 抓取序号 :type regi_num: Integer :param grasp_pose: 抓取位姿 :type grasp_pose: Position :param out_ints(5): 可以task中自定义含义 :type out_ints(5): Array of Integer :return: err_code :rtype: Integer .. function:: Function xyzCalculateObjectPose(vs_id As Integer, ByRef num As Integer, ByRef obj_pose As Position, ByRef object_name As String, ByRef out_ints(5) As Integer) As Integer :noindex: 计算物体位姿 :param vs_id: 需要获取物体点位的工作空间id :type vs_id: Integer :param num: 物体数量 :type num: Integer :param obj_pose: 物体位姿 :type obj_pose: Position :param object_name: 当前返回的物体 pose 类型 :type object_name: String :return: err_code :rtype: Integer .. function:: Function xyzUsrCmd(strs(4) As Variant, ints(9) As Integer, floats(9) As Single, pos As Position, jnt As Joint, ByRef out_strs(4) As String, ByRef out_ints(9) As Integer, ByRef out_floats(9) As Single, ByRef out_pos As Position, ByRef out_jnt As Joint) As Integer :noindex: 用户自定义指令 :param strs: 发给上位机的字符串数组 :type strs: Array of Variant :param ints: 发给上位机的整型数组 :type ints: Array of Integer :param floats: 发给上位机的浮点型数组 :type floats: Array of Single :param pos: 发给上位机的笛卡尔坐标 :type pos: Position :param jnt: 发给上位机的关节坐标 :type jnt: Joint :param out_strs: 上位机发来的字符串数组 :type out_strs: Array of String :param out_ints: 上位机发来的整型数组 :type out_ints: Array of Integer :param out_floats: 上位机发来的浮点型数组 :type out_floats: Array of Single :param out_pos: 上位机发来的笛卡尔坐标 :type out_pos: Position :param out_jnt: 上位机发来的关节坐标 :type out_jnt: Joint :return: err_code :rtype: Integer .. function:: Sub xyzExecuteTraj(num As Integer, traj As Variant) :noindex: 执行轨迹 :param num: 轨迹点的个数 :type num: Integer :param traj: 轨迹数据 :type traj: Variant