Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
en:mervis-ide:65-webpanel:webpanel-api [2017/06/21 13:24]
m.chlupac [Request]
en:mervis-ide:65-webpanel:webpanel-api [2019/05/21 09:45]
m.chlupac [Request]
Line 7: Line 7:
 ==== Request ==== ==== Request ====
  
-Data 
 <code js>{ <code js>{
- ver : 1,//version +  ver : 1,//version 
- //optional - only for non-authenticated access +  //optional - only for non-authenticated access 
- //credentials +  //credentials 
- c: {u: “karel”, p: “x”} +  c: {u: “karel”, p: “x”}
- +
 }</code> }</code>
  
Line 29: Line 27:
 ==== Request ==== ==== Request ====
  
-Data+**URL:** ''http://[ip-address-of-the-plc]/values.cgi'' 
 <code js>{ <code js>{
   ver : 1,//version   ver : 1,//version
Line 42: Line 41:
   * variable ID is unique string - in future, may be different for different platforms/protocol versions (uPLC - int?, SharkRT - string)   * variable ID is unique string - in future, may be different for different platforms/protocol versions (uPLC - int?, SharkRT - string)
  
-=== Variable specification for RT2 ===+=== Variable specification for Mervis RT ===
  
   * svc - protocol   * svc - protocol
Line 52: Line 51:
 the POST body can be: the POST body can be:
  
-  - JSON string (AngularJS default behaviour): +  - JSON string (AngularJS default behaviour): <code js>{"ver":1,"c":{"u":"karel","p":"x"},"v":["svc://defaultConnection/myVarId1","svc://otherConnection/xxxYYYYDDD"]}</code> 
-<code js>{"ver":1,"c":{"u":"karel","p":"x"},"v":["svc://defaultConnection/myVarId1","svc://otherConnection/xxxYYYYDDD"]}</code> +  - converted into POST parameters (jQuery default behaviour):<code>ver=1&c%5Bu%5D=karel&c%5Bp%5D=x&v%5B%5D=svc%3A%2F%2FdefaultConnection%2FmyVarId1&v%5B%5D=svc%3A%2F%2FotherConnection%2FxxxYYYYDDD</code>
-  - converted into POST parameters (jQuery default behaviour): +
-<code>ver=1&c%5Bu%5D=karel&c%5Bp%5D=x&v%5B%5D=svc%3A%2F%2FdefaultConnection%2FmyVarId1&v%5B%5D=svc%3A%2F%2FotherConnection%2FxxxYYYYDDD</code>+
  
-The best solution would be to support both versions. Easier is now the JSON string. 
  
 ==== Response ==== ==== Response ====
  
 <code js>{ <code js>{
- ver : 1,//version + ver : 1,//version 
- code: ok, //return code + code: "ok", //return code 
- msg: “”, //error message+ msg: "", //error message
 v: [{ v: [{
-     i: svc://defaultConnection/myVarId1, //variable Id +     i: "svc://defaultConnection/myVarId1", //variable Id 
-     v: ACA1, //value - binary encoded +     v: "ACA1", //value - binary encoded 
-     q: G,//quality +     q: "G",//quality 
-      t: 654654321654 //timestamp UTC, milliseconds since 1970+     t: 654654321654 //timestamp UTC, milliseconds since 1970
      }      }
    ]    ]
Line 76: Line 72:
 === Encoding of values - version 1 === === Encoding of values - version 1 ===
  
-Ea  Unordered List Itemch value is transmitted as a big endian binary representation of the specified variable (and its offset and length).+  Each value is transmitted as a big endian binary representation of the specified variable (and its offset and length).
  
 ===== Command Request ===== ===== Command Request =====
Line 130: Line 126:
  
 <code js>{ <code js>{
- ver : 1,//version +  ver : 1,//version 
-platform: “uPLC”, +  platform: “uPLC”, 
-maxVariablesInRequest: 5, +  maxVariablesInRequest: 5, 
-maxRequestSize: 1500, //http body size in bytes +  maxRequestSize: 1500, //http body size in bytes 
-preferedLanguage: “en-US”+  preferedLanguage: “en-US”
 }</code> }</code>
  
  • © Energocentrum Plus, s.r.o. 2017 - 2024