Skip to content

Program CRUD

1 Program Deletion

Command Word: 0x5000

Description: Host sends delete program

ParameterTypeRequiredDescription
robotintYesRobot number, range [1,4]
jobfilenamestringYesJob file name
suffixnamestringYesJob file suffix

Suffix Types:

  • .JBR - Main program
  • .JBP - Background local program
  • .JBPG - Background global program
json
{
  "robot": 1,
  "jobfilename": "QQQQ",
  "suffixname": ".JBR"
}

2 Program Rename

Command Word: 0x5001

Description: Changes the name of an existing program; host sends rename program

ParameterTypeRequiredDescription
robotintYesRobot number, range [1,4]
lastnamestringYesProgram name before modification
newnamestringYesProgram name after modification
suffixnamestringYesProgram suffix

Suffix Types:

  • .JBR - Main program
  • .JBP - Background local program
  • .JBPG - Background global program
json
{
  "robot": 1,
  "lastname": "QQQQ",
  "newname": "WWWW",
  "suffixname": ".JBR"
}

3 Program Creation

Command Word: 0x5002

Description:

  • Program creation must be in teach mode
  • Program execution must be in run mode with servo ready and no power-on errors
  • Host sends create program
ParameterTypeRequiredDescription
robotintYesRobot number, range [1,4]
jobNamestringYesNew program name; first character must not be a number
suffixstringYesProgram suffix
timestringYesInstruction insertion time, format like 2025.03.11 20:28:23

Suffix Types:

  • .JBR - Main program
  • .JBP - Background local program
  • .JBPG - Background global program
json
{
  "robot": 1,
  "jobName": "TTT",
  "suffixname": ".JBR",
  "time": "2025.03.11 20:28:23"
}

3.1 Controller Sends New Job Command (0x5004)

Description: Controller sends a new job triggered by an external button on the teach pendant

Command Word: 0x5004

ParameterTypeRequiredDescription
jobNamestringYesName of the job to create
json
{
  "jobName": "File1"
}

4 Program File List Query

Description: Host sends query for program file list; if successful, will return 0x5011, 0x5012, 0x5013 three command words

  • When in use, after receiving 0x5011, start a 5-second timer to determine whether the file download process has timed out
  • When returning 0x5012, each robot sends separately, and each send contains up to five files
  • After file sending is complete, 0x5013 is returned as the completion flag

4.1 Query Program File List (0x5010)

Command Word: 0x5010

Description: Host sends query for program file list

ParameterTypeRequiredDescription
---No fields

4.2 Return Program File Total Count (0x5011)

Command Word: 0x5011

Description: Controller returns total program file count, gets program file list for all robots

ParameterTypeRequiredDescription
absolutepathstring arrayYesProgram file folder list, e.g. {"/job/R1/","/job/R2/","/job/R3/","/job/R4/"}; when only one robot exists, fill other positions with empty strings
jobfilenumint arrayYesNumber of files in each program folder, corresponding to robots 1,2,3,4; count includes reset program; when only one robot exists, other positions are 0

Note: Reset program - executes the reset program or moves to the reset point when reset is clicked, depending on user settings

json
{
  "absolutepath": ["/job/R1/", "/job/R2/", "/job/R3/", "/job/R4/"],
  "jobfilenum": [4, 1, 1, 1]
}

4.3 Return Program File List (0x5012)

Command Word: 0x5012

Description: Controller proactively sends to host; when replying to host, each robot is sent separately

ParameterTypeRequiredDescription
robotintYesRobot number, range [1,4]
listnumintYesNumber of program files sent, maximum 5 per send, range [0,5]
jobfilelistobject arrayYesProgram file array, number of elements equals listnum

jobfilelist Element Structure:

ParameterTypeDescription
namestringProgram file name, e.g. xxx.JBR
MD5stringMD5 value, used to determine if files are the same

Note: RobotResetProgram.ResetPro is the reset program

json
{
  "robot": 1,
  "listnum": 2,
  "jobfilelist": [
    {
      "name": "RobotResetProgram.ResetPro",
      "MD5": "e4b21ca518cd2d2eecd4b3f463c02ab1"
    },
    {
      "name": "yyy.JBR",
      "MD5": "5b172a7a37a07aa6ccec1c60cfd5db7d"
    }
  ]
}

4.4 Program File List Query Complete (0x5013)

Command Word: 0x5013

Description: Marks the end of program file list query; controller returns the completion flag

ParameterTypeRequiredDescription
---No fields

5 Lua File List Query

5.1 Query Lua File List (0x5020)

Command Word: 0x5020

Description: Host sends query for lua file list

ParameterTypeRequiredDescription
---No fields

5.2 Return Lua File List (0x5021)

Command Word: 0x5021

Description: Controller returns lua file list

ParameterTypeRequiredDescription
absolutepathstringYesLua script directory, e.g. lua/
sumintYesTotal list count
scriptliststring arrayYesLua file list
json
{
  "absolutepath": "lua/",
  "sum": 2,
  "scriptlist": ["ww.lua", "ee.lua"]
}