Difference between revisions of "COBOTTA Rest API"

From RobotinoWiki
(Tag: Removed redirect)
 
(14 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
 
 
|}
 
|}
 +
 +
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/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.
  
==GET==
+
'''Parameter:'''<br>
 +
''execute:'' (bool as int 0/1) execute the operation <br>
 +
 
 +
'''Example'''
 +
<pre>
 +
    http://127.0.0.1:8280/cobotta/Reference
 +
    Parameter:
 +
        {"execute" : 1}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 +
</pre>
  
==="/cobotta/Connect/<host>/", defaults={'port': 5007, 'timeout':2000}) <br>
+
===/cobotta/Program/Start===
"/cobotta/Connect/<host>/<port>/<timeout>")===
+
Start a Cobotta World program.
A connection to the COBOTTA is established. Also a background task is started wich is used for cyclically monitoring.
+
The program name is handled internally as upper case.  
  
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>
+
''progname:'' (str) name of Cobotta World robot program<br>
timeout: (int) time to connection timeout [10ms] -- default 2000<br>
+
''mode:'' (optional)(int) execution mode -- default: 1 <br>
 +
1:One cycle execution <br>
 +
2:Continuous execution <br>
 +
3:Step forward <br>
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280/cobotta/Connect/172.21.0.30/
+
     http://127.0.0.1:8280/cobotta/Program/Start
 +
    Parameter:
 +
        {"execute" : 1,
 +
        "progname" : "HOME"}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/Disconnect/===
+
===/cobotta/Program/Stop===
 +
Stops all running robot programs. <br>
 +
Programs will be stopped immediately and connot be continued.
  
 
+
'''Parameter:'''<br>
===/cobotta/StartMotionPreparation/===
+
''execute:'' (bool as int 0/1) execute the operation <br>
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'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Program/Stop
 +
    Parameter:
 +
        {"execute" : 1}   
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/GetProgramList/===
+
===/cobotta/Program/Hold===
Get the program names of CobottaWorld programs and returns them as string array.
+
End all running robot programs.<br>
The update is also done during the instantiation.
+
Program will be stopped. The program can be continued by issuing Resume command.  
If your program isn't listed you may need to update the "Job_PCS.h" file.
 
  
Returns:<br>
+
'''Parameter:'''<br>
(str[]) job names
+
''execute:'' (bool as int 0/1) execute the operation <br>
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Program/Hold
 +
    Parameter:
 +
        {"execute" : 1}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/StartHome/===
+
===/cobotta/Program/Resume===
Starts the HOME program. HOME program has to be defined in CobottaWorld app.  
+
Continues a Cobotta World robot program. E.g. after error reset.<br>
This method is also used internally to drive to HOME position in MotionPreparation method.
+
The program has to be started with "StartProgram" method, first.  
 +
 
 +
'''Parameter:'''<br>
 +
''execute:'' (bool as int 0/1) execute the operation <br>
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Program/Resume
 +
    Parameter:
 +
        {"execute" : 1}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/StartProgram/<progname>/", defaults={'mode': 1})
+
===/cobotta/Speed===
/cobotta/StartProgram/<progname>/<mode>/===
+
Set COBOTTA speed to specified value.
Starts a CobottaWorld robot program.
 
The program name is handled internally as upper case.  
 
  
Arguments:<br>
+
'''Parameter:'''<br>
progname: (str) name of CobottaWorld robot program<br>
+
''speed:'' (int) Speed set value [%]
mode: (int) execution mode <br>
 
1:One cycle execution <br>
 
2:Continuous execution <br>
 
3:Step forward <br>
 
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Speed
 +
    Parameter:
 +
        {"speed" : 50}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/ResumeProgram/===
+
===/cobotta/Io/<number>===
Continues a CobottaWorld robot program. E.g. after error reset.
+
Write IO variable to COBOTTA. <br>
The program has to be started with "StartProgram" method, first.
+
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'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Io/128
 +
    Parameter:
 +
        {"value" : 1}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
 +
===/cobotta/ChangeConnectionParameters===
 +
Changes the connection parameters. For the changes to take effect you have to call GET /CloseConnection and afterwards GET /OpenConnection.
  
===/cobotta/StopPrograms/===
+
'''Parameter:''' <br>
Stops all running robot programs.
+
''ip:'' (str) COBOTTA IP address <br>
Programs will be stopped immediately.
+
''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'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/ChangeConnectionParameters
 +
    Parameter:
 +
        {"ip" : "192.168.0.1",
 +
        "port" : 5007,
 +
        "timeout" : 2000,
 +
        "intervall" : 250}
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/CycleEnd/===
+
==GET==
End all running robot programs.
+
===/cobotta/Versions===
Programs will be stopped at the end of the program.
+
Returns version of REST-API and cobottabcab class
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Versions
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "rest_api": "1.0.0",
 +
    "b_cap_lib": "1.0.0"}
 
</pre>
 
</pre>
  
