Difference between revisions of "COBOTTA Rest API"

From RobotinoWiki
m (LDWR moved page User:LDWR to COBOTTA Rest API without leaving a redirect: Release and rename)
 
(12 intermediate revisions by the same user not shown)
Line 5: Line 5:
 
It provides several PUT/GET methods to control the COBOTTA such as
 
It provides several PUT/GET methods to control the COBOTTA such as
 
* Connect/Dissconnect to COBOTTA  
 
* Connect/Dissconnect to COBOTTA  
* Start/Stop CobottaWorld program
+
* Start/Stop Cobotta World program
 
* Read/Write IOs
 
* Read/Write IOs
 
* Get COBOTTA error status, description
 
* Get COBOTTA error status, description
 
* Reset COBOTTA error  
 
* Reset COBOTTA error  
 
* Get COBOTTA status information
 
* Get COBOTTA status information
* Get/Set COBOTTA override
+
* Get/Set COBOTTA speed
 
* Get a list of robot programs <br>
 
* Get a list of robot programs <br>
The API is acessable on localhost port 8280.
 
All return values will be json object style.
 
 
|}
 
|}
 +
 +
The API is acessable on robotino's IP address on port 8280. <br>
 +
All parameters and return values will be json object style. <br>
 +
Each call will return a http return code. You most likely get one of theese: <br>
 +
200 - request was successful <br>
 +
403 - COBOTTA is not ready to perform the requested action. E.g. in error state or already busy<br>
 +
412 - your (POST) request is missing parameters<br>
 +
500 - COBOTTA raised an error while executing the requested action<br>
 +
 +
In any case the returned object has a member called ''result'' which will have the value "OK" or "FAILED".
 +
If the ''result'' is "FAILED" than there is also the member ''reason'' which describes the error. <br>
  
 
==PUT==
 
==PUT==
===/cobotta/Connect/<host>/, defaults={'port': 5007, 'timeout':2000} ===
+
===/cobotta/Reference===
===/cobotta/Connect/<host>/<port>/<timeout>===
+
This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision.
A connection to the COBOTTA is established.
+
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 COBOTTA manual ID : 7291 for detaild information about COBOTTA startup.
  
'''Arguments:'''<br>
+
'''Parameter:'''<br>
''host:'' (str) IP address of COBOTTA<br>
+
''execute:'' (bool as int 0/1) execute the operation <br>
''port:'' (int) TCP communication port -- default: 5007<br>
 
''timeout:'' (int) time to connection timeout [10ms] -- default: 2000<br>
 
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280/cobotta/Connect/172.21.0.30/
+
     http://127.0.0.1:8280/cobotta/Reference
 +
    Parameter:
 +
        {"execute" : 1}
 
</pre>
 
</pre>
 
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 36: Line 46:
 
</pre>
 
</pre>
  
===/cobotta/StartProgram/<progname>/, defaults={'mode': 1}===
+
===/cobotta/Program/Start===
===/cobotta/StartProgram/<progname>/<mode>===
+
Start a Cobotta World program.
Starts a CobottaWorld robot program.  
 
 
The program name is handled internally as upper case.  
 
The program name is handled internally as upper case.  
  
'''Arguments:'''<br>
+
'''Parameter:'''<br>
''progname:'' (str) name of CobottaWorld robot program<br>
+
''execute:'' (bool as int 0/1) execute the operation <br>
''mode:'' (int) execution mode -- default: 1 <br>
+
''progname:'' (str) name of Cobotta World robot program<br>
 +
''mode:'' (optional)(int) execution mode -- default: 1 <br>
 
1:One cycle execution <br>
 
1:One cycle execution <br>
 
2:Continuous execution <br>
 
2:Continuous execution <br>
Line 49: Line 59:
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/StartProgram/HOME/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Program/Start
 +
    Parameter:
 +
        {"execute" : 1,
 +
        "progname" : "HOME"}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 56: Line 70:
 
</pre>
 
