Skip to content

USM - User Socket Message

Overview

USM is a Socket control plugin for Agilebot robots, developed with Agilebot.Robot.SDK.A-2.0.0.0 .
It uses TCP string commands to call the Python SDK for controlling robot registers, I/O, programs, motion, alarms, servo, and more.


Compatible SDK Version

This plugin is developed with SDK version Agilebot.Robot.SDK.A-2.0.0.0.
Please ensure your robot system environment is compatible with this version.


Packaging

After plugin development is completed, package it with the Agilebot plugin packaging tool.
For detailed packaging and installation steps, refer to:

Packaging and Installation Guide


Version

  • Plugin Version: v1.0
  • SDK Version: Agilebot.Robot.SDK.A-2.0.0.0

Notes

  • Protocol: TCP, UTF-8
  • Command format: command,arg1,arg2,...
  • Response format: success OK[,data] , failure NG,error[,detail]
  • Command names are case-insensitive
  • The only case-sensitive parameter is the program name in program_start/stop/pause/resume
  • Unless otherwise specified, fields are comma-separated

Connection and Responses

  • Default port: 7000
  • Single-client mode: when already connected, new connections are rejected (returns busy )

Common error codes:

  • not_connected
  • invalid_args
  • sdk_error
  • internal_error
  • unknown_command
  • busy

Command Examples

Registers

  • read_R - Read R floating-point register.
    Example: send read_R,5 -> reply OK,8.6

  • write_R - Write R register.
    Example: send write_R,5,10.5 -> reply OK

  • delete_R - Delete R register.
    Example: send delete_R,5 -> reply OK

  • read_MR - Read MR integer register.
    Example: send read_MR,1 -> reply OK,100

  • write_MR - Write MR integer register.
    Example: send write_MR,1,200 -> reply OK

  • delete_MR - Delete MR integer register.
    Example: send delete_MR,1 -> reply OK

  • read_SR - Read SR string register.
    Example: send read_SR,1 -> reply OK,hello

  • write_SR - Write SR string register.
    Example: send write_SR,1,hello -> reply OK

  • delete_SR - Delete SR string register.
    Example: send delete_SR,1 -> reply OK

  • read_MH - Read MH holding register.
    Example: send read_MH,1 -> reply OK,100

  • write_MH - Write MH holding register.
    Example: send write_MH,1,50 -> reply OK

  • read_MI - Read MI input register.
    Example: send read_MI,1 -> reply OK,50

  • write_MI - Write MI input register.
    Example: send write_MI,1,75 -> reply OK

  • read_PR - Read PR pose (comma-separated, format: OK,id,C/J,six_values ).
    Example: send read_PR,5 -> reply OK,5,C,100.000,200.000,300.000,0.000,0.000,0.000

  • write_PR - Write PR pose: id,J/C,six_values .
    Example: send write_PR,5,C,100,200,300,0,0,0 -> reply OK

  • delete_PR - Delete PR.
    Example: send delete_PR,5 -> reply OK

I/O

  • read_DO - Read DO ( ON/OFF ).
    Example: send read_DO,1 -> reply OK,ON

  • write_DO - Write DO.
    Example: send write_DO,1,OFF -> reply OK

  • read_DI - Read DI.
    Example: send read_DI,3 -> reply OK,OFF

  • read_AO - Read AO (supported on some models).
    Example: send read_AO,2 -> reply OK,2048

  • write_AO - Write AO (supported on some models).
    Example: send write_AO,2,1 -> reply OK

  • read_AI - Read AI (supported on some models).
    Example: send read_AI,1 -> reply OK,3276

Program and Operation Rights

  • program_start - Start program (program name is case-sensitive).
    Example: send program_start,test -> reply OK

  • program_stop - Stop program (program name is case-sensitive).
    Example: send program_stop,test -> reply OK

  • program_pause - Pause program (program name is case-sensitive).
    Example: send program_pause,test -> reply OK

  • program_resume - Resume program (program name is case-sensitive).
    Example: send program_resume,test -> reply OK

  • program_list - List running programs (names only, comma-separated).
    Example: send program_list -> reply OK,test,t

  • program_prepare - Pre-start status check for program launch.
    Example: send program_prepare -> reply OK,soft_mode=ok

  • acquire_access - Acquire PC operation rights.
    Example: send acquire_access -> reply OK

  • release_access - Release PC operation rights.
    Example: send release_access -> reply OK

