Siemens SIMATIC S7-1500 Function Manual page 195

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

Advertisement

Web pages
3.20 API (Application Programming Interface)
fetch(TARGET_IP, {
})
first"
}
function changeIp(element) {
TARGET_IP = `${element.value}/api/jsonrpc
}
function closeModal() {
let modal = document.getElementById("example-modal")
modal.style.display = "none"
}
function openModal() {
let modal = document.getElementById("example-modal")
modal.style.display = "block"
}
function closeModal() {
let modal = document.getElementById("example-modal")
modal.style.display = "none"
}
function hideBtn(btnId) {
let btn = document.getElementById(btnId)
btn.style.display = "none"
}
function showBtn(btnId) {
let btn = document.getElementById(btnId)
btn.style.display = "block"
}
194
method: "POST",
headers: {
"Content-type": "application/json",
"X-Auth-Token": AUTH_TOKEN
},
body: JSON.stringify({
"id": messageId++,
"jsonrpc": "2.0",
"method": "Api.Logout",
})
.then(response => response.json())
.then((data) => {
AUTH_TOKEN = null
openModal()
hideBtn("btn-logout")
showBtn("btn-login")
document.getElementById("notice").innerHTML = "Please log in
})
.catch(e => console.error(e))
.replace("//api", "/api")
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