Robot Web Services
3HAC050973-001 Revision:M, Application Manual - Robot Web Services
Subscribe on RAPID persistent variable

It is possible to subscribe on persistent rapid variables. At variable change, an event will be received containing a link to the variable that has changed, along with its changed value.

URL

/subscription

Method

POST

URL Params

None*

Data Params

  • resources = {resource_value} Get rapid symbol data actions
  • *<identifier>*=The subscription resource URI (The URI here is: '/rw/rapid/symbol/data/RAPID/T_ROB1/uimsg/PNum2;value')
  • *<identifier>-p*=The priority associated with the subscription resource.

Success Response

CREATED(201), see HTTP Status codes

Sample Response

<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
       <title>Event</title>
    </head>
    <body>
        <a href="ws://127.0.0.1:9696/poll/9" rel="events"/>
        <a href="http://127.0.0.1:9696/subscription/9?action=show" rel="action"/>
        <div class="state">
            <ul>
            <li class="rap-value-ev" title="value">
                <a href="/rw/rapid/symbol/data/RAPID/T_ROB1/uimsg/PNum;value" rel="self"/>
            </li>
            <li class="rap-data" title="RAPID/T_ROB1/uimsg/PNum">
                <span class="value">4</span>
            </li>
            </ul>
        </div>
    </body>
</html>

Resources

  • rap-value-ev rapid value event resource

Error Response

BAD REQUEST(400) , see HTTP Status codes

Robot controller errors, see Robot controller return codes

Sample Call

Subscribe on RAPID persistent value. The resource url to subscribe on shall be on the form /rw/rapid/symbol/data/{symbolurl};value.

It is possible to possible to subscribe with any subscription priority (i.e High, Medium, Low priority) for RAPID persistent variables value.

curl --digest -u "Default User":robotics -X POST -d "resources=1&1=/rw/rapid/symbol/data/RAPID/T_ROB1/uimsg/PNum2;value&1-p=2" "http://127.0.0.1/subscription"

curl --digest -u "Default User":robotics -X POST -d "resources=1&1=/rw/rapid/symbol/data/RAPID/T_ROB1/uimsg/PNum1;value&1-p=1" "http://127.0.0.1/subscription"

curl --digest -u "Default User":robotics -X POST -d "resources=1&1=/rw/rapid/symbol/data/RAPID/T_ROB1/uimsg/PNum2;value&1-p=0" "http://127.0.0.1/subscription"

Notes

Not supported in bootserver mode