Plcprogram.read - Siemens SIMATIC S7-1500 Function Manual

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

Advertisement

Web pages
3.20 API (Application Programming Interface)
3.20.5.3

PlcProgram.Read

The PlcProgram.Read method is used to read process data from the CPU.
To call the PlcProgram.Read method, you need the "read_value" authorization.
Structure of the request
The following table informs you about the properties of the tag to be read.
Name
Required
"var"
Yes
"mode"
optional, default is
"simple"
Examples
In the following example, the user requests a global tag in the "simple" representation.
{
"var": "\"MotorSpeed\""
}
In the following example, the user requests a global tag in the "raw" representation.
{
"var": "\"MyDB\".MyVariable",
"mode": "raw"
}
Response structure
If the request to the server was successful, the server returns JSON data values.
Examples
The following example shows the result of reading a tag of type "int" in the "simple display".
-42
The following example shows the result of reading a tag of type "dword" in the "raw" display.
[ 1, 47, 233, 0 ]
176
Data type
Description
String
Name of the tag to be read
String
Enumeration that determines the response format for this
method:
"simple": returns tag values according to the "simple"
representation in section "Supported data types
(Page 170)"
"raw": returns tag values according to the "raw" re-
presentation in section "Supported data types".
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