How to get started with Robot Web Services and jog a robot via REST API requests

Maxim RiabichevMaxim Riabichev Sweden admin
edited May 29 in RobotStudio
Hello everyone,

In this video I show the basic requirements for getting up and running with ABB Robot Web Services and RobotWare 6.x controllers.

You will be using the documentation to find valid REST API requests as curl, import it into Postman and send them to the Virtual Controller. No programming knowledge is required.



The headers:
Accept: application/json
Content-Type: application/x-www-form-urlencoded;v=2.0

Remember to change Authorization from Basic Auth to Digest Auth.


Let me know if I missed something or if something is unclear.

Also, this post might be interesting for you to read: https://forums.robotstudio.com/discussion/12177/how-to-change-the-listening-port-of-the-virtual-controller-robotware-6-x-and-7-x


Thanks!

Maxim Riabichev
PC Software Support Engineer
Post edited by Maxim Riabichev on

Comments

  • SebAndraosSebAndraos Paris
    This is really informative, thank you Maxim. This works seamlessly on a new VC in a station with an IRB 120 but when testing it on a previous station I receive the following 400 Bad Request error when sending the jog request:
    c:\agent\agent2\_work\2\s\areas\robapi2\components\rws_motionsystem\rws_resource_motionsystem.cpp[405] Change count mismatch code:-1073436652 icode:-1073436652
    I am guessing "Change count" is the full name of the "ccount" parameter but I'm not sure what that value actually represents and when I should adjust it to anything from 0. Is there any additional insight about that parameter (or error) that you can share?
    Thanks,
    Sebastian
  • Maxim RiabichevMaxim Riabichev Sweden admin
    After a little digging I found a little more information.

    https://developercenter.robotstudio.com/api/rwsApi/ms_motionsystem_get_page.html

    "change_count = counter to keep count for every change in the motion system(domain)"


    We need to find the correct change count which we need to send to the controller with the jog request.


    So first we GET this resource: http://localhost/rw/motionsystem?resource=change-count


    This will return a <span class="change-count">0</span> which is the value we use in the jog request.


    I think this should help you jog your older stations.


    Maxim Riabichev
    PC Software Support Engineer
  • dnilssondnilsson Gothenburg admin
    Here is a description of how to perform a curl request on OmniCore (RW7).

    For http (Without the need of certificate) we first need to disable the default setting that says that the omnicore controller requires a safe connection. This setting is located in the appweb.conf file for the specific robotware you are targeting.
    On my default path installation it located: C:\Users\<YOUR_USERNAME>\AppData\Local\ABB\RobotWare\RobotControl_7.0.4\system

    Change the first parameters from:
    #Listen -1
    ListenSecure -1

    to

    Listen -1
    #ListenSecure -1

    Now you are ready to send the request:
    More info about the requests and their parameters can be found here: https://developercenter.robotstudio.com/api/RWS

    I have used postman to send these requests manually just to prove a working example as in the video above. These are the parameters in order to toggle IO's:

    POST http://localhost/rw/iosystem/signals/none/none/do_00/set-value

    This URL says /rw/iosystem/signals/<NETWORK>/<DEVICE>/<NAME_OF_THE_IO>/set-value


    Authorization:

    Type: Basic Auth
    Username: Default User
    Password: robotics

    Headers:
    Accept: application/hal+json;v=2.0
    Content-type: application/x-www-form-urlencoded;v=2.0
     

    Body:

    Type =  x-www-form-urlencoded (or RAW)

    lvalue: 1 (for True) / 0 (For False)


    Now by hitting send The IO should toggle to the state you defined above as lvalue.

  • user_matissuser_matiss Latvia
    Hi! 
    Great video tutorial. In the video it is mentioned that WebService for VC listens to a different port (8881). 
    How can the port be configured and does it support more than one VC on the localhost?
  • Maxim RiabichevMaxim Riabichev Sweden admin
    Hello,

    Your first question is answered here: https://forums.robotstudio.com/discussion/12177/how-to-change-the-listening-port-of-the-virtual-controller-robotware-6-x-and-7-x

    Regarding your second question, yes you can host multiple VC's on one PC, but you'd have to configure different ports for them. See the thread above how to do it.

    Maxim Riabichev
    PC Software Support Engineer
  • dnilssondnilsson Gothenburg admin
    Here's an additional video to cover HTTPS, certificates, WebServices API 2.0, Swagger, Omnicore, and some quick tips for troubleshooting. 
    We will write to RAPID variables from Robot WebServices API 2.0.


  • annie184annie184 France
    Hello, 
    Your video is very useful. I have a question, to Login as Local User it is necessary to press and release the enabling button after sending the request. But I'm working with a Yumi IRB 14000 and this button is not active, so what should I do instead of pressing the enabling button to be able to login as a local user?
    Thanks,
    Ana
  • dnilssondnilsson Gothenburg admin
    @annie184
    You don't need to press the enabling button when using register user.

Sign In or Register to comment.