</pre>
  
===/cobotta/Override/<ovrd>===
+
===/cobotta/Program/Stop===
Set COBOTTA override to specified value.
+
Stops all running robot programs. <br>
 +
Programs will be stopped immediately and connot be continued.
 +
 
 +
'''Parameter:'''<br>
 +
''execute:'' (bool as int 0/1) execute the operation <br>
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Override/50
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Program/Stop
 +
    Parameter:
 +
        {"execute" : 1}   
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 67: Line 88:
 
</pre>
 
</pre>
  
===/cobotta/Io/<number>===
+
===/cobotta/Program/Hold===
Read IO variable from COBOTTA.  
+
End all running robot programs.<br>
Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App.
+
Program will be stopped. The program can be continued by issuing Resume command.  
  
'''Arguments:''' <br>
+
'''Parameter:'''<br>
''number:'' (int) number of IO <br>
+
''execute:'' (bool as int 0/1) execute the operation <br>
Returns: <br>
 
(bool) IO variable value
 
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Io/128
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Program/Hold
 +
    Parameter:
 +
        {"execute" : 1}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
     {"result" : "OK",
+
     {"result" : "OK"}
    "value" : True}
 
 
</pre>
 
</pre>
  
===/cobotta/Io/<number>/<value>===
+
===/cobotta/Program/Resume===
Write IO variable to COBOTTA.  
+
Continues a Cobotta World robot program. E.g. after error reset.<br>
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.
+
The program has to be started with "StartProgram" method, first.  
  
'''Arguments:''' <br>
+
'''Parameter:'''<br>
''number:'' (int) number of IO <br>
+
''execute:'' (bool as int 0/1) execute the operation <br>
''value:'' (bool) value of IO variable
 
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Io/128/True
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Program/Resume
 +
    Parameter:
 +
        {"execute" : 1}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 101: Line 124:
 
</pre>
 
</pre>
  
===/cobotta/Errors/<errorIndex>===
+
===/cobotta/Speed===
Read a more detailed error inforamtion from robot error list.
+
Set COBOTTA speed to specified value.
  
