Siemens SIMATIC S7-1500 Function Manual page 191

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

Advertisement

Web pages
3.20 API (Application Programming Interface)
function turbineSpeedOverride(element) {
if (AUTH_TOKEN !== null) {
a notification request
}
}
function apiLogin() {
let input_user = document.getElementById("username").value
let input_password = document.getElementById("userpassword").value
fetch(TARGET_IP, {
})
190
fetch(TARGET_IP, {
method: "POST",
headers: {
"Content-type": "application/json",
"X-Auth-Token": AUTH_TOKEN
},
body: JSON.stringify({
"id": messageId++, // id can be omitted, in that case it is
"jsonrpc": "2.0",
"method": "PlcProgram.Write",
"params": {
"var": "\"turbine_speed_override\"",
"value": (element.value === "true")
}
})
})
.then(response => response.json())
.then((data) => {
if (data.result) {
console.log("Api responds with " + data.result)
}
else {
throw "Something happened while writing value"
}
})
.catch(e => console.error(e))
method: "POST",
headers: {
"Content-type": "application/json",
},
body: JSON.stringify({
"id": messageId++,
"jsonrpc": "2.0",
"method": "Api.Login",
"params": {
user: input_user,
password: input_password
}
})
Function Manual, 11/2019, A5E03484625-AG
Web server

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic et 200proSimatic et 200sp

Table of Contents