Web Api Sessions - Siemens SIMATIC S7-1500 Function Manual

Web server
Hide thumbs Also See for SIMATIC S7-1500:
Table of Contents

Advertisement

Example 3
Example 3 shows a bulk request for read and write access to a stack of tags in a single
HTTP request. This procedure is recommended for bulk requests, as it is more efficient than
a series of single accesses and therefore places less load on the CPU.
$.post({
url:"https://192.168.2.132/api/jsonrpc",
data:JSON.stringify([
success: function(data){ console.log(data); },
dataType: "text",
contentType: "application/json",
headers: {
The bulk request contains an invalid tag with an error message providing information about
this. All other methods were successfully carried out, as the following result shows.
[
{jsonrpc:"2.0",id:1,result:{"value":42}},
{jsonrpc:"2.0",id:2,error:{code:-1,message:"Invalid tag name"}},
{jsonrpc:"2.0",id:3,result:{"value":"1990-01-01"}},
{jsonrpc:"2.0",id:4,result:true},
]
3.20.4

Web API sessions

Timeout for Web API sessions
Note
If a Web API call is not made within a session before 120 seconds have elapsed, the CPU
ends the session with a logout event. A timeout reset is initiated by every successful action
of the user in which a toke is supplied.
Call the Api.GetPermission or Api.Ping method cyclically within the timeout grid to ensure
that:
• Your session remains active
• Your authorizations for the call of other methods remain active
Web server
Function Manual, 11/2019, A5E03484625-AG
{jsonrpc:"2.0", id:1, method:"PlcProgram.Read",
{jsonrpc:"2.0", id:2, method:"PlcProgram.Read",
params:{var:"\"MyDB\".InvalidField"},
{jsonrpc:"2.0", id:3, method:"PlcProgram.Read",
params:{tag:"MyDB.MyDate"} },
{jsonrpc:"2.0", id:4, method:"PlcProgram.Write",
params:{tag:"\"BoilerControl\".TempSetPoint", value:9001} }]),
"X-Auth-Token":"d29kamV3cGxtdm5keHNhcXd1aXJ0empkZXN3cQ=="}});
3.20 API (Application Programming Interface)
Web pages
169

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents