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.
https://youtu.be/YoEUEmNL5s4
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!
Comments
-
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,
Sebastian0 -
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 RiabichevPC Software Support Engineer1 -
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.1 -
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?0 -
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 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.
https://www.youtube.com/watch?v=ehmZEmf7GwE3 -
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,
Ana0 -
Hello,
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.
Best
0 -
Hello there,
How did you setup your Authorization settings? Type and credentials?—Maxim RiabichevPC Software Support Engineer0 -
Hi,
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
-
How can one change the appweb.conf file on a real controller? Access grants, even as admin, do not allow changes the folder this is located in.
0 -
dnilsson said: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.
Thank you for the video. However, if I choose HTTP, I get 415 - unsupported media. If I choose HTTPS, I either get " read ECONNRESET" or sometimes an error with the self.cert not being accepted, despite having uncommented said lines in the appweb.conf.
Unsupported Media:POST http://127.0.0.1:665/users/rmmp41525 ms▶Network▶Request Headersaccept: application/jsonContent-Type: application/x-www-form-urlencoded:v=2.0Authorization: Basic RGVmYXVsdCBVc2VyOnJvYm90aWNzUser-Agent: PostmanRuntime/7.42.0Postman-Token: 00d3749f-aa33-4717-98e8-e948a2fca50aHost: 127.0.0.1:665Accept-Encoding: gzip, deflate, brConnection: keep-aliveContent-Length: 16Cookie: -http-session-=2::http.session::5065521dce46b62598c276c4a32442f5; ABBCX=655370▶Request Body▶Response HeadersSet-Cookie: -http-session-=10::http.session::14c123960cc5e9dec5a4bdf70106ef31; path=/; domain=127.0.0.1; httponly; SameSite=NoneSet-Cookie: ABBCX=1179666; path=/; domain=127.0.0.1; httponly; SameSite=NoneVary: Accept-EncodingKeep-Alive: timeout=300, max=2147483646Content-Type: application/xhtml+xml;v=2.0X-Content-Type-Options: nosniffDate: Mon, 14 Oct 2024 10:54:35 GMTCache-Control: no-cache="set-cookie", max-age=0, no-cache, no-storeContent-Length: 376X-XSS-Protection: 1; mode=blockConnection: Keep-AlivePragma: no-cacheExpires: -1Accept-Ranges: bytes
Self signed:Error: self signed certificate▶Request Headersaccept: application/jsonContent-Type: application/x-www-form-urlencoded:v=2.0Authorization: Basic RGVmYXVsdCBVc2VyOnJvYm90aWNzUser-Agent: PostmanRuntime/7.42.0Postman-Token: 8c325c27-fd5c-4f71-8381-09c696ae6804Host: 127.0.0.1:666Accept-Encoding: gzip, deflate, brConnection: keep-alive▶Request Body
If I connect to the real controller, I either get "ECONNECTION refused" or an issue with the self.cert once again:Error: self signed certificate▶Request Headersaccept: application/jsonContent-Type: application/x-www-form-urlencoded:v=2.0User-Agent: PostmanRuntime/7.42.0Postman-Token: 3155218c-535c-4a27-88db-525f52862695Host: 192.168.125.1Accept-Encoding: gzip, deflate, brConnection: keep-alive
0 -
Not really getting anywhere, if I use HTTP I get a 415 on the VC and Connection Refused on the real controller (RC). Using HTTPS, both VC and RC complain about self.certificate even if the appweb.conf is changed accordingly.
How can I add a certificate to my controller? I tried writing to /system on the RC and got a permission error even though I am logging in as admin and have write access.
Edit:
GETting the user login info as described in the first video works flawless with the same accept header.
Post edited by rogerFRAUAS on0 -
rogerFRAUAS said:
How can I add a certificate to my controller?—Maxim RiabichevPC Software Support Engineer0 -
Apparently, I am not the only one hoping for ABBs support to be replaced by AI. Next time, consider not answering at all instead of mocking a paying customer.
Maxim Riabichev said:rogerFRAUAS said:
How can I add a certificate to my controller?
Anyways, for those playing along at home (or struggling with ABBs awful documentation), this is how you do it:
1. Connect to your controller using RobotStudio.
2. Under "Controller"-tab, select your controller listed either under "Management Port" or "Current Station".
3. Right-click on the controllers name, go to "Properties" -> "Manage Certificates".
0 -
Hi,
I apologize for making you feel mocked. That wasn't my intention.
I Googled the terms "manage certificate abb controller omnicore" and the first hit contained relevant information: https://forums.robotstudio.com/discussion/13065/rws-with-a-real-controller-omnicore
I knew I've seen that info somewhere, but I wasn't sure where..
Oh the irony, indeed
One thing I'd like to add is that providing support on these forums is not part of my work as ABB support. These forums are not an official ABB support channel. The Forum Guidelines and FAQ mention this fact as well.
I do it on my spare time. I do it for fun. Sometimes I am able to help and sometimes not so much.
By the way, thanks for pointing out the back and forth referrals in the manuals. I've created a work item for R&D to have this fixed (the information on how to handle certificates in OmniCore will be available in the OM Integrators Guide OmniCore).Post edited by Maxim Riabichev on—Maxim RiabichevPC Software Support Engineer0
Categories
- All Categories
- 5.5K RobotStudio
- 394 UpFeed
- 18 Tutorials
- 13 RobotApps
- 297 PowerPacs
- 405 RobotStudio S4
- 1.8K Developer Tools
- 249 ScreenMaker
- 2.7K Robot Controller
- 309 IRC5
- 59 OmniCore
- 7 RCS (Realistic Controller Simulation)
- 785 RAPID Programming
- AppStudio
- 3 RobotStudio AR Viewer
- 18 Wizard Easy Programming
- 105 Collaborative Robots
- 4 Job listings