COBOTTA Rest API

From RobotinoWiki
Revision as of 12:01, 26 March 2021 by LDWR (talk | contribs) (Removed redirect to Robotino and Cobotta bCaps Integration)

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 override
  • Get a list of robot programs

The API is acessable on localhost port 8280

PUT

GET

==="/cobotta/Connect/<host>/", defaults={'port': 5007, 'timeout':2000})
"/cobotta/Connect/<host>/<port>/<timeout>")=== A connection to the COBOTTA is established. Also a background task is started wich is used for cyclically monitoring.

Arguments:
host: (str) IP address of COBOTTA
port: (int) TCP communication port -- default: 5007
timeout: (int) time to connection timeout [10ms] -- default 2000

Example

    http://127.0.0.1:8280/cobotta/Connect/172.21.0.30/

/cobotta/Disconnect/

/cobotta/StartMotionPreparation/

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.

Example

    http://127.0.0.1:8280

/cobotta/GetProgramList/

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.

Returns:
(str[]) job names

Example

    http://127.0.0.1:8280

/cobotta/StartHome/

Starts the HOME program. HOME program has to be defined in CobottaWorld app. This method is also used internally to drive to HOME position in MotionPreparation method.

Example

    http://127.0.0.1:8280

===/cobotta/StartProgram/<progname>/", defaults={'mode': 1}) /cobotta/StartProgram/<progname>/<mode>/=== Starts a CobottaWorld robot program. The program name is handled internally as upper case.

Arguments:
progname: (str) name of CobottaWorld robot program
mode: (int) execution mode
1:One cycle execution
2:Continuous execution
3:Step forward

Example

    http://127.0.0.1:8280

/cobotta/ResumeProgram/

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

Example

    http://127.0.0.1:8280


/cobotta/StopPrograms/

Stops all running robot programs. Programs will be stopped immediately.

Example

    http://127.0.0.1:8280

/cobotta/CycleEnd/

End all running robot programs. Programs will be stopped at the end of the program.

Example

    http://127.0.0.1:8280

/cobotta/ResetError/

Resets all errors of COBOTTA.

Example

    http://127.0.0.1:8280

/cobotta/Errors/

/cobotta/Errors/<errorIndex>

Check if COBOTTA is in error state.

Returns:
(bool) error state; true = COBOTTA in error state

Example

    http://127.0.0.1:8280

GetErrorCode()

Read the COBOTTA hex value error code.

Returns:
(str) error code

Example

    http://127.0.0.1:8280

GetErrorText()

Read the short description of COBOTTA error.

Returns:
(str) error description

Example

    http://127.0.0.1:8280

GetErrorInfo()

Read the COBOTTA error info. A more detailed description of COBOTTA errors.

Returns:
(str) error info

Example

    http://127.0.0.1:8280

/cobotta/Override/

Sets the COBOTTA override. Reads current override.

Arguments:
ovrd: (int) override to be set; 1..100 (%)
Returns:
(float) current override

Example

    http://127.0.0.1:8280

/cobotta/Override/<ovrd>

/cobotta/Status/

Read status variables from COBOTTA. It is handled as array for easier output from a RobotinoView python script block.

Returns:
(bool[]) current states;
[0]: emergency stop staus; true = emergency stop active
[1]: busy status; true = task is running
[2]: normal status; true = no error
[3]: servo status; true = motors ON

Example

    http://127.0.0.1:8280


/cobotta/BusyStatus/

/cobotta/Io/<number>

Read IO variable from COBOTTA.

Arguments:
number: (int) number of IO
Returns:
(bool) IO variable value

Example

    http://127.0.0.1:8280

/cobotta/Io/<number>/<value>

Write IO variable to COBOTTA.

Arguments:
number: (int) number of IO
value: (bool) value of IO variable

Example

    http://127.0.0.1:8280


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.