×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 23829402, Entry date: 10/26/2006
(4)
Rate

Simple Plant visualization with OCX Data Control in VBA for Excel

  • Entry
  • Associated product(s)

Task:
Process data exchange between SIMATIC S7 stations is a core element in the field of automation technology. OPC provides standardized interfaces for this which enable connecting Windows applications to programmable logic controllers (PLCs). The main requirement in this application is visualizing the process variables delivered via OPC, using a simple and cost-effective user interface in Microsoft Excel.

Solution:  
The application on hand shows a very simple process for generating individual visualization user interfaces with Microsoft Excel and VBA. In this application, a simple production plant is simulated with a SIMATIC S7 controller. The required process information is exchanged between the Excel application, via the OCX Data Control, and the SIMATIC NET OPC server and the S7-CPU via the MPI interface.

Hardware configuration

Various tables of an Excel application illustrate how

  • a simple operator user interface for controlling the plant,
  • a minimal recipe management,
  • the display of temporal processes

are realized. In VBA Code you learn how

  • S7 process data with SIMATIC NET ActiveX Controls (without programming skills) and Excel Standard Controls (with individual programming) are linked and displayed
  • larger data volumes are written to the S7-CPU or read from it
  • the most important S7 variable types are converted and displayed in VBA

 

Downloads

Download contents

Download

Documentation (German) 
Einfache Anlagenvisualisierung mit dem OCX Data Control unter VBA for Excel
23829402_OPC_DATCON_EXCEL_DOKU_v10_d.pdf ( 1476 KB )
Documentation (English) 
Simple Plant visualization with OCX Data Control in VBA for Excel
23829402_OPC_DATCON_EXCEL_DOKU_v10_e.pdf ( 1469 KB )
Code 
STEP7 project and Excel spreadsheet (VBA program)
23829402_OPC_DATCON_EXCEL_CODE_v10.zip ( 392 KB )

 

History

Issue

Changes

09/2006 First edition

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.