Wincc Rest Api

import requests

Setting up the REST API for WinCC Pro requires careful configuration inside the TIA Portal project.

wincc_host = "https://192.168.1.100" # IP of the WinCC Unified Server api_base = "/WinCCUnified/TagValue" tag_name = "Setpoint_Temperature" username = "API_User" password = "SecurePassword123"

The WinCC REST API is an interesting essay in industrial software evolution: a legacy giant trying to speak the language of the web. It succeeds in lowering the initial barrier to entry for IT developers. It fails to deliver enterprise-grade performance or safety without careful design.

For the bold engineer: use it for monitoring, light control, and integration — but always put a safety PLC between your REST call and any dangerous actuator. For the pragmatic architect: keep OPC UA for core data, and use the REST API where HTTP+JSON genuinely simplifies your life.

In the end, the most interesting part isn’t the API itself — but what it represents: the slow, painful, and necessary marriage of the factory floor and the internet. And on that journey, every little REST endpoint is a step forward.


Would you like a practical example (e.g., Python code that reads/writes to a WinCC tag via REST) or a deeper comparison with OPC UA?

The WinCC REST API is a modern interface introduced to simplify data exchange between Siemens WinCC SCADA systems and external IT applications like Python, web apps, or MES/ERP systems. Core Features

Read/Write Access: External clients can read and write WinCC configuration data and tag values.

Standard Protocols: Uses standard HTTP methods (GET, POST, etc.) and returns data in JSON format.

Browser Support: Includes support for CORS (Cross-Origin Resource Sharing), making it usable directly in web scripts. Key Components The REST functionality is split into two primary roles:

WinCC/REST-API (Server): Allows other systems to query WinCC for tag management data, RT (Runtime) values, and archive tags.

WinCC/REST Connector (Client): Enables WinCC to actively send REST requests to external systems, triggered by tag changes or alarms. Technical Details

Licensing: Requires at least the WinCC/Connectivity Pack license; otherwise, it returns a "402 Payment Required" error. wincc rest api

Security: Managed via the WinCC Certificate Manager; users must configure SSL certificates for the connection. Default Port: Typically uses port 34568.

Versions: Available in WinCC V8.0 and updated versions of WinCC V7.5 (e.g., Service Pack 2 Update 17+).

💡 Pro Tip: Use the command netsh http show sslcert in Windows to verify your SSL certificate binding for the REST API port. If you'd like to start developing with the API: REST interface in WinCC (RT Professional)

, a lead automation engineer at a high-speed bottling plant. For years, Alex’s world was divided: on one side was the OT (Operational Technology) Siemens WinCC , humming with real-time PLC data; on the other was the IT (Information Technology)

team, constantly asking for data updates to feed their corporate dashboards. The "Wall" Between Worlds

Previously, bridging these two meant complex custom scripts or rigid database links. If the IT team wanted to see live production counts or adjust a recipe parameter from their web portal, Alex had to jump through hoops. Then came the upgrade to , which introduced the WinCC REST API The Breakthrough

Alex decided to put it to the test for a new "Smart Reporting" project. Setting the Stage : He activated the WinCC REST Service in the Computer editor, setting up a secure HTTPS port. Opening the Door : Using standard HTTP methods

, he allowed the IT department’s web apps to "talk" directly to his tags. Real-World Magic

: Alex integrated a 3rd-party weather service into his SCADA screens. By using the WinCC REST Connector

, WinCC now automatically fetches local humidity data from an external API every hour to adjust the bottle labeling glue’s temperature. The Result

Now, when the plant manager looks at their smartphone, they aren't just seeing a static screenshot; they are seeing live, JSON-formatted data pulled directly from the WinCC Runtime

via the REST interface. The wall between the factory floor and the office has finally crumbled, replaced by a fast, secure, and future-proof digital bridge. for a GET request to read a WinCC tag? import requests Setting up the REST API for

The WinCC REST API is a transformative interface for modern industrial automation, allowing external applications to securely interact with SCADA data using standard web technologies. Traditionally, accessing Siemens WinCC data required complex proprietary drivers or OLE DB connections; however, the introduction of the REST interface in WinCC V7.5 SP2 and WinCC V8.0 has simplified this process by utilizing universal HTTP methods and JSON data structures. Core Capabilities of the WinCC REST Interface

The WinCC REST service acts as a self-hosted bridge that enables both read and write access to critical process information.

Runtime Tag Access: Applications can query current values from HMI tags or update them in real-time using standard GET and POST requests.

Archive Data Retrieval: The API provides endpoints to fetch historical data from the WinCC Tag Logging system, making it ideal for custom reporting tools.