Motion

  • move_joint - Joint motion.
    Format: move_joint,J,j1,j2,j3,j4,j5,j6,vel,acc / move_joint,C,x,y,z,a,b,c,vel,acc / move_joint,PR,id[,vel,acc]
    Notes: vel must be xx% (0-100%), acc must be xx% (1-120%).
    Example: send move_joint,J,0,0,60,60,0,0,50%,100% -> reply OK
    Example: send move_joint,C,0,0,60,60,0,0,50%,100% -> reply OK
    Example: send move_joint,PR,1,50%,100% -> reply OK

  • move_line - Linear motion.
    Format: move_line,J,j1,j2,j3,j4,j5,j6,vel,acc / move_line,C,x,y,z,a,b,c,vel,acc / move_line,PR,id[,vel,acc]
    Notes: vel unit is mm/s, acc must be xx% (1-120%).
    Example: send move_line,J,-63,127,-106,36,0,0,500,60% -> reply OK
    Example: send move_line,C,0,0,60,60,0,0,500,60% -> reply OK
    Example: send move_line,PR,1,500,60% -> reply OK

  • get_current_pose - Current pose in J/C coordinates (comma-separated).
    Example: send get_current_pose,J -> reply OK,J,0.000,0.000,60.000,60.000,0.000,0.000

Jog / Speed / Coordinate System

  • jog_step - Step jog ( 1 means + , 2 means - ).
    Example: send jog_step,1,1,0.5 -> reply OK

  • get_ovc / set_ovc - Global speed override (percentage).
    Example: send get_ovc -> reply OK,100% ; send set_ovc,30% -> reply OK

  • get_oac / set_oac - Global acceleration override.
    Example: send get_oac -> reply OK,100%

  • get_tf / set_tf - Tool frame index (0-50).
    Example: send set_tf,2 -> reply OK

  • get_uf / set_uf - User frame index (0-50).
    Example: send set_uf,1 -> reply OK

  • get_tcs / set_tcs - Reference coordinate system.
    set_tcs supports: JOINT/BASE/WORLD/UF/TF/RTCP_UF/RTCP_TF (case-insensitive).
    Example: send set_tcs,WORLD -> reply OK

Status

  • robot_status - Robot runtime status.
    Example: send robot_status -> reply OK,Robot idle

  • ctrl_status - Controller status.
    Example: send ctrl_status -> reply OK,Controller enabled

  • servo_status - Servo status.
    Example: send servo_status -> reply OK,Servo controller idle

  • ready_check - One-click pre-start check ( alarm/robot/ctrl/servo/op/soft ).
    Example: send ready_check -> reply OK,alarm=none,robot=...,ctrl=...,servo=...,op=...,soft=...

Alarms

  • get_alarms - Active alarm list.
    Example: send get_alarms -> sequential replies: OK,<alarm_message_1> , OK,<alarm_message_2>

  • get_top_alarm - Highest-priority alarm.
    Example: send get_top_alarm -> reply OK,<alarm_message>

Servo and Emergency Stop

  • servo_on - Servo ON.
    Example: send servo_on -> reply OK

  • servo_off - Servo OFF.
    Example: send servo_off -> reply OK

  • servo_reset - Servo reset.
    Example: send servo_reset -> reply OK

  • estop - Emergency stop.
    Example: send estop -> reply OK

Payload

  • get_payload - Current payload, format mass,x,y,z (comma-separated, 3 decimals).
    Example: send get_payload -> reply OK,2.500,0.000,0.000,50.000

Common On-Site Issues

  • Pendant shows "No operation rights": check whether acquire_access has been called; call release_access when needed
  • Garbled text in NetAssist: set receive encoding to UTF-8
  • program_start fails with start-condition error: send program_prepare first