Robot Web Services
3HAC050973-001 Revision:L, Application Manual - Robot Web Services
Subscribe on resources

URL

/subscription

Method

POST

Data Params

  • resources= An identifier Required
  • *<identifier>*= The subscription resource URI Required
  • *<identifier>-p*= The priority associated with the subscription resource. Required
     '0' for Low priority    (Valid for all resources)
     '1' for Medium priority (Valid for all resources)
     '2' for High priority   (Valid for only 'IOSIGNALS' and 'RAPID Persistent variable value' resources)         
    

Success Response

CREATED(201), see HTTP Status codes

Example Response

<html>
<head>
<title>Subscription Event</title>
</head>
<body>
<div class="state">
<ul>
<li class="ios-signalstate-ev">
<a href= "/rw/iosystem/signals/Virtual1/Board1/di1;state" rel="self"/>
<span class="lvalue">0</span>
<span class="lstate">blocked</span>
</li>
<li class="ios-signalstate-ev">
<a href= "/rw/iosystem/signals/Virtual1/Board1/di2;state" rel="self"/>
<span class="lvalue">0</span>
<span class="lstate">blocked</span>
</li>
</ul>
</div>
</body>
</html>

Resources

  • ios-signalstate-ev
    • lstate Signals state {blocked | unblocked}
    • lvalue Logical Signal value

Error Response

BAD_REQUEST(400), UNSUPPORTED_MEDIA(415) See Robot controller return codes

Sample Call

Low Priority subscription

curl --digest -u "Default User":robotics -d "resources=1&1=/rw/iosystem/signals/Virtual1/Board1/di1;state&1-p=0&resources=2&2=/rw/iosystem/signals/Virtual1/Board1/di2;state&2-p=0" -X POST "http://localhost/subscription"

curl --digest -u "Default User":robotics -d "resources=1&1=/rw/panel/ctrlstate&1-p=0" -X POST "http://localhost/subscription"

Medium Priority subscription

curl --digest -u "Default User":robotics -d "resources=1&1=/rw/iosystem/signals/Virtual1/Board1/di1;state&1-p=1&resources=2&2=/rw/iosystem/signals/Virtual1/Board1/di2;state&2-p=1" -X POST "http://localhost/subscription"

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

High Priority subscription

curl --digest -u "Default User":robotics -d "resources=1&1=/rw/iosystem/signals/Virtual1/Board1/di1;state&1-p=2&resources=2&2=/rw/iosystem/signals/Virtual1/Board1/di2;state&2-p=2" -X POST "http://localhost/subscription"

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

Notes

The sequence of steps involved to setup subscription and start listening for events are shown below:

  • Subscribe on resources
  • Response to this HTTP request is a list of initial events for the subscribed resources along with the location header.
  • Retrieve Location header and use this value to setup web socket connection
  • Receive events and parse the events

Maximum 1000 resources can be subscribed per group with low priotity and medium priority

Each client can have maximum 2 groups.

Low priority subscription(p=0) and Medium priority subscription(p=1) is allowed on any resource.

RobotWebservice clients can subscribe maximum of 64 resources with High priority (p=2).

High priority subscription is allowed only on below two types of resources.

1.IOSignals in IOSYSTEM.

2.Rapid Persistentvariables in RAPID.

Not supported in bootserver mode