Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: How to Export Data from WinCC Runtime Advanced into Excel using VB Script
Share
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > How to Export Data from WinCC Runtime Advanced into Excel using VB Script

How to Export Data from WinCC Runtime Advanced into Excel using VB Script

In this article, you will learn how to export data from Siemens WinCC Runtime advanced into Microsoft excel using VB script.

Last updated: September 28, 2022 2:18 pm
Greesh Maheshwari
PLC Tutorials
2 Comments
Share
4 Min Read
SHARE

Data reporting is a very crucial process in Industrial Automation. These data can be of any type such as Batch Data, Alarms log, Process Data, Utility Data, etc.

Contents
What is VB Script?Why do we need to use any scripting language in SCADA?Export Data from WinCC Runtime Advanced into Excel

This article will focus on the usage of VB Script to log data into an excel file.

What is VB Script?

  • VB Script is programming language developed by Microsoft.
  • It is very commonly found scripting language in various SCADA System such as Siemens, Schneider, Indusoft, AVEVA etc.

Why do we need to use any scripting language in SCADA?

  • Many a Times when you want to develop sophisticated and perfect SCADA with many features then to enable that features you have to use scripting language.
  • For Scalability of project.
  • Unlimited possibilities.

Export Data from WinCC Runtime Advanced into Excel

First, make these tags in the tag table.

Here we have added three tags as an example Flow, Pressure, Temperature.

Tag named excel row is for use of VB Script counting.

WinCC RT Advanced

Add a new VB Script and copy the code from this article.

Excel Reporting in Siemens SCADA

This is the complete code.

WinCC Professional Excel Report

Download VB Script: Download Now

Path of the Excel file.

Write data to Microsoft Excel file by WinCC

Excel file Starting cell number of every tag. Change this if you change the Excel file format.

WinCC TIA VB Script data logging to excel

Change these tags if you want to add new tags and do not change any other part of the code if you don’t have any clear idea.

Siemens WinCC VBscript

Configure the SCADA Screen with the following items as shown in the image.

WinCC data logging

For sample reporting, I have configured this button to trigger the excel data. Whenever I press the button new data is inserted into the excel report.

data logging in Wincc advanced

Configure the Alarm window with the following setting, it will be helpful to find any error in the script and troubleshoot it, if the code does not work as expected.

Configure the Alarm window in WinCC Scada

This Excel file formatting. You can change any format you like. But keep in mind the cell number.

SIMATIC WinCC Logging

Now close the Excel file and Start WinCC Runtime in Simulation mode.

Start Simulation in WinCC SCADA

Enter any values in the IO- Field and after that press the “Insert New Data” Button.

data logging functions of the WinCC

Now you can check the new data is inserted into the excel file.

Keep in mind to close the excel window whenever new data is added, otherwise, the script won’t work and result in an error.

Wincc data logging in Excel

EndNote

VBScript has unlimited possibilities to make your SCADA work like charm. So, use this script for your practice and log any data in excel.

If you liked this article, then please subscribe to our YouTube Channel for Electrical, Electronics, Instrumentation, PLC, and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

  • What is Alarm Shelving?
  • Why 24 Volts DC Power Supply?
  • Factory Acceptance Test of PLC
  • Control Two Motors in Sequence
  • Electromagnetic Noise Interference
Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !

Continue Reading

Parts of PLC
PLC Counter Instructions
Vendor Document for Project Systems Architecture
Siemens PLC programming: BCD, Integer, Double Integer, Real
Overview of Industrial Control Systems
How a PLC do the Scaling for a Sensor ?
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
2 Comments
  • behzad says:
    September 13, 2023 at 12:52 pm

    I tested this code, it isn’t save data in columns. only save in rows.

    Reply
  • Rolando says:
    February 5, 2024 at 5:01 pm

    Good morning everyone. Will anyone know where the database error problem lies, when executing scripts to access SQL server, from a Wincc RT Professional client in the TIA portal.

    The Client/Server interaction is carried out perfectly, all screens, menus, etc. are displayed. The problem occurs when an event is executed that needs to read from the SQL database through a script.

    I clarify this, this also happens for the configuration with the web navigator. The scripts works ok on server. Greetings

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

PLC Latching Function
Boolean Logic to PLC Programming
200+ Quiz on Electrical Meters, Measurement, and Troubleshooting
Real-Time Clock in Omron PLC? – CX Programmer
PID with Practical Example
How to Use Analog Input in Mitsubishi FX3U LOLLETTE PLC?
Surface Grinding Process using PLC Program
PLC Programming for Garden Sprinkler System

Keep Learning

Top Automation Vendors

Top Automation Vendors from Around the World – An Overview

Bottle’s Capping with Rotating Mechanism

PLC FBD Program for Bottle’s Capping with Rotating Mechanism

Omron PLC increment and decrement

Increment & Decrement Instructions in CX-Programmer (OMRON)

ICS System Design

ICS System Design Considerations

SFC Language in PLC Programming

SFC Language in PLC Programming

HMI configuration for Delta VFD

Modbus Communication between Delta PLC with VFD

PLC programming for liquid mixing application code

PLC Mixing Logic in Liquids on EcoStruxure Machine Expert-Basic

Basic Concepts of the Safety Relay

Basic Concepts of the Safety Relay

Learn More

Why Damper windings used in synchronous motors

Ball Valve root cause

Ammonia Feed Ball Valve to Ship Tank Closed

Process Control Fundamentals

Process Control Fundamentals

control-engineering-book

Control Engineering Book for beginners

Comparison of Electrical Protection Relays

Comparison of Electrical Protection Relays

intouch Basics

How to Create Project in Wonderware Intouch?

Top 200 Electrical Engineers Objective Questions and Answers

Top 200 Electrical Engineers Objective Questions and Answers

Does Really a Safety Barrier is Important

Does Really a Safety Barrier is Important? – PLC DCS Systems

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?