Differences

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

Link to this comparison view

Both sides previous revision Previous revision
en:mervis-ide:65-webpanel:webpanel-api [2019/05/21 09:57]
m.chlupac
en:mervis-ide:65-webpanel:webpanel-api [2019/05/21 10:13]
m.chlupac [Request]
Line 9: Line 9:
 **URL:** ''​http://​[ip-address-of-the-plc]/​login.cgi''​ **URL:** ''​http://​[ip-address-of-the-plc]/​login.cgi''​
  
-<​code ​js>{+<​code ​javascript>{
   ver : 1,//version   ver : 1,//version
   //optional - only for non-authenticated access   //optional - only for non-authenticated access
Line 18: Line 18:
 ==== Response ==== ==== Response ====
  
-<​code ​js>{+<​code ​javascript>{
   ver : 1,//version   ver : 1,//version
   code: "​ok",​ //return code   code: "​ok",​ //return code
Line 31: Line 31:
 **URL:** ''​http://​[ip-address-of-the-plc]/​values.cgi''​ **URL:** ''​http://​[ip-address-of-the-plc]/​values.cgi''​
  
-<​code ​js>{+<​code ​javascript>{
   ver : 1,//version   ver : 1,//version
   //optional - only for non-authenticated access   //optional - only for non-authenticated access
Line 42: Line 42:
  
   * 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)
 +
 +=== Example ===
 +
 +<code javascript>​{
 + "​ver":​ 1,
 + "​c":​ {
 +  "​u":​ "​Visitor",​
 +  "​p":​ "​b39576d3da8eb2b0e262645e84707cdc"​
 + },
 + "​v":​ ["​svc://​DefaultConnection/​9104[0,​4]", ​
 +       "​svc://​DefaultConnection/​9105[0,​4]", ​
 +       "​svc://​DefaultConnection/​9129[456,​4]"​]
 +}
 +</​code>​
 +
  
 === Variable specification for Mervis RT === === Variable specification for Mervis RT ===
Line 53: Line 68:
 the POST body can be: the POST body can be:
  
-  - JSON string (AngularJS default behaviour): <​code ​js>​{"​ver":​1,"​c":​{"​u":"​karel","​p":"​x"​},"​v":​["​svc://​defaultConnection/​myVarId1","​svc://​otherConnection/​xxxYYYYDDD"​]}</​code>​+  - JSON string (AngularJS default behaviour): <​code ​javascript>​{"​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>​
  
Line 59: Line 74:
 ==== Response ==== ==== Response ====
  
-<​code ​js>{+<​code ​javascript>{
  ver : 1,//version  ver : 1,//version
  code: "​ok",​ //return code  code: "​ok",​ //return code
Line 75: Line 90:
  
   * Each 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).
 +
 +=== Example ===
 +
 +<code javascript>​{
 + "​ver":​ 1.0,
 + "​code":​ "​ok",​
 + "​msg":​ "",​
 + "​v":​ [{
 +   "​i":​ "​svc://​DefaultConnection/​9104[0,​4]",​
 +   "​v":​ "​C376DC63",​
 +   "​q"​
 +   : "​good",​
 +   "​t":​ 636940178310000000
 +  }, {
 +   "​i":​ "​svc://​DefaultConnection/​9105[0,​4]",​
 +   "​v":​ "​C0400000",​
 +   "​q":​ "​good",​
 +   "​t":​ 636940178310000000
 +  }, {
 +   "​i":​ "​svc://​DefaultConnection/​9129[456,​4]",​
 +   "​v":​ "​C0400000",​
 +   "​q":​ "​good",​
 +   "​t":​ 636940178310000000
 +  }
 + ]
 +}</​code>​
 +
  
 ===== Command Request ===== ===== Command Request =====
Line 82: Line 124:
 **URL:** ''​http://​[ip-address-of-the-plc]/​command.cgi''​ **URL:** ''​http://​[ip-address-of-the-plc]/​command.cgi''​
  
-<​code ​js>{+<​code ​javascript>{
  ver : 1,//version  ver : 1,//version
      //​optional - only for non-authenticated access      //​optional - only for non-authenticated access
Line 110: Line 152:
 **URL:** ''​http://​[ip-address-of-the-plc]/​history.cgi''​ **URL:** ''​http://​[ip-address-of-the-plc]/​history.cgi''​
  
-<​code ​js>{+<​code ​javascript>{
  ver : 1,//version  ver : 1,//version
      //​optional - only for non-authenticated access      //​optional - only for non-authenticated access