# RobotWebSocketApp **Repository Path**: longsac/RobotWebSocketApp ## Basic Information - **Project Name**: RobotWebSocketApp - **Description**: 读取Fanuc Robot 数据并转发至web socket - **Primary Language**: Unknown - **License**: Apache-2.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 3 - **Forks**: 1 - **Created**: 2021-07-06 - **Last Updated**: 2024-06-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: 机器人 ## README # RobotWebSocketApp #### 介绍 读取Fanuc Robot 数据并转发至web socket 机器人采集数据详情 #### 软件架构 软件架构说明 #### 安装教程 1. xxxx 2. xxxx 3. xxxx #### 使用说明 1. 建立 WebSocket 连接测试 2. 读取任务 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "GetTask", "TaskType" : { "TypePara" : 任务程序地址, "TypeNumber" : 任务程序个数, "TypeName" : 任务程序类型("Task"表示TP程序,"TaskIgnoreMacro"表示macro宏程序,"TaskIgnoreKarel"表示karel程序, "TaskIgnoreMacroKarel"表示karel程序) } } 发送数据格式: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "GetTask", "TaskType" : { "TypePara" : "1", "TypeNumber" : 1, "TypeName" : "Task" } } 3. 读取Pos数据 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "ReadPos", "TaskType" : { "TypePara" : Group名称, "TypeNumber" : Pos数据个数, "TypeName" : Pos数据类型("Pos"表示Current position,"PosUF"表示Current position with user frame) } } 发送数据格式: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "ReadPos", "TaskType" : { "TypePara" : "1", "TypeNumber" : 15, "TypeName" : "PosUF" } } 4. 读取系统变量 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "GetSysVariable", "TaskType" : { "TypePara" : 系统变量地址, "TypeNumber" : 系统变量个数, "TypeName" : 系统变量类型("Int"表示整数类型,"String"表示字符串类型,"Real"表示布尔类型) } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "GetSysVariable", "TaskType" : { "TypePara" : "$MOR_GRP[1].$max_dis_trq[1]", "TypeNumber" : 1, "TypeName" : "Int" } } 5. 读取 IO 信号 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "ReadIO", "TaskType" : { "TypePara" : IO参数起始地址, "TypeNumber" : IO参数数量, "TypeName" : IO信号类型("ReadSDO"表示整数类型,"String"表示字符串类型,"Real"表示布尔类型) } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "ReadIO", "TaskType" : { "TypePara" : "10001", "TypeNumber" : 100, "TypeName" : "ReadSDO" } } 6. 读取报警历史信息 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "ReadAlarm", "TaskType" : { "TypePara" : 报警信息列表个数, "TypeNumber" : 0, "TypeName" : "Alarm" } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "ReadAlarm", "TaskType" : { "TypePara" : "5", "TypeNumber" : 0 } } 7. 读取字符串寄存器 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "GetStringReg", "TaskType" : { "TypePara" : 字符串寄存器起始地址, "TypeNumber" : 字符串寄存器数量, "TypeName" : "StringReg" } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "GetStringReg", "TaskType" : { "TypePara" : "1", "TypeNumber" : 3, "TypeName" : "StringReg" } } 8. 读取Pos寄存器 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "GetPosReg", "TaskType" : { "TypePara" : 字符串寄存器起始地址, "TypeNumber" : 字符串寄存器数量, "TypeName" : "StringReg" } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "GetPosReg", "TaskType" : { "TypePara" : "1", "TypeNumber" : 10, "TypeName" : "1" } } 9. 读取Number寄存器 发送数据格式: { "RobotIP" : 机器人的IP地址, "TimeOutValue" : 采集超时时间, "TaskName" : "GetNumberReg", "TaskType" : { "TypePara" : 字符串寄存器起始地址, "TypeNumber" : 字符串寄存器数量, "TypeName" : 系统变量类型("Int"表示整数类型,"String"表示字符串类型,"Real"表示布尔类型) } } 示例: { "RobotIP" : "192.168.1.10", "TimeOutValue" : 1000, "TaskName" : "GetNumberReg", "TaskType" : { "TypePara" : "1", "TypeNumber" : 10, "TypeName" : "1" } }