===/cobotta/ResetError/===
+
===/cobotta/OpenConnection===
Resets all errors of COBOTTA.  
+
Opens the connection to COBOTTA. After cyclic update of status variables is started
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/OpenConnection
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===/cobotta/Errors/===
+
===/cobotta/CloseConnection===
===/cobotta/Errors/<errorIndex>===
+
Stopps cyclic status update and disconnects from COBOTTA
Check if COBOTTA is in error state.
 
  
Returns: <br>
+
'''Returns:''' <br>
(bool) error state; true = COBOTTA in error state
+
''connection_settings:'' (obj) settings for connection to COBOTTA and cyclic status update
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/CloseConnection
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "connection_settings":
 +
          {"host": "172.21.0.30",
 +
          "port": 5007,
 +
          "timeout": 2000,
 +
          "intervall": 250}}
 
</pre>
 
</pre>
  
===GetErrorCode()===
+
===/cobotta/Program/GetList===
Read the COBOTTA hex value error code.
+
Get the program names of Cobotta World programs and returns them as string array.<br>
 +
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>
+
'''Returns:''' <br>
(str) error code
+
''programs:'' (str[]) Cobotta World program names
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Program/GetList
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "programs" : ["HOME", "PickPart", "PropPart"]}
 
</pre>
 
</pre>
  
===GetErrorText()===
+
===/cobotta/Error/Reset===
Read the short description of COBOTTA error.
+
Resets all errors of COBOTTA.  
  
Returns: <br>
+
'''Parameter:'''<br>
(str) error description
+
''execute:'' (bool as int 0/1) execute the operation <br>
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Error/Reset
 +
    Parameter:
 +
        {"execute" : 1}   
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK"}
 
</pre>
 
</pre>
  
===GetErrorInfo()===
+
===/cobotta/Error===
Read the COBOTTA error info. A more detailed description of COBOTTA errors.
+
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>
+
'''Returns:''' <br>
(str) error info
+
''errorCount:'' (int) number of currently issued errors<br>
 +
''details:'' (obj[]) array of error details containing errorCode and errorMessage<br>
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Error
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "errorCount" : count,
 +
    "details" : [{ "errorCode": code,
 +
                    "errorMessage": description
 +
                  }] }
 
</pre>
 
</pre>
  
===/cobotta/Override/===
+
===/cobotta/Speed===
Sets the COBOTTA override. Reads current override.
+
Read current COBOTTA speed.
  
Arguments: <br>
+
'''Returns:''' <br>
ovrd: (int) override to be set; 1..100 (%) <br>
+
''speed:'' (int) current COBOTTA speed value [%]
Returns: <br>
 
(float) current override
 
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Speed
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "speed" : 50 }
 
</pre>
 
</pre>
  
/cobotta/Override/<ovrd>
+
===/cobotta/Status===
 
+
Read status variables from COBOTTA.
===/cobotta/Status/===
 
Read status variables from COBOTTA.
 
It is handled as array for easier output from a RobotinoView python script block.
 
  
Returns: <br>
+
'''Returns:''' <br>
(bool[]) current states;  <br>  
+
COBOTTA staus variables.  <br>
[0]: emergency stop staus; true = emergency stop active <br>
+
''connectedStatus:'' (bool as int 0/1) Connection between Robotino and COBOTTA is established<br>
[1]: busy status; true = task is running <br>
+
''referencedStatus:'' (bool as int 0/1) COBOTTA reference motion was performed<br>
[2]: normal status; true = no error <br>
+
''busyStatus:'' (bool as int 0/1) COBOTTA is executing a program<br>
[3]: servo status; true = motors ON
+
''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'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Status
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "connectedStatus": 0,
 +
    "referencedStatus": 0,
 +
    "busyStatus": 0,
 +
    "emergencyStop": 0,
 +
    "errorStatus": 0,
 +
    "thread_status": 0,
 +
    "speed": 0}
 
</pre>
 
</pre>
 
 
===/cobotta/BusyStatus/===
 
  
 
===/cobotta/Io/<number>===
 
===/cobotta/Io/<number>===
Read IO variable 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.
  
Arguments: <br>
+
'''Parameter:''' <br>
number: (int) number of IO <br>
+
''number:'' (int) number of IO <br>
Returns: <br>
+
'''Returns:''' <br>
(bool) IO variable value  
+
''value:'' (bool as int 0/1) IO variable value.
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Io/128
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "value" : 0}
 
</pre>
 
</pre>
  
===/cobotta/Io/<number>/<value>===
+
===/cobotta/Log===
Write IO variable to COBOTTA.  
+
Get log entries of cobottabcap class. Returns last 50 entries. The complete logfile is located at /opt/robotino/cobotta/logfile.txt.
  
Arguments: <br>
+
'''Returns:''' <br>
number: (int) number of IO <br>
+
''loglines:'' (str[]) log entries.
value: (bool) value of IO variable
 
  
 
'''Example'''
 
'''Example'''
 
<pre>
 
<pre>
     http://127.0.0.1:8280
+
     http://127.0.0.1:8280/cobotta/Log
 +
</pre>
 +
'''Return'''
 +
<pre>
 +
    {"result" : "OK",
 +
    "log_lines": ["11:33:07.085;Connect called\n",
 +
                  "11:33:07.087;Try to connect\n",
 +
                  ... ]}
 
</pre>
 
</pre>
 
  
 
==Change Log==
 
==Change Log==

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.