How to get started with Robot Web Services and jog a robot via REST API requests
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.
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
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 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?
After a little digging I found a little more information.
"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 RiabichevPC Software Support Engineer0
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:
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:
This URL says /rw/iosystem/signals/<NETWORK>/<DEVICE>/<NAME_OF_THE_IO>/set-value
Type: Basic Auth
Username: Default User
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.1
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?0
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 RiabichevPC Software Support Engineer0
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.
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?
Thank you for the tutorial.
I followed each of your steps but at the part at which your error ouput becomes "bad request" (at 4:13), I still have error 401 although headers have been set and authorization type modified. I tried for both VC and real controller cases.I checked at the User Authorization System of the real controller in Robotstudio under Controller tab > Access > Authenticate > view user grants, and realized there is no sort of "manual jog" possibility.
Did you have a specific group of possible grants for this tutorial ?
Where can this error difference come from ?
I tried to repeat the process with another action to check if that was the issue. I tried to update a digital I/O signal state previously created in the controller configuration and I reused the command given in the developer center
curl --digest -u "Default User":robotics -d "lstate=simulated" -X POST "http://localhost/rw/iosystem/signals/Local/DRV_1/DRV1K1?action=set"
(with the appropriate IP address instead of localhost, or localhost:80 in the VC case, as explained in the topic your topic "How to change the listening port of the Virtual Controller (RobotWare 6.x and 7.x)", with and without the headers, with and without the same authorization type.
Still the same error 401 each time. Do I need to first go through "login as local user" or "request mastership" or anything else to deal with I/O's ?
Thank you in advance for your assistance.
How did you setup your Authorization settings? Type and credentials?—Maxim RiabichevPC Software Support Engineer0
Thank you for your reply.
I actually never went into thes kinds of settings, except at the time I left my comment, only to have a look at the user grants... The credentials I used were the classical "Default User " and "robotics"0
Well at minute 3 in the video I mention the importance of setting up correct authorization..—Maxim RiabichevPC Software Support Engineer0
Yes, sorry for this misunderstanding, I did try with Digest Auth, exactly the way you explained in the video, and then tried different alternatives since it was not conclusive...0
- 10.4K All Categories
- 5.3K RobotStudio
- 345 UpFeed
- 15 Tutorials
- 8 RobotApps
- 281 PowerPacs
- 404 RobotStudio S4
- 1.7K Developer Tools
- 238 ScreenMaker
- 2.6K Robot Controller
- 246 IRC5
- 36 OmniCore
- 6 RCS (Realistic Controller Simulation)
- 3 RobotStudio AR Viewer
- 689 RAPID Programming
- 14 Wizard Easy Programming
- 101 Collaborative Robots
- 3 Job listings