api接口说明 ============================ 保持寄存器格式 +++++++++++++++++++++++++++++++++++ 本文所有关于WORD, DWORD等的数据格式描述, 均按下表所述约定。用户需要自己分辨这种描述和特定PLC厂家的区别并进行相应转换。 +---------------------------------------------+----------------------------------+ | 数据类型 | 描述 | +---------------------------------------------+----------------------------------+ | 输入线圈(Input Coils / Discrete Inputs) | 只读的 BOOL 型变量 (1-bit) | +---------------------------------------------+----------------------------------+ | 保持线圈(Holding Coils / Coils of Outputs) | 可读可写的 BOOL 型变量(1-bit) | +---------------------------------------------+----------------------------------+ | 输入寄存器(Input Registers / Input Data) | 可读可写的 WORD 型(16-bit)型变量 | +---------------------------------------------+----------------------------------+ | 保持寄存器(Holding Registers / Output Data) | 可读可写的 WORD 型(16-bit)型变量 | +---------------------------------------------+----------------------------------+ 本协议只用到了 **保持寄存器**,没有用到其他寄存器或线圈。 PLC方需要事先告知/确定其单个保持寄存器(WORD)和双保持寄存器(DWORD)的符号位和字节序,PC(XYZ-Studio-Max)需要做相应的配置,否则数据解析会不正确。 +-----------------------------------------------------------------------------------------+ | **单个保持寄存器WORD** | +--------+-----------------------------+--------------------------------------------------+ | 符号位 | 有符号/无符号 | 这个必须是有符号的WORD | | | | | | | | 即数据范围支持-32768 ~ 32767,因为涉及传递负数。 | +--------+-----------------------------+--------------------------------------------------+ | 字节序 | 大端/小端/大端交换/小端交换 | 字节序定义见下文 | | | | | | | | 根据PLC实际情况配置上位机XYZ-Studio-MaX即可 | +--------+-----------------------------+--------------------------------------------------+ +---------------------------------------------------------------------------------------------------------+ | **双保持寄存器DWORD** | +--------+-----------------------------+------------------------------------------------------------------+ | 符号位 | 有符号/无符号 | 这个必须是有符号的DWORD | | | | | | | | 即数据范围支持-2,147,483,648 ~ 2,147,483,647,因为涉及传递负数。 | +--------+-----------------------------+------------------------------------------------------------------+ | 字节序 | 大端/小端/大端交换/小端交换 | 根据PLC实际情况配置上位机XYZ-Studio-Max即可 | +--------+-----------------------------+------------------------------------------------------------------+ 字节序的定义如下: .. code-block:: python class ByteOrder(Enum): """ 2Bytes(word) 4Bytes(dword/float) 8Bytes(double/4word) BIG_ENDIAN AB AB CD AB CD EF GH LITTLE_ENDIAN BA DC BA HG FE DC BA BIG_ENDIAN_SWAP BA BA DC BA DC FE HG LITTLE_ENDIAN_SWAP AB CD AB GH EF CD AB """ BIG_ENDIAN = 0 # 大端 LITTLE_ENDIAN = 1 # 小端 BIG_ENDIAN_SWAP = 2 # 大端交换 LITTLE_ENDIAN_SWAP = 3 # 小端交换 交互标志位寄存器 +++++++++++++++++++++++++++++++++++ +---+----------------------------+----------------+-----------------------------------------------------------------------+ | | 数据内容 | 保持寄存器地址 | 说明 | +---+----------------------------+----------------+-----------------------------------------------------------------------+ | 1 | heart_beat_flag | 0 | 通讯连接后,内部会定期执行 pc → plc | | | | | | | | 心跳检测位 | | 内部自动定期循环发送0-1-0-1-… | | | | | | | | | | (周期1s) | +---+----------------------------+----------------+-----------------------------------------------------------------------+ | 2 | pc_cmd_ready_flag | 1 | plc发送命令前,需要查询此状态: | | | | | | | | (PC command ready flag) | | - 为1,表示此时pc准备好接收来自plc的命令,plc可以发送命令。 | | | | | | | | | | - 为0,表示此时pc为还未准备好接收来自plc的命令,plc不要发送相关命令。 | +---+----------------------------+----------------+-----------------------------------------------------------------------+ | 3 | pc_cmd_complete_flag | 2 | plc发送命令后,需要查询此状态看pc是否命令执行完毕: | | | | | | | | (PC command complete flag) | | - 为1,表示此时pc端已经执行完plc发送的命令。 | | | | | | | | | | - 为0,表示此时pc端处于命令执行的busy状态。 | +---+----------------------------+----------------+-----------------------------------------------------------------------+ | 4 | plc_cmd_request_flag | 3 | plc发送给pc的命令标志位: | | | | | | | | (plc command request flag) | | - 为1,表示让pc开始执行命令。 | | | | | | | | | | - plc需要根据时序要求,进行复位为0。 | +---+----------------------------+----------------+-----------------------------------------------------------------------+ | 5 | 预留 | 4~9 | 占用,预留 | +---+----------------------------+----------------+-----------------------------------------------------------------------+ PLC发送给PC的寄存器 +++++++++++++++++++++++++++++++++++ .. table:: :widths: auto :class: longtable +-------------------+----------------+------------------------------------------------------------------------------------------+ | 数据内容 | 保持寄存器地址 | 说明 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cmd | 10 | 命令码,支持拍照、获取点位、计算轨迹等。 | | | | | | | | 各指令详细信息见下文 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | vision_service_id | 11 | 视觉服务id | +-------------------+----------------+------------------------------------------------------------------------------------------+ | ws_id | 12 | 工作空间id | +-------------------+----------------+------------------------------------------------------------------------------------------+ | token | 13 | 整数值,某些命令需要用到该值 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | item_codename | 14 | 工件代号 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | app_name | 15 | 项目名称 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | flow_name | 16 | task flow的名称 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | object_name | 17 | 工件名称(或者叫object_id) | +-------------------+----------------+------------------------------------------------------------------------------------------+ | tool_name | 18 | 工具名称(或者叫tool_id) | +-------------------+----------------+------------------------------------------------------------------------------------------+ | strategy_name | 19 | 策略名称 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | in_str_5 | 25~29 | 命令码“用户指令”中用到,具体查看下文的“用户指令” | +-------------------+----------------+ | | in_word_10 | 30~39 | | +-------------------+----------------+ | | in_float_10 | 40~59 | | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:x | 60~61 | 占用2个保持寄存器, 数据解析规则是有符号类型的DWORD | | | | | | | | 案例: | | | | | | | | - 想传递的真实数据是: -1234.56, 默认小数点位数为2位 | | | | | | | | - 则数据*100后取整为 -123456, 该值的16进制是: FF FE 1D C0 | | | | | | | | - [60] → FF FE | | | | | | | | - [61] → 1D C0 | | | | | | | | 说明: | | | | | | | | - 小数点位数可以在上位机进行配置 | | | | | | | | - [60]和[61]中字节顺序需要变化的,可以在上位机中进行配置。如[60] -> FE FF, [61] -> C0 1D | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:y | 62~63 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:z | 64~65 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:a | 66~67 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:b | 68~69 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:c | 70~71 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | cart_pose:d | 72~73 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j1 | 74~75 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j2 | 76~77 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j3 | 78~79 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j4 | 80~81 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j5 | 82~83 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | joint:j6 | 84~85 | 同 cart_pose:x | +-------------------+----------------+------------------------------------------------------------------------------------------+ | 系统预留 | 86~99 | 请勿使用 | +-------------------+----------------+------------------------------------------------------------------------------------------+ | 用户自定义区 | 100~129 | 用户自定义区 | +-------------------+----------------+------------------------------------------------------------------------------------------+ PLC接收自上位机反馈的寄存器 +++++++++++++++++++++++++++++++++++ .. table:: :widths: auto :class: longtable +---------------------------+----------------+----------------------------------------------------------------------------------+ | 数据内容 | 保持寄存器地址 | 说明 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | error | 130 | - 0:没有错误 | | | | | | | | - 1:有错误 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | error_code | 131~132 | 具体的错误代码 | | | | | | | | 占用2个保持寄存器, 数据解析规则是有符号类型的DWORD | +---------------------------+----------------+----------------------------------------------------------------------------------+ | token | 133 | 请求某些异步指令时会返回的值,用户可以使用该值来获取对应的异步结果 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | grasp_pose_num | 134 | 抓取点位的数量 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | object_pose_num | 135 | 物体/工件点位的数量 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | pipeline_num | 136 | pipeline文件的number值 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | register_num | 137 | 用到的注册文件的注册number值 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | object_pose_type | 138 | 物体/工件点位的类型 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | 系统预留 | 139~159 | 请勿使用 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:x | 160~161 | 根据plc的请求命令情况,可以是抓取点位姿(grasp_pose)或者物体位姿(object_pose)等。 | | | | | | | | 数据格式同之前的cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:y | 162~163 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:z | 164~165 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:a | 166~167 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:b | 168~169 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:c | 170~171 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | cart_pose:d | 172~173 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j1 | 174~175 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j2 | 176~177 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j3 | 178~179 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j4 | 180~181 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j5 | 182~183 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | joint:j6 | 184~185 | 同cart_pose:x | +---------------------------+----------------+----------------------------------------------------------------------------------+ | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | 系统预留 | 187~189 | 请勿使用 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | trajectory_way_point_type | 190~219 | 存放轨迹中的各个点位和点位的类型,具体分类如下: | | | | | | | | wp1_type: [190] | | | | | | | | wp1: | | | | | | | | data1: [220, 221] | | | | | | | | data2: [222, 223] | | | | | | | | data3: [224, 225] | | | | | | | | data4: [226, 227] | | | | | | | | data5: [228, 229] | | | | | | | | data6: [230, 231] | | | | | | | | wp2_type: [191] | | | | | | | | wp2: | | | | | | | | data1: [232, 233] | | | | | | | | data2: [234, 235] | | | | | | | | data3: [236, 237] | | | | | | | | data4: [238, 239] | | | | | | | | data5: [240, 241] | | | | | | | | data6: [242, 243] | | | | | | | | … | | | | | | | | wp_type: 可能是如下值: | | | | | | | | - 11:joints movej,之后的6个data就是joints | | | | | | | | - 12:joints movel,之后的6个data就是joints | | | | | | | | - 21:Cart movej,之后的6个data就是cartesian | | | | | | | | - 22:Cart movel,之后的6个data就是cartesian | +---------------------------+----------------+----------------------------------------------------------------------------------+ | trajectory_way_point | 220~579 | 参考上面“trajectory_way_point_type”中的说明 | +---------------------------+----------------+----------------------------------------------------------------------------------+ | out_str_5 | 585~589 | 命令码“用户指令”中用到,具体查看下文的“用户指令” | +---------------------------+----------------+ + | out_word_10 | 590~599 | | +---------------------------+----------------+ + | out_float_10 | 600~619 | | +---------------------------+----------------+----------------------------------------------------------------------------------+ | 用户自定义区 | 620~799 | 用户自定义区 | +---------------------------+----------------+----------------------------------------------------------------------------------+ 支持的指令 +++++++++++++++++++++++++++++++++++ +------------------------------------------------------------------+ | **心跳信号(xyzHeartBeat)** | +----------+-------------------------------------------------------+ | 功能描述 | 通讯连接后,PC自动定期循环发送0-1-0-1-… 给PLC,周期1s | +----------+-------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------+ | **切换应用(xyzSwitchApp)** | +-------------------------+------------------------------------------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+----------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+----------------------------------------------------+ | | cmd | 10 | 用户需要填 ``501`` | | +------------+------------+----------------------------------------------------+ | | app_name | 15 | 需要切换到的app名字 | +-------------------------+------------+------------+----------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 0:没有错误,1:有错误 | | +------------+------------+----------------------------------------------------+ | | error_code | 131~132 | 具体的错误代码 | | | | | | | | | | 占用2个保持寄存器, 数据解析规则是有符号类型的DWORD | +-------------------------+------------+------------+----------------------------------------------------+ +------------------------------------------------------------------------------------------------------+ | 切换Flow(xyzSwitchFlow) | +-------------------------+----------------------------------------------------------------------------+ | 功能描述 | 切换任务的flow(如 “1.t”) | +-------------------------+------------+------------+--------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------------------------------------+ | | cmd | 10 | 用户需要填 ``502`` | | +------------+------------+--------------------------------------------------+ | | flow_name | 16 | task flow名称 | | | | | 填写的是max上映射后的task flow名,后缀”.t”不用填 | +-------------------------+------------+------------+--------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------------------------------------+ +------------------------------------------------------------------------+ | **切换工具(xyzSwitchTool)** | +-------------------------+----------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``503`` | | +------------+------------+--------------------+ | | tool_name | 18 | 工具名称 | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +-----------------------------------------------------------------------------------------------------------------------------------+ | **请求拍照(xyzReqCapImg)** | +-------------------------+---------------------------------------------------------------------------------------------------------+ | 功能描述 | 异步请求拍照 | +-------------------------+-------------------+------------+------------------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +-------------------+------------+------------------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``504`` | | +-------------------+------------+------------------------------------------------------------------------+ | | vision_service_id | 11 | 视觉服务id | +-------------------------+-------------------+------------+------------------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +-------------------+------------+ | | | error_code | 131~132 | | | +-------------------+------------+------------------------------------------------------------------------+ | | token | 133 | 可以在获取拍照结果(xyzGetCapImg)指令中使用该值,来查询本次拍照是否成功 | +-------------------------+-------------------+------------+------------------------------------------------------------------------+ +-----------------------------------------------------------------------------------------------------------+ | **获取拍照结果(xyzGetCapImg)** | +-------------------------+---------------------------------------------------------------------------------+ | 功能描述 | 获取异步拍照结果。使用该指令前需先调用请求拍照(xyzReqCapImg) | +-------------------------+------------+------------+-------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+-------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``505`` | | +------------+------------+-------------------------------------------------------+ | | token | 13 | 来自于用户的某一次请求拍照(xyzReqCapImg)返回的token值 | +-------------------------+------------+------------+-------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+-------------------------------------------------------+ +-------------------------------------------------------------------------------------------+ | **拍照(xyzCapImg)** | +-------------------------+-----------------------------------------------------------------+ | 功能描述 | 等价于执行:请求拍照(xyzReqCapImg) + 获取拍照结果(xyzGetCapImg) | +-------------------------+-------------------------+------------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +-------------------------+------------------+--------------------+ | | cmd | 10 | 用户需要填 ``506`` | | +-------------------------+------------------+--------------------+ | | vision_service_id | 11 | 视觉服务id | +-------------------------+-------------------------+------------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +-------------------------+------------------+ | | | error_code | 131~132 | | +-------------------------+-------------------------+------------------+--------------------+ +---------------------------------------------------------------------------------------------------------------------------------+ | **请求抓取目标点位(xyzReqGraspPose)** | +-------------------------+-------------------------------------------------------------------------------------------------------+ | 功能描述 | 异步请求目标抓取点的位姿 | +-------------------------+------------+------------+-----------------------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+-----------------------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``507`` | | +------------+------------+-----------------------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+------------+------------+-----------------------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | | +------------+------------+-----------------------------------------------------------------------------+ | | token | 133 | 可以在获取抓取目标点位(xyzGetGraspPose)指令中使用该值,来查询本次抓取点的值 | +-------------------------+------------+------------+-----------------------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------+ | **获取抓取目标点位(xyzGetGraspPose)** | +-------------------------+------------------------------------------------------------------------------------------------+ | 功能描述 | 获取目标抓取点的位姿。使用该指令前需先调用请求抓取目标点位(xyzReqGraspPose) | +-------------------------+----------------+------------+------------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +----------------+------------+------------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``508`` | | +----------------+------------+------------------------------------------------------------------+ | | token | 13 | 来自于用户的某一次请求抓取目标点位(xyzReqGraspPose)返回的token值 | +-------------------------+----------------+------------+------------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +----------------+------------+ | | | error_code | 131~132 | | | +----------------+------------+------------------------------------------------------------------+ | | grasp_pose_num | 134 | 抓取点位的数量 | | +----------------+------------+------------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +----------------+------------+------------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number值 | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:x | 160~161 | 抓取点位姿的x值 | | | | | | | | | | 占用2个保持寄存器,案例参考本说明书上文中的说明 | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:y | 162~163 | 同 cart_pose:x | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:z | 164~165 | 同 cart_pose:x | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:a | 166~167 | 同 cart_pose:x | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:b | 168~169 | 同 cart_pose:x | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:c | 170~171 | 同 cart_pose:x | | +----------------+------------+------------------------------------------------------------------+ | | cart_pose:d | 172~173 | 同 cart_pose:x 如果机器人是欧拉角形式,则d用不到 | +-------------------------+----------------+------------+------------------------------------------------------------------+ +-------------------------------------------------------------------------------------------------------------------------+ | **请求物体位姿(xyzReqObjPose)** | +-------------------------+-----------------------------------------------------------------------------------------------+ | 功能描述 | 异步请求物体位姿 | +-------------------------+------------+------------+---------------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+---------------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``509`` | | +------------+------------+---------------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+------------+------------+---------------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | | +------------+------------+---------------------------------------------------------------------+ | | token | 133 | 可以在获取物体位姿(xyzGetObjPose)指令中使用该值,来查询本次物体位姿 | +-------------------------+------------+------------+---------------------------------------------------------------------+ +----------------------------------------------------------------------------------------------------------------------+ | **获取物体位姿(xyzGetObjPose)** | +-------------------------+--------------------------------------------------------------------------------------------+ | 功能描述 | 获取物体位姿。使用该指令前需先调用请求物体位姿(xyzReqObjPose) | +-------------------------+------------------+------------+------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------------+------------+------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``510`` | | +------------------+------------+------------------------------------------------------------+ | | token | 13 | 来自于用户的某一次请求物体位姿(xyzReqObjPose)返回的token值 | +-------------------------+------------------+------------+------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------------+------------+ | | | error_code | 131~132 | | | +------------------+------------+------------------------------------------------------------+ | | object_pose_num | 135 | 物体点位的数量 | | +------------------+------------+------------------------------------------------------------+ | | object_pose_type | 138 | 物体点位的类型 | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:x | 160~161 | 物体点位的x值 | | | | | | | | | | 占用2个保持寄存器,案例参考本说明书上文中的说明 | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:y | 162~163 | 同 cart_pose:x | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:z | 164~165 | 同 cart_pose:x | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:a | 166~167 | 同 cart_pose:x | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:b | 168~169 | 同 cart_pose:x | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:c | 170~171 | 同 cart_pose:x | | +------------------+------------+------------------------------------------------------------+ | | cart_pose:d | 172~173 | 同 cart_pose:x | | | | | 如果机器人是欧拉角形式,则d用不到 | +-------------------------+------------------+------------+------------------------------------------------------------+ +------------------------------------------------------------------------+ | **重置任务(xyzResetTask)** | +-------------------------+----------------------------------------------+ | 功能描述 | 重置任务,一般用来初始化任务内部变量 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``511`` | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +------------------------------------------------------------------------+ | **发送机器人当前角度(xyzSendCurrentJoints)** | +-------------------------+----------------------------------------------+ | 功能描述 | 发送机器人当前关节角给PC | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``512`` | | +------------+------------+--------------------+ | | joint:j1 | 74~75 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j2 | 76~77 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j3 | 78~79 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j4 | 80~81 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j5 | 82~83 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j6 | 84~85 | 同 cart_pose:x | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +------------------------------------------------------------------------------------------------------------+ | **发送机器人当前Cartesian(xyzSendCurrentCartPose)** | +-------------------------+----------------------------------------------------------------------------------+ | 功能描述 | 发送机器人当前笛卡尔位姿给PC | +-------------------------+-------------+------------+-------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +-------------+------------+-------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``513`` | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:x | 60~61 | 同 上 | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:y | 62~63 | 同 cart_pose:x | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:z | 64~65 | 同 cart_pose:x | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:a | 66~67 | 同 cart_pose:x | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:b | 68~69 | 同 cart_pose:x | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:c | 70~71 | 同 cart_pose:x | | +-------------+------------+-------------------------------------------------------+ | | cart_pose:d | 72~73 | 如果机器人是欧拉角形式,则只需给a,b,c赋值,d赋值0即可 | +-------------------------+-------------+------------+-------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +-------------+------------+ | | | error_code | 131~132 | | +-------------------------+-------------+------------+-------------------------------------------------------+ +------------------------------------------------------------------------+ | **发送机器人当前扩展轴位置(xyzSendCurrentExtJoints)** | +-------------------------+----------------------------------------------+ | 功能描述 | 发送机器人扩展轴/附加轴的关节值给PC | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``514`` | | +------------+------------+--------------------+ | | joint:j1 | 74~75 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j2 | 76~77 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j3 | 78~79 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j4 | 80~81 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j5 | 82~83 | 同 cart_pose:x | | +------------+------------+--------------------+ | | joint:j6 | 84~85 | 同 cart_pose:x | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +------------------------------------------------------------------------+ | **请求pick动作规划(xyzReqPick)** | +-------------------------+----------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``515`` | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +------------------------------------------------------------------------+ | **请求place动作规划(xyzReqPlace)** | +-------------------------+----------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``516`` | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +------------------------------------------------------------------------+ | **请求pick和place规划(xyzReqPickPlace)** | +-------------------------+----------------------------------------------+ | 功能描述 | 请求进行Pick和Place规划 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``517`` | | +------------+------------+--------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ | **获取取料入框轨迹(xyzGetPickin)** | +-------------------------+------------------------------------------------------------------------------------------------------+ | 功能描述 | | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +--------------------------+------------+--------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``518`` | | +--------------------------+------------+--------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +--------------------------+------------+ | | | error_code | 131~132 | | | +--------------------------+------------+--------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +--------------------------+------------+--------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number | | +--------------------------+------------+--------------------------------------------------------------+ | | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | | +--------------------------+------------+--------------------------------------------------------------+ | | 各个轨迹点类型和具体的值 | 190~219 | 每个点位的类型,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | | | +------------+--------------------------------------------------------------+ | | | 220~579 | 各个点位的值,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ | **获取取料出框轨迹(xyzGetPickout)** | +-------------------------+------------------------------------------------------------------------------------------------------+ | 功能描述 | | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +--------------------------+------------+--------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``519`` | | +--------------------------+------------+--------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +--------------------------+------------+ | | | error_code | 131~132 | | | +--------------------------+------------+--------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +--------------------------+------------+--------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number | | +--------------------------+------------+--------------------------------------------------------------+ | | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | | +--------------------------+------------+--------------------------------------------------------------+ | | 各个轨迹点类型和具体的值 | 190~219 | 每个点位的类型,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | | | +------------+--------------------------------------------------------------+ | | | 220~579 | 各个点位的值,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ | **获取放料入框轨迹(xyzGetPlacein)** | +-------------------------+------------------------------------------------------------------------------------------------------+ | 功能描述 | | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +--------------------------+------------+--------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``520`` | | +--------------------------+------------+--------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +--------------------------+------------+ | | | error_code | 131~132 | | | +--------------------------+------------+--------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +--------------------------+------------+--------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number | | +--------------------------+------------+--------------------------------------------------------------+ | | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | | +--------------------------+------------+--------------------------------------------------------------+ | | 各个轨迹点类型和具体的值 | 190~219 | 每个点位的类型,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | | | +------------+--------------------------------------------------------------+ | | | 220~579 | 各个点位的值,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ | **获取放料出框轨迹(xyzGetPlaceout)** | +-------------------------+------------------------------------------------------------------------------------------------------+ | 功能描述 | | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +--------------------------+------------+--------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``521`` | | +--------------------------+------------+--------------------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +--------------------------+------------+ | | | error_code | 131~132 | | | +--------------------------+------------+--------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +--------------------------+------------+--------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number | | +--------------------------+------------+--------------------------------------------------------------+ | | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | | +--------------------------+------------+--------------------------------------------------------------+ | | 各个轨迹点类型和具体的值 | 190~219 | 每个点位的类型,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | | | +------------+--------------------------------------------------------------+ | | | 220~579 | 各个点位的值,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ +------------------------------------------------------------------------+ | **请求切换策略(xyzSwitchStrat)** | +-------------------------+----------------------------------------------+ | 功能描述 | | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``522`` | | +------------+------------+--------------------+ | | strat_name | 19 | 策略名称 | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +-----------------------------------------------------------------------------------+ | **料箱重定位(xyzUpdateTotePose)** | +-------------------------+---------------------------------------------------------+ | 功能描述 | 执行完毕后,环境中的料箱位姿会被自动更新 | +-------------------------+-------------+------------+------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +-------------+------------+------------------------------+ | | cmd | 10 | 用户需要填 ``523`` | +-------------------------+-------------+------------+------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +-------------+------------+ | | | error_code | 131~132 | | | +-------------+------------+------------------------------+ | | cart_pose:x | 160~161 | 目前该值用不到,用户无需使用 | | +-------------+------------+ | | | cart_pose:y | 162~163 | | | +-------------+------------+ | | | cart_pose:z | 164~165 | | | +-------------+------------+ | | | cart_pose:a | 166~167 | | | +-------------+------------+ | | | cart_pose:b | 168~169 | | | +-------------+------------+ | | | cart_pose:c | 170~171 | | | +-------------+------------+ | | | cart_pose:d | 172~173 | | +-------------------------+-------------+------------+------------------------------+ +------------------------------------------------------------------------+ | **工件在手上的二次定位(xyzUpdateObjPoseOnHand)** | +-------------------------+----------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``524`` | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +--------------------------------------------------------------------------------------------------------------------------------+ | **工件不在手上的二次定位(xyzUpdateObjPoseToHand)** | +-------------------------+------------------------------------------------------------------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +--------------------------+------------+--------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``525`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +--------------------------+------------+ | | | error_code | 131~132 | | | +--------------------------+------------+--------------------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +--------------------------+------------+--------------------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number | | +--------------------------+------------+--------------------------------------------------------------+ | | trajectory_wap_point_num | 186 | 轨迹中的点位数量 | | +--------------------------+------------+--------------------------------------------------------------+ | | 各个轨迹点类型和具体的值 | 190~219 | 每个点位的类型,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | | | +------------+--------------------------------------------------------------+ | | | 220~579 | 各个点位的值,具体参考上面 ``PLC接受自上位机反馈的寄存器`` | +-------------------------+--------------------------+------------+--------------------------------------------------------------+ +-----------------------------------------------------------------------------------+ | **获取工件姿态类型(xyzGetObjPoseType)** | +-------------------------+---------------------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------------+------------+-------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------------+------------+-------------------------+ | | cmd | 10 | 用户需要填 ``526`` | +-------------------------+------------------+------------+-------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------------+------------+ | | | error_code | 131~132 | | | +------------------+------------+-------------------------+ | | object_pose_type | 138 | 物体/工件的pose类型信息 | +-------------------------+------------------+------------+-------------------------+ +------------------------------------------------------------------------+ | **重置工业码垛状态(xyzResetPalletStatus)** | +-------------------------+----------------------------------------------+ | 功能描述 | 暂不支持 | +-------------------------+------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``527`` | +-------------------------+------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------+------------+ | | | error_code | 131~132 | | +-------------------------+------------+------------+--------------------+ +---------------------------------------------------------------------------+ | **切换工件(xyzSwitcItem)** | +-------------------------+-------------------------------------------------+ | 功能描述 | 切换工件 | +-------------------------+---------------+------------+--------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +---------------+------------+--------------------+ | | cmd | 10 | 用户需要填 ``528`` | | +---------------+------------+--------------------+ | | ws_id | 12 | 工件空间id | | +---------------+------------+--------------------+ | | item_codename | 14 | 工件代号 | +-------------------------+---------------+------------+--------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +---------------+------------+ | | | error_code | 131~132 | | +-------------------------+---------------+------------+--------------------+ +----------------------------------------------------------------------------------------------------------+ | **计算抓取目标点位(xyzCalculateGraspPose)** | +-------------------------+--------------------------------------------------------------------------------+ | 功能描述 | 等价于 请求抓取目标点位(xyzReqGraspPose) + 获取抓取目标点位(xyzGetGraspPose) | +-------------------------+----------------+------------+--------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +----------------+------------+--------------------------------------------------+ | | cmd | 10 | 用户需要填 ``529`` | | +----------------+------------+--------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+----------------+------------+--------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +----------------+------------+ | | | error_code | 131~132 | | | +----------------+------------+--------------------------------------------------+ | | grasp_pose_num | 134 | 抓取点位的数量 | | +----------------+------------+--------------------------------------------------+ | | pipeline_num | 136 | pipeline文件number值 | | +----------------+------------+--------------------------------------------------+ | | register_num | 137 | 用到的注册文件的注册number值 | | +----------------+------------+--------------------------------------------------+ | | cart_pose:x | 160~161 | 抓取点位姿的x值 | | | | | | | | | | 占用2个保持寄存器,案例参考本说明书上文中的说明 | | +----------------+------------+--------------------------------------------------+ | | cart_pose:y | 162~163 | 同 cart_pose:x | | +----------------+------------+--------------------------------------------------+ | | cart_pose:z | 164~165 | 同 cart_pose:x | | +----------------+------------+--------------------------------------------------+ | | cart_pose:a | 166~167 | 同 cart_pose:x | | +----------------+------------+--------------------------------------------------+ | | cart_pose:b | 168~169 | 同 cart_pose:x | | +----------------+------------+--------------------------------------------------+ | | cart_pose:c | 170~171 | 同 cart_pose:x | | +----------------+------------+--------------------------------------------------+ | | cart_pose:d | 172~173 | 同 cart_pose:x 如果机器人是欧拉角形式,则d用不到 | +-------------------------+----------------+------------+--------------------------------------------------+ +------------------------------------------------------------------------------------------------------------+ | **计算物体位姿(xyzCalculateObjectPose)** | +-------------------------+----------------------------------------------------------------------------------+ | 功能描述 | 等价于 请求物体位姿(xyzReqObjPose) +获取物体位姿(xyzGetObjPose) | +-------------------------+------------------+------------+--------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------------+------------+--------------------------------------------------+ | | cmd | 10 | 用户需要填 ``530`` | | +------------------+------------+--------------------------------------------------+ | | ws_id | 12 | 工作空间id | +-------------------------+------------------+------------+--------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------------+------------+ | | | error_code | 131~132 | | | +------------------+------------+--------------------------------------------------+ | | object_pose_num | 135 | 物体点位的数量 | | +------------------+------------+--------------------------------------------------+ | | object_pose_type | 138 | 物体点位的类型 | | +------------------+------------+--------------------------------------------------+ | | cart_pose:x | 160~161 | 物体点位的x值 | | | | | 占用2个保持寄存器,案例参考本说明书上文中的说明 | | +------------------+------------+--------------------------------------------------+ | | cart_pose:y | 162~163 | 同 cart_pose:x | | +------------------+------------+--------------------------------------------------+ | | cart_pose:z | 164~165 | 同 cart_pose:x | | +------------------+------------+--------------------------------------------------+ | | cart_pose:a | 166~167 | 同 cart_pose:x | | +------------------+------------+--------------------------------------------------+ | | cart_pose:b | 168~169 | 同 cart_pose:x | | +------------------+------------+--------------------------------------------------+ | | cart_pose:c | 170~171 | 同 cart_pose:x | | +------------------+------------+--------------------------------------------------+ | | cart_pose:d | 172~173 | 同 cart_pose:x 如果机器人是欧拉角形式,则d用不到 | +-------------------------+------------------+------------+--------------------------------------------------+ .. table:: :widths: auto :class: longtable +---------------------------------------------------------------------------------------------------------------------------------------------------+ | **用户指令(xyzUsrCmd)** | +-------------------------+-------------------------------------------------------------------------------------------------------------------------+ | 功能描述 | 用户自定义指令,用于基础指令不支持的情况下,配合任务流图完成用户特定功能 | | | | | | 各个参数的含义取决于任务流图中设定的输入输出 | +-------------------------+------------------------+------------+-----------------------------------------------------------------------------------+ | PLC输入设置值相关寄存器 | 数据内容 | 寄存器地址 | 说明 | | +------------------------+------------+-----------------------------------------------------------------------------------+ | | cmd | 10 | 用户需要填 ``600`` | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | in_str_5 | [0] | 25 | 5个“字符串”输入 | | | +---------+------------+ | | | | [1] | 26 | 这里的“字符串”只能是word类型的数字 | | | +---------+------------+ | | | | [2] | 27 | | | | +---------+------------+ | | | | [3] | 28 | | | | +---------+------------+ | | | | [4] | 29 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | in_word_10 | [0] | 30 | 10个word类型的数值输入 | | | +---------+------------+ | | | | [1]~[8] | 31~38 | | | | +---------+------------+ | | | | [9] | 39 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | in_float_10 | [0] | 40~41 | 10个“浮点数”输入 | | | | | | | | | +---------+------------+ | | | | [1]~[8] | 42~57 | 这里所谓的“浮点数”,同前面所述的cart_pose的x/y/z/a/b/c/d。 | | | | | | | | | +---------+------------+ 每个值的类型为dword,占2个保持寄存器。 | | | | [9] | 58~59 | | | | | | | 如第一个值中想传递的真实数值是-1234.56,则[0]的值需要填入-123456,默认保留两位小数 | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | cart_pose | x | 60~61 | 1个“笛卡尔坐标值”输入,解析方式同上文 | | | +---------+------------+ | | | | y | 62~63 | | | | +---------+------------+ | | | | z | 64~65 | | | | +---------+------------+ | | | | a | 66~67 | | | | +---------+------------+ | | | | b | 68~69 | | | | +---------+------------+ | | | | c | 70~71 | | | | +---------+------------+ | | | | d | 72~73 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | joints | j1 | 74~75 | 1个“关节角”输入,解析方式同上文 | | | +---------+------------+ | | | | j2 | 76~77 | | | | +---------+------------+ | | | | j3 | 78~79 | | | | +---------+------------+ | | | | j4 | 80~81 | | | | +---------+------------+ | | | | j5 | 82~83 | | | | +---------+------------+ | | | | j6 | 84~85 | | +-------------------------+--------------+---------+------------+-----------------------------------------------------------------------------------+ | plc收到返回值相关寄存器 | error | 130 | 同上 | | +------------------------+------------+ | | | error_code | 131~132 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | out_str_5 | [0] | 585 | 5个“字符串”输出 | | | +---------+------------+ | | | | [1] | 586 | 这里的“字符串”是word类型的数字 | | | +---------+------------+ | | | | [2] | 587 | | | | +---------+------------+ | | | | [3] | 588 | | | | +---------+------------+ | | | | [4] | 589 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | out_word_10 | [0] | 590 | 10个word类型的数值输出 | | | +---------+------------+ | | | | [1]~[8] | 591~598 | | | | +---------+------------+ | | | | [9] | 599 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | out_float_10 | [0] | 600~601 | 10个“浮点数”输出 | | | +---------+------------+ | | | | [1]~[8] | 602~617 | | | | +---------+------------+ 解析方式同上 | | | | [9] | 618~619 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | cart_pose | x | 160~161 | 1个“笛卡尔坐标值”输出,解析方式同上文 | | | +---------+------------+ | | | | y | 162~163 | | | | +---------+------------+ | | | | z | 164~165 | | | | +---------+------------+ | | | | a | 166~167 | | | | +---------+------------+ | | | | b | 168~169 | | | | +---------+------------+ | | | | c | 170~171 | | | | +---------+------------+ | | | | d | 172~173 | | | +--------------+---------+------------+-----------------------------------------------------------------------------------+ | | joints | j1 | 174~175 | 1个“关节角”输出,解析方式同上文 | | | +---------+------------+ | | | | j2 | 176~177 | | | | +---------+------------+ | | | | j3 | 178~179 | | | | +---------+------------+ | | | | j4 | 180~181 | | | | +---------+------------+ | | | | j5 | 182~183 | | | | +---------+------------+ | | | | j6 | 184~185 | | +-------------------------+--------------+---------+------------+-----------------------------------------------------------------------------------+