COBOTTA Rest API

From RobotinoWiki
Revision as of 13:43, 6 May 2021 by LDWR (talk | contribs)

Introduction

This RESTful API which uses cobottabcap python class to communicate with denso robotics COBOTTA.

It provides several PUT/GET methods to control the COBOTTA such as

  • Connect/Dissconnect to COBOTTA
  • Start/Stop CobottaWorld program
  • Read/Write IOs
  • Get COBOTTA error status, description
  • Reset COBOTTA error
  • Get COBOTTA status information
  • Get/Set COBOTTA speed
  • Get a list of robot programs

The API is acessable on localhost port 8280. All parameters and return values will be json object style.

PUT

/cobotta/Reference/

This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision. The COBOTTA prepares it's system for operation and drives to the CALSET position. Make sure that there are no obstacles around the COBOTTA before running the motion preperation. Refer to manual ID : 7291 for detaild information about COBOTTA startup. After axis calibration the "HOME" program is started. HOME program has to be defined in CobottaWorld app.

Parameter:
execute: (bool as int 0/1) execute the operation

Example

    http://127.0.0.1:8280/cobotta/Reference/
    Parameter:
        {"execute" : 1}

Return

    {"result" : "OK"}

/cobotta/Program/Start

Start a CobottaWorld program. The program name is handled internally as upper case.

Parameter:
execute: (bool as int 0/1) execute the operation
progname: (str) name of CobottaWorld robot program
mode: (optional)(int) execution mode -- default: 1
1:One cycle execution
2:Continuous execution
3:Step forward

Example

    http://127.0.0.1:8280/cobotta/Program/Start/
    Parameter:
        {"execute" : 1,
         "progname" : "HOME"} 

Return

    {"result" : "OK"}

/cobotta/Program/Stop/

Stops all running robot programs.
Programs will be stopped immediately and connot be continued.

Parameter:
execute: (bool as int 0/1) execute the operation

Example

    http://127.0.0.1:8280/cobotta/Program/Stop/
    Parameter:
        {"execute" : 1}    

Return

    {"result" : "OK"}

/cobotta/Program/Hold/

End all running robot programs.
Program will be stopped. The program can be continued by issuing Resume command.

Parameter:
execute: (bool as int 0/1) execute the operation

Example

    http://127.0.0.1:8280/cobotta/Program/Hold/
    Parameter:
        {"execute" : 1} 

Return

    {"result" : "OK"}

/cobotta/Program/Resume/

Continues a CobottaWorld robot program. E.g. after error reset.
The program has to be started with "StartProgram" method, first.

Parameter:
execute: (bool as int 0/1) execute the operation

Example

    http://127.0.0.1:8280/cobotta/Program/Resume/
    Parameter:
        {"execute" : 1}

Return

    {"result" : "OK"}

/cobotta/Speed/

Set COBOTTA speed to specified value.

Parameter:
value: (int) Speed set value [%]

Example

    http://127.0.0.1:8280/cobotta/Speed/
    Parameter:
        {"speed" : 50} 

Return

    {"result" : "OK"}

/cobotta/Io/<number>/

Write IO variable to COBOTTA.
Some IO signals are predefined and restricted to use. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App.

Parameter:
number: (int) number of IO
value: (bool as int 0/1) value of IO variable

Example

    http://127.0.0.1:8280/cobotta/Io/128
    Parameter:
        {"value" : 1}

Return

    {"result" : "OK"}


GET

/cobotta/Program/GetList/

Get the program names of CobottaWorld programs and returns them as string array.
The update is also done during the instantiation.
If your program isn't listed you may need to update the "Job_PCS.h" file.

Example

    http://127.0.0.1:8280/cobotta/Program/GetList/

Return

    {"result" : "OK",
     "programs" : ["HOME", "PickPart", "PropPart"]}

/cobotta/Error/Reset

Resets all errors of COBOTTA.

Parameter:
execute: (bool as int 0/1) execute the operation

Example

    http://127.0.0.1:8280/cobotta/Error/Reset/
    Parameter:
        {"execute" : 1}     

Return

    {"result" : "OK"}

/cobotta/Error/

Returns the number of currently issued errors.
If it returns an error count of 0 then there is no error.
Also returns an array of error deails. Containing an error code and a description text.

Returns:
errorCount: (int) number of currently issued errors
details: (obj[]) array of error details containing errorCode and errorMessage
errorCode: (int) COBOTTA error number
errorMessage: (str) error description text.


Example

    http://127.0.0.1:8280/cobotta/Error/

Return

    {"result" : "OK",
     "errorCount" : count,
     "details" : [{ "errorCode": code,
                    "errorMessage": description
                  }] }

/cobotta/Speed/

Read current COBOTTA speed.

Returns:
speed: (int) current COBOTTA speed value [%]

Example

    http://127.0.0.1:8280/cobotta/Speed/

Return

    {"result" : "OK",
     "speed" : 50 }

/cobotta/Status/

Read status variables from COBOTTA.

Returns:
COBOTTA staus variables.
connectedStatus: (bool as int 0/1) Connection between Robotino and COBOTTA is established
busyStatus: (bool as int 0/1) COBOTTA is executing a program
emergencyStop: (bool as int 0/1) COBOTTA emergency stop is pressed
errorStatus: (bool as int 0/1) COBOTTA in error state

Example

    http://127.0.0.1:8280/cobotta/Status/

Return

    {"result" : "OK",
     "connectedStatus" : value,
     "referencedStatus" : value,
     "busyStatus" : value,
     "emergencyStop" : value,
     "errorStatus" : value }


/cobotta/Io/<number>

Read IO variable from COBOTTA.
Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App.
Default user IOs start at IO 128

Parameter:
number: (int) number of IO
Returns:
value: (bool as int 0/1) IO variable value.

Example

    http://127.0.0.1:8280/cobotta/Io/128

Return

    {"result" : "OK",
     "value" : value}

Change Log

This are the changes in cobottabcap class.
You can check your version with cobotta/version/.

Date Version Changes
22.01.2021 1.0.0 first Release

COBOTTA® is a registered trademark of Denso Corporation in certain countries.