Skip to content

Online Programming Command Set

On-line programming file management

Query online program list get_program_trajectory_list

  • Input parameter
ParameterTypeDescription
page_numintPage number (This parameter is not passed when querying all programs).
page_sizeintPage size (This parameter is not passed when querying all programs).
vague_searchstringVague search (passing this parameter can initiate vague search).
  • Output parameter
ParameterTypeDescription
page_numintPage serial number.
page_sizeintPage size.
total_sizeintTotal size.
vague_searchstringVague search (passing this parameter can initiate vague search).
listlistTrajectory list.
  • Code demo

Input

Query the stored trajectory list. Page query and vague search are supported.

json
{"command":"get_program_trajectory_list","page_num":1,"page_size":10,"vague_search":"file"}

Output

json
{
    "command": "get_program_trajectory_list",
    "page_num": 1,
    "page_size": 2,
    "total_size": 2,
    "vague_search": "file",
    "list": [
        {
            "id": 1,
            "size": 2580,
            "speed": 50,
            "trajectory_name": "1_file1.txt"
        },
        {
            "id": 2,
            "size": 2580,
            "speed": 50,
            "trajectory_name": "2_file2.txt"
        }
    ]
}

Query Flowchart Program Run State get_flowchart_program_run_state

  • Input parameter
ParameterTypeDescription
get_flowchart_program_run_statestringQuery the run state of the current online programming file
  • Output parameter
ParameterTypeDescription
run_stateint0: Not Started, 1: Running, 2: Paused.
step_modeintStep-by-step mode, 1 for step-by-step mode, 0 for non-step-by-step mode. Not returned if not running.
modal_idintID of the flowchart block currently being executed. Not returned if not running.
idintID of the currently enabled file. Not returned if not running.
namestringName of the currently enabled file.
plan_speedintGlobal planning speed ratio (1 - 100).
  • Code demo

Input

json
{ "command": "get_flowchart_program_run_state" }

Output

json
{
    "command":"get_flowchart_program_run_state",
    "id":15,
    "modal_id":"fdc30031-0b0a-448b-936a-e6c8d73c199f",
    "name":"readIO",
    "plan_speed":50,
    "run_state":1,
    "step_mode":1
}

Start to run the online programming file with the specified ID set_program_id_start

  • Input parameter
ParameterTypeDescription
set_program_id_startstringStart to run the trajectory with the specified ID.
idintRun the specified ID, 1-100. Trajectories are available for running.
speedint1-100. Trajectory running speed. The speed ratio may not be provided, and the trajectory will run according to the stored speed.
  • Output parameter
ParameterTypeDescription
start_statebooltrue: start to run false: running failed.
  • Output parameter
ParameterTypeDescription
finish_idintID of finishing trajectory
  • Code demo

Input

Start to run trajectory 2 at a speed of 50%.

json
{"command":"set_program_id_start","id":2,"speed":50}

Output

Start running successfully.

json
{
    "command": "set_program_id_run",
    "start_state": true
}

After the online program ends, the ID of the finishing trajectory will be reported automatically.

json
{
    "state": "program_run_finish",
    "finish_id": 4
}

Delete the specified online programming file delete_program_trajectory

  • Input parameter
ParameterTypeDescription
delete_program_trajectorystringDelete the trajectory with the specified ID
idintSpecified ID, ID of deleted trajectory
  • Output parameter
ParameterTypeDescription
delete_statebooltrue: success, false: failure
  • Code demo

Input

Start to run trajectory 2 at a speed of 50%

json
{"command":"delete_program_trajectory","id":2}

Output

json
{
    "command": "delete_program_trajectory",
    "delete_state": true
}

Update the online programming file with the specified ID

  • Input parameter
ParameterTypeDescription
update_program_trajectorystringUpdate the information of the trajectory with the specified ID
idintID of the specified online programming trajectory
plan_speedintUpdated planned speed ratio, 1-100 (optional configuration)
project_namestringUpdated file name (10 bytes at most) (optional configuration)
  • Output parameter
ParameterTypeDescription
update_statebooltrue: success, false: failure
  • Code demo

Input

Update the information of trajectory with the specified ID

json
{"command":"update_program_trajectory","id":1,"plan_speed":66,"project_name":"file"}

Output

json
{
    "command": "update_program_trajectory",
    "update_state": true
}

Set the default running ID of IO

  • Input parameter
ParameterTypeDescription
set_default_run_programstringSet the ID of online programming file that the IO runs by default.
  • Output parameter
ParameterTypeDescription
set_default_run_programbooltrue: success, false: failure
  • Code demo

Input

Set the ID of online programming file that the IO runs by default. It is configurable from 0 to 100. 0 means canceling the setting.

json
{"command":"set_default_run_program","id":1}

Output

json
{
    "command": "set_default_run_program",
    "set_state": true
}

Get the default running ID of IO

  • Input parameter
ParameterTypeDescription
get_default_run_programstringGet the ID of online programming file that the IO runs by default.
  • Output parameter
ParameterTypeDescription
idintID of online programming file that the IO runs by default.
  • Code demo

