Both sides previous revision
Previous revision
Next revision
|
Previous revision
Next revision
Both sides next revision
|
en:mervis-scada:50-api [2020/04/06 13:15] m.chlupac [api/set/history] |
en:mervis-scada:50-api [2020/04/07 09:52] m.chlupac [api/get/values] |
| |
| |
===== Example ===== | ===== Examples ===== |
| |
====api/checkCredentials==== | ====api/checkCredentials==== |
projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0" | projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0" |
dpId="e86dba6d-1250-4e7f-aafb-84fd28324710"> | dpId="e86dba6d-1250-4e7f-aafb-84fd28324710"> |
<n2:cred t="xxxxx"/><!-- token should be always used here --> | <n2:cred t="xxxxx"/><!-- token should be used here --> |
<vals> | <vals> |
<hv ts="2020-03-15T11:00:00+00:00" i="P1D"> | <hv ts="2020-03-15T11:00:00+00:00" i="P1D"> |
xmlns:n1="http://dev.rcware.eu/auth" | xmlns:n1="http://dev.rcware.eu/auth" |
xmlns:r="http://dev.rcware.eu/serialization/references"> | xmlns:r="http://dev.rcware.eu/serialization/references"> |
<n1:cred n="userName" p="password"/> | <n1:cred t="xxxxxx"/> |
<actionDefs projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0"> | <actionDefs projId="5abf8ca0-94ba-48df-8d3c-7ebe87a12fd0"> |
<actions> | <actions> |
<code xml><?xml version="1.0" encoding="utf-8"?> | <code xml><?xml version="1.0" encoding="utf-8"?> |
<executeActionsResponse xmlns:r="http://dev.rcware.eu/serialization/references" code="Ok" message="OK" xmlns="http://dev.rcware.eu/scada/error-reporting" /></code> | <executeActionsResponse xmlns:r="http://dev.rcware.eu/serialization/references" code="Ok" message="OK" xmlns="http://dev.rcware.eu/scada/error-reporting" /></code> |
| |
| ====api/get/values==== |
| |
| The right way how to retrieve current values of data points (property "Output" which is usually what you want) from one or multiple projects. |
| |
| **Request** |
| |
| * URL: /api/get/values?format=xml |
| * Method: POST |
| |
| <code javascript> |
| { |
| "cred": { |
| "t": "xxxxxx" //token |
| }, |
| "propNamesToSerialize": ["Output"], |
| "offset": 0, |
| "count": 1000, |
| "serverState": null, |
| "dps": [{ |
| "projId": "ba1a92f7-f213-4a72-90e4-f7142b50274a", |
| "dpIds": ["e089dde2-a097-4e0d-8012-c8cf3dc62695", "e089dde2-a097-4e0d-8012-c8cf3dc62696"] |
| } |
| ] |
| } |
| |
| </code> |
| |
| **Response** |
| |
| <code xml><?xml version="1.0" encoding="utf-8"?> |
| <values xmlns:r="http://dev.rcware.eu/serialization/references" nextOffset="-1" serverTime="2020-04-07T07:46:34.850422Z" xmlns:n1="http://dev.rcware.eu/scada/basic-props" xmlns="http://dev.rcware.eu/scada/datapoints"> |
| <vals> |
| <v projId="ba1a92f7-f213-4a72-90e4-f7142b50274a" dataVersion="637217783110000000" serverTime="2020-04-07T07:46:34.850422Z"> |
| <dps> |
| <d id="e089dde2-a097-4e0d-8012-c8cf3dc62695" serAlr="true"> |
| <props> |
| <p n="Output" t="2020-04-07T07:43:42.1000676Z" q="Bad" r:type="177e726a-3180-4152-bef2-6254e7055e1f"> |
| <n1:v>ON</n1:v> |
| </p> |
| </props> |
| </d> |
| <d id="e089dde2-a097-4e0d-8012-c8cf3dc62696" serAlr="true"> |
| <props> |
| <p n="Output" t="2020-04-07T07:45:00.2408399Z" q="Good" r:type="b133774d-21ce-42b6-add3-57c012079c55"> |
| <n1:v>0</n1:v> |
| </p> |
| </props> |
| </d> |
| </dps> |
| </v> |
| </vals> |
| </values></code> |
| |
| |