Skip to content
🤖 AI 助手 / 自动化工具:先读 《AI 助手先读》 《Agent 开发指引》 《生成前信息采集清单》;机器可读入口 /llms.txt;技能包(SKILL)直链:SKILL.md

7000 上位机服务协议(0x9512–0x95A6) ​

端口 7000,TCP 或 UDP,控制器为服务端(HostComputerService::MAIN_PORT)。命令字取自 HostComputerService::Cmd(src/hostComputerService/hostComputerService.h),共 9 条,不计入 6000/6001 的 970 条统计。

连接 ​

  • 帧格式同 6000/6001 端口(见帧格式说明)。
  • 命令字取自 HostComputerService::Cmd(src/hostComputerService/hostComputerService.h),共 9 条:
命令字说明处理/应答函数
0x9512—parsingQueryData()
0x9513—getQueryReplyData()
0x9521—parsingRunControlData()
0x9523—replyRunControl()
0x9531—parsingVarIOControlData()
0x95A1—parsingServoPosSwitchData()
0x95A3—replyServoPosSwitch()
0x95A4—parsingServoPosControlData()
0x95A6—replyServoPosControl()

QueryRequest(0x9512) ​

parsingQueryData() 读取的字段:

参数名类型说明取值范围
channelint通道[1,9]
stopint停止—
robotint机器人号[1,4]
modeint模式[0,2]
intervalint间隔[1,60000]
queryType[]array<string>—数组
typeCfg.numGVar[]array<string>—数组
typeCfg.IO[]array<string>—数组
typeCfg.ShenTuoTorqueSensor[]array<int>—数组
typeCfg.detailedMotionPos.numuint编号/数量—
typeCfg.detailedMotionPos.optional[]array<string>—数组
json
{
    "channel": 1,
    "stop": 1,
    "robot": 1,
    "mode": 1,
    "interval": 1,
    "queryType": [
        ""
    ],
    "typeCfg": {
        "numGVar": [
            ""
        ],
        "IO": [
            ""
        ],
        "ShenTuoTorqueSensor": [
            1
        ],
        "detailedMotionPos": {
            "num": 1,
            "optional": [
                ""
            ]
        }
    }
}

QueryReply(0x9513) ​

应答 JSON 的顶层字段由 getQueryReplyData() 写入;查询项各自写入 replyData 下的键:

写入函数写入的键类型
getQueryReplyDatachannelint
getQueryReplyDatarobot—
getQueryReplyDatareplyData.timestamp[]array<int>
getQueryReplyDatareplyData.serialNum—
getRealPosACSreplyData.realPosACS[]array<any>
getRealPosMCSreplyData.realPosMCS[]array<any>
getRealPosPCSreplyData.realPosPCS[]array<any>
getRealPosUCSreplyData.realPosUCS[]array<any>
getAxisVelreplyData.axisVel[]array<any>
getAxisAccreplyData.axisAcc[]array<any>
getTorquereplyData.torque[]array<any>
getRunControlPosRunNumreplyData.runControlPosRunNum—
getProgramRunStatusreplyData.programRunStatusint
getServoStatusreplyData.servoStatusint
getOperationModereplyData.operationModeint
getGlobalSpeedreplyData.globalSpeed—
getSyncPositionreplyData.syncPosition[]array<any>
getDetailedMotionPosreplyData.detailedMotionPos.numint
getDetailedMotionPosreplyData.detailedMotionPos.data[].time[]array<any>
getDetailedMotionPosreplyData.detailedMotionPos.data[].ACS[]array<any>
getDetailedMotionPosreplyData.detailedMotionPos.data[].MCS[]array<any>
getIODatareplyData.IOobject
getVarDatareplyData.numGVarobject

RunControl(0x9521) ​

parsingRunControlData() 读取 robot/targetPos/count/sum/cfg.moveMode,并调用 cacheRecvRunControlDataParam() 读取下列参数:

参数名类型说明取值范围
robotint机器人号[1,4]
targetPos[]array<double>目标位置数组
countint计数—
sumint总数>=1
cfg.moveModestring运动模式字符串
clearBufferint清除缓冲—
targetModeint目标模式[0,1]
sendModeint发送模式[0,1]
runModeint运行模式[0,1]
cfg.coordstring坐标系字符串
cfg.extMovebool外部运动true / false
cfg.syncint同步—
cfg.speedint速度[1,最大速度]
cfg.accint加速度[1,100]
cfg.plint平滑等级[0,5]
cfg.timeoutint超时[10,10000]
endint结束—
json
{
    "robot": 1,
    "targetPos": [
        1.0
    ],
    "count": 1,
    "sum": 1,
    "cfg": {
        "moveMode": "",
        "coord": "",
        "extMove": true,
        "sync": 1,
        "speed": 1,
        "acc": 1,
        "pl": 1,
        "timeout": 1
    },
    "clearBuffer": 1,
    "targetMode": 1,
    "sendMode": 1,
    "runMode": 1,
    "end": 1
}

readRecvRunControlDataPos() 读取的连续轨迹字段:

参数名类型说明
targetVec[].pos[]array<double>位置
targetVec[].axisVel[]array<double>轴速度
targetVec[].axisAcc[]array<double>轴加速度
targetVec[].veldouble速度
targetVec[].accdouble加速度
targetVec[].plint平滑等级
targetVec[].timeStampint—
json
{
    "targetVec": [
        {
            "pos": [
                1.0
            ],
            "axisVel": [
                1.0
            ],
            "axisAcc": [
                1.0
            ],
            "vel": 1.0,
            "acc": 1.0,
            "pl": 1,
            "timeStamp": 1
        }
    ]
}

RunControlReply(0x9523) ​

replyRunControl() 构造的应答;size 仅在 success 为 true 时写入:

参数名类型说明
robotint机器人号
successbool成功
causestring—
sizeint大小/数量
json
{
    "robot": 1,
    "success": true,
    "cause": "",
    "size": 1
}

VarIOControl(0x9531) ​

numGVar 与 IO 是以变量名/端口名为键的 JSON 对象(源码用 getMemberNames() 遍历),不是数组。

参数名类型说明
numGVarobject<string,double>—
IOobject<string,int / double>—
json
{
    "numGVar": {
        "key": 1.0
    },
    "IO": {
        "key": 1
    }
}

ServoPosSwitch(0x95A1) ​

参数名类型说明取值范围
robotint机器人号[1,4]
switchbool开关true / false
json
{
    "robot": 1,
    "switch": true
}

ServoPosSwitchReply(0x95A3) ​

replyServoPosSwitch() 构造的应答:

参数名类型说明
robotint机器人号
successbool成功
causestring—
json
{
    "robot": 1,
    "success": true,
    "cause": ""
}

ServoPosControl(0x95A4) ​

参数名类型说明取值范围
robotint机器人号[1,4]
endint结束—
countint计数—
sumint总数>=1
PosVec[][]array<array<double>>—数组
json
{
    "robot": 1,
    "end": 1,
    "count": 1,
    "sum": 1,
    "PosVec": [
        [
            1.0
        ]
    ]
}

ServoPosControlReply(0x95A6) ​

replyServoPosControl() 构造的应答:

参数名类型说明
robotint机器人号
successbool成功
causestring—
json
{
    "robot": 1,
    "success": true,
    "cause": ""
}

← 返回完整命令参考 | ← 返回 RTL-22.07 协议