Alarm and Message Management: External systems can access runtime messages and historical alarms, allowing for the integration of SCADA notifications into enterprise-level alerting platforms.

Configuration Data: Beyond just live data, the interface allows for querying WinCC configuration settings programmatically. Dual Roles: Server vs. Client

In newer versions like WinCC V8.0, the system can operate in two distinct modes:

WinCC as a REST Server: External clients (such as Python scripts, mobile apps, or BI tools like Power BI) send requests to WinCC to fetch or update data.

WinCC as a REST Client: Using the REST Connector editor, WinCC can initiate requests to external web services (e.g., fetching weather data or interacting with a cloud-based MES) and map the response directly back to WinCC tags. Setting Up the WinCC REST Service

To enable the REST interface in WinCC (RT Professional or V7/V8), follow these primary steps: REST interface in WinCC (RT Professional)

WinCC REST API: Streamlining Industrial Data Integration The Siemens WinCC REST API serves as a modern bridge between traditional industrial automation and the digital enterprise. By leveraging standard web technologies, it allows developers to interact with WinCC Unified or WinCC V7/V8 systems using HTTP requests. This shift from proprietary drivers to open standards enables seamless data flow between the factory floor and IT applications like MES, ERP, or custom web dashboards. What is the WinCC REST API?

The REST (Representational State Transfer) interface is a software architecture that uses web protocols to exchange data. In the context of WinCC, the API provides a secure way to read and write process values, manage alarms, and access historical data. Unlike traditional OLE-DB or OPC UA connections, REST is platform-independent and can be consumed by almost any modern programming language, including Python, JavaScript, and C#. Key Capabilities and Features Would you like a practical example (e

Universal Access: Connect to WinCC from web browsers, mobile apps, or cloud platforms.Data Read/Write: Fetch real-time tag values or update setpoints remotely.Alarm Management: Retrieve active alarm lists and acknowledge messages via API calls.Historical Data: Access logged process data for external analytics and reporting.Security: Utilizes standard authentication methods like OAuth2 or API keys to ensure data integrity. Why Use REST API in Industrial Automation?

Modern manufacturing requires agility. The WinCC REST API eliminates the need for complex middleware when building custom interfaces. For instance, a data scientist can use a Python script to pull live production metrics directly into a Jupyter notebook for real-time analysis. Similarly, IT teams can integrate shop floor data into corporate portals without needing deep expertise in PLC programming or SCADA configuration. Implementation and Getting Started

To begin using the WinCC REST API, the "Web Runtime" or "Connectivity Pack" usually needs to be enabled and configured within the WinCC project. Once the endpoint is active, developers can use tools like Postman to test requests. A typical GET request to retrieve a tag value involves calling a specific URL endpoint and receiving a JSON payload in return. This JSON format is lightweight and easy to parse, making it ideal for high-performance applications. Future-Proofing Your SCADA System

As Industry 4.0 continues to evolve, the ability to communicate via REST becomes a competitive advantage. It aligns SCADA systems with the broader Internet of Things (IoT) ecosystem. By adopting the WinCC REST API, companies ensure their industrial data is no longer trapped in a silo, but is instead a versatile asset ready for the next wave of digital transformation.

Using the POST method in the WinCC REST API (introduced in WinCC V8.0) is primarily used for writing tag values to the Runtime or for initial authentication. Key Uses for POST

Write Tag Values: External applications can send POST requests to update real-time values or archive tags in WinCC.

Authentication (Sign-in): The first request in a session must be a sign-in POST request, sending user credentials in the body (JSON or XML) to receive a session token.

Data Structure: Requests typically require a Content-Type: application/json header and a JSON body containing the tag name and its new value. Configuration Requirements

Licensing: A valid WinCC/Connectivity Pack license is mandatory. Without it, the API will return a 402 Payment Required error.

REST Service: The API is a passive, self-hosted service. You must configure the URL and port (default is often 443 for HTTPS) to enable communication.

WinCC/REST Connector: While the API is passive (waiting for requests), the WinCC/REST Connector can actively send POST requests from WinCC to external IT systems, triggered by specific tags or alarms. Example Workflow

Authenticate: Send a POST to the sign-in endpoint with credentials.

Identify Tag: Find the tag management endpoint (e.g., /WinCCRestApi/v1/Tags).

Execute Write: Send a POST request to the specific tag endpoint with the new value in the request body. If you'd like, I can help you with: The exact JSON body for writing multiple tags at once. The URL structure for specific WinCC versions. How to handle the 402 error if your license is missing. REST interface in WinCC (RT Professional)