Input

Get the default running ID of IO

json
{ "command": "get_default_run_program" }

Output

json
{
    "command": "get_default_run_program",
    "id": 1
}

Global waypoints

Add global waypoints add_global_waypoint

  • Input parameter
ParameterTypeDescription
add_global_waypointstringNewly added global waypoint
point_namestringName of global waypoint
jointintJoint angle of newly added global waypoint, unit: 0.001°
poseobjectPosition of newly added global waypoint, position: x: 0.1 m, y: 0.2 m, z: 0.03 m, orientation: rx: 0.4 rad, ry: 0.5 rad, rz: 0.6 rad
work_frameobjectName of work frame
tool_framestringName of tool frame
timestringTime of newly added global waypoint
  • Output parameter
ParameterTypeDescription
add_statebooltrue: success, false: failure
  • Code demo

Input

Add global waypoints

json
{"command":"add_global_waypoint","point_name":"abc","joint":[10,20,30,40,50,60,40],"pose":[100000,200000,30000,400,500,600],"work_frame":"World","tool_frame":"Arm_Tip","time":"2023-2-22 15:23:00"}

Output

json
{
    "command": "add_global_waypoint",
    "add_state": true
}

Update global waypoints update_global_waypoint

  • Input parameter
ParameterTypeDescription
update_global_waypointstringUpdate global waypoint commands.
point_namestringName of global waypoint.
jointintUpdate the joint angle of global waypoint, unit: 0.001°
poseobjectUpdate the position of global waypoint, position: x: 0.1 m, y: 0.2 m, z: 0.03 m, orientation: rx: 0.4 rad, ry: 0.5 rad, rz: 0.6 rad.
work_frameobjectName of work frame.
tool_framestringName of tool frame.
timestringUpdate the time of global waypoint.
  • Output parameter
ParameterTypeDescription
update_statebooltrue: success, false: failure
  • Code demo

Input

Update global waypoints

json
{"command":"update_global_waypoint","point_name":"abc","joint":[10,20,30,40,50,60,40],"pose":[100000,200000,30000,400,500,600],"work_frame":"World","tool_frame":"Arm_Tip","time":"2023-2-22 15:23:00"}

Output

json
{
    "command": "update_global_waypoint",
    "update_state": true
}

Delete global waypoints delete_global_waypoint

  • Input parameter
ParameterTypeDescription
delete_global_waypointstringDelete global waypoint commands.
point_namestringName of global waypoint.
  • Output parameter
ParameterTypeDescription
delete_statebooltrue: success, false: failure
  • Code demo

Input

Delete global waypoints.

json
{"command":"delete_global_waypoint","point_name":"abc"}

Output

json
{
    "command": "delete_global_waypoint",
    "delete_state": true
}

Query given global waypoints given_global_waypoint

  • Input parameter
ParameterTypeDescription
given_global_waypointstringQuery given global waypoint
point_namestringName of global waypoint
  • Output parameter
ParameterTypeDescription
given_statebooltrue: success, false: failure
  • Code demo

Input

Query the specified global waypoint

json
{"command":"given_global_waypoint","point_name":"abc"}

Output

json
{
    "command": "given_global_waypoint",
    "point_name": "abc",
    "joint": [
        10,
        20,
        30,
        40,
        50,
        60,
        40
    ],
    "pose": [
        100000,
        200000,
        30000,
        400,
        500,
        600
    ],
    "work_frame": "World",
    "tool_frame": "Arm_Tip",
    "time": "2022-12-22 15:23:00"
}

Query multiple global waypoints get_global_waypoints_list

  • Input parameter
ParameterTypeDescription
get_global_waypoints_liststringQuery multiple global waypoints
page_numintPage number (This parameter is not passed when querying all global waypoints)
page_sizeintPage size (This parameter is not passed when querying all global waypoints)
vague_searchstringVague search (passing this parameter can initiate vague search)
  • Output parameter
ParameterTypeDescription
get_global_waypoints_liststringQuery global waypoints.
total_sizeintTotal size.
listobjectDetails of waypoints.
  • Code demo

Input

Query multiple global waypoints.

json
{"command":"get_global_waypoints_list","page_num":1,"page_size":10,"vague_search":"file"}

Output

json
{
    "command": "get_global_waypoints_list",
    "total_size": 50,
    "list": [
        {
            "point_name": "abcd",
            "joint": [
                10,
                20,
                30,
                40,
                50,
                60,
                40
            ],
            "pose": [
                100000,
                200000,
                30000,
                400,
                500,
                600
            ],
            "work_frame": "World",
            "tool_frame": "Arm_Tip",
            "time": "2022-12-22 15:23:00"
        },
        {
            "point_name": "1abc",
            "joint": [
                10,
                20,
                30,
                40,
                50,
                60,
                40
            ],
            "pose": [
                100000,
                200000,
                30000,
                400,
                500,
                600
            ],
            "work_frame": "World",
            "tool_frame": "Arm_Tip",
            "time": "2022-12-22 15:23:00"
        }
    ]
}