'''Arguments:''' <br>
+
'''Parameter:'''<br>
''errorIndex:'' (int) 0-based index of the error list <br>
+
''speed:'' (int) Speed set value [%]
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Errors/1
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Speed
 +
    Parameter:
 +
        {"speed" : 50}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
     {"errorCode"     : info[0],          #(VT_I4)
+
     {"result" : "OK"}
    "errorMessage" :  info[1],        #(VT_BSTR)
 
    "errorDescription" : description,  #(VT_BSTR)
 
    "subCode"      :  info[2],        #(VT_I4)
 
    "fileID"        :  file_id,        #(VT_I4)
 
    "lineNumber"    :  line_number,    #(VT_I4)
 
    "programName"  :  info[4],        #(VT_BSTR)
 
    "lineNumber"    :  info[5],        #(VT_I4)
 
    "fileID"        :  info[6]          #(VT_I4)}
 
 
</pre>
 
</pre>
  
==GET==
+
===/cobotta/Io/<number>===
===/cobotta/Disconnect/===
+
Write IO variable to COBOTTA. <br>
 +
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:''' <br>
 +
''number:'' (int) number of IO <br>
 +
''value:'' (bool as int 0/1) value of IO variable
 +
 
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Disconnect/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Io/128
 +
    Parameter:
 +
        {"value" : 1}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 133: Line 160:
 
</pre>
 
</pre>
  
===/cobotta/StartMotionPreparation/===
+
===/cobotta/ChangeConnectionParameters===
This method sould be called once after switching on the COBOTTA or if the COBOTTA had a hard collision.
+
Changes the connection parameters. For the changes to take effect you have to call GET /CloseConnection and afterwards GET /OpenConnection.
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.
+
'''Parameter:''' <br>
Refer to manual ID : 7291 for detaild information about COBOTTA startup.
+
''ip:'' (str) COBOTTA IP address <br>
After axis calibration the "HOME" program is started. HOME program has to be defined in CobottaWorld app.
+
''port:'' (optional)(int) COBOTTA communication port -- default: 5007 <br>
 +
''timeout:'' (optional)(int) time for connection timeout [1/10 s] -- default: 2000 <br>
 +
''intervall:'' (optional)(int) intervall for cyclic status update [ms] -- default: 250 <br>
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/StartMotionPreparation/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/ChangeConnectionParameters
 +
    Parameter:
 +
        {"ip" : "192.168.0.1",
 +
        "port" : 5007,
 +
        "timeout" : 2000,
 +
        "intervall" : 250}
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 148: Line 183:
 
</pre>
 
</pre>
  
===/cobotta/GetProgramList/===
+
==GET==
Get the program names of CobottaWorld programs and returns them as string array.
+
===/cobotta/Versions===
The update is also done during the instantiation.
+
Returns version of REST-API and cobottabcab class
If your program isn't listed you may need to update the "Job_PCS.h" file.
 
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/GetProgramList/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Versions
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
 
     {"result" : "OK",
 
     {"result" : "OK",
     "programs" : "HOME", "PickPart", "PropPart"}
+
     "rest_api": "1.0.0",  
 +
    "b_cap_lib": "1.0.0"}
 
</pre>
 
</pre>
  
===/cobotta/StartHome/===
+
===/cobotta/OpenConnection===
Starts the HOME program. HOME program has to be defined in CobottaWorld app.  
+
Opens the connection to COBOTTA. After cyclic update of status variables is started
This method is also used internally to drive to HOME position in MotionPreparation method.
 
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/StartHome/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/OpenConnection
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 174: Line 210:
 
</pre>
 
</pre>
  
===/cobotta/ResumeProgram/===
+
===/cobotta/CloseConnection===
Continues a CobottaWorld robot program. E.g. after error reset.
+
Stopps cyclic status update and disconnects from COBOTTA
The program has to be started with "StartProgram" method, first.
+
 
 +
'''Returns:''' <br>
 +
''connection_settings:'' (obj) settings for connection to COBOTTA and cyclic status update
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/ResumeProgram/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/CloseConnection
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
     {"result" : "OK"}
+
     {"result" : "OK",
 +
    "connection_settings":
 +
          {"host": "172.21.0.30",
 +
          "port": 5007,
 +
          "timeout": 2000,
 +
          "intervall": 250}}
 
</pre>
 
</pre>
  
===/cobotta/StopPrograms/===
+
===/cobotta/Program/GetList===
Stops all running robot programs.  
+
Get the program names of Cobotta World programs and returns them as string array.<br>
Programs will be stopped immediately.  
+
The update is also done during the instantiation.<br>
 +
If your program isn't listed you may need to update the "Job_PCS.h" file.
 +
 
 +
'''Returns:''' <br>
 +
''programs:'' (str[]) Cobotta World program names
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/StopPrograms/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Program/GetList
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
     {"result" : "OK"}
+
     {"result" : "OK",
 +
    "programs" : ["HOME", "PickPart", "PropPart"]}
 
</pre>
 
</pre>
  
===/cobotta/CycleEnd/===
+
===/cobotta/Error/Reset===
End all running robot programs.
+
Resets all errors of COBOTTA.  
Programs will be stopped at the end of the program.
+
 
 +
'''Parameter:'''<br>
 +
''execute:'' (bool as int 0/1) execute the operation <br>
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/CycleEnd/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Error/Reset
 +
    Parameter:
 +
        {"execute" : 1}   
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
Line 210: Line 265:
 
</pre>
 
</pre>
  
===/cobotta/ResetError/===
+
===/cobotta/Error===
Resets all errors of COBOTTA.  
+
Returns the number of currently issued errors. <br>
 +
If it returns an error count of 0 then there is no error.<br>
 +
Also returns an array of error deails. Containing an error code and a description text.
 +
 
 +
'''Returns:''' <br>
 +
''errorCount:'' (int) number of currently issued errors<br>
 +
''details:'' (obj[]) array of error details containing errorCode and errorMessage<br>
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/ResetError/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Error
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
     {"result" : "OK"}
+
     {"result" : "OK",
 +
    "errorCount" : count,
 +
    "details" : [{ "errorCode": code,
 +
                    "errorMessage": description
 +
                  }] }
 
</pre>
 
</pre>
  
===/cobotta/Errors/===
+
===/cobotta/Speed===
Returns the number of currently issued errors.
+
Read current COBOTTA speed.
If it returns an error count of 0 than there is no error.
+
 
 +
'''Returns:''' <br>
 +
''speed:'' (int) current COBOTTA speed value [%]
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Errors/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Speed
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
 
     {"result" : "OK",
 
     {"result" : "OK",
     "errorCount" : count }
+
     "speed" : 50 }
 
</pre>
 
</pre>
  
===/cobotta/Override/===
+
===/cobotta/Status===
Read current COBOTTA override.
+
Read status variables from COBOTTA.
 +
 
 +
'''Returns:''' <br>
 +
COBOTTA staus variables.  <br>
 +
''connectedStatus:'' (bool as int 0/1) Connection between Robotino and COBOTTA is established<br>
 +
''referencedStatus:'' (bool as int 0/1) COBOTTA reference motion was performed<br>
 +
''busyStatus:'' (bool as int 0/1) COBOTTA is executing a program<br>
 +
''emergencyStop:'' (bool as int 0/1) COBOTTA emergency stop is pressed<br>
 +
''errorStatus:'' (bool as int 0/1) COBOTTA in error state<br>
 +
''thread_status:'' (bool as int 0/1) status of the thread which cyclically updates the COBOTTA status<br>
 +
''speed:'' (int) speed of COBOTTA [%]
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Override/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Status
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
 
     {"result" : "OK",
 
     {"result" : "OK",
     "override" : 50 }
+
     "connectedStatus": 0,
 +
    "referencedStatus": 0,
 +
    "busyStatus": 0,
 +
    "emergencyStop": 0,
 +
    "errorStatus": 0,
 +
    "thread_status": 0,
 +
    "speed": 0}
 
</pre>
 
</pre>
  
===/cobotta/Status/===
+
===/cobotta/Io/<number>===
Read status variables from COBOTTA.  
+
Read IO variable from COBOTTA. <br>
 +
Some IO signals are predefined. Please refer to COBOTTA manual ID : 7261 or check the signal's comments in Remote TP App. <br>
 +
Default user IOs start at IO 128.
 +
 
 +
'''Parameter:''' <br>
 +
''number:'' (int) number of IO <br>
 +
'''Returns:''' <br>
 +
''value:'' (bool as int 0/1) IO variable value.
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/Status/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Io/128
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
 
     {"result" : "OK",
 
     {"result" : "OK",
     "emergencyStop" : status[0],
+
     "value" : 0}
    "busyStatus" : status[1],
 
    "normalStatus" : status[2],
 
    "servoStatus" : status[3] }
 
 
</pre>
 
</pre>
  
===/cobotta/BusyStatus/===
+
===/cobotta/Log===
During motion preperation the communication to COBOTTA is blocked by motion preperation task. For this reason status update with /cobotta/Status doesn't work. /cobotta/BusyStatus uses in that case a flag which is set before and reset after motion preperation is done.
+
Get log entries of cobottabcap class. Returns last 50 entries. The complete logfile is located at /opt/robotino/cobotta/logfile.txt.
 +
 
 +
'''Returns:''' <br>
 +
''loglines:'' (str[]) log entries.
  
 
'''Example'''
 
'''Example'''
     http://127.0.0.1:8280/cobotta/BusyStatus/
+
<pre>
 
+
     http://127.0.0.1:8280/cobotta/Log
 +
</pre>
 
'''Return'''
 
'''Return'''
 
<pre>
 
<pre>
 
     {"result" : "OK",
 
     {"result" : "OK",
     "busy" : True}
+
     "log_lines": ["11:33:07.085;Connect called\n",
 +
                  "11:33:07.087;Try to connect\n",
 +
                  ... ]}
 
</pre>
 
</pre>
  

Latest revision as of 12:45, 30 July 2021

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 Cobotta World 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 robotino's IP address on port 8280.
All parameters and return values will be json object style.
Each call will return a http return code. You most likely get one of theese:
200 - request was successful
403 - COBOTTA is not ready to perform the requested action. E.g. in error state or already busy
412 - your (POST) request is missing parameters
500 - COBOTTA raised an error while executing the requested action

In any case the returned object has a member called result which will have the value "OK" or "FAILED". If the result is "FAILED" than there is also the member reason which describes the error.

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 COBOTTA manual ID : 7291 for detaild information about COBOTTA startup.

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 Cobotta World program. The program name is handled internally as upper case.

Parameter:
execute: (bool as int 0/1) execute the operation
progname: (str) name of Cobotta World 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 Cobotta World 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:
speed: (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"}

/cobotta/ChangeConnectionParameters

Changes the connection parameters. For the changes to take effect you have to call GET /CloseConnection and afterwards GET /OpenConnection.

Parameter:
ip: (str) COBOTTA IP address
port: (optional)(int) COBOTTA communication port -- default: 5007
timeout: (optional)(int) time for connection timeout [1/10 s] -- default: 2000
intervall: (optional)(int) intervall for cyclic status update [ms] -- default: 250

Example

    http://127.0.0.1:8280/cobotta/ChangeConnectionParameters
    Parameter:
        {"ip" : "192.168.0.1",
         "port" : 5007,
         "timeout" : 2000,
         "intervall" : 250}

Return

    {"result" : "OK"}

GET

/cobotta/Versions

Returns version of REST-API and cobottabcab class

Example

    http://127.0.0.1:8280/cobotta/Versions

Return

    {"result" : "OK",
     "rest_api": "1.0.0", 
     "b_cap_lib": "1.0.0"}

/cobotta/OpenConnection

Opens the connection to COBOTTA. After cyclic update of status variables is started

Example

    http://127.0.0.1:8280/cobotta/OpenConnection

Return

    {"result" : "OK"}

/cobotta/CloseConnection

Stopps cyclic status update and disconnects from COBOTTA

Returns:
connection_settings: (obj) settings for connection to COBOTTA and cyclic status update

Example

    http://127.0.0.1:8280/cobotta/CloseConnection

Return

    {"result" : "OK",
     "connection_settings": 
          {"host": "172.21.0.30", 
           "port": 5007, 
           "timeout": 2000, 
           "intervall": 250}}

/cobotta/Program/GetList

Get the program names of Cobotta World 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:
programs: (str[]) Cobotta World program names

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

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
referencedStatus: (bool as int 0/1) COBOTTA reference motion was performed
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
thread_status: (bool as int 0/1) status of the thread which cyclically updates the COBOTTA status
speed: (int) speed of COBOTTA [%]

Example

    http://127.0.0.1:8280/cobotta/Status

Return

    {"result" : "OK",
     "connectedStatus": 0, 
     "referencedStatus": 0, 
     "busyStatus": 0, 
     "emergencyStop": 0, 
     "errorStatus": 0, 
     "thread_status": 0, 
     "speed": 0}

/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" : 0}

/cobotta/Log

Get log entries of cobottabcap class. Returns last 50 entries. The complete logfile is located at /opt/robotino/cobotta/logfile.txt.

Returns:
loglines: (str[]) log entries.

Example

    http://127.0.0.1:8280/cobotta/Log

Return

    {"result" : "OK",
     "log_lines": ["11:33:07.085;Connect called\n", 
                   "11:33:07.087;Try to connect\n",
                   ... ]}

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.