Read 1421577425.pdf text version

SINUMERIK 840D/840Di SINUMERIK 810D/FM--NC HMI Programming Package Part 1

User's Manual

Edition 03.2003

Manufacturer/Service Documentation

Document Structure

Manufacturer/Service Documentation

SINUMERIK 840D/840Di/ 810D/ FM-NC User's Guide ProTool/Pro SINUMERIK Optionion Kit

SINUMERIK 840D/840Di/ 810D/ FM-NC

SINUMERIK 840D/840Di/ 810D/ FM-NC

SINUMERIK 840D/810D/ FM-NC

SINUMERIK 840D/840Di/ 810D FM-NC User's Manual HMI Environment

Description Installation Guide of Functions HMI Programming HMI Programming Package Package

Description of Functions OSACA Programming Package

Introduction

1 2 3 4 5 6 7 8 9 10 11 12 A I

General information

SINUMERIK 840D/840Di/ SINUMERIK 810D/FM-NC HMIProgramming Package Part 1

User's Manual

HMI Fundamentals

SINUMERIK User Interface

SystemStructure

Regie

Sequence Control

Interface between HMI and NCK/PLC

Alarms (Alarm handling)

Valid for: Component HMI Softwareversion 6.3

Data Management

Reference

Sample Application

Appendix

Edition 03.2003

Index

3ls

SINUMERIK documentation

Printing history Brief details of this edition and previous editions are listed below. The status of each edition is schown by the code in the 'Remarks' column. Status code in the 'Remarks' column: A . . . . . New documentation. B . . . . . Unrevised reprint with new order No. C . . . . . Revised edition with new status. If factual changes have been made on the page since the last edition, this is indicated by a new edition coding in the header on that page

Edition Preliminary 08.95 10.95 10.95 12.96 03.97 03.97 08.97 12.97 12.97 08.98 12.98 11.99 02.2000

Ident-No. 570886.3805.2j 570 886.3806.23 570 886.3809.31 570 886.3806.31 570 886.3806.34 570 886.3809.36 570 886.3806.36 570 886.3806.42 570 886.3809.42 570 886.3806.43 570 886.3806.44 570 886.3806.51 570 886.3806.52 none

Remarks A C Supplement C C Supplement C C Supplement C Supplemenz C C C

Marken SIMATICr, SIMATIC HMIr, SIMATIC NETr, SIROTECr, SINUMERIKr und SIMODRIVEr sind eingetragene Marken der Siemens AG. Die übrigen Bezeichnungen in dieser Druckschrift können Marken sein, deren Benutzung durch Dritte für deren Zwecke die Rechte der Inhaber verletzen können.

Siemens quality for software and training to DIN ISO 9001, Reg.Nr.1258-03 This publication was produced with Interleaf 7. The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.

Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing. We have checked that the contents of this document correspond to the hardware and software described. Nonetheless, differences might exist and therefore we cannot guarantee that they are completely identical. The information contained in this document is, however, reviewed regularly and any necessary changes will be included in the next edition. We welcome suggestions for improvement.. Subject to change without proir notice.

Siemens AG 2000. All rights reserved.

Bestell-Nr. 6FC5 297-6AC60-0AP0 Printed in the Federal Republic of Germany

Siemens-Aktiengesellschaft

03.03

Dear customer

We would like to congratulate you on your decision in selecting the OEM package. Now you have access to everything to implement your operator control interface or 840D NCK functions on SINUMERIK 840. It goes without saying that you can also purchase existing WINDOWS software packages and integrate them into the HMI. The documentation provided shows how you do this. Before you continue to read the paragraphs in small print below, please observe the following information.

Description of software and hardware

The HMI environment (OEM package) is part of the HMI programming package. With SINUMERIK 840D/840Di/810D/FM-NC the following software and hardware descriptions are used:

S S S S S

MMC103-software MMC100-software MMC103-hardware MMC100-hardware OP031/OP032/OP032S

-> -> -> -> ->

HMI Advanced HMI Embedded PCU 50 PCU 20 OP012/OP015

Alterations for the HMI programming package

The following alterations arise for the HMI programming package:

S S S S S S

runs under Windows NT Service Pack 6 we recommend applications to be programmed in Visual Basic 6.0 the additional DOS box function is no longer part of SINUMERIK DDECTL.VBX and MENUGEN are no longer part of the delivery DCTL.VBX is replaced by DCTL.OCX REGCTL.VBX is replaced by IregSvr.DLL

You have everything and you can commence. We also want to support you in the following phase, as well as when your development has been completed and the complete machine has been shipped to your customer. However, our support goes even further. SIEMENS service technicians are available over the machine lifetime to keep your machine up and running thus ensuring customer satisfaction- your customer! We would now like to show you what is available and how you can access it.

The HMI package

You have purchased the software and the documentation and you are now in a position to write software applications for SINUMERIK. If you would like some tips on how you can use SINUMERK interface, then you can use our hotline. This is also true if you need troubleshooting help or if the WINDOWS API (Application Programmers Interface) does not function as it should. The first three months of hotline service are free- -charge as it is included in the OEM package. -of-

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

i

03.03

The software update service

This package is a 'support package' which is included in the OEM package and which is intended to help you after you have purchased your OEM package. It consists of:

S Hotline support S Upgrades/updates

The hotline support service can be ordered under a separate order number and should ideally be purchased directly with an OEM package. The minimum time is 12 months.

Call our hotline if you have questions

You are just developing your SINUMERIK OEM application and all of a sudden Murphy's law hits. You simply can't move on. Or you are in the conceptual phase of your software project and require support as to how your idea can be best realized. Then simply fax our OEM hotline. We will help you before you loose time by experimenting. Let us know your name, telephone- or fax number and your question on the attached fax form. We will call you back the same day and respond to your question. If you should need support when designing or developing your software project please contact your Siemens sales agent. Our Center of Competence at Stuttgart will help you with pleasure.

Why the fax form?

The hotline is not only one person - it is backed up by the whole OEM team. Depending on your particular problem, that expert will call you back. That saves both parties time and increases the quality of the hotline. We will pay for the telephone call - not you. In difficult cases we can contact our own development group or even the professional Microsoft hotline (we will also pay for these costs) so that we can help you quickly.

Why is this hotline not free- -charge? -ofUp until now, you probably were used to being helped by a SIEMENS employee without having to order a hotline service. That will remain the same. This is also true for the initial phase (the first three months) where experience has shown that the most questions occur. In the case of an OEM development, you don't use solely SIEMENS generated functions. You use your own development tools and you use third-party software and create your own new functions. You are a system developer and you have your own software concepts. This should be the case in an open system so that you can fully utilize all of the possibilities. By-the-way the hotline services aren't quite so simple as several years ago when SINUMERIK was still a closed, proprietary system. Of course these costs could be included in a higher OEM package price, but we are of the opinion that you should only purchase that performance which you really require.

ii

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

The software update service

The hotline is included in the software update service. Hasn't it already happened to you? You worked for a long time on a specific function only to finally find out from a hotline that you have a software where this is not even possible? Software has been available for several months now which would do everything for you at the click of a mouse. And now you must order new software which has to go through purchasing- planning, finance- and the sales departments - a -, lengthy process. This will all be a thing of the past with our software update service. You will always receive the latest software and you yourself can decide whether you use it. Your purchasing department is protected from any surprises and can make risk-free calculations. You can concentrate on the technical aspects of the project without having to wait for a software shipment which could endanger the development schedule.

Service Guideline

The Service Guidelines contain instructions for the development of OEM applications. With the checklist of the Guideline one of our authorized service technicians checks, if it is possible to service your Siemens NC together with your applications at reasonable cost

Why compliance with the Service Guidelines?

When you comply with the Service Guidelines, you have strong arguments with your customers. Our goal is to ensure that a differentiation is made between serious, professional OEM developments and 'quick and dirty solutions' : Because your product should have a good image. This service is of course not possible if just any hardware and software is incorporated in SINUMERIK, so that the service technician might even think that it doesn't involve a SINUMERIK. Or do you want to track down every machine although there is a SIEMENS service technician close by who can troubleshoot far more cheaply?

Ordering is easy

The software update service is ordered just like normal hardware or software. For more information contact your local SIEMENS representative.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

iii

03.03

Platz für Notizen

iv

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Preface

Structure of thisdocumentation

The SINUMERIK documentation is organized in three parts: S General documentation S User documentation S Manufacturer/Service documentation Nähere Informationen zu den Druckschriften für alle SINUMERIK-Steuerungen erhalten Sie von Ihrer SIEMENS-Niederlassung.

Target group

This documentation is intended for machine tool builders who equip machine tools with SINUMERIK 840D and SIMODRIVE 611D.It is written for the advanced programmer who is familiar with WINDOWS programming and who is experienced in the programming language Visual Basic. Some parts require knowledge of the programming language C++. Detailed knowledge of the structure of the CNC is a good base for efficient work on HMI projects.

Goals

This documentation introduces the possibilities of carrying out special manufacturing technologies to the machine tool builders using SINUMERIK 840D as OEM. The emphasis is put on functional expansions of the HMI which get practicable with customer--specific WINDOWS applications.

Standard scope of delivery

The documentation of the OEM package MMC is organized in five parts: Introduction Programming instructions Reference Applications Appendix The introduction briefly describes the open architecture of the HMI component of the SINUMERIK 840D and possible OEM applications. You will also find a history of the earlier versions with notes concerning the new functions of the latest SW release. The programming instructions explain how to install the HMI package, how to use the development tools, how to link own applications (consisting of code and data) to the HMI basic system and how to test the new functions. Background information in the Chapters 5 to 10 enable the user to take advantage of all features. Chapter 1 Chapter 2 to 10 Chapter 11 Chapter 12

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

v

Preface

03.03

The Reference part contains a list of the programming interfaces and their definitions in tabular form. The Applications part provides sample applications and user recommendations supplied on disk. Functional extent and installation of the samples are explained in Chapter 12.

Help

For better orientation see the following documents: 1. List of abbreviations and glossary 2. Bibliography 3. Index Appendix Appendix Index

Troubleshooting

If you encounter problems while installing or using the OEM--package, we recommend to read chapters 2.4 and 2.5 prior to a hotline--call: These chapters treat common errors and show how to solve them.

Important This documentation is valid for: HMI Programming Package, software release 6.2 for numeric control SINUMERIK 840D/810D/FM--NC, PCUxx and operator's panel OP 012/015, MMC 103 and operators panel OP 031/032.

Notes

This documentation uses the following conventions:

Note This symbol always appears in the documentation, when importnt information is coneyed.

vi

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Preface

Important This symbol always appears in the documentation, when important information is conveyed.

Warnings

Following warning notes marking different levels of severity are used in the documentation:

!

Warning The device may only be used for the purposes intended by the catalog and the technical description, as well as only in conjunction with non--Siemens devices and components recommended or permitted by Siemens. The proper and reliable operation of the product requires transport and storage according to the relevant standards and instructions, proper mounting and installation, as well as operation and maintenance by qualified personnel.

!

Danger This symbol appears whenever death, severe bodily injury or substantial material damage wil occur, if the appropriate precautions are not taken.

!

Danger This symbol appears whenever death, severe bodily injury or substantial material damage could occur, if the appropriate precautions are not taken.

!

Caution This symbol appears, whenever minor bodily injury or material damage can occur, if the appropriate precautions are not taken.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

vii

Preface

03.03

Caution This warning notice (without warning triangle) means that a material damage can occur if the appropriate precautions are not taken.

!

Attention This warning notice means that an undesired event or an undesired status can occur if the relevant notes are not observed.

Technical notes

Trademarks IBM is registered trademark of International Business Corporation.MS--DOS, MS, Microsoft, WINDOWSt Visual Basict, Visual C++t and Excel are registered trademarks of Microsoft Corporation.

Effect of changes

When data are modified (e.g. machine data), the time when the new values get effective (e.g. after PowerOn or immediately) is worth knowing. Therefore this time is always specified.

Important Before commissioning the numeric control, pay attention to the hints of the corresponding documentation. Order numbers may be taken from the catalogues NC, SD, AR or contact your local SIEMENS--service. Operation is prohibited until it is guaranteed, that the machine is in accordance with legal requirements 89/392/EWG.

viii

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Preface

Manufacturer's note The OEM package HMI includes three components: S HMI Advanced-standard software S OEM tools, examles and sources S Remote diagnosis From these three software components only the HMI Advanced standard software is intended to be stored permanently on the PCU50. When using an HMI component as a development computer, remove the other two software components `OEM tools, examples and sources' and `remote diagnosis' from the hard disk before delivering it to your customer since these are licensed products.

Manufacturer's note When developing additional features realize, that exporting derivative software and the related technical information might require official approval -- e.g. because of the type and intended use of the derivative software. This particularly applies to the SINUMERIK controls, if the derivative software is installed there. The detailed regulations concerning this subject are part of the OEM contract.

ß

Important This symbol marks preliminary features. These are features that may be used for testing purposes during the development process only. They are not intended for released products that are to be run on your customers' control.

Note Whenever we use grammatical forms for persons in the masculinum, this will always happen for pure practical and stylistic considerations; the information provided herein naturally also applies to femal users, female engineers, female programmers etc.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

ix

Preface

03.03

Notes

x

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Contents

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.7.1 1.7.2 1.7.3 1.7.4 1.7.5 1.7.6 1.7.7 2 2.1 2.2 2.3 2.4 2.5 3 3.1 3.1.1 3.1.2 3.2 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.3 3.3.1 3.3.2 3.4 4 4.1 4.1.1 4.1.2 SINUMERIK 840D as an open system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Open system architecture of the Human Machine Interface (HMI) . . . . . . Which parts of the documentation are of interest for me . . . . . . . . . . . . . . Development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Typographic conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . What happened in the last versions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 3.4 August 1996 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 4.2 August 1997 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 4.3 Dezember 1997 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 4.4 August 1998 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 5.1 Dezember 1998 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 5.2 November 1999 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Release 6.0 April 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23 1-23 1-24 1-25 1-27 1-28 1-30 1-32 1-32 1-43 1-52 1-55 1-56 1-58 1-83

General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-103 Features of the component PCUxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-103 Optimizing the development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-106 Problems during operation and how to solve them . . . . . . . . . . . . . . . . . . . 2-106 Transfer of VB applications from 16Bit to 32Bit . . . . . . . . . . . . . . . . . . . . . . 2-109 Notes for the OEM user on "Hard disk Backup/Restore with Ghost" . . . . 2-116 HMI as a part of SINUMERIK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-120 Operator component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-120 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-122 Software architecture of the HMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The layer of the HMI software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alarm server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-123 3-123 3-124 3-126 3-128 3-131 3-133

Basics of the HMI component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-119

Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-137 MPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-137 Transfer of OEM data to the control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-139 OEM applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-141 User interface of the standard NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-143 Info field (header) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-145 Application area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-146

Design of the graphical user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-143

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

xv

Contents

03.03

4.1.3 4.1.4 4.2 4.3 4.4 4.4.1 4.5 4.6 5 5.1 5.2 5.3 5.4 5.5 5.6 5.7 6 6.1 6.2 6.3 6.3.1 6.3.2 6.3.3 6.3.4 6.3.5 6.3.6 6.3.7 6.3.8 6.3.9 6.3.10 6.3.11 6.3.12 6.3.13 6.3.14 6.3.15 6.4 6.4.1 6.4.2 6.4.3 6.4.4 6.4.5 6.4.6 6.4.7 6.4.8

Interactive field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-148 Softkey bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-148 Embedding additional applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-149 How to create an application with the OEM--package . . . . . . . . . . . . . . . . . 4-150 Adapting the standard application to your needs . . . . . . . . . . . . . . . . . . . . . 4-152 Embedding an OEM softkey in the area MASCHINE . . . . . . . . . . . . . . . . . 4-155 Adapting the standard interface (regie.ini, mmc.ini) . . . . . . . . . . . . . . . . . . . 4-156 The application aeditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-158 DH.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-161 MBDDE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-162 MMC.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-162 NETNAMES.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-164 OEMFRAME.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-165 REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-167 S7DPMPI.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-168 Concept of the Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-170 Integration of OEM applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-173 Application with sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The initialization file REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [Version] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [SystemDllCoonfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [MMCDllConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [StartupConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [TaskConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [Miscellaneous] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [CommandToTask] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The initialization file language.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [HSoftkeyTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [VSoftkeyTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [GeneralTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [HSoftkeyIcons] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [HSoftkeyTextsShort] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Section [MsgBox] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions of the RegieServer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switching tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switching tasks in the hidden area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Switching tasks (to hidden area) immediately . . . . . . . . . . . . . . . . . . . . . . . . Screen control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Locking tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions for managing the command line . . . . . . . . . . . . . . . . . . . . . . . . . . Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-174 6-174 6-175 6-176 6-177 6-177 6-180 6-191 6-197 6-197 6-198 6-199 6-199 6-199 6-199 6-200 6-201 6-203 6-205 6-208 6-211 6-213 6-214 6-215 6-216

System structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-161

Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-169

xvi

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Contents

6.5 6.6 6.6.1 6.6.2 6.7 6.8 6.8.1 6.8.2 7 7.1 7.2 7.2.1 7.2.2 7.2.3 7.2.4 7.3 7.3.1 7.3.2 7.3.3 7.3.4 7.4 7.4.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.6 7.5 7.5.1 7.5.2 7.6 7.6.1 7.6.2 7.7 7.7.1 7.7.2 7.7.3 7.7.4 7.7.5 7.7.6 7.7.7 7.7.8 7.7.9 7.7.10 7.8 7.8.1

Events of the RegieServer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-220 Application without sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-226 Entry in the file REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-226 Entry in the file OEMFRAME.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-228 Embedding an OEM application in the HMI . . . . . . . . . . . . . . . . . . . . . . . . . 6-238 Adding help support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-239 Creating an alarm help file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-242 Creating an own help mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-242 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-244 Your first OEM application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Directory structure of SW 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Building the framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Adding an additional window / form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Files of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initialization file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modules and forms of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . Modules of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Temporary files of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . Language support for your applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . User interface and language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . RC files for texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Creating the language DLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Asian languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Language selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Editing Texts Using Codepages Different From the Codepage Used by the Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-246 7-247 7-249 7-250 7-253 7-255 7-255 7-256 7-257 7-257 7-259 7-259 7-260 7-263 7-267 7-268 7-268

Sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-243

Types of windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-272 Application--modal windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-275 Displaying messages/notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-276 Menu control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-277 State table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-277 State transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-281 Procedures and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . State control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Inquiry functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . MDIChild functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Locking/unlocking softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Softkey text functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Displaying texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Modal window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Action functions (dynamic change of the state matrix) . . . . . . . . . . . . . . . . Functions for dynamic graphic resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . Functions for reading/ writing INI file entries . . . . . . . . . . . . . . . . . . . . . . . . . 7-284 7-287 7-290 7-293 7-297 7-302 7-310 7-311 7-316 7-320 7-324

Horizontal and vertical softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-327 Icons for softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-329

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

xvii

Contents

03.03

7.8.2 7.8.3 7.8.4 7.9 7.10 8 8.1 8.2 8.3 8.3.1 8.3.2 8.3.3 8.4 8.4.1 8.4.2 8.4.3 8.5 8.5.1 8.5.2 8.6 8.6.1 8.6.2 8.6.3 8.7 8.8 8.9 8.9.1 8.9.2 8.9.3 8.9.4 8.10 8.10.1 8.10.2 8.10.3 8.11 8.12 8.12.1 8.12.2 8.12.3 8.13 8.14 8.15 8.15.1

Configuring the softkey bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-330 Extending the Softkey bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-332 New functions as from software version 6.2 . . . . . . . . . . . . . . . . . . . . . . . . . 7-333 Global variables of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-335 The Menu Tree Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-336 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-338 Basics of DDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-339 Configuring the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The initialization file MMC.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Command files of the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Connecting several NCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Establishing a DDE connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Establishing a DDE connection with Visual Basic . . . . . . . . . . . . . . . . . . . . Establishing a DDE connection with Visual C/C++ . . . . . . . . . . . . . . . . . . . Establishing a DDE connection from MS Excel . . . . . . . . . . . . . . . . . . . . . . 8-340 8-340 8-343 8-344 8-347 8-347 8-350 8-352

Interface HMI <=> NCK/PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-337

Variable Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-352 Single variable access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-354 Array variable access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-355 File transfer Services (Domain Services) . . . . . . . . . . . . . . . . . . . . . . . . . . . Transferring data between the HMI and the NC/PLC . . . . . . . . . . . . . . . . . Extended copy functions between the HMI and the NC/PLC . . . . . . . . . . . MAP--functions between domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-359 8-359 8-368 8-370

PI Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-374 More NCDDE Server commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-376 OEM--Visual Basic Controls (OCX files) . . . . . . . . . . . . . . . . . . . . . . . . . . . . File DDECTL.VBX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Filei DCTL.VBX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File DCTL.OCX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Applying DCTL.OCX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Diagnosis features for NCDDE--access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Testing functions of the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . State of a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Extensions of the NCDDE server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Multi variable service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Indirect item specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . New access modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-380 8-380 8-381 8-381 8-387 8-393 8-393 8-395 8-396 8-401 8-401 8-402 8-402

How to configure the NCDDE Server for access via network . . . . . . . . . . 8-397

Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9 . . . 8-403 Online--help for variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-408 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409 Connection break down with NCK/PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409

xviii

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Contents

8.15.2 8.15.3 8.15.4 8.16 9 9.1 9.2 9.3 9.3.1 9.3.2 9.3.3 9.4 9.4.1 9.4.2 9.4.3 9.5 10 10.1 10.2 10.2.1 10.3 10.4 10.4.1 10.4.2 10.4.3 10.4.4 11 11.1 11.1.1 11.1.2 11.1.3 11.1.4 11.1.5 11.2 11.2.1 11.2.2 11.3 11.3.1 11.4 11.5 11.5.1 11.5.2 11.6

...didn't respond to DDE-Initiate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409 Form Load takes long because many Hotlinks are being established . . . 8-409 First Execute commando doesn't work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-410 Determining the active bus nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-410 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-412 Types of Services (DDE link mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-414 Services of the Alarm DDE Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alarm Server commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Advise variables of the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Request variables of the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Initializing the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The file MBDDE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . The file NETNAMES.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alarm text files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-414 9-414 9-416 9-420 9-423 9-423 9-430 9-431

Alarms (Alarm Handling) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-411

Alarm areas of the Sinumerik 840D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-433 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-436 Directory structure of the Data Management . . . . . . . . . . . . . . . . . . . . . . . 10-437 Properties of the elements in the directory tree . . . . . . . . . . . . . . . . . . . . . 10-438 Elements in the MMC Data Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-443 Functions of the Data Management Server . . . . . . . . . . . . . . . . . . . . . . . . Establishing DDE connections with the Data Management Server . . . . . Request Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Simple Execute jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Complex Execute jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Areas of the NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File systems of the NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Domain Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . PI Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-449 10-449 10-451 10-459 10-468 11-481 11-481 11-482 11-485 11-485 11-488

Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-435

Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-481

Variable definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-488 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-488 Shared modules of active and passive NCU file system . . . . . . . . . . . . . . 11-489 Module types for the active file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-492 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-494 Machine data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-495 PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-496 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-496 Summary of the PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-498 PI Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-503

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

xix

Contents

03.03

11.7 11.7.1 11.7.2 11.7.3 11.7.4 11.7.5 11.7.6 11.7.7 11.7.8 11.7.9 11.7.10 11.8 11.9 11.10 11.10.1 11.10.2 11.10.3 11.10.4 11.10.5 11.11 11.11.1 11.11.2 11.11.3 11.11.4 12 12.1 12.2 12.3 12.4 12.5 12.6 12.7 12.8 12.9 12.10 12.11 12.12 12.13 A A1 A2

NCDDE -- Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Variable LastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . General error class definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Definition of the Error Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 1, 4 and 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Detailsfor general = 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Details for general = 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

11-505 11-505 11-506 11-507 11-507 11-512 11-513 11-513 11-514 11-515 11-517

Error messages of the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-518 Directory structure of the Data Management . . . . . . . . . . . . . . . . . . . . . . . 11-519 Software Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . File extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Alarm numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Supported languages and Language shortcuts . . . . . . . . . . . . . . . . . . . . . Assignment of ANSI tables and fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Hardware information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Memory addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Input/output addresses MMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . More details on the PCU50 hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-531 11-531 11-533 11-534 11-538 11-539 11-540 11-540 11-541 11-542 11-543

Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-545 Sequence Control / Application change--over . . . . . . . . . . . . . . . . . . . . . . . 12-545 NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-546 Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-546 Example Regie/OEMFRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-547 Data Management Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-548 NCDDE Server for PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-548 Positioning WINDOWS applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-549 Example Data exchange between Visual Basic and DLL . . . . . . . . . . . . . 12-549 Functions of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-549 Sequential processing of several asynchronous jobs . . . . . . . . . . . . . . . . 12-550 Starting an application with an OEM softkey and realizing a DCTL connection . 12-550 Operating a 32--bit C++ application with softkeys . . . . . . . . . . . . . . . . . . . 12-551 Embedding SprintPlus in MMC--OEM applications . . . . . . . . . . . . . . . . . . 12-551 Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-554 Technical terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-556

Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-553

xx

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Contents

A3

Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-558 I-569

Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

xxi

Contents

03.03

Notes

xxii

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Introduction

1

The flexible numeric control SINUMERIK 840D / 810D/FM--NC provides the machine tool builder many ways to extend and adapt internal functions. Starting out with the fast operation of the standard NC--kernel with its basic features and a standard user interface, they can carry out manifold extensions and create interface designs in a customer--specific manner.

1.1

SINUMERIK 840D as an open system

Components

Customer demands on the NC have three technical aspects: hardware supplements design of a user interface (HMI) extension of the NC--kernel functions.

Open system

The open system architecture of the SINUMERIK 840D provides a suitable programming interface for each of the above aspects.

Hardware-supplements S PLC modules S PCUxx components max. 3 SIMATIC--S7 racks containing: input and output modules, FC modules... PCI/ISA adapter with 2 slots for: -- measuring device -- network card -- floppy disk drive -- PC card adapter fast NCK environment, digital and analog input and output. link V.24 or MPI interface for: communication, networking, PGs, PCs.

S NCK components S serial

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-23

Introduction 1.2 Open system architecture of the Human Machine Interface (HMI)

03.03

HMI design S PLC modules S HMI components in conjunction with PLC program: lamps, buttons, mini--control panels in connection with PCI/ISA adapter: driving operation and display components via standard PC boards in conjunction with the OEM package HMI

S HMI applications

Extension of NC- functions S PLC modules in conjunction with PLC program: operation of peripheral equipment and additional axes form the most powerful method for providing the NC--kernel with fast additional functions.

S Compile cycles

Table of configuration/OEM domains

Table 1-1 Configuration and OEM domains of SINUMERIK 840D

Range application development environment connection access to data storage medium programminglanguage OEM application

HMI WINDOWS on industrial PCs Regie Sequence Control OPC/COM harddisc Visual Basic VisualC++

1.2

Open system architecture of the Human Machine Interface (HMI)

New feature

The open system architecture of the Human Machine Interface (HMI) is a new feature of the SINUMERIK 840D / 810D / FM--NC in the consequent pursuit to offer a completely open numeric control to the machine tool builder as an OEM. This applies to hardware as well as to software.

1-24

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.3

Introduction Which parts of the documentation are of interest for me

Open hardware

The PCU503 is a standard PC that supplies several hardware interfaces for: mass storage floppy disk drive PCI/ISA box for PCU50 2 serial interfaces and 1 parallel interface.

Open software

The standard software of HMI Advanced includes the operating system MS Windows NT SINUMERIK standard user interface, using which standard and adapted software applications can be run. A standard PC with MS Windows NT as operating system offers many ways to design user specific applications. The structure will be described in more detail in Chapter `HMI fundamentals'.

1.3

Which parts of the documentation are of interest for me

Chapter 3.2 contains an explanation of the technical terms used in Chapters 5 to 10. It depends on your special application which parts of the documentation are of interest for you beyond that.

Integrators

The HMI standard user interface satisfies the needs of your NC. However, you want to use the PC for other purposes, too. Therefore you additionally integrate third party applications, e.g. CAD programs, using additional softkeys.

Modifiers

You do not really want to know how the HMI works, but you still want to slightly modify the standard. Use the OEM calls to the standard applications.

Interface designers

You miss your function on the HMI standard interface. Therefore you add own applications which can be operated like the HMI standard interface by softkeys and the operating panel (e.g. for configuring and displaying NC user data).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-25

Introduction 1.3 Which parts of the documentation are of interest for me

03.03

Power User

Your customers buy your machine. You do not mind the standard user interface of the SINUMERIK. Your Corporate Identity is supposed to dominate the interface of the control.

Interfaces of the OEM package

A system of interfaces is provided which can be variably combined according to the requirements: Server for accessing NC data: NCDDE Server Alarm Server Data Management Server Regie Sequence Control StandardNC applications, e.g. machine, parameter The table below lists the interfaces that might be of interest for you. You need to use those printed in bold letters in any case, the others depending on the range of functions of your application.

Table 1-2

Who needs which interfaces of the OEM package Modifiers Regie Sequence Control NCDDE-Server Alarm Server Interface designers Regie Sequence Control NCDDE-Server Alarm-Server NCDDE-Server Alarm-Server Power users

Integrators Regie

Data Management Data Management Data Management Server Server Server

1-26

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.4

Introduction Development environment

1.4

Development environment

Overview

In order to develop customer--specific applications which are to be executed on HMI the following equipment is required: standard PC for program development standard software tools for WINDOWS applications HMI Programming Package as basis for developing customer--specific programs numeric control SINUMERIK 840D / 810D / FM--NC for testing customer applications in the system environment software engineers with sufficient know-how of NC systems and experience in modern high level languages.

Hardware

HMI applications are developed on standard PCs under the operating system MS Windows NT. System requirements are listed in Chapter 2 `General information'.

Software

HMI customer applications are written using standard software development tools like : S Visual Basic VB 6 S Tools for adding texts to the DLLs (e.g. Visual C++) S HMI Progamming Package The required extent of the external tools and recommendations for their use are listed in Chapter 2 `General information.

Test tools

Applications developed under WINDOWS with the OEM package HMI are S tested on the PC S simulated in a model environment and S transferred to HMI. The final system test is carried out under realistic operating conditions on the target hardware, a complete NC with the necessary configuration.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-27

Introduction 1.5 Support

03.03

Demands on the software engineer Developers of HMI applications work at the boundary of general WINDOWS programming and NC--specific requirements. They must therefore be familiar with both fields and additionally they should be experienced in the organization of software projects.

Experience with PCs

This includes especially: S experience in carrying through development projects based on PCs S detailed experience in programming DOS and WINDOWS S knowledge of object--orientated problem solving and programming S detailed experience in Visual Basic Professional S experience with a resource editor, e.g. Visual C++

Knowledge of the NC-subject

The requirements basically depend on the technical demand of the problem: S knowledge of the software architecture of the NC S familiarity with the necessary data S experience in the design of technology--specific and user--friendly user interfaces

1.5

Support

The OEM user is provided several kinds of support: -- training -- software support service with hotline -- hard-/software development service

1-28

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.5

Introduction Support

Training

The SINUMERIK concept for graded training offers among others: S operating and programming of the NC control S setting into operation and maintenance S OEM applications and leads to an advanced understanding of the structure of the numeric control and the MTB's diverse possibilities of adapting the base system to serve his own purposes. The know--how needed for an efficient use of the development tools can be acquired in courses at the SIEMENS training center.

Software Update Service

With the software update service the user purchases support for the next releases (update-- and upgrade--versions). update An update is a software version with a higher version--number. It contains bug fixes. Example: update from release 3.4 to 3.6 An upgrade is a software with a higher release number. It offers new features. Example: upgrade from release 3.6 to release 4.2 The hotline for the OEM--package is part of the software update service.

upgrade

hotline

A software update service may be concluded for the actual product release only. The period of validity is 12 months and will be prolonged for further 12 months, if it is not canceled at least four weeks before its end.

Hotline

Together with the OEM package HMI the customer is provided three months of support by the hotline. This period can be extended by further 12 months in the software support contract.

Fax-hotline

You can contact the OEM hotline by calling the Technical Support Center in Erlangen: Phone: Fax: E--Mail: 0180 / 525--8008 0180 / 525--8009 [email protected]

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-29

Introduction 1.6 Typographic conventions

03.03

Hardware and software-service

After the customer requirements are split up into hardware supplements design of HMI operator interface extensions of the NC functions and the question of how to realize PLC programming WINDOWS development in HMI OEM extension of the NCK with Compilecycles is decided, the question of execution by eitherown staff or order to external suppliers turns up. Here outsourcing to the SIEMENS development department will be economical. Experienced programmers and system specialists will tackle the task on time and for a fixed price.

1.6

Typographic conventions

Besides some text passages this manual also contains examples of programs, extracts from programs and instructions for the user for pressing certain keys or entering certain combinations of keys. In order to emphasize these components of the documentation they are marked with different fonts or styles. These typographic conventions follow the conventions used in the manuals of the programming languages `Visual Basic' and `Visual C++'. The conventions are listed in the chapter `Introduction' under `Document Conventions'.

Table 1-3

Typography of text components in this user's manual example meaning and description reserved keywords of the programming language: bold, initial letter capitalized names of properties, events, special objects: initial letter capitalized user keyboard entry: bold within texts: first appearance of a term, put emphasis on a text passage italic

Sub, If, ChDir

BackColor, Click, Debug setup event-driven

1-30

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.6

Introduction Typographic conventions

Table 1-3

Typography of text components in this user's manual example meaning and description within programs: place--holder for information to be supplied by the user: italic within programs: optional entry inside square brackets within programs: selection from two or more items: inside curved brackets user defined variable and error messages type Courier program code: type Courier program code should be typed all in one line of the code window:identifier icon for line continuation: Ä file name: capital letters names of keys and combination of keys: small capital letters combination of keys + -- sign between key

eventname

[expressionlist] { While|Until }

Syntax error Sub HelloButton_Click () Readout.Text = "Hallo!" End Sub Readout.Text = "This Äshould be typed all in Äone line" CONSTANT.TXT ENTER, CTRL+R ALT+F1

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-31

Introduction 1.7 What happened in the last versions?

03.03

1.7

What happened in the last versions?

1.7.1

Release 3.4 August 1996

Overview

New and modified features: S S S S S S S S S S S S S S S S S S S S S S S S S S S S S S documentation delivery volume extended delivery volume (new source files) help--feature for variables modified installation procedure information on updating from release 3.1 to 3.4 new start--up routine extended area for the DLLs attribute AccessLevel for the Regie new Regie Control texts for the Regie tool for configuring the Regie dynamic link library of the Regie temporary files of the Sequence Control softkeys with access rights extended menu tree generator extended copy--function between domains additional information on the Domain--Service modified Data Management server variable stopCond new variable stopCondPar variable safeFctEnable, parameters changed global user variables, index range changed local user variables, index range changed additional PLC variables Control TABELLE.VBX variable load, data type changed variable axisFeedRateUnit, corrections State data for axes, limit values PI Service _N_F_PROT, parameters

1-32

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Documentation

The documentation has been revised and newly structured to achieve a clearer organization. All chapters cally Chapter 5 Chapters 6 and 7 The sections of the .INI--files have been sorted alphabetistructure of the system has been added Chapters 5 (Regie) and 6 (Sequence Control) have been moved to chapters 6 and 7. The information on the keyboard server --so far contained in chapter 7-- has been shared out to the corresponding sections (Regie and Sequence Control). The description of variables has been shortened. Now you can find more detailed information in the documentation `lists' /LIS/ or you can use the online--help to take over the information directly to the corresponding project. The online--help for variables is described in chapter 8. The PI Services have been newly structured and sorted according to the type of service. The NCDDE alarms have been significantly updated. New chapter containing information on software and hardware

Chapter 11

Chapter 11.12 Chapter 11.14 Chapter 11.18

Delivery volume

The delivery volume of the OEM--package MMC consists of four components listed in the following table.

Table 1-4

Delivery volume of the OEM--package MMC release 3.4 volume MMC 102 base system as it can be run on the NC or an external PC sources, examples, Sequence Control, online--help for variables 32 bit extender for WINDOWS 3.11 number of disks 10 3 2 2

software MMC 102 base system OEM--package WIN 32S

remote diagnosis host and target software for remote diagnosis

A complete installation of all components requires about 64 MByte of storage on your hard disk.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-33

Introduction 1.7 What happened in the last versions?

03.03

Extended delivery volume

The delivery volume now contains the source files of the two standard applications `alarm diagnosis' and `parameters'.

Note We supply these source files so the OEM customers can hook own diagrams or menu trees in already existing applications. You should not use the internal interfaces of the applications, because we cannot guarantee compatibility of these interfaces in future releases.

Help feature for variables

The online--help for variables has been added to the delivery volume. It may generally be used for programming the MMC 102, configuring the MMC 100 or programming the PLC with the NC--var--selector. Information on variables can be accessed by various search criteria (as you are familiar with using the WINDOWS help). From there you can directly take over the definition of variables to your project. You can define bookmarks for variables you frequently use or add your own comments. The extend of this feature and its application is described in chapter 8.

Installation

The installation procedure of the OEM--package MMC release 3.4 differs from the procedure used up to now. You can find detailed instructions for installing and uninstalling the package in chapter 2.

Updating release 3.1 to 3.4

Applications that were developed with release 3.1 can be run under release 3.4 as well without making any changes. However, if the applications are edited and then compiled with the new Sequence Control of release 3.4 the .MAK file of the Visual Basic project must be edited first. To do so, open the .MAK file with e.g. WINDOW's editor NOTEPAD and merely replace the entry "REGIECTL.VBX" by "RECTLP32.VBX".

1-34

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Important: This applies to global user variables !

If you are using global user variables in your project consider, that the index range of the global user data GUD, GD1 to GD9 as described in chapter 11 has been changed: column index = index of the variables used to start from 0. Since release 3.2 it starts from 1.

Important: This applies to local user data !

If you are using local user variables in your project consider, that the index range of the local user data LUD as described in chapter 11 has been changed: row index = index of the variables used to start from 0. Since release 3.2 it starts from 1.

New start-up routine

From release 3.1 on there is a new start--up and software loader for the operating component MMC 102. It is described in more detail in the Installation & Start--up Guide (IA). This routine is called during start--up: When the text "Starting DOS ..." is displayed, press the key "6" and select from the opened menu.

Extended area for DLLs

The Regie can now manage twice as many DLLs: S 32 auxiliary applications S 32 area applications S 64 dynamic link libraries (DLL) of the system S 64 dynamic link libraries of the MMC.

Attribute AccessLevel for the Regie

The new attribute `AccessLevel` has been added to the section [TaskConfiguration]. Using this attribute you can set the access permission levels for the tasks of the Regie. From release 3.2 on the softkeys for handling the Regie have been assigned access rights.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-35

Introduction 1.7 What happened in the last versions?

03.03

Table 1-5

Softkeys for operating the Regie

Maschine

Parameter

Program

Services

Diagnosis

Set up

The default value is AccessLevel := 4. The possible levels of access permission are listed in table 1--6, where the default value is marked with gray background color.

Table 1-6 The eight levels of access permission

access S0 S1 S2 S3 S4 S5 S6 S7

required system password MTB password service password user password key switch position 3 key switch position 2 key switch position 1 key switch position 0

user group SIEMENS machine tool builder set--up / service staff (machine tool builder) privileged user (in--house service) programmer trained operator operator semi--skilled operator (NC start/NC stop, operating panel)

Example:

[TaskConfiguration] Task2 = Name := ib, AccessLevel := 2 Only the set--up staff may access the area application `set--up' by entering the MTB's password.

New Regie Control

A new control ( RECTLP32.VBX ) now including a command interpreter channel has been developed for the Regie. You can find a more detailed description in chapter 6.

Texts for the Regie

The language dependent texts for the Regie are no longer stored in the language-DLL, but rather in a file called <language.INI>. This file can be edited using any ASCII editor. You can find information on its structure in chapter 6.

1-36

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Tool for configuring the Regie

The section [TaskConfiguration] of the REGIE.INI can be configured using this configuration tool. You can find it in the service menu on the control and in the path ..\aconfig\aconfig.exe in the installation--directory of the MMC--OEM--package. This configuration tool can be used for S specifying how the softkeys are to be labeled for each task. This can be done for all languages to which the corresponding files exist (...\MMC2\LANGUAGE\RE_XX.INI). S editing the parameters of the file REGIE.INI (name, CmdLine, DosBox, PreLoad, TimeOut, HeaderOnTop, TerminateTasks and AccessLevel ) S moving or removing existing entries The tool offers an online--help for how to use it.

Note This configuration tool is suitable for editing the initialization files REGIE.INI starting with release 3.2.

Dynamic link libraries of the Regie

The functionality of the REGIE.DLL has been significantly extended. The REGIE.DLL now offers functions providing S task changeover S task changeover to an non displayed area S immediate task changeover to a non displayed area S screen control S locks S command line S miscellaneous. Chapter 6 gives an overview of these features as well as more detailed information.

Temporary files of the Sequence Control

Installing the software--package release 3.4 will automatically delete the temporary files of the Sequence Control stored in <drive>:\ALTMP\*.$$$.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-37

Introduction 1.7 What happened in the last versions?

03.03

Softkeys with access rights

Each softkey can now be assigned an access permission level (AccessLevel). An additional attribute AccessLevel has been added to the state matrix PROGNAME.ZUS. You can use this attribute for setting the access rights for this softkey's actions. The preset value for an invalid entry is AccessLevel := 5. For a missing entry (when taking over existing menu structures) AccessLevel:= 7 (i.e. no access level) is reserved. Table 1--7 lists the possible levels of access permission. The default value is marked with gray background color.

Table 1-7

The eight levels of access permission required System password MTB password service password user password key switch position 3 key switch position 2 key switch position 1 key switch position 0 user group SIEMENS machine tool builder set up / service staff (machine tool builder) privileged user (in--house service) programmer trained operator operator semi--skilled operator (NC start/NC stop, operating panel)

access level 0 1 2 3 4 5 6 7

Access levels and user classes may also be defined and managed with symbolic names.

1-38

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Menu tree generator

The menu tree generator (Screen Control Design) has been revised and adapted to the new features of the Sequence Control. Additional features: S S S S S improved graphical user interface marking of the Z--Flag by store/unload instead of store/drop entry field for locking softkeys entry field for softkey switch over marking states of the softkey text switch over

modified features: S removing softkey bars: Now a special button DELETE is offered for deleting softkey bars S RECALL--key: If no subsequent state has been configured for the recall--key, the preceding state is not taken up. S It is no longer necessary to insert at least one softkey text (e.g. a space ) for each state. New features of the Sequence Control There now are new functions available for realizing the Sequence Control. There are in total 43 functions for the S S S S S S S S state control help feature MDIChild function release/lock softkeys softkey text feature text display modal window functions action functions (dynamic changes of the state matrix)

You can find more details in chapter 7.

Extended copy-function between domains

Since SW--release 3.3 extended copy--functions are available: During heavy hotlink--activities they offer higher data throughput than single PI-- and transfer--commands. The new functions are described in chapter 8.3.2.

Additional information on the Domain Service

Concerns the command MAP_ACC_MC, as described in chapter 8: If the parameter WinFile is a file with the extension.NSK the Domain Service besides an ACC file generates a NSK file that contains the corresponding LINK commands.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-39

Introduction 1.7 What happened in the last versions?

03.03

Data Management Server

The Data Management Server has been revised. Modified and extended features S The Data Management Server now also allows to use paths of the whole DOS file system. These paths must start with the specification of the disk drive: A:\TEST.ARC , C:\TMP\TEST.XYZ, K:\TMP\NEU.TXT They may be used for the create and copy procedures as source respectively as destination. S When accessing the specified floppy disk, the Data Management Server checks to see whether the disk slot is closed. In case of an error, the new error code 125 will be returned. S If the destination of a copy procedure starts with a disk drive specification, the data type is set to either DOSFILE or DOSDIR S The function copy now allows the active file system to be a path for loading/unloading the active file system of the NC. Example: load copy \NCINI.MDN\UFR.DIR\CH_UFR.INI --m \INITIAL.INI --nf * \ unload copy \CH_UFR.INI --n \NCINI.MDN\UFR.DIR\CH_UFR.INI --mf Access rights are not considered during this procedure. S Handling PLC data has been extended: Copy a PLC file to a DOS file copy \PLC.DIR\0800001 --n C:\TMP\TEST.TXT --m DOSFILE Copy a DOS file to a PLC file copy C:\TMP\TEST.TXT --m \PLC.DIR\0800001 --n DOSFILE create \PLC.DIR 0800001 ------ DOSFILE --n C:\TMP\QUELLE.TXT S The function Best_Datatype now allows the following call: Best_Datatype test mpf \wks.dir\welle2.wpd --n In this case the data type is set according to the data types valid in this directory. New functions S function activate2: works just like activate, the source file however is not deleted. S function get_attributes2: same call as get_attributes, same result as obtained from list Example: topic: get_attributes item: \wks.dir --n #100#WKS WKS work pieces DIR WKS 0 812388942 DM 77770#

1-40

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Variable stopCond

The valid values of the variable hold state of NC, /Channel/State/stopCond as it is described in chapter 11, have been added the values below so that now 50 values may be returned: 25 26 27 28 29 30 "wait for gear stage change" "wait for position control " "wait for threat cutting" "wait" "wait for punch " "wait for safe operation".

The following values have been reserved: 31 to 50 "wait 31" "wait 50",

The corresponding texts will be specified when needed. This extended range of values must be considered.

New variable stopCondPar

There is an additional parameter /Channel/State/stopCondPar for the variable hold state of the NC (/Channel/State/stopCond) indicating possible reasons for four holdstates referring to axes respectively to spindles. For all other values of the variable stopCond not listed here the variable stopCondPar = 0. value 12 15 22 23 variable stopCond "wait: axis enable missing" "wait: for spindle" "wait: spindle enable missing" "wait: axis feed override 0" variable stopCondPar axis number spindle number spindle number axis number.

Variable safeFctEnable

The variable safeFctEnable for SISITEC axes provides the contents of the machine data MD 36901_SAFE_FUNCTION_ENABLE.

Global user variable

The range of the global user data GUD, GD1 to GD9 as described in chapter 11 has been changed: column index = index of the variable used to start from 0. Since release it starts from 1.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-41

Introduction 1.7 What happened in the last versions?

03.03

Local user variable

The range of the local user data GUD, GD1 to GD9 as described in chapter 11 has been changed: row index = index of the variable used to start from 0. Since release it starts from 1.

PLC variable

The description of the PLC variables in chapter 11 has been added the following items: /Float /Directory /Hierarchy1 /Directory /Hierarchy2 /Directory /Hierarchy3 no additional parameter: accessing four sequentially stored bytes to be inter-preset as floating point number accessing the module list of all types of modules accessing the module list of one module type accessing the module list of modules of a special module The cycle time for cyclic services for PLC variables is 500 ms

additional parameter: --FAST The scan time is 100 ms for both this variable and all other variables of the same cluster.

Control Tabelle.VBX

The control TABELLE.VBX should no longer be used.

Variable load (Service Drives)

The data type of the two variables operating the drive load driveHSA/State/Load and DriveVSA/State/Load have been changed from unsigned to float. Thus the minimum value = 0,0 ; maximum value = 100,0.

1-42

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Variable axisFeedRateUnit)

The values of the variable (Unit of the axis feed rate in the modules SEGA and SEMA) axisFeedRateUnit have the following meaning: 0 = mm/min 1 = degree/min (and not mm/rev) 2 = inch/min 3 = no meaning (and not inch/rev).

State data of the axes, limits

The number of lines of the variables in the modules SMA SEMA SGA SEGA State data for machine axes in the machine coordinate system Extended state data for machine axes in the machine coordinate system State data for geometry axes and additional axes in the workpiece coordinate system Extended state data for geometry axes and additional axes in the workpiece coordinate system

does not reach from 0 to M_AX_NUM, but from 0 to numMachAxes (stored in the module CY).

PI Service _N_F_PROT

There are only two levels of the access right for the function execute of the PI Service _N_F_PROT (assign access rights to a file): 0 : file cannot be selected for execution or 7 : file can be selected for execution.

1.7.2

Release 4.2 August 1997

Overview

New and modified features: S S S S S S S S S S delivery volume installation operating system information on updating from release P3.6 to P4.1 32--bit server for NC data OEM examples "simulation" on PC control Tabelle.VBX documentation online help for NC data and PI Services

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-43

Introduction 1.7 What happened in the last versions?

03.03

S S S S S S S S

new PI Services source code menu tree generator new directory structure new configuration tool OEM softkeys: customer interfaces modifications of the Sequence Control new features of the Sequence control

Delivery volume

The delivery volume of the OEM package MMC consists of three parts listed in the table below: software MMC 102 standard--SW OEM discs remote diagnosis features MMC 102 standard--SW examples, Sequence Control host-- and target software for remote diagnosis 14 2 2 discs

Installation

Install the OEM package by first installing the MMC102 standard SW and then the OEM discs. For this purpose there is a set--up program contained on the first disk which is started under windows. The remote diagnosis can be installed if needed.

Operating system

Since package 4.1 the MMC102 software uses Microsoft Windows 95 as operating system. Notice In spite of this the Regie (task management) can still handle 16 bit applications only, i.e. even using the OEMFRAME only 16 bit operations can be started.

1-44

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Update from SW 3.6 to SW 4.2

It was intended to achieve binary compatibility of the .EXE files that have been created with release 3.6, i.e. applications that have been created for the MMC pakkage 3.6 should run without error on a control after software release 4 was installed. Unfortunately this cannot be guaranteed for all applications. If you have problems with your applications, you have to regenerate the Sequence Control of the OEM package 4.2. For this purpose you must use Visual Basic 4.0 16 bit.

32-bit server for NC data

The servers for NC data (NCDDE--Server, Alarm--Server) are supplied as a 16 bit version of the standard software. If you should need a 32 bit version (e.g. for operating SIMATIC--programming devices), contact your local dealer.

OEM examples

Two OEM examples have been added: S Example 11: Functions of the Sequence Control S Example 12: Sequential execution of several asynchronous jobs

Simulation

In principle there are restrictions when simulating standard components on the PC, since not all required variables are available and certain functions do not work.

Control Tabelle.VBX

The control "Tabelle.VBX" does not exist anymore. Use the control "grid.VBX" instead.

Documentation

The documentation has been completely revised and has been added the functions important for software release 4.

Online help for NC-data and PI Services

The new package supplies an online--help for PI Services as well as for all data of the operating panel's interface (BTSS) released for OEM use. Concerning the BTSS variables the following programmers/configurers can be seen as OEM-users: S programmers of applications of the MMC102--OEM S configurers of the OP030

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-45

Introduction 1.7 What happened in the last versions?

03.03

S PLC programmers using the NC--Var--Selector The online--help for the PI Services contains the descriptions of the parameters and an example for each service. The online--help for the BTSS variables contains the information included in the user /LS/ in chapter 4 "Variables". In addition to this the package supplies examples for all BTSS components which can be copied by the OEM programmer. The following text uses the expression BTSS--components for the different programming environments (OEM--MMC, OP030 and NC--Var Selector), since all of them can be connected to the operating panel (BTSS).

Using the online-help for BTSS-variables

The layout of the online--help has been especially designed for use on a PC. There are no lists displayed (like in earlier versions of the paper documentation), but for each BTSS--variable the complete information is displayed on one screen. The online--help exclusively uses windows standard functions, so the OEM user does not need any special know--how. The PC system does not need to be especially configured: The online--help can be run on any PC under Windows (German and English Windows version tested). The online help runs as an independent Windows application parallel to the OEM configuration package. There are no links between the OEM package and the online--help. Here is a list of the standard functions of the online--help (like the OEM user is familiar with from other online--helps). S You can print the topic presently displayed S You can add personal notes to each topic S You can copy parts from the displayed topic and drop them in another file. This is useful for taking over a programming example to your OEM program. S You can define bookmarks for quickly finding frequently used topics. S The online--help itself contains an online--help that describes the functions (bookmark, print, copy). S You can skip several description levels when jumping to the information on each variable. data areas --> data modules --> variables --> example S You may also directly search key words. Typical keywords are: abbreviation of the data modules variable names (appear in the search window as "variable..") short description of the variables

1-46

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

New PI Services

Now there is an online--help available for PI Services. The following PI Services are available since software release 4.2. _N_CRCEDN _N_DELECE _N_TMCRTO _N_TMFPBP Creates a cutting edge by specifying an edge number Deletes a cutting edge Creates a tool with a specified name, tool number and duplo number in the tool management Searches for an empty place in a specified magazine: you can specify the place type, which magazines are to be searched through and how much space the tool needs. Determines the T--number for a given tool--ID and Duplo--number

_N_TMGETT

Symbolic addressing

Please use symbolic addressing of PI Services from now on: /NC and /PLC can be much more easily read than e.g. /0d0d

Source code

The sources of the applications machine, parameters and diagnosis were supplied with earlier software releases to enable the OEM user to assign his own functions to softkeys of these applications. This brought the disadvantage that these applications had to be recompiled each time the MMC software was updated. To solve this problem MMC102 SW 4.2 introduces the OEM softkeys.

Menu tree generator

The menu tree generator has not been modified since SW 3.2.

New directory structure

The directory structure of the MMC102 has been extended to simplify the handling of customer applications.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-47

Introduction 1.7 What happened in the last versions?

03.03

Up to now the files of the MMC were located in the directory \MMC2. This directory also contained the OEM applications and the .ini files (regie.ini,...) were modified there. After an MMC update all OEM--specific modifications were lost, since the \MMC2--directory was deleted and then reinstalled. To improve this three additional directories are created since SW 4.2: S ADDON S OEM S USER for SIEMENS applications like Autoturn, SINDNC, etc. for OEM applications for modifications of the .ini files, alarm texts etc.

The \MMC2 -- directory still exists. It is however write protected since SW 4.2. It is still deleted while updating, but because the OEM specific modifications are now located in other directories, they remain effective. Developers of OEM applications should take care that their applications can be installed in one of the new directories and that the default path of a corresponding SETUP application refers to the OEM directory. To embed user specific NC--data the system calls the file user.nsk.

New configuration tool

A new configuration tool has been developed for the MMC102 SW 4.2. You can use this tool to 1) configure the section [TaskConfiguration] of the file REGIE.INI 2) edit the writeable .ini files of the MMC102. Modifications that were done with the configuration tool are stored directly in the corresponding files in one of the new directories ADDON, OEM or USER. You can find the tool on the control in the service menu and on the PC in the programming group for the OEM package MMC. You can use it for S specifying the softkey labels for each task. Here all languages defined in the file mmc.ini are offered for selection. S editing the parameters of regie.ini (name, CmdLine, DosBox, PreLoad, TimeOut, HeaderOnTop, TerminateTasks and AccessLevel ) S adding new tasks to the Regie S moving and deleting existing entries The configuration tool online explains the possible operations.

Note The configuration tool is suitable for editing initialization files starting from SW 4.2.

1-48

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

OEM softkeys: customer interfaces

For each application supplied with the SINUMERIK 840D MMC102/103, you can configure additional states by making entries in the corresponding .ini files. This allows you to insert user pictures at predetermined places without modifying the application itself.

Note This function is described chapter 4.4.

Accessing .INI-files

Due to the new directory structure .INI files may be located in different directories. In order to access the highest priority entry you should refrain from using functions of the WINDOWS--API and rather use the following functions of the library AB16.DLL which is part of the Sequence Control. ALGetPrivateProfileString ALGetprivateProfileInt ALWritePrivateProfileString If the base directory of the .INI file differs from the base MMC directory (typically L:\MMC2), the corresponding standard C functions are called. When reading values with the functions ALGetPrivateProfileString and ALGetprivateProfileInt the directories..\USER, ..\OEM, ..\ADD_ON and MMC2 (in this order) are searched through for the desired entry starting with the MMC path; if no entry is found, either the default value is returned if the .INI file is located in one of the above directories (or is supposed to be located there -- i.e. the base path is identical or no directory has been specified), or the standard C function GetPrivateProfileString or GetprivateProfileInt is called. When writing data to an .INI file using the function ALWritePrivateProfileString S the directory ..\USER is addressed, if the base directory of the .INI file is ..\USER, ..\OEM, ..\ADD_ON or MMC2 or if the file name does not contain a directory specification; if the .INI file does not exist, it will be created. S the standard C function WritePrivateProfileString is called, if the basic directory of the .INI file differs from the base MMC directory.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-49

Introduction 1.7 What happened in the last versions?

03.03

If the directory ..\USER does not exist, it will be created. If an .INI file name is specified without a path specification, only standard directories will be searched through or data are written to ..\USER only. The WinApi--functions GetPrivateProfileString, GetprivateProfileInt and WritePrivateProfileString are "redefined" for Visual Basic--applications, so that for OEM applications possibly existing declarations of these three functions must be removed from private files. Please check your declarations to see, whether you have formerly used the keyword ByVal for the same arguments as the Sequence Control does now. C--library functions must get the address via the function GetProcAddress, before one of the functions can be used (first the library AB16.DLL must be loaded or its handle must be determined!). e.g.: S PrototypDefinition: typedef int WINAPI PFN_GETPRIVATEPROFILESTRING (LPCSTR,LPCSTR,LPCSTR,LPSTR,int, LPCSTR); typedef UINT WINAPI PFN_GETPRIVATEPROFILEINT (LPCSTR, LPCSTR, int, LPCSTR); typedef int WINAPI PFN_WRITEPRIVATEPROFILESTRING (LPCSTR, LPCSTR, LPCSTR, LPCSTR); S Declaration of the function pointer and of the AB16--Dll--handle: HINSTANCEhAB16DLL; PFN_GETPRIVATEPROFILESTRING *lpfnGetPrivateProfileString; PFN_GETPRIVATEPROFILEINT *lpfnGetPrivateProfileInt; S Loading the AB16.DLL and setting the function pointer, in case of error the function pointers are set with the pointers to the original functions. lpfnGetPrivateProfileString = NULL; lpfnGetPrivateProfileInt = NULL; hAB16DLL = LoadLibrary ("ab16.dll"); if (hAB16DLL<0 || hAB16DLL>HINSTANCE_ERROR) { lpfnGetPrivateProfileString = (PFN_GETPRIVATEPROFILESTRING * GetProcAddress (hAB16DLL, "ALGetPrivateProfileString"); lpfnGetPrivateProfileInt = (PFN_GETPRIVATEPROFILEINT *) GetProcAddress (hAB16DLL, "ALGetPrivateProfileInt"); } if (!lpfnGetPrivateProfileString) lpfnGetPrivateProfileString = GetPrivateProfileString; if (!lpfnGetPrivateProfileInt) lpfnGetPrivateProfileInt = GetPrivateProfileInt;

1-50

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

S Enabling the AB16.Dll--handle (typically the function WEP for DLLs): if (hAB16DLL<0 || hAB16DLL>HINSTANCE_ERROR) FreeLibrary (hAB16DLL); S Declaring the function pointer as external (for being used in other modules): extern PFN_GETPRIVATEPROFILESTRING *lpfnGetPrivateProfileString; extern PFN_GETPRIVATEPROFILEINT *lpfnGetPrivateProfileInt; S Using the function pointer in the program text: (*lpfnGetPrivateProfileString) ("HSoftkeyText","Entry","Dflt",szHSoftKey,sizeof(szHSoftKey),szIniFilePath);

New functions of the Sequence Control

Function AL_GetSkState(sk As Integer) As Integer This function returns the value FALSE, if the softkey specified by sk is locked; in the other case it returns TRUE. Function ALGetSuccessorBySK(ByVal State As Integer, ByVal SKIndex As Integer) As Integer This function returns the successor of the state specified by the arguments State and Softkey-Index. LOCK_ETC and UNLOCK_ETC The procedure Lock_ ETC locks the ETC--key (the ETC--display turns to gray!), the procedure UnLock_ETC unlocks it. The procedures do not have any arguments. LOCK_RECALL and UNLOCK_RECALL The procedure Lock_Recall locks the Recall--key (the Recall--display turns to gray!), the procedure UnLock_Recall unlocks it. The procedures do not have any arguments Sub Show_A_Hidden_Child(ByVal fname As Form) The procedure displays the MDI child specified by the argument FormName, which had been hidden before by Hide_A_Child or by Hide_Childs.

New formula type 5

The application can select specific forms for staying in the memory as long as possible. For this a strategy is defined in the Sequence Control which keeps forms in the memory or unloads them, i.e. an application must be prepared that its forms might be removed from the memory at any time.

Note This function is described in chapter 7.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-51

Introduction 1.7 What happened in the last versions?

03.03

1.7.3

Release 4.3 Dezember 1997

Overview

Software release 4.3 has not been added additional features compared to release 4.2.

Update from SW 3.6 to SW 4.3

It was intended to achieve binary compatibility of the .EXE files that have been created with release 3.6, i.e. applications that have been created for the MMC pakkage 3.6 should run without error on a control after software release 4 was installed. Unfortunately this cannot be guaranteed for all applications. If you have problems with your applications, you have to re--generate the Sequence Control of the OEM package 4.3. For this purpose you must use Visual Basic 4.0 16 bit.

Notes for applications

The following notes may be of importance when using the OEM package HMI:

Note Starting from software release 4 the files "REGIE.INI", "MMC.INI" and "RE_XX.INI" are evaluated by searching them in the following directories in the order shown: 1. MMC2 2. ADD_ON 3. OEM 4. USER. Also see page 22 in chapter 1, new directory structure.

Note For this reason the OEM--user must enter his differences for "REGIE.INI" and "LANGUAGE\RE_XX.INI" only in the OEM path. That is, entries in the OEM path overwrite those in the standard MMC2 path.

1-52

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

OEMFRAME

With OEMFRAME you can now incorporate 32--bit--applications in the Regie.

Form type 5: MAYBE_1OR2

Form type 5 presently behaves like form type 2. It is planned to assigned the following properties to this form type: When resources are low, form type 5 is transformed to form type 1 and then can be removed from the memory.

Message texts, externally generated

Creating message and alarm text with any DOS--editor may cause problems with special characters, like ä, ö or ü: The reason are the different character sets OEM and ANSI. Windows generally uses ANSI. An automatic recognition is not possible. To nevertheless import DOS generated files, add a blank and the string "DOS" after the name of the text file in MBDDE.INI (upper and lower case allowed). The alarm server MBDDE then automatically performs a conversion from OEM to ANSI. New: After the parameter DOS has been set or reset, the date of the effected text file must be updated (by just opening and saving), since otherwise the change of the parameter will not be noticed by the system (see chapter 9.4.1).

Development environment

We recommend to use MS Visual Basic 3/4.0_16

Application DCTL-Control

The DCTL control cannot execute the next transaction until the preceding one has been finished. If the caller tries to parametrize a transaction (Read/Write/Execute or Advise) for a DCTL control, while he is engaged in a synchronous transaction with the same Control at another location, the following error will occur: LastError = 07 xx 01 12.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-53

Introduction 1.7 What happened in the last versions?

03.03

Global variables of the Sequence Control

Some other global variables, which supply the paths of the newly installed directories ADD_ON, OEM and USER, have been added to the existing global variable g_chMMCPATH, which contains the MMC2 path of the system (e.g.: c:\mmc2). g_chAdd_OnPath contains the path of the directory ADD_ON, g_chOemPath contains the path of the directory OEM, g_chUserPath contains the path of the directory USER.

Problems with the Data Management when the power is cut off

Problem description: When using either the COPY or the CREATE command specifying a source file of the Data Management Server with the parameter --f the following error might occur: The existing file is deleted and the new file is not created/copied, since the parameter --f causes the destination file to be overwritten in any case, even when the COPY or CREATE action has been aborted with an error. Remedy: Instead of directly applying the COPY command to the actual destination file, copy the file from the MMC to a temporary file in the NC. If the COPY command was successful ( "#100#..." ), delete the already existing destination file on the NC and then rename the temporary file with the RENAME command. For the CREATE command proceed as follows: first create an empty file with the CREATE command and then follow the steps described for the COPY command.

Problem with CREATE

Problem description: If the CREATE command is used specifying a source file and if this file is quite large (1MB and more) the MMC102 gets blocked. Remedy: On the MMC only. Use the CREATE command without specifying a source file. Then use the VisualBasic command "FILECOPY" for overwriting the file created with CREATE.

1-54

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

1.7.4

Release 4.4 August 1998

Updating from SW 3.6 to SW 4.4

Please refer to the file "Releas_e.wri", included in the OEM package in the directory "SAMPLES.OEM", "Updating from SW 3.6 to SW 4.4".

Configuration tool

Starting from software release 4.4 the configuration tool is no longer part of the OEM package.

BTSS variables

The following BTSS variables have been added: /Channel/GeometricAxis/DisplayAxis[u<area index>,c<column index>, <row index>] /Channel/MachineAxis/DisplayAxis[u<area index>,c<column index>, <row index>] /Channel/ProgramInfo/circleRadiusS[u<area index>,<column index>] For more information use the OEM online help (BTSS_GR.HLP). START--PROGRAM -- SINUMERIK 840 D MMC V4.4.

New PI Services

_N_EXTMOD selecting program execution from external _N_SETUDT activates the current user data

Also see the online help (PI_GR.HLP).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-55

Introduction 1.7 What happened in the last versions?

03.03

PI Services, which are no longer available

_N_ACTDEF Definition (GUD, Makro) active in the passive file system Also see the online help (PI_GR.HLP).

Online help

The online help on topics BTSS variables (BTSS_GR.HLP) and PI Services (PI_GR.HLP) have been adapted.

1.7.5

Release 5.1 Dezember 1998

Update to SW 5.1

Please refer to the file: "Releas_d.wri" 'Updating to SW 5.1'

New OEM - examples New OEM -- examples: Oembsp13: Using the control DCTL.VBX and language switch--over. Oembsp14: Controlling C++ -- applications with softkeys. Oembsp15: Embedding the editor--based parametrization in an OEM application Also refer to the file: "contents.wri"

Installation guide for OEM applications

An installation guide for OEM applications has been added. File: "Oem--inst.doc"

NCDDE-Server

In the Variable--Service of the NCDDE--Server you can demand in the format specification, that for read access with more than one return value the different values must be separated by a "|" -- symbol. Up to now, this separator was not generated by an explicit format specification. Starting from 05.01 this separator is generated also, when the format is specified explicitely. The error correction can be switched off by setting bit0 of the variable NCDDE_OPERATION_MODES. The downward compatibility has been defined to have the bit value 0. So the value 0 is taken for all earlier releases, where the variable had not yet existed.

1-56

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

BTSS variables

newly added BTSS variables: AaEgActive electronic gear: coupling of the specified leading axis is active, i.e. switched on AaEgAx electronic gear: axis number of the n--th leading axis (1--n). (axis index = axis number -- 1) AaEgBc electronic gear: block change criterion. Relevant for EGON, EGONSYN AaEgDenom electronic gear: denominator of the coupling factor for the specified leading axis AaEgNumera electronic gear: numerator of the coupling factor for the specified leading axis AaEgNumLa electronic gear: number of leading axes specified with EGDEF AaEgSyn electronic gear: synchronization position for the specified leading axis AaEgSynFa electronic gear: synchronization position for the following axis AaEgType electronic gear: coupling type for the specified leading axis AaEsrEnable (axis--specific) enabling of the reaction(s) of the function "Exten ded stop and retract" AaEsrStat (axis--specific) state return messages of the function "Extended stop and retract" AcAlarmStat !=0: alarms are active, the corresponding coded alarm reactions can be used as source for the function "Extended stop and retract" AcAxCtSwA state of the axes container referring to a channel AnAxCtAS actual address of the container, i.e. for how many slots has the axes container been rotated? AnAxCtSwA axes--container--rotation is active AnAxEsrTrigger (global) control flag "Stop and retract by drive" APbbIn data byte (8Bit) in the PLC--input/output area IN ApbbOut data byte (8Bit) in the PLC--input/output area OUT APbdIn data double word (32Bit) in the PLC--input/output area IN ApbdOut data double word (32Bit) in the PLC--input/output area OUT APbrIn real data (32Bit) in the PLC--input/output area IN APbrOut real data (32Bit) in the PLC--input/output area OUT APbwIn data word (16Bit) in the PLC--input/output area IN ApbwOut data word (16Bit) in the PLC--input/output area OUT AxisActivInChan Is the axis active in the channel? BadMemFfs number of damaged bytes in the Flash File System (FFS) BasisFrameMask Which channel--specific base frames are active? DiagnoseDataFfs diagnosis data for the Flash File System (FFS) FreeMemFfs number of free bytes in the Flash File System (FFS) NcuLinkActive Is the NCU--Link enabled by machine data? NettoMemFfs number of bytes netto available for the Flash File System (FFS)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-57

Introduction 1.7 What happened in the last versions?

03.03

NumBasisFrames number of base frames NumUserFrames number of channel independent user frames ProtAreaCounter counter is incremented when the protection area changes (data module PA) TotalMemFfs number of bytes reserved on the PCMCIA card for the Flash File System (FFS) UsedMemFfs numer of used bytes in the Flash File System (FFS) VaEgSyncDiff electronic gear: synchronization difference (actual values). Also refer to the online help (PI_GR.HLP).

PI-Services

newly added: _N_SCALE_ scale setting (metric<-->INCH)

Also refer to the online help (PI_GR.HLP).

Online help

The sections BTSS variables and PI--Services of the online help have been updated.

1.7.6

Release 5.2 November 1999

Update to SW 5.2

The EXE--file should be newly created with the current Sequence Control to guarantee a safe and correct operation of existing OEM applications.

Installation chapter 2

The installation of the MMC--OEM package from CD--ROM with the program Install Shield is described.

Features of the component MMC 103 (chapter 2)

In a new chapter 2.3 some features of the component MMC 103 are desribed in detail.

1-58

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Overview

In this chapter some features of the component MMC 103 are compiled: -- Windows 95 Properties -- Better handling of the registry -- Shutting down the MMC -- Locking key combinations

Windows 95 properties

Windows 95's automatic hardware identification has been disabled and will run in an idle loop if it is started. The screen resolution has been changed to 256 colors. Other settings are allowed.

Better handling of the registry

The Windows system environment for standard Windows and the MMC Windows environment will no longer be distinguished or separately managed like up to SW 05.01.26. There will only be one system environment for both cases. This allows the user to more easily handle the system environment (REGISTRY, SYSTEM.INI). The irritating prompts during system start--up, asking the operator whether changes of the system settings are to be saved and whether they are to be transferred to the backup also, become unnecessary with the new handling. The system environment is managed automatically which guarantees the next system start--up to be successful. Modifications of the system environment are automatically taken over with this new management. The following procedure for managing the system environment has been realized: S There are (still) one working copy, one safety copy, one backup copy and --to make sure-- a separate SIEMENS original environment. S Normally exiting Windows ­ in service mode or MMC mode ­ turns the safety copy to the backup copy and the working copy to the safety copy. Of course the working copy still remains the working copy. This behavior guarantees changes of the system environment to be available for the next start--up and additionally saves them. S During start--up it is checked, whether the start--up can be run with the working copy. If this is true, the system is started using the working copy and the environment is available as it has been left when Windows has been exited. If not, the system is started using the safety copy as working copy. The most recent system settings will be lost, since they have violated the system integrity. If the start--up should not be possible even with the safety copy, the backup copy becomes the working copy and the system starts with this copy. In this case the most recently made changes will be lost, too.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-59

Introduction 1.7 What happened in the last versions?

03.03

S Sheet anchor for a successful start--up is the SIEMENS original environment, which cannot be modified and in any case guarantees a successful start--up. This environment will then become the working copy, i.e. the original delivery state is set again. S The corresponding files are located under C:\Tools\Siemens.org, C:\Tools\User.sav and C:\Tools\User.act and in the Widows directory (C:\win.95).

Note These files will be overwritten when the software is updated.

Shutting down the MMC

The functionality during the MMC shut--down has been modified. If now the MMC is left with the EXIT button, the MMC applications are closed and Windows is shut down. The system stops with the message "Safe to power off. Press any key to reboot". In the process the automatic restart is stopped. It is distinguished, whether an MMC start--up or a start--up in a Windows service mode has taken place. During an MMC start--up Windows is shut down as described above, a service--mode start--up shuts down the MMC only, Windows remains active. This improved functionality offers the EXIT -- softkey per default on HSK8 in the second layer of the area menu during MMC shut--down. The following procedure runs during the MMC shut--down: Following the instruction to shut down the MMC, (EXIT--button) the REGIE and the MMC applications (applications that have not been started with the OEM--Frame) run the protocol QueryForShutDown. Sequentially (the sequence corresponds to the task index in the REGIE.INI) the QueryForShutDown--message is sent to the applications. As soon as the first application responds negatively ­ i.e. refuses the shut--down-- a recall alarm appears "...area xxx cannot be shut down". The RECALL--key is used for acknowledging the alarm and the corresponding area is implicitly selected. There the necessary operating actions may be taken. However the MMC shut--down is then interrupted and has to be started again later. If an application is active in the DOS box, the MMC shut--down is also stopped and the corresponding message prompts for first terminating the DOS box application. If all MMC applications are ready for shut--down, the termination protocol is run one by one with each application. Applications that had been started from the OEM frame just receive a WM_CLOSE message. If all applications have been processed like this, Windows is terminated while the MMC starts up.

1-60

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Note The softkey "Exit" may be locked in the file REGIE.INI with the entry "ExitButton=False".

Locking key combinations

Key combinations like Alt+Ctrl+Del, Alt+Tab, Alt+F4 are now hidden. If they should be needed for OEM-- or service purposes, the entry SeqAct in the section [MMC103keyb] of the file SYSTEM.INI may be modified accordingly. This handling only works on a MMC103 hardware, since only here the Siemens--specific keyboard driver applies. In the service--mode the entry has no effect, i.e. all key combinations are enabled. The following codes have been implemented: Bit 0: Bit 1: Bit 2: Bit 3: Bit 4: Bit 5: Bit 6: Bit 7: CTRL--ALT--DEL ALT--F4 ALT--TAB LEFTSHIFT--ALT--TAB RIGHTSHIFT--ALT--TAB CTRL--ESC ALT--ESC ALT--SPACE

Customizing the keyboard driver (chapter 3)

Since software version 5.1 it is possible to process the MMC--keys from area applications. Detailed information you will find in the chapters 6.3.1.5 and 11.10.4.

Entries in the file REGIE.INI for OEM-Customers (chapter 6)

Entries for OEM in the section Startup Configuration The OEM--applications have to be entered in the area from 'Startup12' to 'Startup24' in the section [StartupConfiguration] of the file 'Regie.ini'. Other entries may result in conflicts with the MMC 103--standard system. Entries for OEM in the section TaskConfiguration The range from 0 to 23 in the section [TaskConfiguration] of the file 'Regie.ini' is reserved for tasks which can be activated by the area menu. The remaining numbers (24 to 63) are reserved for so--called Child applications, where the numbers from 51 to 63 may be used for the OEM customers` Child applications.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-61

Introduction 1.7 What happened in the last versions?

03.03

Processing MMC keys from area applications (chapter 6)

With two new attributes of the TaskConfiguration of the Regie it is possible to process "MMC keys" from area applications. Attribute GIMMEKEYS ShowAppMenuKey Meaning Enabling mask for keys of the regie, which are to be handled by the area application Enabling mask for the area changeover key, which is to be used by the area application

Customizing the keyboard filter

Use the extension described below to customize the 'MMC keys' like area changeover--key, channel switch-- key ... for the different area applications. This allows the OEM application e.g. to process the F10 key on its own and to use another key (parametrized with the ShowAppMenuKey) to start the area changeover. The required settings are entered in the file REGIE.INI in the section [TaskConfiguration] with the new setting items GIMMEKEYS and ShowAppMenuKey:

... [TaskConfiguration] TaskX = name := oemframe, ..., GIMMEKEYS := n, ShowAppMenuKey := m

The parameters n and m are bitmasks: Their meaning is desribed with the attributes.

Attribut GIMMEKEYS:

This is an enabling mask for keys of the regie, which are to be handled by the area application. GIMMEKEYS:=n, with n as a 32--bit bitmask, which defines those REGIE keys that are to be processed by the application on its own. bit0 : area changeover 1=OEMApp wants to process F10, 0=OEMApp wants F10 to be handled as standard (area change--over) bit1 : channel changeover 1=OEMApp wants to process F11, 0=OEMApp wants F11 to be handled as standard bit2 : Cancel--key (BigMac) 1=OEMApp wants to process ESC, 0=OEMApp wants ESC to be handled as standard

1-62

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

bit3 : machine area key 1=OEMApp wants to process SH--F10, 0=OEMApp wants SH--F10 to be handled as standard bit4 : End--key instead of Tab--key 1= The End--key is passed to OEMApp, 0= Tab is passed to OEMApp, when the End--key is pressed Example: GIMMEKEYS:=15 OEMApp wants to handle F10, F11, ESC, SH--F10 on its own GIMMEKEYS:=1 OEMApp wants to handle F10 on its own,

Attribut ShowAppMenuKey:

Enabling mask for the area changeover key, which is to be used by the application. ShowAppMenuKey:=m, where m is a 32--bit bitmask, that defines, which key within this application is to activate the area changeover (F10 substitute) bit0--7 virtual keycode of the area changeover--key to be defined (see winuser.h VK_xxx entries) bit16 1=Shift must be pressed, 0=Shift may not be pressed bit17 1=Ctrl must be pressed, 0=Ctrl may not be pressed bit18 1=Alt must be pressed, 0=Alt may not be pressed Example: ShowAppMenuKey := 65659 65659 = 0x1007B VK_F12 = 0x7B Ô Shift--F12 triggers the area changeover function for this application VK_F1 = 0x70, VK_F1 = 0x71, ..., VK_F24 = 0x87

Note If an application is assigned another key for area changeover with 'ShowAppMenuKey', the key 'F10' will still work. Specify 'GimmeKey' explicitly to prevent this.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-63

Introduction 1.7 What happened in the last versions?

03.03

Tips for the OEMFRAME (chapter 6)

To handle a windows--application as area application the following steps are necessary: 1. Copy the program file to the directory OEM 2. Make an entry in the section TaskConfiguration in the file REGIE.INI in the directory OEM with the placeholder--application OEMFRAME.EXE 3. Install necessary drivers e.g. for a pointing device (mouse) 4. Enter softkey--texts in a softkeytext file in the directory C:\OEM\LANGUAGE 5. Enter special values in a section [PROGRAM NAME] of a file OEMFRAME.INI in the directory OEM

Note To characterize programs in the file REGIE.INI it is sufficient to enter either Class Name or Window Name.

Note Specifications of the parameter "CmdLine" may not contain any space characters in the directory name or the file name.

New attributes in the file OEMFRAME.INI

With two new attributes in the file OEMFRAME.INI applications can be better integrated: nDelayInitComplete=xx nSecondsToFindWindows=30

Attribute nDelayInitComplete:

Sending WM_INITCOMPLETE can be delayed or suppressed by an entry in the file 'OEMFrame.ini'. For this 'nDelayInitComplet=xx' must be entered in the corresponding section of the file 'OEMFrame.ini', where xx represents the time in microseconds.

1-64

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Attribute nSecondsToFindWindows:

Some OEM applications (e.g. Step7) may take quite long to display their screen. The OEM frame waits just a certain time (up to now 20s) for the application window. Then it assumes, that the application has not been started and it terminates. Selecting the application once again will restart it a second time. For this reason the following modifications were added: 1. The max. waiting time has been extended from 20 to 40s 2. Now the waiting time may be configured with OEMFrame.INI . [<ApplName>] nSecondsToFindWindow = ...

Note This value must correspond to the timeout value in the file REGIE.INI!

Example: Regie.ini, Section [TaskConfiguration] TaskX=name:=oemframe, ..., TimeOut:=30000 OEMFrame.ini, Sektion [Application name] nSecondsToFindWindow = 30

Language selection and asian languages (chapter 7)

Asian languages Asian languages require an additional tool, which automatically installs the corresponding fonts. With each language package this tool automatically installs the corresponding fonts and performs all entries required in the mmc.ini and in the registry. S DLL's, text files ( machine data files) and language--dependent INI--files are stored in the directory "\mmc2\language", S The alarm texts are stored in the directory "\dh\mb.dir". Language selection Use the softkey 'select language' for configuring the control for other languages. Literature: /IAD/ Installation and Start--Up Guide 840D, Chapter 13 MMC, Configure 'Language selection' softkey.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-65

Introduction 1.7 What happened in the last versions?

03.03

Softkey pictograms (chapter 7)

If in the language--DLL (starting with \\) a file name has been specified for a softkey, this file name is interpreted as the name of a bitmap (type BMP). It is completed by the base path SKPICTO from the application--specific INI file. This file is searched in the directories USER, OEM, ADD_ON and MMC2 and ­if found-- the bitmap contained is displayed on the screen (SW P4). New in P5: If a bitmap file is specified with an absolute path (e.g. L:\...) , this bitmap will be displayed, if it exists there! Attention: In the DLL 'must be tagged by a preceding '. (e.g. L:\\...)

New functions of the Sequence Control (chapter 7)

Four new procedures of the Sequence Control complement the softkeytext--functions and support the dynamic graphic resolution of the screen. name

Softkeytext-functions SK_Highlight SK_HighlightUn

F/P P

meaning

Highlighting a softkey Immediate highlighting a softkey

Attribute-functions for dynamic graphic resolution subSetTFrmAttr subSetTCtrlAttr

P P

Set attribute for forms Set attribute for controls

Additional softkey text funktions SK_Highlight

Description The procedure SK_Highlight highlights the softkey addressed by the parameter Index (in the contrary to the procedure SK_HighlightUn, which immediately highlights the corresponding softkey!). Syntax Sub SK_HighLight(ByVal Index As Integer).

1-66

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

SK_HighlightUn

Description The procedure SK_HighlightUn immediately highlights the softkey addressed by the parameter Index with a blue background (in the contrary to the function SK_Highlight, which highlights the corresponding softkey not before the end of an action!) Syntax Sub SK_HighlightUn(ByVal Index As Integer)

Functions for dynamic graphic resolution

Overview In order to display the PC version of MMC applications in the set screen size, the Sequence Control of P5 scales the size of the forms, as well as controls and texts displayed on the forms. This is however possible only for forms and controls which are known to the Sequence Control respectively which sizes are modified by the Sequence Control (SC). The SC scales the control sizes only, it cannot modify the contents (e.g. grid, listbox: there are dependencies which are not known by the SC, as e.g. the line spacing of a listbox). In order to make use of this feature available for applications have to activate it in the global INI file MMC.INI and might need some slight modification of their program code: Entry in the global INI--file MMC.INI in the section [CONTROL] : ;==Resolution: 0=fixed (640x480), 1=variable, default:0 Resolution=1 ;==BaseScreen: 640x480, 800x600, ... default: 640x480 BaseScreen=640x480 S Resolution=1 (variable) means, that the screen resolution actually set on the PC is used. S BaseScreen=640x480 specifies, for which resolution the application has been developed; in our case this so far always (!!!) has been 640x480 (default setting); i.e. usually the entry does not have to be modified. The INI entry ScreenTwips (in the application--specific INI file) is ignored if Resolution=1. (ScreenTwips=1 sets the number of twips per pixel to 15 independently of the actual conditions--according to the value set at the control. The Sequence Control contains a global data structure which holds all data that are relevant for the application: Type AppRes_Info HSize As Integer VSize As Integer HFact As Single horizontal resolution vertical resolution (exc. Task bar) X--factor referring to BaseScreen--X

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-67

Introduction 1.7 What happened in the last versions?

03.03

VFact As Single End Type

Y-- factor referring to (BaseScreen--Y-- Task bar)

Global g_tAppRes As AppRes_Info The width res. the height of a form res. of a control are multiplied with e.g. the quantity g_tAppRes. HFact res. g_tAppRes. Vfact. The procedures subSetTCtrlAttr and subSetTFrmAttr have an optional parameter, specifying whether the font size of the corresponding control is to be multiplied with the factor g_tAppRes. Hfact or not: if no parameter has been specified or if the parameter is FALSE, the factor is 1, otherwise it is g_tAppRes. Hfact.

subSetTFrmAttr

Description The procedure subSetTCtrlAttr sets the attributes FontName, FontSize and FontBold for a control of type wType, specified by the paramter Ctrl . An application shall call this procedure in FormLoad for all controls: This gives a uniform appearance to the forms of an application and cares for the right FontAttributes after a changeover of the language. The procedure subSetTCtrlAttr(Ctrl As Control, wType As Integer, Optional ByVal size As Variant) has two or three parameters (the third is optional). An existing third parameter means that for setting the FontSize ist value is not calculated again. This is important especially in the case of high resolutions (e.g. from 640x480 to 1024x768), where the calculation occured during form load.

subSetTCtrlAttr

Description The procedure subSetTFrmlAttr sets the attributes FontName, FontSize and FontBold for the Header/Dialogue line (defined by type wType) of a form specified by the parameter frm. An application shall call this procedure in FormLoad for all controls: This gives a uniform appearance to the forms of an application and cares for the right FontAttributes after a changeover of the language. The procedure subSetTFrmAttr(frm As Form, wType As Integer, Optional ByVal size As Variant) has two or three parameters (the third is optional). An existing third parameter means that for setting the FontSize ist value is not calculated again. This is important especially in the case of high resolutions (e.g. from 640x480 to 1024x768), where the calculation occured during form load.

1-68

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Configurationen of the NCDDE-server (chapter 8)

Depending on the installation settings the NCDDE--server can be configured in four ways: S establishing a connection to an NC (default) S establishing a connection to one or more NCs (for the M:N -- feature see chapter 8.3.3) S local operation mode on a PC Allows the developer to test his application locally on his PC without a connected NC. In this case the NCDDE Server supplies substitute values, that can be defined with the command "NEW" (chapter 8.8) and modified with the command "ANIMATE" (chapter 8.8) to simulate an active NC. S local operation mode on a PC with NC simulator Allows the developer to test his application locally on his PC without a connected NC. With the NC simulator it is possible to achieve a behaviour very close to a real CNC. NcddeMachineNamesAdd1 This attribute in the section [GLOBAL] of the file MMC.INI characerizes an installed NC simulator. In no NC simulator is installed, this entry has no meaning. Name spaces In the LOCAL--mode the NCDDE--Server does not distinguish the 'name spaces' of variables. 'Name space' means a distinction regarding TOPIC. If a variable has been created for the TOPIC LOCAL and the same variable has been created for the TOPIC Sim0, the NCDDE does not distinguish them. This may have the effect, that e.g. the current block display does not work in the simulation mode, once a screen with current block display has been selected in the area application MACHINE. In this case the program creates local variables which overdefine the 'simulation variables`.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-69

Introduction 1.7 What happened in the last versions?

03.03

New DCTL control (32 Bit) (chapter 8)

This control is suitable especially for users, who want to incorporate their 32--bit applications via OEMFRAME and want to use a Siemens control. The control allows the 32--bit--applications to access the PI--, the Variable-- and the Domain--Services. The control has been tested under VisualBasic 6 only. Using other development tools might endanger the correct functionality. All required files are located under \oem\dctl. To use the control, please follow the steps described in the file readme.txt in the corresponding directory (\oem\dctl).

Extensions of the NCDDE server (chapter 8)

Multi variable service Overview The multi variable service allows to access several variables in one NCDDE job. This speeds up the access of several single variables. Available for reading and writing access only. (not hotlink). The items are specified like the items of the corresponding single variables/ arrays access separated by '|'. Data obtained by reading accesses are tightly packed when accessing arrays. Separators have to be parametrized like before when accessing arrays with format specifications or with a new access modifications (see later). During writing access the first character of the written data is interpreted as a separator for the different data blocks. Limitations S Each job consists of max. 8 tightly packed PDUs. This usually allows access to more than 100 variables in one job. (the exact number can be determined by trial) S The PDUs are sent to a destination address. Therefore PLC-- and NC--accesses may not be mixed in one job. Furthermore access to channel--specific variables in different channels may not be mixed. (NC--requirement). The same applies to the access to drive--specific variables. S The multi--variable--service can address real variables only (BTSS--interface/ PLC--BUB). It cannot address date, time, system state list, directory information etc. S Attention, the DDE item size is limited to 255 characters. If the itemstring exceeds this limit, the item has to specified indirectly (see below). Example for both writing and reading with the multi--variable service Item: /channel/parameter/r[1,2](|"!l%ld")|/channel/parameter/r[10](|) Data e.g.: |1|2|10.000000

1-70

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Indirect Item specification

The indirect item specification allows to use items >255 characters (up to 4KB ). The contents of an NCDDE--local variable may be used as item for the DDE access. In this case the name of the local variable must be specified as an item with a leading '>'--character. Example for R10 access: Exec: NEW(x,"/channel/parameter/r[10]") Item: >x Data e.g. 10.000000

Note The data length in the NCDDE--Server for writing variables and executing commands is limited to 4KB. Exceeding this value results in an error 0X01050414.

New access modifications

Can be added to Itemstring in parenthesis: '|' inserts a '|' ­ symbol before each single item on CF_TEXT--reading access. It is not evaluated on writing access. See multi--variable--service example chapter 8.12.1 The hotlink--deactivation is not valid for a variable with such a tag (DEBA/DEBR).

'^'

Extension of the alarm protocol (chapter 9)

The section [PROTOCOL] of the initialisation file MBDDE.INI of the alarm server is extended by a new attribute: DiskCare. DiskCare For the message module MBDDE now it be configured, whether the alarm protocol is written on the hard disk (file mmc2\proto.txt ) and when. Up to now the alarm protocol was written on the hard disk each time an alarm appeared or disappeared. The entry "DiskCare" in the section [PROTOCOL] of the file MBDDE.INI now controls, when the protocol file is to be written. The following parameters may be set: DiskCare = --1 (default) The MBDDE server runs the alarm protocol in the main memory. The protocol is written to the hard disk only when this is ordered by a softkey in the diagnosis mode. This also means, that the alarm protocol is not available after the control has been turned off, unless it has been written to the hard disk before.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-71

Introduction 1.7 What happened in the last versions?

03.03

DiskCare = 0 DiskCare = n

The protocol file is saved immediately after a change (like earlier behavior). Changes of the alarm state are written to the protocol file, if for n seconds no change has occurred.

The entry DiskCare is evaluated during start--up only.

New PI services (chapter 11)

The function group "tool functions" of the PI services is extended by five new functions. Function group tool functions meaning Initiate check of unique D numbers Activate tool in sister tool group Set active wear group in a magazine Create tool with defined number of cutting edge Reset the active state More information you will find in the online help file (PI_UK.HLP). PI name _N_CHEKDM _N_SETTST _N_TMAWCO _N_TMCRTC _N_TMRASS

Newly added, changed and removed variables (chapter 11)

The following variables have been changed, newly added or removed: Data area A / data module M (axis--specific machine data)

MDCA_CTRLOUT_MODULE_NR MDCA_CTRLOUT_TYPE MDCA_ENC_MODULE_NR MDCA_ENC_TYPE MDB_WORKAREA_MINUS_ENABLE MDB_WORKAREA_PLUS_ENABLE MDD_SPIND_MAX_VELO_G26 MDD_SPIND_MAX_VELO_LIMS MDD_SPIND_MIN_VELO_G25 MDD_WORKAREA_LIMIT_MINUS MDD_WORKAREA_LIMIT_PLUS Ü Ü Ü Ü CTRLOUT_MODULE_NR CTRLOUT_ TYPE ENC_MODULE_NR ENC_TYPE

Data area A / data module SE (axis--specific setting data)

Ü WORKAREA_MINUS_ENABLE Ü WORKAREA_PLUS_ENABLE Ü SPIND_MAX_VELO_G26 Ü SPIND_MAX_VELO_LIMS Ü SPIND_MIN_VELO_G25 Ü WORKAREA_LIMIT_MINUS Ü WORKAREA_LIMIT_PLUS

Data area C / data module ETP (event types) asciiMode (newly added)

1-72

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Data area C / data module FB (base frame) asciiMode (data base entry corrected) Data area C / data module FU (settable zero offset) asciiMode (data base entry corrected) Data area C / data module S (channel--specific state data) aaEgBc (removed) acwStat (newly added) acwTu (newly added) acPtpSup (newly added) actOnToolLength1 (newly added) actOnToolLength2 (newly added) actOnToolLength3 (newly added) acVactB (newly added) axisActivInChan (removed) chanAxisNoGap (newly added) pEgBc (newly added) pTcAng (newly added) pTcDiff (newly added) Data area C / data module SE (channel--specific setting data)

MDD_DRY_RUN_FEED MDD_THREAD_START_ANGLE Ü DRY_RUN_FEED Ü THREAD_START_ANGLE

Data area C / data module SEGA (state data: channel axes in the WKS (extensions of SGA)) AaVactW (newly added) ActProgPosBKS (newly added) Data area C / data module SEMA (state data: channel axes in the MKS (extensions of SMA)) aaOffVal (newly added) aaVactB (newly added) aaVactM (newly added) chanAxisNoGap (newly added) focStat (newly added) saveActPosDiff (newly added) saveActVeloDiff (newly added) saveMaxVeloDiff (newly added) Data area C / data module SPARP (part program information) circleTurn ( newly added) circle TurnS (newly added) Data area C / data module SSP (state data: spindle) channelNo (newly added) Data area C / data module SSP2 (state data: spindle) channelNo (newly added) Data area C / data module Y (channel--specific spindle) numActAxes (newly added) numMagPlaceParams (removed)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-73

Introduction 1.7 What happened in the last versions?

03.03

numOriAxes (newly added) progProtText (newly added) Data area M / data module S (internal state data MMC) (newly added) /Nck/Nck/ActApplication (newly added) /Nck/Nck/ActBag (newly added) /Nck/Nck/Channel (newly added) /Nck/Nck/CoordSystem (newly added) Data area N / data module DIAGN (global diagnosis data) (newly added) actCycleTimeBrut (newly added) actCycleTimeNet (newly added) maxCycleTimeBrut (newly added) maxCycleTimeNet (newly added) minCycleTimeBrut (newly added) minCycleTimeNet (newly added) pcmciaDataShotAct (newly added) pcmciaDataShotSum (newly added) pcmciaFfsLength (newly added) pcmciaShotStatus (newly added) pcmciaStartFfsOffset (newly added) pcmciaStartShotOffset (newly added) Data area N / data module FA (channel-independent active zero offset) (newly added) linShift (newly added) mirrorImgActive (newly added) rotation (newly added) scaleFact (newly added) Data area N / data module FB (channel--independent base frames) (newly added) linShift (newly added) linShiftFine (newly added) mirrorImgActive (newly added) scaleFact (newly added) Data area N / data module FB (channel--independent user frames) (newly added) linShift (newly added) linShiftFine (newly added) mirrorImgActive (newly added) scaleFact (newly added) Data area N / data module M (global machine data)

MDBA_DRIVE_IS_ACTIVE MDCA_DRIVE_LOGIC_NR MDCA_DRIVE_MODULE_TYPE MDCA_DRIVE_TYPE Ü DRIVE_IS_ACTIVE Ü DRIVE_LOGIC_NR Ü DRIVE_MODULE_TYPE Ü DRIVE_TYPE

1-74

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

MDD_INT_INCR_PER_DEG MDD_INT_INCR_PER_MM MDD_SYSCLOCK_CYCLE_TIME MDL_POSTCTRL_SYSCLOCK_TIME_RATIO MDLA_DRIVE_INVERTER_CODE MDSA_AXCONF_MACHAX_NAME_TAB

Ü Ü Ü Ü Ü Ü

INT_INCR_PER_DEG INT_INCR_PER_MM SYSCLOCK_CYCLE_TIME POSTCTRL_SYSLOCK_TIME_RATIO DRIVE_INVERTER_CODE AXCONF_MACHAX_NAME_TAB

Data area N / data module SEMA (state data: channel axes in the MKS (extensions of SMA) aaCoupAct (newly added) aaCoupOffs (newly added) aaCurr (newly added) aaDtbb (newly added) aaDteb (newly added) aaDtepb (newly added) aaLeadP (newly added) aaLeadSp (newly added) aaLeadSv (newly added) aaLeadTyp (newly added) aaLeadV (newly added) aaLoad (newly added) aaMm (newly added) aaMm1 (newly added) aaMm2 (newly added) aaMm3 (newly added) aaMm4(newly added) aaOff (newly added) aaOffLimit (newly added) aaOffVal (newly added) aaOscillReversePos1 (newly added) aaOscillReversePos2 (newly added) aaOvr (newly added) aaPower (newly added) aaSoftendn (newly added) aaSoftendp (newly added) aaStat (newly added) aaSync (newly added) aaTorque (newly added) aaTyp (newly added) aaVactB (newly added) aaVactM (newly added) aaVc (newly added) ackSafeMeasPos (newly added) actCouppPosOffset (newly added) actFeedRate (newly added) actIndexAxPosNo (newly added) actSpeedRel (newly added) actValResol (newly added) amSetupState (newly added)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-75

Introduction 1.7 What happened in the last versions?

03.03

axComp (newly added) axisActiveInChan (newly added) axisFeedRateUnit (newly added) chanAxisNoGap (newly added) chanNoAxisIsActive (newly added) cmdContrPos (newly added) cmdCouppPosOffset (newly added) cmdFeedRate (newly added) cmdSpeedRel (newly added) contrConfirmActive (newly added) contrMode (newly added) displayAxis (newly added) distPerDriveRevol (newly added) drive2ndTorqueLimit (newly added) driveActMotorSwitch (newly added) driveActParamSet (newly added) driveClass1Alarm (newly added) driveContrMode (newly added) driveCoolerTempWarn (newly added) driveDesMotorSwitch (newly added) driveDesParamSet (newly added) driveFastStop (newly added) driveFreqMode (newly added) driveImpulseEnabled (newly added) driveIndex (newly added) driveIntegDisable (newly added) driveLinkVoltageOk (newly added) driveMotorTempWarn (newly added) driveNumCrcErrors (newly added) driveParked (newly added) drivePowerOn (newly added) driveProgMessages (newly added) driveReady (newly added) driveRunLevel (newly added) driveSetupMode (newly added) driveSpeedSmoothing (newly added) effComp1 (newly added) effComp2 (newly added) encChoice (newly added) fctGenState (newly added) feedRateOvr (newly added) focStat (newly added) fxsStat (newly added) handwheelAss (newly added) impulseEnable (newly added) index (newly added) kVFactor (newly added) lag (newly added) logDriveNo (newly added)

1-76

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

measFctState (newly added) measPos1 (newly added) measPos2 (newly added) measPosDev (newly added) measUnit (newly added) paramSetNo (newly added) preContrFactTorque (newly added) preContrFactVel (newly added) preContrMode (newly added) PRESETActive (newly added) PRESETVal (newly added) progIndexAxPosNo (newly added) qecLrnIsOn (newly added) refPtBusy (newly added) refPtCamNo (newly added) refPtStatus (newly added) safeActPosDiff (newly added) safeActVeloDiff (newly added) safeActVeloLimit (newly added) safeDesVeloLimit (newly added) safeFctEnable (newly added) safeInputSig (newly added) safeInputSig2 (newly added) safeInputSigDrive (newly added) safeInputSigDrive2 (newly added) safeMaxVeloDiffmax (newly added) safeMeasPos (newly added) safeMeasPosDrive (newly added) safeOutputSig (newly added) safeOutputSig2 (newly added) safeOutputSigDrive (newly added) safeOutputSigDrive2 (newly added) spec (newly added) subSpec (newly added) torqLimit (newly added) traceState1 (newly added) traceState2 (newly added) traceState3 (newly added) traceState4 (newly added) trackErrContr (newly added) trackErrDiff (newly added) type (newly added) vaVactm (newly added) Data area N / data module SMA (state data: channel axes in the MKS) (newly added) actIncrVal (newly added) actToolBasePos (newly added) cmdToolBasePos (newly added)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-77

Introduction 1.7 What happened in the last versions?

03.03

extUnit (newly added) name (newly added) status (newly added) toolBaseDistToGo (newly added) toolBaseREPOS (newly added) varIncrVal (newly added) Data area N / data module SSP (state data: spindle) actGearStage (newly added) actSpeed (newly added) channelNo (newly added) cmdAngPos (newly added) cmdConstCutSpeed (newly added) cmdGearStage (newly added) cmdGwps (newly added) cmdSpeed (newly added) driveLoad (newly added) gwpsActive (newly added) index (newly added) name (newly added) opode (newly added) speedLimit (newly added) speedOvr (newly added) spindleType (newly added) status (newly added) turnStatus (newly added) Data area N / data module SP2 (state data: spindle) channelNo (newly added) Data area N / data module Y (global system data) maxnumContainerPlaces (removed) maxnumContainerSlots (newly added) numContainerPlaces (removed) numContainerSlots (newly added) Data area N / data module YFAFL (NCK--instruction groups Fanuc) (newly added) Gruppe (newly added) gruppe_NUM (newly added) Data area T / data module TC (parameters of the tool carrier) (newly added) tcCarr1 (newly added) tcCarr2 (newly added) tcCarr3 (newly added) tcCarr4 (newly added) tcCarr5 (newly added) tcCarr6 (newly added) tcCarr7 (newly added) tcCarr8 (newly added) tcCarr9 (newly added) tcCarr10 (newly added)

1-78

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

tcCarr11 (newly added) tcCarr12 (newly added) tcCarr13 (newly added) tcCarr14 (newly added) tcCarr15 (newly added) tcCarr16 (newly added) tcCarr17 (newly added) tcCarr18 (newly added) tcCarr19 (newly added) tcCarr20 (newly added) tcCarr21 (newly added) tcCarr22 (newly added) tcCarr23 (newly added) Data area T /data module TD (tool data: general data) adaptNo (newly added) Data area T / data module TUM (tool data: magazine user data) data Ü userData Data area T /data module TUP (tool data: magazine place user data)) data Ü userPlaceData Data area T /data module TUS (tool data: monitor user data) data Ü userData More information you will find in the online help file (BTSS_UK.HLP).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-79

Introduction 1.7 What happened in the last versions?

03.03

Modifications of the keyboard driver (chapter 11)

Modifying the scan codes of the OP 031 with the keyboard driver For some keys (VSK0--7, M--key, ETC--key, '(', ')', SingleQuote) the OP031 generates scancodes, which are reserved in the PC area. Since these are not standard key codes and since future OPs might not generate these key codes, it is necessary to eliminate these key codes as soon as possible. The keyboard driver contained in P5 is equipped with a scancode mapping feature, which allows to redefine the special scancodes generated by the OP031. The following incompatibilities will occur in P5: Up to P5.1 the OP031 created the following codes: Codes up to SW version 5.1 Key VSK0: VSK1: VSK2: VSK3: VSK4: VSK5: VSK6: VSK7: SingleQuote: ETC: Machine: ( ) 0x5E 0x5F 0x62 0x63 0x64 0x65 0x66 0x67 0x67 0x67 0x6A 0x6B 0x6C ScanCode 0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xBF (wie PC) 0xE8 0xE9 0xEA 0xEB VirtKeyCode

From P5.1UPD the KeyboardDriver will provide the following mappings:

1-80

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Codes from SW version 5.1UPD Key VSK0: VSK1: VSK2: VSK3: VSK4: VSK5: VSK6: VSK7: SingleQuote: ETC: Machine: ( ) ScanCode like Shift F1 like Shift F2 like Shift F3 like Shift F4 like Shift F5 like Shift F6 like Shift F7 like Shift F8 like SingleQuote like Shift F9 like Shift F10 like ( like ) VirtKeyCode like Shift F1 like Shift F2 like Shift F3 like Shift F4 like Shift F5 like Shift F6 like Shift F7 like Shift F8 like SingleQuote like Shift F9 like Shift F10 like ( like )

The mapping uses a table contained in the file SYSTEM.INI. Any VirtKeycode may be substituted there by a sequence of VirtKeycodes (from P5.1UPD). The SYSTEM.INI for P5.1 will be supplied with a table that gives the mapping showed above. Thus the KeyboardDriver in P5.1UPD generates PC compatible scancodes only. If on a MMC103 an OEM application is installed which works with the 'old` OP031 codes only, the mapping feature may be disabled in the SYSTEM.INI. This does not touch the MMC103 applications. Problems will occur, if several OEM applications have been installed, which differ regarding their requirements on the keycodes (i.e. if e.g. one OEM application ONLY works with 'old' codes and another works with 'new' codes only. However, this case cannot occur yet, since up to now there are no OEM applications which react on 'new' keycodes only, since such applications could NOT be run on MMC103--SW--releases <P5.1UPD. Troublefree are all applications which react on both kinds ('old' and 'new') of keyboard codes, since they can be run on all SW releases. Problems might occur with applications which can be operated with the OP031 only and therefore can process the previous scancodes only.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-81

Introduction 1.7 What happened in the last versions?

03.03

Supported languages (chapter 11)

Languages and applied ANSI--table/Code--Page

Language German English Spanish Italian French Chinese(simplified) Chinese (traditional) Korean Japanese Swedish Hungarian Portuguese Czech Turquoise Russian Polish Dutch Finnish Abbreviation GR UK SP IT FR CH TW KO JA SW HU PO CZ TR RU PL NL FI Code-Page (DOS) 850 850 850 850 850 936 950 949 932 850 852 850 852 857 866 852 850 850 ANSI-Table (Windows) 1252 1252 1252 1252 1252 ----1252 1250 1252 1250 1254 1251 1250 1252 1252

Assignment of ANSI tables and fonts

Ansi--Table 1250 (Central Europe) Font Arial Arial bold Arial italic Arial bold italic File Cearial.ttf Ceariabd.ttf Ceariali.ttf Caeriabi.ttf Characters Arial CE (True Type) Arial CE Bold (True Type) Arial CE Italic (True Type) Arial CE Bold Italic (True Type)

1-82

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Ansi--Table 1251 (Cyrillic) Font Arial Arial bold Arial italic Arial bold italic Aricyr.ttf Aricyb.ttf Aricyri.ttf Aricyrbi.ttf File Characters Arial Cyr (True Type ) Arial Cyr Bold (True Type ) Arial Cyr Italic (True Type ) Arial Cyr Bold Italic (True Type )

Ansi--Table 1252 (West Europe) Font Arial Arial bold Arial italic Arial bold italic File Windows--Standard Windows--Standard Windows--Standard Windows--Standard Characters Arial (True Type ) Arial Bold (True Type ) Arial Italic (True Type ) Arial Bold Italic (True Type )

In order to use these languages, each of them must be installed under Windows.

Online help

The sections BTSS variables and PI--Services of the online help have been updated.

1.7.7

Release 6.0 April 2000

Installation

Note

HMI­Patch 06.00.16 must be installed after any installation of "DDE/COM/OPC--Server, Controls'" oder "HMI­Advanced for PC/PG".

Product Identification

Version: 06.00/15 vom 28.04.00 Version Identifier: 06_00_15_00

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-83

Introduction 1.7 What happened in the last versions?

03.03

Compatibilities

Compatible to versions 3.x, 4.x and 5.x of NCK/PLC/611D. The HMI Softwareplatform for version 6.0 has been changed to the operating systemWindows NT (32Bit) servicepack6. HMI Advanced does not run with Windows 95/98. In HMI Advanced version 6.0 16--bit--OEM application will run compatible to version 5.2 after having done the following changes. For using the total functionality of an existing OEM application (16--bit), add in the section [StartupConfiguration] in the file "Regie.ini" the file "Langtool.exe" as an additional application. These changes are necessary to provide an application wide language change. HMI Advanced SW 6 extends the directory structure used until now for the installation/environment around the path 'hmi_adv'. In hmi_adv, the HMI Advanced standard user interface will be installed; in the directory "MMC" previously shared by both the user interface and the servers (basic system), only components shared by several subsystems (HMI Advanced, HMIProgramming Package, ProToolPro NC, 840Di, SINUCOM_NC) are installed. All changes carried out by an OEM customer must use the "OEM" directory. This also applies to changes on already existing HMI Advanced files. Any other products, such as "SolutionProvider" and any other add--on products must install their components in the "Add_on" directory.

Licensing MS components

If the error message "License information for this component not found. You do not have an appropriate license to use this functionality in the design environment" is generated when creating an EXE, probably, the Sheridan 3D Controls have not or not completely been installed during the installation of Visual Studio (see also section "Upgrading 16-bit to 32-bit applications".

Functional changes and extensions

General A system requirement for the HMI environment SW 6.0 is Windows NT,4.0 with Service Pack 6, in both cases, the English (U.S.) version. A Microsoft bugfix with the ID: Q249639 must be installed. These system requirements are provided with the basic system version 06.01.01.

1-84

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

The HMI environment can be installed on any PC/programming device (PG) or laptop. For the appropriate hardware requirements, please refer to the documentation. It is not imperative to install the Microsoft bugfix in the development environment; however, problems may occur in case of very high / longer lasting information exchange with a PCU. The OEM applications developed thereon will run on the HW platforms MMC103 and PCU50, also with the new operator panels, OP012 and OP015. HMI Advanced is preinstalled on the operator panels on drive F:. Upgrading from 16-bit to 32-bit applications see Section 4.2 of the Operator's Guide Changes in the "Regie" With 16--bit applications, the communication is effected via the Regie DLL and Regie Control. With software release 6.0 and higher, these mechanisms are provided by the IRegieEvt and IRegieSvr interfaces of the Regie server.

VB Application (32Bit) IRegieEvt IRegieSvr

OEM Application (32Bit) IRegieSvr IRegieEvt/ OEMFrame

REG_CMD.EXE

RegieControl VB Application (16Bit )

RegieDLL

OEMFrame OEM Application (16Bit)

S 16--bit VB applications are supported with full compatibility; S 16--bit Windows--OEM applications are supported with compatibility. S DOS applications are NOT supported. To be able to make the existing 16--bit applications compatible, the components REGIE.DLL and RECTLP32.VBX of the 32--bit MMC release must be used. When translating the 16--bit application to 32--bit, a change to the Regie server is imperative (see also Section "Functions of the Regie server").

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-85

Introduction 1.7 What happened in the last versions?

03.03

The following interfaces are supported: S 16--bit OEM interface consisting of REGIE.DLL and RECTLP32.VBX; scope of functions as previously S 32--bit Regie-API interface (implemented in the IRegieSvr interface); scope of functions corresponds to that of REGIE.DLL S 32--bit Regie Event interface (-->_IRegieServerEvents interface); scope of functions corresponds to that of RECTLP32) These interfaces will be discussed in the following in detail: IregieSvr interface Functions that were not contained in the Regie.DLL: AsyncCompleted: GetCommandString: InitSvr: InitCompleteEx: NEW NEW NEW; MUST BE CALLED AS THE FIRST FUNCTION !! NEW; SIMPLIFIES InitComplete PLEASE NOTE: InitComplete should no longer be used!

Functions no longer supported in IRegieSvr: ScreenOn: ScreenOff: StopRegieEvents: ReadCmdLineVB: ReadCmdLineMeVB: WriteCmdLineVB: WriteCmdLineExVB: does not apply; use MMCScreenOn does not apply; use MMCScreenOff does not apply; use TestAndStopRegieEvents does not apply: use ReadCmdLine does not apply: use ReadCmdLineMe does not apply: use WriteCmdLine does not apply: use WriteCmdLineEx

All the other functions of the Regie.DLL are also provided by the RegieServer.

Note

Before any function can be called at the IRegieSvr interface, the function InitSvr() MUST be called. This function contains a windows handle as a parameter. The Windows thread that created this window, MUST be identical with the Windows thread instanciating the IRegieSvr.

See also: Section "Functions of the Regie server" IregieServerEvents interface RECTLP32 knew the following properties: AsyncCompleted: DoCommandParam: to acknowledge an event to read out a command string

These two functionalities are implemented in IRegieEvt using two functions:

1-86

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

AsyncCompleted(): GetCommandString():

Synonym for AsyncCompletedProperty of RECTLP32.VBX Synonym for DoCommandParamProperty of RECTLP32.VBX

Furthermore, RECTLP32.VBX supported the following events: FORMLOAD ACTIVATE FORMUNLOAD DEACTIVATE QUERYFORSHUTDOWN GETSPECIALKEY These events will be fired into the Notify method of the ConnectionPoint to be implemented on the client side (Interface _IRegieServerEvents). The following events are currently supported: FORMLOAD ACTIVATE FORMUNLOAD DEACTIVATE QUERYFORSHUTDOWN GETSPECIALKEY see also: Section "Functions of the Regie server" Changes in the Controls From this software version onwards, the Control DDECTL.VBX is no longer available. Where previously the Control DCTL.VBX has been used, now please use the Control DCTL.OCX. Embedding DOS applications The embedding of DOS applications and the resulting support of the Regie (e.g. area switchover) are no longer possible with software version 6.0 and higher.

OPC server

General OPC is the acronym for OLE for Process Control and designates a standard interface for the communication in the automation technology. For the description of the individual servers, please refer to the Description of Functions, Chapter 6. OPC Event Server allows to evaluate SINUMERIK alarms and messages according to the customer's specific requirements.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-87

Introduction 1.7 What happened in the last versions?

03.03

Note The OPC server: -- does not offer an event/alarm history -- does not offer the possibility of triggering alarms (MMC alarms)! -- delivers only attributes of the data type VT_NULL in the case of a refresh The function OPCEventServer::AckCondition of the Automation Wrapper returns an array whose elements possess wrong data types; for this reason, this array should not be evaluated.

OPC Data Server The OPC-Data Server can be used to edit SINUMERIK--specific variables.

IMC COM server

The IMC COM server provides SINUMERIK--specific HMI interfaces. For the description of the individual servers, please refer to the Description of Functions, Chapter 7. IMC Command The IMC Command interface grants access to SINUMERIK PI services with COM interface. IMC Domain The IMC Domain interface can be used to handle files (for copying a file to NC/ PLC or vice versa ) via the COM interface. IMC ADSI The IMC ADSI objects constitute directories and files, as well as offer the functions of data management, which have already previously been offered, in the form of an object--oriented view.

Note

The "ADSClass" is not implemented. Thus, only the name area (data management tree) can be used.

IMC File The IMC File server has taken over the functions of the former data management.

OPI variables

The following variables have been changed, added or do not longer exist: Data range A / data block M (axis--specific machine data)

1-88

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

CTRLOUT_MODULE_NR CTRLOUT_TYPE ENC_MODULE_NR ENC_TYPE SPIND_MAX_VELO_G26 SPIND_MAX_VELO_LIMS SPIND_MAX_VELO_G25 WORKAREA_LIMIT_MINUS WORKAREA_LIMIT_PLU ORKAREA_MINUS_ENABLE WORKAREA_PLUS_ENABLE

Ô MDCA_CTRLOUT_MODULE_NR Ô MDCA_CTRLOUT_TYPE Ô MDCA_ENC_MODULE_NR Ô MDCA-ENC_TYPE Ô Ô Ô Ô Ô Ô Ô MDD_SPIND_MAX_VELO_G26 MDD_SPIND_MAX_VELO_LIMS MDD_SPIND_MIN_VELO_G25 MDB_WORKAREA_LIMIT_MINUS MDB_WORKAREA_LIMIT_PLUS MDB_WORKAREA_MINUS_ENABLE MDB_WORKAREA_PLUS_ENABLE

Data range A / data block SE (axis--specific setting data)

Data range C / data block FA (active zero offsets) linShift (description changed) mirrorImgActive rotation scaleFact Data area C / data block FS (system frame) linShift linShiftFine mirrorImgActive rotation scaleFact Data range C / data block FU (settable zero offset) linShift (no longer existing) linShiftFine (no longer existing) mirrorImgActive (no longer existing) rotation (no longer existing) scaleFact (no longer existing) Data range C / data block M (channel--specific machine data)

MDS_CHAN_NAME

Data range C / data block S (channel--specific status data) cIn cOut G0Mode pTc Data range C / data block SE ( channel-specific setting data) DRY_RUN_FEED Ô MDD_DRY_RUN_FEED THREAD_START_ANGLE Ô MDD_THREAD_START_ANGLE Data range C / data block SEGA (status data: channel axes in the WCS (extension to SGA)) motEnd Data range C / data block Y (channel--specific system files) systemFrameMask

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-89

Introduction 1.7 What happened in the last versions?

03.03

Data range N / data block DIAGN (global diagnostic data) dp611USpecAccChangeCnt dp611USpecAccChangeMask dp611USpecAccKey dp611USpecAccPath dpAxisCfgMachAxisNr dpAxisCfgnumAxes dpAxisCfgValid dpAxisStateCtrlout dpAxisStateEnc1 dpAxisStateEnc2 dpAxisStateLifeCntErrCtrlout dpAxisStateLifeCntErrEnc1 dpAxisStateLifeCntErrEnc2 dpBusCfgBaudrate dpBusCfgCycleTime dpBusCfgDataExTime dpBusCfgNumBuses dpBusCfgValid dpBusStateAccessDurationAct dpBusStateAccessDurationMax dpBusStateAccessDurationMin dpBusStateAccessErrCnt1 dpBusStateAccessErrCnt2 dpBusStateAvgCycleBetweenErr1 dpBusStateAvgCycleBetweenErr2 dpBusStateCycleCnt dpBusStateDpmAction dpBusStateDpmActual dpBusStateDpmCtrl dpBusStateDpmError dpBusStateDpmPrjCnt dpBusStateDpmRequest dpBusStateNumActiveSlaves dpClientCfgId dpClientCfgNumClnt dpClientCfgValid dpClientStateComm dpSlaveCfgBusAddr dpSlaveCfgInputTime dpSlaveCfgMasterAppCycTime dpSlaveCfgNumSlaves dpSlaveCfgOutputTime dpSlaveCfgValid dpSlaveIdentNo dpSlave StateIncCnt dpSlaveStateSync dpSlotCfgAssignAxis dpSlotCfgAssignBus

1-90

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

dpSlotCfgAssignClient dpSlotCfgAssignMaster dpSlotCfgAssignSlave dpSlotCfgIoType dpSlotCfgLength dpSlotCfgLogBaseAddress dpSlotCfgNumSlots dpSlotCfgSlaveAdress dpSlotCfgSlotNr dpSlotCfvValid dpSlotStateComm dpSlotStateRecvTelegram dpSlotStateSendTelegram dpSlotStateTelegramType dpSysCfgAvailable dpSysCfgNumMaster dpSysCfgValid dpSysCfgVersionDpm dpSysCfgVersionDpr dpSysCfgVersionDprEx dpSysCfgVersionHost dpSysStateDpmInit Data range N / data block M (global machine data)

AXCONF_MACHAX_NAME_TAB DRIVE_INVERTER_CODE DRIVE_IS_ACTIVE DRIVE_LOGIC_NR DRIVE_MODULE_TYPE DRIVE_TYPE INT_INCR_PER_DEG INT_INCR_PER_MM POSCTRL_SYSCLOCK_TIME_RATIO SYSCLOCK_CYCLE_TIME Ô Ô Ô Ô Ô Ô Ô Ô Ô Ô MDSA_AXCONF_MACHAX_NAME_TAB MDLA_DRIVE_INVERTER_CODE MDBA_DRIVE_IS_ACTIVE MDCA_DRIVE_LOGIC_NR MDCA_DRIVE_MODULE_TYPE MDCA_DRIVE_TYPE MDD_INT_INCR_PER_DEC MDD_INT_INCR_PER_MM MDL_POSTCTRL_SYSLOCK_TIME_RATIO MDD_SYSCLOCK_CYCLE_TIME

Data range N / block S (global status data) driveType driveTypeChangeCnt safeSplStatus safeXcmpCmd safeXcmLevel safeXcmpState Data range N / data block SEMA (status data: channel axes in the MCS (extension to SMA)) aaCoupAct (description changed) aaCoupOffs (description changed) aaCurr (description changed) aaDtbb (description changed) aaDteb (description changed)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-91

Introduction 1.7 What happened in the last versions?

03.03

aaDtepb (description changed) aaEsrEnable (description changed) aaEsrStat (description changed) aaLeadP (description changed) aaLeadSp (description changed) aaLeadSv (description changed) aaLeadTyp (description changed) aaLeadV (description changed) aaLoad (description changed) aaMm (description changed) aaMm1 (description changed) aaMm2 (description changed) aaMm3 (description changed) aaMm4 (description changed) aaOff (description changed) aaOffLimit (description changed) aaOffVal (description changed) aaOscillReversePos1 (description changed) aaOscillReversePos2 (description changed) aaOvr (description changed) aaPower (description changed) aaSoftendn (description changed) aaStat (description changed) aaSync (description changed) aaTorque (description changed) aaTyp (description changed) aaVactB (description changed) aaVactM (description changed) aaVc (description changed) actCouppPosOffset (description changed) cmdCouppPosOffset (description changed) displayAxis (description changed) focStat (description changed) fxsStat (description changed) PRESETVal (description changed) safeMeasPos (description changed) vaVactm (description changed) Data range N / data block SMA (status data: channel axes in the MCS) actIncrVal (description changed) actToolBasePos (description changed) Data range N data block SSP (status data: spindle) cmdSpeed (description changed) opMode (description changed) turnState (description changed) Data range N / data block SSP2 (status data: spindle) actGearStage actSpeed

1-92

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

channelNo (description changed) cmdAngPos cmdConstCutSpeed cmdGearStage cmdGwps cmdSpeed driveLoad gwpsActive index name namePhys (description changed) opMode speedLimit speedOvr spindleType status turnState Data range N / data block VSYN (NCK--specific user variables for synchronized actions) anMarker (no longer existing) Data range N / data block Y (global system data) maxnumDrives (description changed) numCuttEdgeParams_tao numCuttEdgeParams_tas numCuttEdgeParams_ts numCuttEdgeParams_tam numCuttEdgeParams_tad simo611dSupport Data range N / data block YFAFL (NCK statement groups Fanuc) Group Group_NUM Data range T / data block TAD (application--specific data) siemData Data range T / data block TAM (application--specific magazine data) siemData Data range T / data block TAO (application--specific cutting edge data) siemEdgeData Data range T / data block TAP (application--specific magazine location data) siemPlaceData Data range T / data block TAS (application--specific monitoring data) siemData Data range T / data block TC (toolholder parameters) tcCarr1 (no longer existing) tcCarr10 (no longer existing) tcCarr11 (no longer existing)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-93

Introduction 1.7 What happened in the last versions?

03.03

tcCarr12 (no longer existing) tcCarr13 (no longer existing) tcCarr14 (no longer existing) tcCarr15 (no longer existing) tcCarr16 (no longer existing) tcCarr17 (no longer existing) tcCarr18 (no longer existing) tcCarr19 (no longer existing) tcCarr2 (no longer existing) tcCarr20 (no longer existing) tcCarr21 (no longer existing) tcCarr22 (no longer existing) tcCarr23 (no longer existing) tcCarr3 (no longer existing) tcCarr4 (no longer existing) tcCarr5 (no longer existing) tcCarr6 (no longer existing) tcCarr7 (no longer existing) tcCarr8 (no longer existing) tcCarr9 (no longer existing) Data range T / data block TM (magazine data: general data) actWearGrInMag (no longer existing) Data range T / data block TMC (magazine data: configuration data) magBLMag (description changed) magSearch (description changed) modeWearGroup (description changed) Data range T / data block TO (cutting edge data: tool compensation data) edgeData (description changed) Data range T / data block TOE (cutting edge--related data; additive offsets coarse, setting--up offsets) edgeECData (no longer existing) Data range T / data block TOET (cutting edge--related data; additive offsets coarse, setting--up offsets transformed) edgeECData (no longer existing) Data range T / data block TP (magazine data: location data) placeData (no longer existing) Data range T / data block TT (magazin data: location types) placeType (no longer existing) Data range T / data block TUE (cutting edge data: user--defined data) edgeData (description changed)

PI services

The following PI service has been added:

1-94

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

_N_F_OPER

Release 6.1 March 2001

Note Is an installation of Internet Explorer on your target system, please update to version 5 or higher before installing HMI--ProgrammingPackage. In other case Windows Explorer occures an exception.

New commands in the NCDDE Server

"Freeze" and "UnFreeze" for freezing Hotlinks The command "Freeze" suppresses the transfer of changes to DDE clients with Hotlinks. When this command is enabled the data is still procured from the NC/ PLC and can be read from the NCDDE resident cache with read commands. NC/ PLC are not relieved by this command! The command "UnFreeze" disables the "Freeze" command and causes the client to be informed about the current setting when value changes are received. Both commands can be found in NSK files. The command syntax is: Freeze ( <Hotlink-Item> ) UnFreeze ( <Hotlink-Item> ) <Hotlink-Item> and the selected DDE Topic serve to identify the Hotlink. Should <Hotlink-Item> contain syntactic characters from the NCDDE command syntax, it must be specified explicitly as a string. Examples: Freeze ( /bag/state/opmode ) UnFreeze ( /bag/state/opmode) Freeze ("/channel/parameter/r[2] (\"!|%d\")") UnFreeze ("/channel/parameter/r[2] (\"!|%d\")") Special characters such as inverted commas must protected by the programming language used. For example, the syntax in Visual Basic is: Dctl1.LinkItem = "Freeze (""/channel/parameter/r[2] (\""!|%d\"")"")"

Note When several Hotlinks have the same Itemtext, they can be differentiated by prefixing with blanks in Item.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-95

Introduction 1.7 What happened in the last versions?

03.03

Horizontal softkeys

The position and size of horizontal softkey text boxes have been changed only slightly (multiple--line texts with increased resolution)

Control server definitions

The RegieCOMServer constants are contained in the type library (IRegieSvr.dll) from V6.1 onwards. The header regieusr.h has been deleted!

New functions for reading entries from a language DLL

There are two new Visual Basic functions which read entries from a language DLL, without converting the double blanks to a line break (i.e. read in the data raw). The functions are: Function ALGetDLLEntriesRaw(ByVal hdl As Long, ByVal t_start As Integer, ByVal t_end As Integer, ByVal t_maxRead As Integer, Sktext As Variant) As Integer and Function ALGetDLLEntriesIRaw(ByVal hdl As Long, ByVal t_start As Integer, ByVal t_maxRead As Integer, Sktext As Variant) As Integer The parameters are the same as for the functions without RAW.

Dynamic graphics resolution

From this version onwards only the window frame and not the contents (i.e. the controls) can be enlarged in an application with a resolution higher than 640x480. This allows more information to be accommodated in a window. This is achieved with an entry in the application--specific INI file: [CONTROL] ControlResolution=0 The default setting is 1, i.e. the size of all controls are adapted. If ControlResolution=0, individual sections (for example the header line in a form) can be adapted with the calls: MDI_ControlResolution header MDI_ControlResolution lblTitleText

1-96

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Masking out the vertical master control softkeys

Vertical master control softkeys will not be displayed when the following entry is made in Regie.ini: [Miscellaneous] ; ----> applies for all applications ; NbrHorSoftkeys=10 ; NbrVerSoftkeys=0 ; ----> applies only for Reg_dsp: NbrVerRegieSoftkeys=0 The entry is only effective when NbrVerSoftkeys is not set.

New controls

The following new Controls are included in software version 06.01: MMC Controls: S Controls: -- Textbox -- Togglebox -- Combobox -- Checkbox -- Optionbutton -- Scrollbar S Functionality: -- User guidance by displaying the keyboard bitmap (Edit, Input, Select key) -- Geometric navigation with cursor keys -- Textbox with special entry filters (numerical, alphanumeric, program name, block number, etc.), Min/max checks and integrated calculator -- Tooltips -- Supports logographic languages (Japanese) S Boundary condition: -- The calculator function does not allow a number to be multiplied by a negative number (for example 5* --3). The minus is interpreted as a second operator character and NOT as a sign. ASCII editor control: S General functionality -- Standard editor functionality -- Extensive keyboard and programming interface -- Editing files and "domains" (optimized NCK access) -- Asynchronous loading and saving of files -- Aborting asynchronous procedures -- Buffering keyboard entries -- Using the maximum block length with keyboard entry and editor functions S NC--specific functionality

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-97

Introduction 1.7 What happened in the last versions?

03.03

------------

Insert, delete, replace character/block--oriented "Fast" search for block numbers Automatic block numbering of existing program parts and with new entry TeachIn support (automatic insertion of axis positions) Text input in characters or in blocks Detection of steps (programming support) Edit, "Read only" and "Display only" mode Individual display (rectangle, bar, color) of actual NC and edit block Individual end of block detection Marking individual blocks as "Hidden" or "Read only" Automatic recognition of editable and non--editable NC program sections

FileViewer control: S Functionality -- Displaying the file system including NCK data management ("merged" display) -- Extensive configuration and programming interface -- "Explorer" view (split window for use in applications with mouse operation) -- "MMC" view (for use on OPs with keyboard operation) -- Number, order and format of columns to display directories and file attributes adjustable -- Supporting display filters for directories and files -- Automatic update of window contents Sorting the screen contents for any column -- Granting access levels for displaying drives and directories -- Multiple selection of unconnected areas Please refer to the documentation for a detailed description of the controls.

OPC Alarm&Event server

Limitations S The OPC Alarm&Event server does not offer an event/alarm history. S Alarms (MMC alarms) cannot be triggered by the server. They can, however, be triggered by the SINUMERIK specific interface IMCEventCreation. Changes S The OPCEventServer::AckCondition of the Automation Wrapper now returns an array whose elements contain the correct data types. S The attributes are now returned correctly after a refresh. S With the method IOPCEventServer::CreateEventSubscription the interface IOPCEventSubscriptionMgt must always be called over the parameter riid. IUnknown must not be called any more!

Generating alarms

This version does not contain the interface IMCEventCreation, which provides methods for generating alarms. The documentation contains the description of this interface initially.

1-98

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Accessing alarms and events

This version does not contain the interfaces IMCEventList, IMCEventSubscription and IEnumVARIANT which enable access to the scheduled alarms and the events connected with the alarms (for example "Alarm comes", "Alarm goes"). The documentation contains the description of this interface initially.

BTSS variables

Some variables have been modified, others removed and new ones added: Data area C / data block DIAGN (channel--specific diagnosis data) cuttingTime new cycleTime new ipoBufLevel changed operatingTime new poweronTime new setupTime new Data area C / data block FA (active user frames) General description changed linShift changed mirrorImgActive changed rotation changed scaleFact changed Data area C / data block FB (base frame) linShift changed linShiftFine changed mirrorImgActive changed rotation changed scaleFact changed Data area C / data block S (channel--specific status data) aaMeasP1Valid new aaMeasP2Valid new aaMeasP3Valid new aaMeasP4Valid new aaMeasPoint1 new aaMeasPoint2 new aaMeasPoint3 new aaMeasPoint4 new aaMeasSpValid new aaMeasSetpoint new acIwStat changed acIwTu changed acMeasActPlane new acMeasCornerAngle new acMeasCornerSetangle new acMeasDiameter new acMeasDirApproach changed

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-99

Introduction 1.7 What happened in the last versions?

03.03

acMeasDNumber acMeasFrameSelect acMeasLatch acMeasPoint1 acMeasPoint2 acMeasPoint3 acMeasPoint4 acMeasSema acMeasSetpoint acMeasTNumber acMeasToolLength acMeasType acMeasValid acMeasWpAngle acMeasWpSetangle actParts acTrafoParSet aTcAckC aTcCmdC cmdDwellTime cmdTrafoParSetS cmdTrafoS pTcSol pToolO remainDwellTime reqParts seruproMasterChanNo seruproMasterNcuNo specParts timeOrRevolDwell totalParts stopCond vaEgSyncDiff

new new new deleted deleted deleted deleted new deleted new new changed new new new new new new new new new new new new new new new new new new new changed changed

Data area C / data block SEMA (state data: machine axes (extension of SMA)) vaDistTorque new Data area C / data block SSP (state data: spindle) pSMode new pSModeS new Data area C / data block SSP2 (state data: spindle) pSMode new pSModeS new Data area N / data block DIAGN (global diagnostic data) dp611UspecAccChangeMask à dp611UspecAccMask errCodeSetNrGen new errCodeSetNrPi new setupTime new poweronTime new

1-100

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 1.7

Introduction What happened in the last versions?

Data area N / data block ETPD (data lists for protocolling) area new asciiMode new col new countActivated new dataListIndex new dataProtok new dataUploaded new eventActiveStatus new unit new maxElementsFastFifoUsed new maxFileLength new maxGrossFileLengthUsed new maxNetFileLengthTooSmall new numData new numElementsFastFifoTooSmall new protocolFilename new row new skip new timePeriod new type new Data area N / data block FB (global NCU base frames)linShift changed linShiftFine changed mirrorImgActive changed scaleFact changed Data area N / data block S (Zustandsdaten) freeMemDram2PassF new freeMemDramPassF new freeMemSramPassF new numTraceProtocDataList new numTraceProtocEventType new numTraceProtocOemDataList new numTraceProtocOemEventType new protocTrigMaskInt16 new protocTrigMaskInt32 new protocTrigNumEvDelay new protocTrigState new protocTrigType new protocTrigVarArea new protocTrigVarCol new protocTrigVarRow new protocTrigVarType new protocTrigValueInt16 new protocTrigValueInt32 new protocTrigValueReal32 new protocTrigValueReal64 new protocTrigVarUnit new protocUserActive new

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

1-101

Introduction 1.7 What happened in the last versions?

03.03

totalProtokolFiles totalMemDram2PassF totalMemDramPassF totalMemSramPassF traceProtocolActive usedMemDram2PassF usedMemDramPassF usedMemSramPassF

new new new new new new new new new

Data area N / data block SD (Servo--DatenAcConstCutS) servoDataFl32 new servoDataFl64 new

Data area N / data block SEMA (Zustandsdaten: Kanalachsen im MKS (Erweiterung zu SMA)) vaDistTorque new Data area N / data block SSP2 (state data: spindle) AcConstCutS new Data area N / data block Y (Systemdaten) ncuPerformanceClass new oemProtText new Data area T / data block TC (Parameter der Werkzeugträger) tcCarr22 changed tcCarr23 changed tcCarr24 new tcCarr25 new tcCarr26 new tcCarr27 new tcCarr28 new tcCarr29 new tcCarr30 new tcCarr31 new tcCarr32 new tcCarr33 new Data area T / data block TO (tool edge data: offset data) cuttEdgeParam changed edgeData changed

PI services

The following PI--Service is changed: _N_TMPCIT changed

1-102

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

General information

2

2.1

Features of the component PCUxx

Overview

This Chapter is a compilation of some features of the component PCU xx: -- Improved handling of the registry -- Shutting down the PCUxx -- Locking key combinations

Improved handling of the registry

The Windows system environment for standard Windows and that for MMC will no longer be distinguished or separately managed like up to SW 05.01.26. There will be only one system environment for the two cases. This allows the user to handle the system environment (REGISTRY, SYSTEM.INI) more easily. The confusing prompts during system start--up, asking the operator whether changes of the system settings are to be saved and whether they are to be transferred to the backup also, become unnecessary with the new handling. The system environment is managed automatically, which guarantees the next system start--up to be successful. Modifications done to the system environment are automatically taken over with this new management. The following procedure for managing the system environment has been realized: S There are (still) one working copy, one safety copy, one backup copy and -- to make sure -- a separate SIEMENS original environment. S Normally exiting Windows -- in service mode or HMI mode -- turns the safety copy to the backup copy and the working copy to the safety copy. Of course the working copy still remains the working copy. This behavior guarantees changes of the system environment to be available for the next start--up and additionally saves them. S During start--up it is checked whether the start--up can be run with the working copy. If this is true, the system is started using the working copy and the environment is available as it has been left when Windows has been exited. If not, the system is started using the safety copy as working copy. The most recent system settings will be lost, since they have violated the system integrity. If the start--up should not be possible even with the safety copy, the backup copy becomes the working copy and the system starts with this copy. In this case the most recently made changes will be lost, too. S Sheet anchor for a successful start--up is the SIEMENS original environment,

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-103

General information 2.1 Features of the component PCUxx

03.03

which cannot be modified and in any case guarantees a successful start--up. This environment will then become the working copy, i.e. the original delivery state is set again. S The corresponding files are located under C:\Tools\Siemens.org, C:\Tools\User.sav and C:\Tools\User.act and in the Widows directory (C:\win.95).

Note These files will be overwritten when the software is updated.

Shutting down the PCU50

The functionality during the HMI shut--down has been modified. If now the HMI is left with the EXIT button, the HMI applications are closed and Windows is shut down. The system stops with the message "Safe to power off. Press any key to reboot". In the process the automatic restart is stopped. It is distinguished, whether an HMI start--up or a start--up in a Windows service mode has taken place. During an HMI start--up Windows is shut down as described above, a service--mode start-up shuts down the HMI only, Windows remains active. This improved functionality offers the EXIT softkey per default on HSK8 in the second layer of the area menu during HMI shut--down. The following procedure runs during the HMI shut--down: Following the instruction to shut down the HMI, (EXIT--button) the REGIE and the HMI applications (applications that have not been started with the OEM--Frame) run the protocol QueryForShutDown. Sequentially (the sequence corresponds to the task index in the REGIE.INI) the QueryForShutDown--message is sent to the applications. As soon as the first application responds negatively ­ i.e. refuses the shut--down-- a recall alarm appears "...area xxx cannot be shut down". The RECALL--key is used for acknowledging the alarm and the corresponding area is implicitly selected. There the necessary operating actions may be taken. However the HMI shut--down is then interrupted and has to be started again later. If an application is active in the DOS box, the HMI shut--down is also stopped and the corresponding message prompts for first terminating the DOS box application. If all HMI applications are ready for shut--down, the termination protocol is run one by one with each application. Applications that had been started from the OEM frame just receive a WM_CLOSE message. If all applications have been processed like this, Windows is terminated while the HMI starts up.

2-104

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.1

General information Features of the component PCUxx

Note The softkey "Exit" may be locked in the file REGIE.INI with the entry "ExitButton=False".

Locking key combinations

Key combinations like Alt+Ctrl+Del, Alt+Tab, Alt+F4 are now hidden. If they should be needed for OEM-- or service purposes, the entry SeqAct in the section [MMC103keyb] of the file SYSTEM.INI may be modified accordingly. This handling only works on a MMC103 hardware, since only here the Siemens--specific keyboard driver applies. In the service--mode the entry has no effect, i.e. all key combinations are enabled. The following codes have been implemented: Bit 0: Bit 1: Bit 2: Bit 3: Bit 4: Bit 5: Bit 6: Bit 7: CTRL--ALT--DEL ALT--F4 ALT--TAB LEFTSHIFT--ALT--TAB RIGHTSHIFT--ALT--TAB CTRL--ESC ALT--ESC ALT--SPACE

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-105

General information 2.2 Optimizing the development environment

03.03

2.2

Optimizing the development environment

Overview

In this section you can find some tricks and tips to make work easier for you.

Limits using Visual Basic functions

Here some Visual Basic functions are listed which you should not use in the environment of the HMI: MessageBox and InputBox (functions): The Regie itself decides which windows are displayed in the foreground. Therefore dialog boxes might be hidden even though they are waiting for entries and the HMI operation is blocked. As an alternative the function ModalDialog is offered. Several instances of one form: When running up the control, the Regie calls UNLOAD. Only if the implicit form variable (same name as the form type) is being used, Visual Basic will --if necessary-- create a new instance. DoEvents: should be avoided, because it is not easy to go round recursive calls.

2.3

Problems during operation and how to solve them

Overview

The following section describes problems that might possibly occur during operation and shows how to solve them instead of calling the hotline.

LoadLibrary - first call If a DLL (here: REGIE.DLL) is called for the first time by LoadLibrary, the file REGIE.DLL must be located either in the actual directory or in the WINDOWS search path. In some developmental stages (e.g. while testing with a debugger) LoadLibrary might not find the file REGIE.DLL.

2-106

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.3

General information Problems during operation and how to solve them

Spelling of Child names

Child names must always be spelt correctly and must be set in double quotes (") if used in an ASCII--file. A distinction is made between lower and upper case letters in Child names. Child names should not exceed 8 characters.

Copy MDIChild

Proceed as follows to generate a new MDI Child from a similar one which already exists: S Store your project. S Modify the properties name and tag of the existing MDI Child. S Store the modified Child with Save File as ... under a new name. Then the original Child is no longer part of the project. S Add the original MDI Child to the project with Add File.

`Lock'-function in START-MDIFORM

Using the function Set_State(START--MDIFORM) in the file PRIVATE.BAS under private_ini() leads to the following malfunction of the `lock'--function if it is called in the FormLoad of the START--MDIFORM: The `lock'--function is canceled, since SetState() is called twice by the Sequence Control. Remedy: Move the `lock'--function of the START--MDIFORM to State_Reached.

Error messages from the Sequence Control

File AL_UTIL.DLL (or similar) not found If this error message occurs, the path in Project --> Properties --> Make --> Command Line Arguments might not have been specified correctly. The correct entry must read C:\Siemens\Sinumerik\HMI--Advanced\mmc2. Alcommon.bas:State_init . . . Ô Check FormNames If the FormNames match the specified files, you should remove the temporary file of your application from the directory altmp.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-107

General information 2.3 Problems during operation and how to solve them

03.03

Quickly clicking softkeys

Clicking softkeys several times might cause the system to crash. Description: Clicking softkeys several times causes the error message "ALCOMMON.BAS Set_Action, Error: Foreign application won't perform DDE--method or operation" to appear. Then the error: The operator system has reached a critical point ------> reboot the system appears. Reason: A DDE connection caused by a softkey action has not yet been terminated and the same softkey action tries to build up a DDE connection again even though the first one still exists. Remedy: Use AL_STOPSKS (lock softkey) before a DDE connection is established and AL_RESUMESKS (release softkey) after the DDE connection has been established.

Display size on the testing PC

Description: In the testing environment not all forms fit in the frame given by the VGA resolution of the PCU xx. You can find two rows of softkeys: an outer and an inner row. Remedy: Add the following line to the section [CONTROL] of the .INI--file of your application: ScreenTwips=1

Not enough contrast on the monochrome-display (black and white)

Remedy: Under DOS you can increase the contrast with the key combination CTRL--ALT--U or decrease the contrast with the key combination CTRL--ALT--D. Use the function ContrastUp or ContrastDown of the file REGIE.DLL to obtain the same effect from the program.

Problems with the Data Management when the power is cut off

Problem description: When using either the COPY or the CREATE command specifying a source file of the Data Management Server with the parameter --f the following error might occur: The existing file is deleted and the new file is not created/copied, since the parameter --f causes the destination file to be overwritten in any case, even when the COPY or CREATE action has been aborted with an error.

2-108

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.4

General information Transfer of VB applications from 16Bit to 32Bit

Remedy: Instead of directly applying the COPY command to the actual destination file, copy the file from the HMI to a temporary file in the NC. If the COPY command was successful ( "#100#..." ), delete the already existing destination file on the NC and then rename the temporary file with the RENAME command. For the CREATE command proceed as follows: first create an empty file with the CREATE command and then follow the steps described for the COPY command.

Problem with CREATE

Problem description: If the CREATE command is used specifying a source file and if this file is quite large (1MB and more) the HMI gets blocked. Remedy: On the HMI only. Use the CREATE command without specifying a source file. Then use the VisualBasic command "FILECOPY" for overwriting the file created with CREATE.

2.4

Transfer of VB applications from 16Bit to 32Bit

If you have produced applications using VB 4-- 16Bit, proceed as follows in order to transfer the application for the 32Bit version of the HMI environment:

Step1

Replace DDECTL Controls by DCTL Controls in the 16Bit project using VB4-16Bit.

Step2

Install Visual Basic 6.0, Visual C++ 6.0 (Visual Studio 6.0 Enterprise Edition, Service Pack 2) on the development computer (Windows NT 4.0 SP 6).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-109

General information 2.4 Transfer of VB applications from 16Bit to 32Bit

03.03

Step 3

Check if the Sheridan 3D Controls are completely and correctly installed (if they are used -- the AB uses them): S Open Visual Basic 6.0 and create a new project (Standard EXE). S Select the component Sheridan 3D Controls in Project | Components. If this component does not exist, click `Browse' and select the file "threed32.ocx". The file is located either in the System32 folder or in the mmc2 folder. If it cannot be found in either folder, it must be copied from CD onto your hard disk. It can be found in: Visual Studio 6 in \Common\Tools\Vb\Controls on CD 3 Visual Basic 6 in \Common\Tools\Vb\Controls on CD 1 Place a Sheridan 3D Control (e.g. SSPanel) on a form; if this is possible the Sheridan 3D Controls are already correctly installed. However, if you receive a message which reads that the placement is refused due to a missing license (Error 429 or "License not found"), the installation of the Sheridan 3D Controls must be corrected. In order to register for the design time, the file "vbctrls.reg" must be imported into the registry. This can be done with the command `regedit <path>\vbctrls.reg'. The reg file can be found in: Visual Studio 6 in \Common\Tools\Vb\Controls on CD 3 Visual Basic 6 in \Common\Tools\Vb\Controls on CD 1

Step 4

For the Samples 2 and 11, which are part of the delivery, the `MicroHelp Gauge Control' is required additionally. If you use these Samples please proceed according to what has been said for the Sheridan 3D Controls. The required file is called `Gauge32.ocx'.

Step 5

Transfer the language DLL (see Chapter "Sequence Control" Section "Creating a language DLL").

2-110

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.4

General information Transfer of VB applications from 16Bit to 32Bit

Step6

Configure the 32Bit environment by: substituting drive L: e.g. Subst L: C:\Siemens\Sinumerik\HMI-Advanced

Step 7

Check the file VB.INI file, Section [VBX Conversions32] to contain the following entries. If the entries are missing, they must be entered.

[VBX Conversions32] threed.vbx={0BA686C6-F7D3-101A-993E-0000C0EF6F5E}#1.0#0; <path>\threed32.ocx grid.vbx={A8B3B723-0B5A-101B-B22E-00AA0037B2FC}#1.0#0; <path>\grid32.ocx mmcctrls.vbx={E55625E2-7147-11D1-897A-0020AFB6554E}#1.0#0;<path>\mmcc tr32.dll dctl.vbx={22842323-3FCE-11D1-9B93-0020AF524FA5}#1.5#0;<path>\dctl.ocx

(VB automatically replaces the 16Bit DCTL and the 16Bit MMC Controls by the respective 32Bit Controls)

Step 8

Open the 16Bit project in VB6. This will: S replace the 16Bit versions of the DCTL Control and of the MMC Controls by the respective 32Bit versions, replace the GRID and the TREED Controls accordingly, and S automatically replace the Editor Control and the Disp Control by PictureBox Controls.

Important The automatic replacement of the 16Bit DCTL and MMC Controls is only possible if the font properties of these Controls are not used. Whether or not font properties are being used can be found out easily by opening the 16Bit form file (*.frm) in a text editor and checking if the DCTL and MMC Controls of the regarding form contain entries for the font properties such as Fontbold, Fontitalic etc. Delete such entries from the form file in order to enable the automatic replacement of the 16Bit Controls by 32Bit ones to be carried out properly.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-111

General information 2.4 Transfer of VB applications from 16Bit to 32Bit

03.03

Step 9

Reference the type libraries `SINHMI.TLB', `Ole Automation' and `IRegieSvr' in Project | References.

Step 10

Specify MMC path "L:\MMC2" in Project | Properties | Make" in the dialog box "Command Line Arguments".

Step 11

Functions of the AB166.DLL the names of which end on "EX" may be contained without this suffix in the AB32.DLL, i.e. alter existing functions in the applications accordingly, if necessary.

Step 12

Transfer application--specific C--DLLs as either: S C--DLL (with/without type library) or S VB ActiveX DLL (Transfer from C to Basic --> Handling of strings is easier)

Step 13

In 16Bit the communication is performed through the Regie DLL and the Regie Control. These mechanisms will be carried out by the IRegieEvt and the IRegieSvr interface of the RegierServer from Software version 6.0 on.

2-112

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.4

General information Transfer of VB applications from 16Bit to 32Bit

VB application (32Bit) IRegieEvt IRegieSvr

OEM application (32Bit) IRegieSvr IRegieEvt/ OEMFrame

REG_CMD.EXE

RegieControl VB application (16Bit) )

RegieDLL

OEMFrame OEM application (16Bit)

The following side conditions are valid for the 32Bit architecture: S 16Bit VB applications are supported S 16Bit Windows OEM applications are supported S DOS applications are not supported. In order to achieve compatibility of the existing 16Bit applications, the components REGIE.DLL and RECTLP32.VBX of the 32Bit stage of development must be used. If the 16Bit application is transferred to 32Bit, you must change to the RegieServer. For further details, see also Chapter "Functions of the RegieServer".

32Bit interfaces

The following interfaces are supported: -- OEM interface 16Bit, consisting of REGIE.DLL and RECTLP32.VBX, no changes in the scope of functions -- 32Bit Regie API interface (implemented in IRegieSvr interface), scope of functions like REGIE.DLL -- 32Bit Regie Event interface (--> IRegieServerEvents interface), scope of functions like RECTLP32 In the following text these interfaces are looked at in some more deatil:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-113

General information 2.4 Transfer of VB applications from 16Bit to 32Bit

03.03

IRegieSvr interface

Functions which were not contained in Regie.dll: AsyncCompleted: GetCommandString: InitSvr: InitCompleteEx: NEW NEW NEW, MUST BE CARRIED OUT AS THE FIRST FUNCTION! NEW, SIMPLIFIED InitComplete NB: InitComplete should no longer be used

Functions which are no longer supported by IRegieSvr: ScreenOn: ScreenOff: StopRegieEvents: ReadCmdLineVB: ReadCmdLineMeVB: WriteCmdLineVB: WriteCmdLineExVB: discontinued, use MMCScreenOn discontinued, use MMCScreenOff discontinued, use TestAndStopRegieEvents discontinued, use ReadCmdLine discontinued, use ReadCmdLineMe discontinued, use WriteCmdLine discontinued, use WriteCmdLineEx

All other functions of Regie.dll are supported by RegieServer, too. NB: The function InitSvr() must be carried out before any other function can be used. This function contains a Windows handle as one parameter. The Windows thread which produced this box must be identical to the Windows thread which instances the IRegieSvr. See also: Chapter "Functions of the RegieServer".

2-114

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.4

General information Transfer of VB applications from 16Bit to 32Bit

IRegieServerEvents interface

RECTLP32 knew the following properties: AsyncCompleted: DoCommandParam: to acknowledge an event to export a command string

These two properties are realized in IregieEvt with the help of two functions: AsyncCompleted(): GetCommandString synonymous to the AsyncCompleted property of the RECTLP32 synonymous to the DoCommandParam property of the RECTLP32

In addition, RECTLP32.VBX supported the following events: FORMLOAD ACTIVATE FORMUNLOAD DEACTIVATE QUERYFORSHUTDOWN GETSPECIALKEY These events are fired into the Notify method of the ConnectionPoint (IRegieServerEvents interface) which is to be implemented on the client side. The following events are currently supported: FORMLOAD ACTIVATE FORMUNLOAD DEACTIVATE QUERYFORSHUTDOWN GETSPECIALKEY See also: Chapter "Functions of the RegieServer"

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-115

General information 2.5 Notes for the OEM user on "Hard disk Backup/Restore with Ghost"

03.03

2.5

Notes for the OEM user on "Hard disk Backup/Restore with Ghost"

Saving the contents of the hard disk with GHOST is described in detail in the HMI Advanced Startup Manual. The import of an image is described there as well. During the import the following dialog pops up: What kind of partitioning is the selected image of? 1 Standard partitioning (default) 2 User-defined partitioning Your Choice [1,2]? You can choose here if the partitioning which forms the basis for the image shall be the (operating system--specific) standard partitioning or a freely determinable partitioning. While GHOST will import the image automatically if you have selected the standard partitioning, it will perform this interactively if you have selected the freely determinable partitioning. This means that the operator is requested to enter e.g. partition sizes to be set. If you have selected the standard partitioning, the partition sizes are determined automatically in dependence on the operating system basis of the imported image and on the actual capacity of the hard disk. The partition sizes can be determined in the file Ghost.ini (using a text editor). Size ranges are given in which a certain partitioning is valid, e.g. [DOS] Ranges=... ... ... [Win95] Ranges=... ... ... [WinNT] Ranges=Min_450MB UpTo_2100MB UpTo_4800MB UpTo_2100MB=19P 19P 28P V UpTo_4800MB=19P 20P 25P V Default=2048M 2048M 25P V

2-116

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 2.5

General information Notes for the OEM user on "Hard disk Backup/Restore with Ghost"

Possible entries: Min _yMB: The hard disk must have a capacity of at least y MB, else the image is not imported. UpTo_yMB: If the hard disk capacity is between x MB and () y MB (for next lower values UpTo_xMB or Min_xMB), the partitions are determined as specified under UpTo_yMB. Max_yMB: The hard disk must have a capacity of y MB or less, else the image is not imported. If the hard disk capacity is between xMB and () y MB (for next lower values UpTo_yMB or Min_xMB), the partitions are determined as specified under Max_yMB. If the size range has no upper limit (the last entry in increasing order of size ranges is the entry Min_yMB or an UpTo_yMB entry, or in `Ranges' no size range is specified at all) the partitions are determined as specified in the `Default' settings. The partitioning valid for a certain operating system basis is determined during the start of the service menu. For further steps please refer to the HMI Advanced Startup Manual.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

2-117

General information 2.5 Notes for the OEM user on "Hard disk Backup/Restore with Ghost"

03.03

Platz für Notizen

2-118

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Basics of the HMI component

3

For developing OEM applications on the HMI Advanced you should be familiar with the complete system, i.e. you should know how the standard operating component works from the user's point of view and you should know how these components have to work together. This chapter gives a summary of the components involved. Together with the chapters 5 to 10 (description of the components) this will put you in the position to straightway solve your problems. For getting familiar with the functions of the MMC components, the following customer documentation is recommended reading: S /BA/ Operator's Manual S /BH/ Operator Components Manual S /FB1/, /FB2/ Description of Functions S /IAD/ Installation and Start--up Guide Besides that it is necessary for the programmer of MMC applications to be familiar with: S the operating system MS--WINDOWS NT S Entwicklung, Test und Debuggen mit Visual Basic S creating WINDOWS resources, e.g. examples Visual C++. S designing an technology--specific WINDOWS operator's interface.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-119

Basics of the HMI component 3.1 HMI as a part of SINUMERIK

03.03

3.1

HMI as a part of SINUMERIK

Functional components

The functions of the CNC control SINUMERIK 840D are split up in five components: S Human Machine Interface (HMI) S Programmable Logic Controller (PLC) S Numeric Control Kernel (NCK) S Drive control (SIMODRIVE devices) In addition to that communication between the areas and with external components is realized.

HMI

operating monitoring programming setting--up diagnosis

PLC

machine logic enable signals machine operating PLC Data Management

NCK NC program execution preparation interpolation servo control NC Data Management drive interface

Internal Communication

Drives

data acquisition velocity control current control

3.1.1

Operator component

Operating unit

The operating unit consists of several hardware components: S display unit including the NC keypad S machine control panel S MF2 standard keyboard S PCU50 module S options

3-120

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.1

Basics of the HMI component HMI as a part of SINUMERIK

Display unit

CRT monitor or flat screen monitor with an assembly frame, power supply unit, softkey and integrated NC keypad. S Tips for designing the graphical user interface will follow in chapter 4. S Assigning the softkeys is discussed in chapter 7. S Operating the WINDOWS applications with the NC keypad is treated in chapter 7. S Data display is explained in chapter 8.

Machine control panel

Machine control panel including EMERGENCY--STOP button, keys for operation modes and program control, for direction, spindle and feed control, key--lock switch and customer keys. Connection to the MMC--component via Multi Point Interface (MPI). S Chapter 8 contains tips for the evaluation of signals received from the machine control panel. S Handling access permission via key--lock switch is explained in chapter 10. S Information concerning the MPI is contained in chapter 3.

Standard keyboard

Keyboard with US standard layout QUERTY according to the MF2--standard with function keys and cursors. S The OEM--user doesn't need to take care of anything particular.

PCU50 module

The OEM--user can adapt the performance of the module PCU50 with hard disk for his purposes by selecting from several processor types and memory extensions. It is an industrial standard PC with the usual interfaces. The operating system MS-WINDOWS NT is installed. S See chapter 2 for completely installing the OEM--package HMI. S The remaining contents of the hard disk are also listed in chapter 2. S If you want to know how to copy the OEM applications to your hard disk, continue reading this chapter.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-121

Basics of the HMI component 3.1 HMI as a part of SINUMERIK

03.03

3.1.2

Options

There are several interfaces and additional components provided for functionally expanding the base system:

3-122

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

3.2

Software architecture of the HMI

3.2.1

The layer of the HMI software

At a glance

DDE server for data management, alarms and messages

HMI applications with sequence control Regie Com Server

Customer applications with sequence control Regie Com Server

NCDDE server for access to data of NCK and PLC Regie Regie Com Server Customer applications without sequence control Keyboard filter

MPI drvier

WINDOWS NT

Basic software

(cannot only be used for SINUMERIK)

PCU50 MPI bus NCK hardware PLC hardware

Hardware level

611D hardware

Fig. 3-1

HMI software structure

Help for interpretation

Figure 3--1 shows a schematic diagram of the MMC's different software layers from the application's view. The area highlighted gray marks the standard delivery volume. It includes three levels: S hardware

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-123

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

S operating system and drivers S applications Besides the standard applications you can run further customer--specific applications on the control. Off the shelf programs (e.g. CAD--systems) as well as own applications which include the SINUMERIK Sequence Control are allowed. A VisualBasic interface is provided. This gives you the advantage, that your program can access global variables of the SINUMERIK and is informed about some events you could not react on otherwise with Visual Basic. Using the drivers and the operating system makes you -- as an application developer -- independent on the hardware layer. Usually applications without Sequence Control are programs which were not primarily developed for use on the SINUMERIK, e.g. CAD--programs. They may be run on a SINUMERIK control, if their user interface has been adapted accordingly. The problems that might occur are described in chapter 4.

3.2.2

Regie

Features

The Regie is a superordinate program for flexibly managing S auxiliary programs S area applications S dynamic link libraries (16 Bit) S VBX files (16 Bit) Thus the Regie corresponds to WINDOW'S Program Manager. Among others the application `Regie' takes care of: S system initialization S system start--up S loading the system's and the MMC's dynamic link libraries S starting the application in the correct order S system configuration S area changeover

3-124

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

Starting sequence

The Regie first starts the auxiliary programs followed by the area applications. It waits for a return message from each program indicating a successful initialization. This proceeding provides the necessary auxiliary functions as soon as they are requested. A similar procedure applies when applications that were started by the Regie are being closed.

Umfang der Einträge

The Regie can manage up to: S 32 auxiliary applications S 32 area applications S 64 dynamic link libraries (DLL) of the system S 64 dynamic link libraries of the MMC

Regie for OEM

The Regie manages OEM--applications, too. The OEM--user can edit certain files of the Regie in order to announce his application to the system. Key assignment The possible key assignments of both the NC operating panel and the PC standard keyboard as they can be passed to the OEM user are listed in the following table.

Table 3-1 Key assignment of the NC-- and PC--(MF2--) keyboards

NC keyboard horizontal softkeys 1 to 8 Recall--key area change--over--key channel change--over--key info--key alarm acknowledgment window change--over--key End F1 to F8 F9 F10 F11 F12 Escape Home End

MF2 keyboard

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-125

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

Tabulator

For WINDOWS--applications it is necessary to convert the END--key to the TAB-key, since there is no TAB--key available on the NC operating panel.

Key assignments

The Regie receives all key strokes and passes them according to the active application. [F10] (area change--over is always evaluated by the Regie. If the active application is an Oem frame, the area change--over--key, the channel change--over--key, the machine--keys [cancel] and [end] are evaluated by the Regie, all others by the application. If an application with Sequence Control is active, the Regie evaluates [END] and [HOME] and besides that all function keys. The Sequence Control passes the softkeys (F1 to F8 and SHIFT F1 to SHIFT F8) to the application.

OEM frame

The special area application OEM frame (OEMFRAME.EXE) filters the softkeys codes from the special codes and converts them to the standard key codes ( F1 to F8 and Shift F1 to Shift F8 ) for WINDOWS--applications.

Customizing the keyboard driver

Since software version 5.1 it is possible to process the MMC--keys from area applications. Detailed information you will find in the chapters 6.3.1.5 and 11.10.4.

3.2.3

Sequence Control

Features

The sequence structure provides a frame for the SIEMENS standard applications and compatible OEM applications. It offers the following features: S managing the Sequence Control (`menu tree' consisting of states) S query of the softkeys (vertical and horizontal) S query of the NC special keys S displaying the softkey texts S managing the interactive prompt line

3-126

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

States

Central element for describing the Sequence Control is the state . It is characterized by: S a unique state number S a list of MDIchilds that are displayed in this state S a definition of the softkey setting: text indices and assigned functions S z--flag: save or quit settings You may store the number of the starting state in the .INI file of the application. In the structure diagrams a state is represented by the symbol according to the following figure.

state 7

vertical softkeys

horizontal softkeys

Menu tree

These symbols can be combined to a menu tree. The following figure shows an example.

action state 0 state transition state 1 state 2 state 3

state 4

state 5

state 6

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-127

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

State transitions

States transitions are provoked by S softkey actions (vertical or horizontal) or RECALL. These state transitions are described in the state matrix (file with the extension .ZUS). S programmed reactions on external influences, e.g. the application Machine reacts on a change of the operating mode. Examples of state transitions are: S hiding windows by opening others S hanging softkey functions.

Processing keyboard entries

The keys on the NC keyboard panels, short NC panels, differ from those on standard PC keyboards. Some of these keys have special NC--specific meanings as for example the key alarm acknowledgment or area changeover. These keys are to be taken care of in the base system by tasks that usually do not have the entry focus (i.e. are running in the background).

3.2.4

NCDDE Server

Overview

The NC--DDE Server performs three jobs regarding to the data transfer: S Variable Service S Domain Service S PI Service : access NC--, PLC-- and drive data copy files from MMC to NCK and vice versa. start Programm Invocation Services of the NC.

Variable Service

The DDE Server allows access to e.g. the NC data in accordance with table 3--2. DDE (dynamic data exchange) characterizes the dynamic data transfer between WINDOWS applications.

3-128

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

Table 3-2

Overview of data provided by the NCDDE Server

data group machine data

data type global machine data channel specific machine data axis--specific machine data global setting data channel specific setting data axis--specific setting data frames tool corrections user parameters actual values of the axis positions actual values of the feed rate spindle values override setting inputs outputs flags timers part programs sub programs tool data counters data blocks data block lists clock system state list messages/alarms

setting data

program parameters

actuell values

PLCdata

files

Data description

The variables have been put together in data description files. You can find an overview on all variables in the list book /LIS/ or in the online help function.

Data representation for test purposes

To be able to use DDE connections while developing and testing you can define special variables: S NEW S ANIMATE defining data changing values for a screen demonstration

Data representation on the screen

Visual Basic standard controls are used for displaying data on the screen. For special demands on the velocity newly developed supplements to Visual Basic (VBX. files) are supplied with the OEM--package.

DDE tool for test purposes

For testing DDE connections the delivery volume of the OEM package MMC includes a DDE test tool.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-129

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

Domain Service

Using the Domain Service of the NC--DDE Server, data contained in different domains of the MMC and the NCK can be transferred in both directions.

Commands of the Domain Service

You can find the valid commands in the online help. They are parametrized with: S file name of the MMC WINDOWS environment S file name of the NC environment S name of a variable returning the state

State of the transfer

The state is monitored and characterized by five states: S transfer has been started S transfer is running S transfer has been finished S transfer has been successful S transfer has been stopped with error code

Table 3-3 Commands of the Domain service

command COPY_TO_NC COPY_TO_NC_BINARY COPY_FROM_NC COPY_FROM_NC_BINARY

description copy from MMC to NCK with additional information copy from MMC to NCK without additional information copy from NCK to MMC with additional information copy from NCK to MMC without additional information

3-130

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

PI Service

The PI Service can be used for transferring commands to the NC and the PLC. Use the Execute commands provided: S PI_START (argument) S PI_STOP (argument) S PI_RESUME (argument) start PI Service stop PI Service resume stopped PI Service

Valid parameters are functions of the types listed below. They are explained in more detail in chapter 8.The possible parameters are described in the online help, too.

Table 3-4 Examples for PI Services

Function group NC function NC program function File function Protection level function Tool function PLC function

Example _N_DIGION _N_FINDBL _N_F_DELE _N_F_PROT _N_CREATO _INSE

Meaning Digitizing ON Activate search delete file Assign protection level to a file Create tool Activate module

3.2.5

Alarm server

The alarms&events server provides the current system alarms and messages for HMI (see Section 9.1). For compatibility reasons, it is also possible to use the alarm server (mbdde.ini) via DDE. An overview is provided by the diagram below:

diagnosis application (HMI) message line/administration

registry--DDEServer

alarm list filter

protocol files

PLC

HMI

NCK

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-131

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

System alarms/messages

Following alarms/messages may occur in the system: S NCK alarms S drive alarms S cycle program alarms S PLC alarms S PLC messages S Compile--Cycles alarms S HMI alarms/messages

Features

The DDE Alarm Server provides the following registry features for messages: S register alarms S acknowledge alarms S query functions: highest priority alarm second priority alarm number of active alarms number of alarms occurred list of active alarms S recording of log files Chapter 9 describes how to configure the application--specific alarm handling.

Displaying alarms

The DDE Alarm Server has no operator interface. It merely supplies alarms/messages via the DDE protocol. A display of an alarm may be activated by configuring a window for alarms/messages. In this window e.g. the DDE--variables containing the alarm with the highest priority are displayed.

Alarm log files

The DDE Alarm Server administrates a list of currently active alarms/messages. It optionally records alarms/messages that have been passed through a filter. These log files can be used for diagnosis purposes.

Log file generation

The log file may be generated flexibly using the following features: S Name S Filter name of log file selection characteristic of the alarms to be logged

3-132

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

S Records S RecLen S FlushTime

number of entries in the log file length of one entry (in bytes) time period for flushing the buffer to the log file

3.2.6

Data Management

Overview

The operator's component PCU50 is equipped with a hard disk. A DOS file system manages the files on this disk. This is the storage location for all data and programs that are presently not needed in NCK. Since the features provided by the mere WINDOWS system do not fulfill the requirements of the NC, the HMI domain has been added the Data Management. It is realized using the functions of a Data Management server. This transfers the features of the NCK file system to the HMI area.

Advantages of the Data Management

The advantages the HMI applications take from the Data Management are: S structured storage of data in a data scheme according to their logical relations S automatic check of the scheme's structuring rules S common view on the data of the NCK file system and the data stored on the hard disk S transparent embedding of the NCK file system in the complete system S sensitive management of access permissions S extension of the file name length to 25 usable characters

Data scheme

The Data Management is based on the data scheme that describes the shape of a data structure by: S attributes of data objects S data types S types of knots (assignment of data types) S storage location in directories.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-133

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

The required information of all data to be managed is stored in the data scheme. Besides that, additional administration information is stored on the hard disk.

Data Management in the complete system

The next figure shows how the Data Management is integrated into the complete system.

application 1

Data Management Server

Scheme

DOS file system

NCDDE Server

NCK

communication via DDEML function calls

The Data Management's view on the data

The Data Management Server provides the interface from the applications to the user data on the hard disk. The Server has direct access to the data located in the DOS file system and --via the NC--DDE interface-- also to the data contained in the NCK file system. Thus a uniform view on all data located in the complete system is provided.

Directly accessing NCK data

The NCK file system can be accessed (starting out from MMC) exclusively via the NC--DDE Server. This data interface is described in the chapter 8 which explains the NC--DDE Server.

3-134

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 3.2

Basics of the HMI component Software architecture of the HMI

Administratiom information

The Data Management adds some additional features to the files and directories of the DOS file system. For example: S longer names S access permission S user classes. This administration information is stored for each directory in a hidden file and contains an entry with the following information for each directory and each file included in this directory: S access permission S name S DOS name S extension S data type identifier read, write, show, execute, delete name of the Data Management, up to 25 characters DOS file name, created by the Data Management file extension, 3 characters predefined name in NCK or '*' for arbitrarily selectable names

Using the additional information

Also the applications may use the characterization of files and directories provided by the Data Management. The function list supplies the following information: information file name data type extension full name file system name storage location size date access permission example testmac SMAC SPF standard macro --1testmac active (NCK) , passive (MMC) 12345 26.07.1999 12234

Files without additional information

Files or directories that have not been added additional information are handled as standard DOS--files or DOS--directories. No access permission is being managed for these files and the maximum length of their names is 8 characters.

Initialization file

The file DH.INI contains among others the following sections (table 3--5):

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-135

Basics of the HMI component 3.2 Software architecture of the HMI

03.03

Table 3-5

Sections of the file DH.INI

section DHSTART SCEME

meaning root directory of the MMC Data Management on the hard disk name of the binary parts of the data scheme

Features of the Data Management

The Data Management provides interfaces for handling files and directories: S creating S deleting S copying S listing S downloading (copy from NCK to MMC) S uploading (copy from MMC to NCK) as well as S setting access permission S getting help The Data Management server starts out with the description of the data structures on hard disk (data scheme), that is stored in the system and is readable during run time. The Data Management server may use the scheme in order to S store data according to the description defined in the data scheme S administrate and evaluate default access permission S specify general characteristics of objects The services of the Data Management are implemented as DDE Server.

3-136

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Basics of the HMI component 3.3 Communication

3.3

Communication

3.3.1

MPI interface

The MPI interface is the physical transfer medium connecting the following components: S MMC S MSTT S NCK S PLC S PG operator panel machine control panel numeric control programmable logic control programming device

The data transfer rate ranges from 187,5 KBit/s for the components PLC, PG and the control SINUMERIK FM--NC, up to 1,5 MBit/s for the control SINUMERIK 840 D. This interface does not support the transfer of OEM--MMC files.

MPI connection

The PCU50 is equipped with a MPI interface with the 9--pin D--Sub female connector X4. The physical transfer medium is a shielded two wire cable according to SINEC L2 for a maximum distance of 200 m.

Wiring

Here you find some important help for wiring: Both ends of the bus must be terminated to avoid signal reflections. Note, that at least one of the terminators is supplied with 5 Volts (i.e. the corresponding station must be turned on), since otherwise the neutral voltage of the bus will be incorrect. There may not be any terminating resistors active within the bus segments. These could cause reflections and attenuate the voltage level of the bus.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-137

Basics of the HMI component 3.3 Communication

03.03

PCU50

Roff

Ron

PC

MSST

Roff = MPI Adapter

NCU 840D

Ron Ron = terminating adapter on Roff = terminating adapter off

Branches ( i.e. cables connecting the participants with the bus ) should be as short as possible ( less than 2m ) and should be used only where it cannot be avoided (i.e. when connecting a PG). Ideally the branches should only consist of the bus connector (connector that feeds through the bus and offers terminating resistors to be activated ). Remove unused branches from the bus.

Cable components

We recommend to use the original SINUMERIK cables. You can assemble the cables by yourself using the following components: SINEC L2 bus cable (specify length) bus connector (2 per cable) order no. 6XV1 830 -- 0AH10 order no. 6ES5 762 -- 2AA12

3-138

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Basics of the HMI component 3.3 Communication

Configuration

The NCDDE--Server while starting up, also starts the MPI driver, if it is not yet active.

Note The MPI interface uses the interrupt request IRQ 10 and the memory area CC00H to CCFFH. This must be taken in account when using additional network boards.

Note If you have any problems when connecting a PC in spite of correct wiring and correctly set terminating resistors, check if the PC uses an AWARD--BIOS. The AMI-BIOS might do a better job providing the required shadowing of the memory area.

Programming devices

The programming device of the type SIMATIC PG 740 is equipped with a MPI interface.

3.3.2

Transfer of OEM data to the control

Overview

This chapter only discusses the transfer of OEM data to the control. The interface used for this transfer depends on the technical equipment and on the personal preferences of the OEM user. In principle the interfaces according to table 3--6 are provided:

Table 3-6 Interfaces of the PCU50

interface parallel serial network floppy disk X8

identifier

comment with external net card or an external mass memory (Streamer, JAZ drive, ZIP drive) with terminal simulation, PC IN 4 or Interlnk--Intersrv with PCI/ISA box with optional disk drive

X6 and X7

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-139

Basics of the HMI component 3.3 Communication

03.03

Pre-installed software

The supplied HMI software is intended for the operation of a VALITEC streamer at the parallel interface. Its connection, parametrization and operation is described in the Installation and Start--up Guide /IAD/. The serial interface can be parametrized with the integrated data transfer program PCINlight. This program is described in more detail in the Operator's Guide /BA/. You can also select HyperTerminal in the start menu of WINDOWS NT under programs-->accessories for using the serial interface. If a floppy disk drive is connected to X9, it will be recognized automatically. Note, that the power supply for this disk drive is not provided by the interface X9.

Connecting the MMC with other PCs

With network boards inserted in the ISA adapter and with the suitable network software it is possible to connect the PCU50 to computer networks. For installing the network board and the network software as well as for the operations in the network refer to the according manuals respectively to the installation instructions.

3-140

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Basics of the HMI component 3.4 OEM applications

3.4

OEM applications

Definition

The functions of the MMC can be extended custom--specifically by one or more OEM application: An OEM application is defined as a program that can only be executed in connection with the dynamic link library of the Regie (REGIE.DLL). If an OEM application is started by the Regie, it can use the initializations contained in the system's initialization file (MMC.INI). It includes the elements of the Sequence Control required for coordinating the MMC tasks.

Volume

An OEM application called e.g. OTTO consists of several files which meanings and contents are listed in table 3--7:

Table 3-7 Files of an OEM application

File initialization file program file text file diagram file state management

Meaning, contents default values executable program language dependent texts, e.g. softkey texts, display texts managing the Regie diagrams managing the Regie menus

Example OTTO.INI OTTO.EXE OTTO_GR.DLL OTTO.MDI OTTO.ZUS

Embedding in the system

These files are embedded in the base system by entries in the files in the directory \OEM listed in table 3--8.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

3-141

Basics of the HMI component 3.4 OEM applications

03.03

Table 3-8

Entries of an OEM--application in the standard system

File REGIE.INI

Entry in the section TaskConfiguration

Example Task7=name:=otto OEM application is announced to the system Version = 5.12 / Date = 26.07.99 version management by the OEM--developer HSK7="OTTO" OEM application accessible via softkey 7

REGIE.INI

Version

language.INI of the Regie

HSoftkeyTexts

Configuration

An OEM application is configured with Visual Basic or Visual C++. How to do this is shown in the following chapters.

3-142

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Design of the graphical user interface

4

This chapter contains a brief discussion of the NC's standard interface. This might be useful for those OEM programmers who want to develop operating interfaces that are in accordance with the SINUMERIK standard interface.

4.1

User interface of the standard NC

Overview

The graphical user interface of the SINUMERIK 840D is structured in four fields for NC--specific applications:

info field application area

verti--cal soft--keys

dialog line horizontalsoftkeys

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-143

Design of the graphical user interface 4.1 User interface of the standard NC

03.03

Table 4-1

Structure of the display screen

name of field info field (header)

contents operating section channel state program state name of channel and mode group alarm text operation mode program name channel operation messages display of channel state

example Machine channel reset program is active channel 1 channel 1 block N5 error at circle end position JOG PROGRAM1 Stop: EMERGENCY--STOP active SKP skip block

application area interactive field

five working windows and positions, auxiliary NC--displays functions, feed dialog line with notes for the operator, information corresponding to the menu bar labels of 8 horizontal softkeys labels of 8 vertical softkeys entered value exceeds upper limit ^ recall is possible PARAMETER REPOS

horizontal softkey bar vertical softkey bar

4-144

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.1

Design of the graphical user interface User interface of the standard NC

4.1.1

Info field (header)

Arrangement

The elements of the header briefly described in table 4--1 are arranged according to the following figure:

area

channel and mode group operation mode program name

channel: 1 AUTO / N MPF DIR/ N LA MPF

channel operating messages state display

PARAMETER

program state channel state

alarm and message line

Contents

The possible contents are described in the /BE/ Operator's Manual.

OEM alarms

OEM user alarms can be displayed in this section. More detailed information can be found in the chapter 'Alarm Server'.

Hiding the info field

In some cases, e.g. fullscreen--applications in WINDOWS, the OEM user might decide to hide this field, also called header, (refer to the chapter 'Regie').

!

Caution If the info field is hidden, alarms are not displayed on the user interface any more. If alarms should nevertheless be displayed, this is to be carried out via a separate OEM--defined application that uses the Alarm Server.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-145

Design of the graphical user interface 4.1 User interface of the standard NC

03.03

4.1.2

Application area

Overview

In the application area application--specific windows can be installed. This field is put at the OEM's disposal without restriction.

Size

The screen offers a 640 x 480 pixels resolution (standard VGA ). Of that 560 x 325 pixels are reserved for the working field. The starting position and the size of the display area are set via the constants BeArttop BeArtleft BeArtwidth BeArtheight. upper limit left limit width height.

These are defined in the file ALSTART.FRM.

!

Warning This file may not be changed!

Number of windows

In the application area up to 8 windows may be defined.

Structure of the windows

In principle, the design of the application windows is at the user's hand. In order to get an unified look within the SINUMERIK environment, we recommend the following design: A window consists of a title bar and a display section. The sizing controls (maximize, minimize, close button), usually available in WINDOWS applications, are not supplied.

Title bar

Parameters recommended for the title bar are:

4-146

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.1

Design of the graphical user interface User interface of the standard NC

Table 4-2

Parameters for the title bar

element background color window without focus background color window with focus text color text font

parameter gray yellow white

VB identifier &H00808080 &H0000FFFF &H00000000 MS Sans Serif

Display section

The parameters recommended for the display section are:

Table 4-3 Parameters for the display section

element background color fixed texts text boxes (for entry window) text output toggle fields

parameter light gray background gray text black background white text black left aligned text black options to be selected left aligned text black check box line style window border yellow

VB identification &H00C0C0C0 VB Label VB Textbox VB Label VB SSOption

ON/OFF or YES/NO fields line focus (active window)

VB SSCheck no 3--D ! &H0000FFFF

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-147

Design of the graphical user interface 4.1 User interface of the standard NC

03.03

4.1.3

Interactive field

Overview

The interactive field offers two types of information: S information applying to the menu bars S interactive line containing notes for the operator. The information applying to the menu bars contains three symbols. Their meanings are listed in table 4-4:

Table 4-4 Information applying to a menu bar

symbol

meaning Recall is possible: This is a jump back to the higher menu level. Additional information concerning this menu is available via the INFO key i.

^ i

The respective symbol is displayed only, if the function may actually be selected.

Additional information

Beyond these symbols, the OEM user may also create his own application--specific symbols with Visual Basic.

Dialog line

The dialog line is used for guiding the operator and is closely correlated with the softkey functions. Modal dialogs offer another way of guided operation. Its contents are programmed in the context of the Sequence Control. For details refer to chapter 7 'Sequence Control'.

4.1.4

Softkey bars

Eight horizontal and eight vertical softkeys are provided for your application. You may however configure more than 8 horizontal softkeys. An arrow will be displayed at the right of the eighth horizontal softkey. You can specify the label, the function and the access rights. For further details, refer to Chapter 7.

4-148

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.2

Design of the graphical user interface Embedding additional applications

4.2

Embedding additional applications

When embedding applications in the frame of the Regie you are supported by the configuration tool which is started by the service menu. It modifies the section TaskConfiguration in the file regie.ini and the files re_XX.ini. The chapter 'Regie' contains a more detailed description.

Which applications may be integrated ?

You may embed the following kinds of applications: S own applications with Sequence Control S WINDOWS applications without Sequence Control

Stumbling blocks for applications without Sequence Control

If you want to integrate applications without a Sequence Control you have to consider the following restrictions: S A control usually does not include a mouse and a MF2--keyboard. Can the applications still be operated? Here the function keys [F9] to [F12] with and without [Shift] and the [Alt]--key are of special importance. S If the embedded application can be terminated by user commands, the operator will face a black screen and must first reactivate the area selection. S If you modify the operator interface of the SINUMERIK, the control can not necessarily be serviced any more by the SIEMENS service. To still benefit from this service, your control must satisfy certain criteria. They are summarized in the SERVICE-- Guideline. Your sales partner will be glad to supply the current release for you and will look after the corresponding contract.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-149

Design of the graphical user interface 4.3 How to create an application with the OEM-package

03.03

4.3

How to create an application with the OEM-package

Overview

The OEM package allows the OEM to create his own applications which are adapted to the standard applications of HMI Advanced and which may therefore be intuitively operated by the machine operators. To do so, the so--called Sequence Control is integrated in your project. A program that can be run in connection with the Regie--DLL only, is called an OEM application. If it is started from within the Regie it can make use of the initializations of the MMC.INI and it can evaluate the softkeys. It contains the elements of the Sequence Control that are necessary for coordinating the tasks on the HMI.

Volume

An OEM application contains the following files: S program file (e.g. OTTO.EXE) S initialization file (e.g. OTTO.INI) S language dependent texts (e.g. OTTO_GR.DLL) This file contains at least the texts for the application--specific softkeys. This is also a good place for all texts to be displayed by the application. They are accessed by LoadString (description in winapi31.hlp in the VB--directory tree ). S picture management (e.g. OTTO.MDI) S state management (e.g. OTTO.ZUS) S files of the Sequence Control The files can contain any names, just the file extension is fix. Nevertheless we recommend to choose the part of the name before the extension--dot the same for all components, since this is conducive for the clearness.

Building the framework for an application

The procedure is described in detail in chapter 7.2.

4-150

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.3

Design of the graphical user interface How to create an application with the OEM-package

Testing with the VB debugger

When testing on a development PC you have to observe the following issues: Assign the drive letter L to the directory, where you have installed the OEM pakkage, e.g. subst l: d:\oempaket. Set the variable NcddeMachineName in the file mmc.ini local , if this has not already been done during the installation of the MMC OEM package. Set the variable NCDDEStartupFile in the file mmc.ini to the NSK file that contains the NEW instruction. During MMC operation the LINK instructions are located here. Start the servers you need for testing your program before starting your application (e.g. NCDDE--Server, DH--Server, MBDDE--Server) Note the restricted function of the servers if NCK is not connected. This means in detail S NCDDE can only return the values you supplied (dynamically via DDE test or statically in the NSK file). S The Data Management only knows the local files. Commands addressing NCK files return errors. The Regie functions (from regie16.dll) can only be processed task--specifically. They are e.g. not informed about any area change over. The expense spent for debugging is worth it. You will see, that only applications that have been thoroughly tested separately can be loaded usefully in the Regie.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-151

Design of the graphical user interface 4.4 Adapting the standard application to your needs

03.03

4.4

Adapting the standard application to your needs

For each application supplied with the SINUMERIK 840D HMI Advanced, you can configure additional states by making entries in the .INI--files and thus supplementing user pictures without modifying the application itself. For this you must add three new sections to the application--specific .INI file : [MATRIX], [CHILDS] and one additional section for each modified state. To return to the original application use the Regie functions which names start with SwitchToParent (for the description see chapter 6.4). Assign the application you want to start with the Regie.ini to a Task--Number greater than 23.

Section MATRIX

Specify here, which given states of an application are to be modified. You can modify up to 16 states using the lines UPS0 to UPS15. Syntax: [MATRIX] UPSx=state: Sektion{Softkeys} where: State Sektion Number of the state you want to modify You can find it in the .ZUS file of the application To describe the new state you have to add a new section to the .INI file. It contains the name of the new section. The softkey, which function you want to modify

Softkeys Example:

[MATRIX] UPS1=10:otto{0,3,4,9} The 1st, 4th and 5th horizontal softkey and the 2nd vertical softkey of state 10 are overwritten. Define the new values in the section [Otto].

4-152

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.4

Design of the graphical user interface Adapting the standard application to your needs

Section CHILDS

Specify here the symbolic names for the entries of the section [TaskConfiguration] in the file regie.ini Syntax: [CHILDS] symbol=number where: Symbol Number A symbolic name that is used in this .INI file only. Task number of the addressed application in the file regie.ini, section TaskConfiguration. The task number should be greater than 23, since otherwise the Regie indicates an error if no softkey text has been entered in the language file. If you want to use task numbers less than or equal 23, configure the task with PreLoad := False

Example: [CHILDS] HINZ=8 KUNZ=17 HINZ addresses the area application 8, KUNZ the area application 17.

New section for the new state

Here you define your modifications. They can overwrite softkey texts, call tasks from regie.ini and define further states by themselves. Syntax: [newsection] softkey=text>function where: softkey text Softkey identifier text in quotation marks #<nr>h #<nr>v #<nr>a The text is written directly to the softkey Text of the horizontal softkey texts with the number nr Text of the vertical softkey texts with the number nr Text of the general texts with the number nr

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-153

Design of the graphical user interface 4.4 Adapting the standard application to your needs

03.03

function

{Child} {Child}:'cmdline'

symbolic name of the application (defined in the section CHILDS) In cmdline you can add arguments for the application Child. They follow a colon and are enclosed in quotation marks. Format and number of parameters exclusively depend on the application called.

Example: [OTTO] 0="blabla">{HANS} 3=#5h>{EMIL} 4=#7h>{HINZ} 9=#11a>{KUNZ}:'clock' The left hand horizontal softkey is labeled blabla. Here you may start an application with the symbolic name hans. Which task index is addressed, is described in the section [CHILDS]. Softkey 3 works similarly, it is however labeled using the 5th text from the block of horizontal softkeys. Softkey 4 uses the text of the 7th horizontal softkey. It starts the application which has been assigned the symbolic name hinz. The corresponding task index is recorded in the section [CHILDS]. Softkey 9 (the second vertical softkey) has been assigned the 11th general text. The application with the symbolic name kunz is started. The argument clock is passed.

4-154

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.4

Design of the graphical user interface Adapting the standard application to your needs

4.4.1

Embedding an OEM softkey in the area MASCHINE

Objective

An OEM application (kunden.exe) is to be started from the machine main screen. The configuration is carried out in two steps.

Step 1

Create a file "Maschine.ini" in the directory C:\OEM with the following contents: [MATRIX] UPS1=1:JUMP{0} [JUMP] 0="OEM_Test">{RUN_TEST} [CHILDS] RUN_TEST=24 These settings, which are stored in the OEM--directory, will not be lost when the software is updated.

Step 2

Create a file "Regie.ini" in the directory C:\OEM with the following contents: [TaskConfiguration] Task24=name := oemframe, cmdline := "C:\\OEM\\COSTUMER.EXE", TimeOut := 60000, PreLoad := False After a restart of the MMC, the application assigned to the OEM--Softkey can be started.

Summary

An OEM--Softkey with the label text "OEM_Test" has been configured for the first softkey of the basic screen of the area application "Machine" (state 1 in the *.ZUS-file). The application CUSTOMER.EXE can now be started with this OEM--Softkey.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-155

Design of the graphical user interface 4.5 Adapting the standard interface (regie.ini, mmc.ini)

03.03

4.5

Adapting the standard interface (regie.ini, mmc.ini)

OEM--extensions in the files MMC.INI, REGIE.INI and RE_xx.INI (in the directories ADD_ON, OEM and USER) referring to the standard system (in the directory MMC2) are collected during the Regie's start up in the following order of priority: MMC2 (fix system settings) HMI_ADV ADD_ON OEM USER

Note The files MMC.INI, REGIE.INI and RE_xx.INI are taken as difference to the corresponding predecessor, i.e. the information is collected. In the case of the *.DLL files the last one found is valid. Entries in the *.NSK files can be made only in USER.NSK in the directory \USER.

Note For this reason the user must enter his differing entries in the OEM path "REGIE.INI" and "LANGUAGE\RE_XX.INI". Entries in the OEM path overwrite those in the standard MMC2 path.

French language

To use the French language, create the file MMC.INI in the OEM path with the following contents: Example 4-1 MMC.INI in the OEM path

[LANGUAGE] Language=Fr Language2=GR

Configuring a MMC103 interface without MPI-connection

To use the HMI Advanced interface without a NC, add the following lines to the file MMC.INI in the OEM path:

4-156

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 4.5

Design of the graphical user interface Adapting the standard interface (regie.ini, mmc.ini)

Example 4-2

MMC.INI in the OEM path

[GLOBAL] NcddeMachineName=local NcddeDefaultMachineName=local NcddeMachineNames= NcddeStartupFile= ncdde202.nsk

Embedding a standard Windows application

In the following example the standard Windows application Calculator is embedded. To do this, create a file named "regie.ini" and enter the following lines: Example 4-3 REGIE.INI in the OEM path

[TaskConfiguration] Task6=name := oemframe, cmdline := "calc", Timeout := 0, ClassName := "SciCalc", HeaderOnTop := False, PreLoad := False

In addition to that, a softkey text must be configured. Create a file named "re_gr.ini" and enter the following lines: Example 4-4 RE_GR.INI n the OEM\LANGUAGE path

[HSoftkeyTexts] HSK6='pocket calculator //20

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-157

Design of the graphical user interface 4.6 The application aeditor

03.03

4.6

The application aeditor

The HMI software package includes a text editor which you can embed in different applications as a child application. This requires the following three steps to be taken:

Add to regie.ini

The Regie must know the child application. You can create the entry using the Config Tool (in the start menu): [TaskConfiguration] ... Task35 = name := aeditor, Timeout := 5000 If the editor is to be loaded not until it has been started, add: PreLoad := False If the editor is to be closed when being exited, add TerminateTasks := aeditor:35 to the entry of the calling application. If you call the editor from several applications, each must have a separate entry in the section ; Task1 using aeditor:35, Task2 using aeditor:36 Task35 = name := aeditor, Timeout := 5000 Task36 = name := aeditor, Timeout := 5000

Creating the command line for the editor

Syntax for the call is: <cmd_line> ::= <full_path>,<display_text>,<type>,<access> <full_path> : any valid DOS path: The directories must exist. If the file does not exist, it will be created.

<display_text> :any character string with maximum 40 characters <type> ::= DOM | FILE DOM = domain path, not implemented in P3.1 FILE = file path RW | RO RW = read/write RO = read only

<access> ::=

4-158

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Design of the graphical user interface 4.6 The application aeditor

Example in Visual Basic:

Dim sCmdLine As String Dim sFileName As String ' get file name from file list box flbBox sFileName = flbBox.Path + "\" + flbBox.List(flbBox.ListIndex) ' open file with read/write access, display full name sCmdLine = sFileName + "," + sFileName + ",FILE,RW" - or ' open file with read only access, title "scratch file" sCmdLine = sFileName + ",scratch file,FILE,RO"

Starting thes editor with this command line

In Visual Basic the sequence of commands might look as follows:

Const CHILD_INDEX_EDITOR = 35 Dim nRet As Integer nRet = WriteCmdLineVB(CHILD_INDEX_EDITOR, sCmdLine) Call SwitchToChild(CHILD_INDEX_EDITOR)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

4-159

Design of the graphical user interface 4.6 The application aeditor

03.03

Notes

4-160

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

System structure

5

This chapter gives a summary of the INI files which are evaluated by several applications of the standard MMC. The Sequence Control provides some of the entries as global variables. You should have a look at this chapter if you want to evaluate entries in your applications that are not set the same on all MMCs. Private initialization files of the supplied applications are not discussed. For details refer to the standard documentation. The following files are used by several applications on the HMI. They are located in the directory \mmc2\HMI_ADV, modifications are entered in the directories \oem and \user. During run time you should access these files with the functions ALGetPrivateProfileString ALGetprivateProfileInt ALWritePrivateProfileString which are described in the chapter Sequence Control.

5.1

DH.INI

The Data Management uses only one configuration--dependent parameter: the starting directory. Modifying this entry might be useful if you e.g. like to hold data sets for different NCUs or testing scenarios on your developing system. section DHSTART SCEME entry mmchome sceme meaning ROOT directory of the MMC Data Management name of the binary part of the data scheme

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

5-161

System structure 5.2 MBDDE.INI

03.03

5.2

MBDDE.INI

Use this file for parametrizing the alarm handling. section Alarms TextFiles meaning general information concerning the alarm list. example: time and date format of the registry entries path and file names of the alarm text lists example: MMC=..\dh\mb.dir\alm_ for MMC alarm texts in the directory mb (registry module). names and paths of the help files example: File0=hlp\alarm_ default definition of the priorities of the different alarm types example: POWERON=100 characteristics of the log file example: file=.\proto.txt name and path of the log file information about the keys that may be used to clear an alarm example: Cancel=+F10 clear alarm with the key combination Shift+F10

Helpcontext DEFAULTPRIO PROTOCOL

KEYS

The entries are described in chapter 9.

5.3

MMC.INI

This file contains all user--specific settings. You can set colors and language--dependent details and configure the hardware (settings of the V24--interface). If the assignment to an NCU is unique, you can find all specifications here, otherwise you can find the file name which contains further information. section BTSS settings meaning machine data of the operating panel example: precision of displayed data example: change access level of R parameters color set up of the VGA drivers Screen resolution time formats for different languages additional information example: name of floppy disk drive FloppyDisk=a: definition of catalogues example: temporary directory for Sequence Control: AlDir=D:ALTMP

colors Control DateTime Services DIRECTORIES

5-162

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

System structure 5.3 MMC.INI

section Europe Function GLOBAL

meaning selecting a font from the fonts contained in the section LANGUAGE description of interfaces Characterization of a particular NC by NcddeDefaultMachineName NcddeMachineName NcddeMachineNames NcddeMmcName NcddeServiceName NcddeStartupFile NCServerName selecting 2 languages and their fonts example: GR Europe address of CNC--components in the development computer example: ADDRESS1=/PLC,0 name of Alarm Server address of CNC--components example: ADDRESS1=/PLC,10000d01 Name of the initialization file for connecting several NCUs to an operating panel. Example: NETNAMES=netnames.ini parameter for the remote diagnosis Names and addresses of the CNC components for the simulation tool identification systems Example: end of text of code carrier data tool management example: name of the tool data base n--th data set for the configuration of the serial interface (n=0 to 2) information for the display--control ViewTree

LANGUAGE LOCAL mbdde NCU840D net

Remote SIM0 TIS ToolMgmt V24--Conf_n ViewTree

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

5-163

System structure 5.4 NETNAMES.INI

03.03

5.4

NETNAMES.INI

The file netnames.ini is not evaluated if the MMC and the NCU are coupled 1:1. It must represent the actual hardware configuration. We recommend the following proceeding: The file is completely edited on one MMC, then copied to the other MMCs and there only the entry owner is modified. section own conn MMC_1 conn_1 NCU_1 defines which NCU the MMC may access entry owner value MMC_1 meaning own name the section exists once for each MMC one entry per NCU notes

param network param MMC_1

bus

btss the section exists once for each MMC

mmc_address param NCU_1 nck_address plc_address name

own bus address

must correspond to S7DPMPI.INI the section exists once per NCU

NCU bus address called NCU_1 bus address of the PLC on NCU_1 name for NCU_1

5-164

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 5.5

System structure OEMFRAME.INI

5.5

OEMFRAME.INI

In this file you can specify the size each application without Sequence Control is displayed on the screen. For each application you want to store parameters for, you have to enter a separate section with the same name as the corresponding program file but without the file name extension. For a detailed description of the entries in OEMFRAME.INI, please refer to Section 6.6.2.

Section

Entry

Value

Meaning

[Taskname] WindowStyle_On [Taskname] WindowStyle_Off [Taskname] Width

user-identifies the properties which are to be dependent assigned to the window user-identifies the properties which the window is dependent not to possess user-Width of the window (attribute X in pixels) dependent Remark: If x=0 and y=0, the application header will be hidden. user-Height of the window (attribute X in pixels) dependent Remark: If x=0 and y=0, the application header will be hidden.

[Taskname] Height

[Taskname] nDelayInitComplete user-delays the ramp--up time after which the dependent application can be selected via Regie [Taskname] nSecondsTo FindWindows [Taskname] fSearchOnlyFor TaskWindow [Taskname] nSwitchToTask AfterTermination [Taskname] fRestoreTask Window user-Setting of the teim after which the OEMFrame dependent aborts the search for the window of the application. user-specifies whether the window specified in dependent Regie.ini also belongs to the task specified there user-delays the behavior when quitting the dependent OEMFrame application user-determines the behavior of the OEMFrame dependent when quitting an application which has been started from the OEMFrame application (2nd task level) Remark: If possible this situation should be avoided. user-deactivates the size adaptation carried out by dependent OEMFrame for the main window of the OEM application

[Taskname] fKeepPlacement

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

5-165

System structure 5.5 OEMFRAME.INI

03.03

Section

Entry

Value

Meaning

[Taskname] fForceTaskFocus

user-When switching to the application, the main dependent window is activated instead of the last active window. user-If fForceTaskFocus is set, either the active dependent pop--up window will be activated or the main window (if no active pop--up window exists).

[Taskname] fSearchForPopUps

5-166

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

System structure 5.6 REGIE.INI

5.6

REGIE.INI

This defines the functions your MMC uses to know. Enter your own OEM--applications here. The configuration tool supports this. section Miscellaneous entry RemoveIcons ShowMessageBox meaning development support: During start--up the task icons are displayed development support: Warnings occurring during start--up are displayed as message boxes number of the task, the info--button branches to development support: shows the system load number of the task displayed after start--up for testing only: MMC modifies DB19, DBW16 each second list of WINDOWS--modules being started list of SINUMERIK--modules being started list of servers running in the background list of foreground tasks

HelpTaskIndex ShowResources PoweronTaskIndex MMCSignOfLife SystemDllConfiguration DllNamex MMCDllConfiguration StartupConfiguration TaskConfiguration DllNamex Startupx Taskx

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

5-167

System structure 5.7 S7DPMPI.INI

03.03

5.7

S7DPMPI.INI

Entries in S7DPMPI.INI should be modified by the user interface in the area 'installation' only. If a 32 bit bus driver is being used, they are no longer stored in the .INI file but in the registry data base. section S7ONLINE DRIVER PROFILE HW_DEVICE S7MPISPC2 BAUDRATE HWINT_VECTOR driver used interface description used interface used interface description baudrate hardware interrupt 3 = 187,5 kBit 7 = 1,5 MBit must match the preset hardware interrupt of the MPI interface must match the mmc.ini respectively the netnames.ini entry meaning note

TS_ADR

bus address

other parameters of the S7 protocol

Note Only file "S7DPMPI.INI" of the windows directory is taken into account.

5-168

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Regie

6

The Regie is a program for flexible management of auxiliary programs and area applications (Task management). The application Regie takes care of: S system initialization S system start--up S loading of dynamic link libraries of the system and of the MMC S starting the applications in right order S system configuration S area changeover The Regie is parameterized by an initialization data file. A configuration tool for this data file is available, which makes it easy to add a new application. The Regie can manage up to: S 32 auxiliary applications S 32 area applications S 64 dynamic link libraries (DLL) of the system S 64 dynamic link libraries of the HMI

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-169

Regie 6.1 Concept of the Regie

03.03

6.1

Concept of the Regie

Overview

The Regie is a control program (REG_CMD.EXE for Regie Command--Modul) for the flexible management of S auxiliary programs (base modules) S area applications S dynamic link libraries (DLL) and VBX--files, shown in figure 6--1 (extract). base modules

Regie display Header

area applications

Machine Dialog programming

Regie

NCDDE server Alarm server Data management server additional base functions

setting in to operation

OEM-Application 1 OEM-Application 2 WINDOWS Standard application

dynamic link libraries (DLL and VBX) of the system

DDEML.DLL MMSYSTEM.DLL VBRUN300.DLL Fig. 6-1

dynamic link libraries (DLL and VBX) of the MMC

AL_UTIL.DLL MMC.DLL

Regie links area applications to auxiliary programs and DLLs

The application Regie takes care of: S system initialization S system start--up S loading of dynamic link libraries of the system and of the MMC S starting the applications in right order

6-170

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.1

Regie Concept of the Regie

S system configuration S area changeover.

Starting sequence

The auxiliary applications (DLL, VBX) are started by the Regie prior to the area applications. Having started an application, the Regie waits, until this application indicates the end of its initialization. In this way the necessary auxiliary programs are ready, when they are needed. A similar mechanism is implemented when applications, that have been started by the Regie, are being closed.

Limits of the Regie

The Regie can manage up to: S 32 auxiliary applications S 32 area applications S 64 dynamic link libraries (DLL, VBX) of the system S 64 dynamic link libraries of the MMC.

OEM specific

The Regie manages the customers OEM--applications, too. The OEM user may edit the data file REGIE.INI to announce his application to the system.

Area application

The Regie distinguishes three types of area application: S standard OEM area applications, created with VB, embedded in the Sequence Control S customer applications for PCs under WINDOWS S standard applications under WINDOWS, e.g. EXCEL or EDIT.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-171

Regie 6.1 Concept of the Regie

03.03

Files

For realizing these area applications, the Regie uses four files: S REGIE.INI S REGIE.DLL S Regie--language.INI (e.g. RE_GR.INI) S OEMFRAME.INI S MMC.INI Note Starting from software release 4 the files "REGIE.INI", "MMC.INI" and "RE_XX.INI" are evaluated by searching them in the following directories in the order shown: "MMC2", "ADD_ON", "OEM", "USER". Also see chapter 4.5.

Note For this reason the OEM--user must enter his differences for "REGIE.INI" and "LANGUAGE\RE_XX.INI" only in the OEM path. That is, entries in the OEM path overwrite those in the standard MMC2 path.

REGIE.INI

This file is an initialization file, as known from other WINDOWS--applications. Regie.ini is a text file that can be edited with a customary text editor. (e.g. EDIT or WRITE). It is built up of several sections, which are listed in table 6--1 and described in detail in chapter 6.3.

REGIE.DLL

The file REGIE.DLL provides the following features: S determination of the directory that the task was started from S access to the current language.DLL of the task S indication, whether the task initialization has been finished S contrast control of the monochrome display. The functions of the REGIE.DLL can be called by VB and by VC++. They are linked during run--time.

6-172

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.2

Regie Integration of OEM applications

language.INI

The data file language.INI (e.g. RE_GR.INI for German texts) contains the softkey labels and general texts of the Regie. It can be edited with a customary text editor which is described in chapter 6.3.

OEMFRAME.INI

With this file you can parametrize the substitute application OEMFRAME for embedding WINDOWS applications, if needed. It is described in more detail in chapter 6.6.

MMC.INI

This data file is described in chapter 5.

6.2

Integration of OEM applications

Analog to the standard HMI applications, OEM applications are usually selected via a softkey of the area switchover bar. The configuration required for this depends on the type of OEM application and is described in the sections 6.3 "Application with sequence control" and 6.6 "Application without sequence control". As an alternative to the selection via softkeys, hardkeys -- the so--called hotkeys -can be used to select an application on operator panels OP10 and OP10C and the Sinumerik keyboards with hotkey block. We recommend that you use OP hotkeys above all for applications that are permanently used during regular machine operation. As a result, it must be possible to select them quickly, i.e. only through a few operator inputs in situations in which the number of softkeys required for selecting all standard and OEM applications exceeds the 24 softkeys available in the area switchover bar. The factory standard assignment for the OP hotkeys and their configuration are described in: References: /IAM/ SINUMERIK 840D/840Di/810D HMI/MMC Installation and Start--up Guide BE1 Supplement operator interface Section 5: Configuration of OP hotkeys and PLC keys

Another possibility to integrate applications is the so--called Maintenance Task. First, this is an "empty" operating area of HMI Advanced the task of which consists in providing softkeys for the selection of further (standard or OEM) applications. We recommend that you use the Maintenance Task when certain applications are to be combined to form one group and the softkeys used to select these applications shall be accessed via a single softkey of the area switchover bar, or if the 24 softkeys available in the area switchover do not suffice for integrating all standard and OEM applications.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-173

Regie 6.3 Application with sequence control

03.03

6.3

Application with sequence control

Summary

The initialization files of the Regie are: S REGIE.INI S Regie--language.INI (e.g. RE_GR.INI) S OEMFRAME.INI. For details of the general structure of a WINDOWS ini file see the WINDOWS Programmer's Reference Manual /WPR/.

REGIE.INI, language.INI

All applications, that are to be started by the Regie, must be configured in the file REGIE.INI. The initialization file language.INI (e.g. RE_GR.INI for German texts) includes the softkey texts and the general texts of the Regie. Both files are described in this chapter.

OEMFRAME.INI

The initialization file OEMFRAME.INI contains information on the substitute application OEMFRAME that can be provided for embedding standard WINDOWS programs if needed. This file is described in chapter 6.6.

6.3.1

The initialization file REGIE.INI

REGIE.INI

All applications, that are to be started by the Regie, must be configured in the file REGIE.INI. The file REGIE.INI is a text file which can be edited with standard ASCII text editors (e.g. EDIT). It consists of the sections listed in table 6--1.

Table 6-1 Sections of the file REGIE.INI

section Version

function Date and software release number of the Regie. Facilitating a separate release management by the OEM software engineer

6-174

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Table 6-1

Sections of the file REGIE.INI

section SystemDll Configuration MMCDllConfiguration

function List of all system DLLs and VBX data files: e.g. DllName0 = DDEML.DLL to DllName63 = VBRUN300.DLL List of all HMI DLLs or VBX data files: e.g. DllName0 = AL_UTIL.DLL to DllName63 = DCTL.OCX List containing auxiliary applications that are to be started before the area applications. example: NCDDE server List containing the area applications (with attributes) that are to be started during system initialization. example: operation of the machine List containing several parameters for the Regie: ExitButton ExitButtonIndex HelpTaskIndex MMCSignOfLife PoweronTaskIndex RemoveIcons ShowMessageBox ShowResources Information for the command interpreter channel

StartupConfiguration

TaskConfiguration

Miscellaneous

CommandToTask

Starting sequence

First the Regie starts the auxiliary programs (DLL, VBX) of the sections SystemDllConfiguration and MMCDllConfiguration, followed by the auxiliary applications of the section StartupConfiguration and then the area applications of the section TaskConfiguration. The Regie waits for each program to indicate its successful start--up. This guarantees the required auxiliary programs to be available as soon as they are needed. A similar mechanism is used for closing the applications that have been started by the Regie. The following chapters describe the sections of the REGIE.INI.

6.3.2

Section [Version]

You can modify the file REGIE.INI for your purposes by e.g. adding information for version management in the section version:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-175

Regie 6.3 Application with sequence control

03.03

Examplel 6-1 Section Version

[Version] Version = 5.21 Date = 26.07.99 ; specifies the version, set by the OEM developer ; specifies the date, set by the OEM developer

6.3.3

Section [SystemDllCoonfiguration]

This is a list of all the system's dynamic link libraries (DLL) and Visual Basic Extensions (VBX). It may not contain more than 64 valid entries. Due to a peculiarity of the WINDOWS system it is recommended to add all DLLs required by the system to this section. During system start--up the Regie loads all system DLLs configured there. You can organize the DLLs in two ways: S Entry without path specification: The DLL must be located in a directory of the search path S Entry with path specification: The DLL is started from the specified directory.

Section SystemDllConfiguration

Examplel 6-2 Section SystemDllConfiguration

[SystemDllConfiguration] DllName0 = DDEML.DLL ; DLL must be located on the search path and depends on the WINDOWS DllName1 = C:\MYSYSTEM\GRID.VBX ; the entry does not depend on the WINDOWS release

Note The DLLs must be specified with their file extensions, because the name alone is not unique (e.g. "NAME.DLL" or "NAME.VBX").

6-176

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

6.3.4

Section [MMCDllConfiguration]

This is a list of all the MMC's dynamic link libraries (DLL) and Visual Basic Extensions (VBX). They must be located in a MMC2 system directory. Path specifications are not allowed: thus the DLLs (respectively the VBX) are assigned uniquely to a specific software release. The list may not contain more than 64 valid entries. The Regie loads the DLLs configured in this section before the servers and area applications (The Regie also unloads them when it is closed): The area application does not need to care about calls like LoadLibrary and FreeLibrary.

Section MMCDllConfiguration

Example 6-3 Section MMCDllConfiguration

[MMCDllConfiguration] DllName0 = MMC.DLL ;DLL is loaded automatically during system ;start-up.

Note The DLLs must be specified with their file extensions, because the name alone is not unique (e.g. "NAME.DLL" or "NAME.VBX").

6.3.5

Section [StartupConfiguration]

Overview

In the section StartupConfiguration all auxiliary applications (server), that are to be started by the Regie prior to the area applications, must be listed. Each application must be added one ore more attributes (separated by commas), that describe the properties of the application in more detail.

Entry identifier

The applications are started in the order they have been numerated by the Entryidentifier (e.g. startup2). For example: An application configured with the entry Startup2 = Name := HEADER may presuppose for its start up, that an application configured with Startup1 = Name := SERVER already exists in the system.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-177

Regie 6.3 Application with sequence control

03.03

Entries for OEM in the section StartupConfiguration

The OEM--applications have to be entered in the area from 'Startup12' to 'Startup24' in the section [StartupConfiguration] of the file 'Regie.ini'. Other entries may result in conflicts with the MMC 103--standard system.

Attributes

Table 6--2 gives an overview over the attributes of the entries in the section StartupConfiguration.

Table 6-2 Attributes of the entries in the section StartupConfiguration

attribute Name Timeout CmdLine ShowTask <empty>

meaning Name of the application as listed in the file manager, without extension ".EXE" Maximum period of time for initialization in milliseconds. Default value is 10000 (10 sec.) Parameter for the client application: ASCII string Parameter for visibility of the icons: TRUE or FALSE Usually cancels the configuration of the relevant task set in the file \mmc2\regie.ini. The relevant task is thus no longer offered for selection in the area switchover bar.

Attribute Name:

The name of the application as listed in the file manager (this means, the attribute name must not contain the extension EXE). Example 6-4 Attribute Name

; correct ; W R O N G

[StartupConfiguration] Startup5 = Name := MBDDE Startup6 = Name := MBDDE.EXE

Attribute Timeout:

Maximum period of time (in milliseconds) provided by the Regie for initialization of the application. The application is committed to indicate the end of its initialization to the Regie by calling the function InitComplete of the REGIE.DLL. Should the message InitComplete not be received during the specified maximum period of time, the Regie will indicate a system error. In this case the further system start up cannot be guaranteed to run correctly.

6-178

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Note This time--out value should not be set too small! If the MMC is very busy, the waiting time might become inadequately long.

This attribute is optional. If it is omitted, the Regie uses a default value of 10 seconds. The maximum length that can be processed is nine digits.

Note If it is not possible to insert a call of InitComplete (e.g. if the source files of auxiliary programs are not available) then a Timeout value of 0 is to be used.

Attribute CmdLine:

With the optional attribute CmdLine you can supply client applications with parameters.

Attribute ShowTask:

As default the auxiliary applications are started iconized and then shifted out of the visible area of the screen (thus the icons don't disturb the screen update). If an auxiliary application shall be visible the attribute ShowTask must be used (example HEADER) Example 6-5 AttributeShowTask

[StartupConfiguration] Startup0 = name := shutdown, Timeout := 15000 ; this application may take up to 15 seconds to indicate its execution Startup1 = name := header, ShowTask := TRUE ; this application may take up to 10 seconds (preset value) and remains on the screen

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-179

Regie 6.3 Application with sequence control

03.03

Attribute <empty>:

The attribute <empty> serves for deactivating subsequently a configuration set for a task in the file \mmc2\regie.ini -- this contains all HMI Advanced standard tasks -without modifying the file \mmc2\regie.ini. To do this, the <empty> attribute is configured in the file regie.ini in the OEM or AddOn directory for the relevant task. Typically, the attribute is configured in conjunction with the installation of OEM and AddOn products when it shall no longer be possible to select HMI Advanced standard tasks after installing the OEM resp. AddOn product via softkey in the area switchover bar. Example: Skip standard task 5 (startup) The file regie.ini in the OEM resp. AddOn directory must contain the following configuration: ... [TaskConfiguration] Task5 = <empty> ...

6.3.6

Section [TaskConfiguration]

Overview

The section [TaskConfiguration] includes all area applications and all other applications to be started by the Regie. One or more attributes may be specified for each application (separated by commas) to describe its special characteristics.

Entries

The applications are started in the order specified by the entry-identifier Task (e.g. Task5). For example, during start--up an application configured by the entry Task5 = Name := IB may assume that an application configured with Task2 = Name := DIENSTE already exists.

Note There is one exception: Applications entered in the section [Miscellaneous] with the entry PoweronTaskIndex (usually Task0 is used) are started last during system start--up. This avoids unnecessary area changeovers during start--up.

6-180

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Entries for OEM in the section TaskConfiguration

The range from 0 to 23 in the section [TaskConfiguration] of the file 'Regie.ini' is reserved for tasks which can be activated by the area menu. The remaining numbers (24 to 63) are reserved for so--called Child applications, where the numbers from 51 to 63 may be used for the OEM customers` Child applications.

Softkeys of the Regie

In the same way the softkey assignment is set by task entries: the task with the smallest number is located on the machine area key, task1 on softkey 1 and so on up to Task 23 on the right key in the third extension of the softkey bar.

Softkey labeling

The file language.INI specifies the softkey labels. Each language has its own language.INI (e.g. RE_GR.INI for German) in the subdirectory LANGUAGE. An application can be started by a softkey only if there is a softkey text entered in the language.INI.

Attributes

Table 6--3 lists the entries of the task configuration.

Table 6-3

Attributes of the task configuration meaning name of the application as used in the file manager but without the extension ".EXE" maximum time to be used for start--up in milliseconds default is 10000 (10 sec.) parameters for the client application: name of an application in the OEM frame display of HEADER active or not active load an application during start--up remove other applications from the memory when starting an application level of access permission class name of an application window name of an application show icons or hide them, default value TRUE Enabling mask for keys of the Regie, which are to be handled by the area application Enabling mask for the area changeover key, which is to be used by the area application

attribute name Timeout CmdLine HeaderOnTop PreLoad TerminateTask AccessLevel ClassName WindowName ShowTask GIMMEKEYS ShowAppMenu-key

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-181

Regie 6.3 Application with sequence control

03.03

Attribute Name:

Name of the application as used in the file manager (without specified extension '.EXE').

Attribute Timeout

Maximum amount of time (in milliseconds) provided by the Regie for starting--up the application. For a more detailed description see the preceding chapter.

Attribute CmdLine

The attribute CmdLine can be used for specifying parameters for the client application: as command line for the area applications. The default setting is the empty string "". This is a static assignment. With the functions WriteCmdLine of the REGIE.DLL a task can be dynamically assigned command line parameters. These can be read by the functions ReadCmdLine. This is described in chapter 6.4.6. The following applies to standard DOS-- and WINDOWS applications: As name of the task the substitute OEMFRAME is entered and the standard DOS program name or WINDOWS task name is passed in the attribute CmdLine. Example 6-6 Attribute CmdLine

[TaskConfiguration] Task2 = Name := OEMFRAME, CmdLine := "EXCEL.EXE TAB.XLS" ; the spread sheet program EXCEL is called by OEMFRAME.

Attributes ClassName and WindowName The Regie (and the OEM frame) can only handle the client applications if the client application knows the Owner Window Handle. Since this handle is not necessarily unique in a WINDOWS application (a WINDOWS application can have more than one Owner Window Handle ), it must be specified in the file REGIE.INI by the attributes ClassName and WindowName: Example 6-7 Attribute ClassName und WindowName

[TaskConfiguration] Task2 = Name := OEMFRAME, CmdLine := "WinWord", ÄClassName := "OpusApp", ÄWindowName := "Microsoft Word" ; Calling the text processing program WinWord by ClassName and ; WindowsName.

For client applications available as source code you can access this information directly. You have to look for it in the two WINDOWS --API calls RegisterClass and CreateWindow.

6-182

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Note If the source code is not available, these strings can be determined with Public Domain Tools like WinWalk.

Note Area applications are basically started with the instruction WinExec (lpszCmdLine, SW_SHOW).For more details see the description of the parameter lpszCmdLine in WinExec in the "Programmer's Reference Manual, Volume 2: Functions" /WPR/.

Black screen and hour glass

Note If after having entered an application in the REGIE.INI the screen turns black and an hour glass appears, in the Siemens Sequence Control is linked to that application and the application has been additionally started via an OEM frame. Remedy: Enter application directly in REGIE.INI without an OEM frame.

Attribute HeaderOnTop:

This optional attribute can be used to specify, whether the application Header (displaying the operating area, the operation mode etc.) for this area application is inactive (HeaderOnTop = False) or active (HeaderOnTop = True). The default setting is True, i.e. the header is displayed unless it is deactivated. Example 6-8 Attribute HeaderOnTop

[TaskConfiguration] Task5 = Name := MACHINE, HeaderOnTop := True ; application machine with header Task6 = Name := DP, HeaderOnTop := False ; Dialogprogrammierung ohne Header Task7 = Name := aeditor ; ASCII editor with header (default header active)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-183

Regie 6.3 Application with sequence control

03.03

Attribute PreLoad:

This optional attribute can be used for preventing an area application from being started during a MMC start--up. If this attribute is not set (PreLoad := False), the area application will not be started until it is activated for the first time. Advantage: The MMC system start--up can be sped up. Disadvantage: At the time the MMC system starts up, you cannot see whether all configured area applications can be handled during run time. (capacity of resources). The default setting is PreLoad := True, i.e. applications without this attribute are started during start--up. Example 6-9 Attribute PreLoad

[TaskConfiguration] Task5 = Name := SIMULA, PreLoad := False ; The operating area Simulation (SIMULA) was configured in the ; REGIE.INI, but will not be started during start-up.

Note This attribute should be set False for development and testing purposes. For safety reasons a released version has to start all operating areas during start--up. This is taken into consideration by the default setting.

Attribute TerminateTasks:

This attribute can be used for removing certain area applications from the memory when starting other area applications (Example 6--10). This solves the problem of limited WINDOWS resources.

Removing an area application

Example 6-10 Removing an area application

[TaskConfiguration] Task6 = name := param, TerminateTasks := dp; ; Calling PARAM.EXE removes the application DP.EXE from the memory.

6-184

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Removing several area application

If more than one application is to be removed at a time, the corresponding names are to be put in round brackets, separated by commas (Example 6--11). Example 6-11 Removing several area application

[TaskConfiguration] Task7 = name := dp, TerminateTasks := (param, dg); ; Calling DP.EXE removes the applications PARAM.EXE and DG.EXE ; from the memory.

Running two applications alternately

If two applications having the same name are to exclude each other, add a colon followed by the corresponding task number (Example 6--12). Example 6-12 Running two applications alternately

[TaskConfiguration] Task8 = name := oemframe, cmdline := "EXCEL.EXE", ÄTerminateTasks := oemframe:12 Task12 = name := oemframe, cmdline := "NOTEPAD.EXE", ÄTerminateTasks := oemframe:8; Two applications are running alternately under OEMFRAME: either ; EXCEL or NOTEPAD. If OEMFRAME with EXCEL as task 8 is loaded, ; OEMFRAME with NOTEPAD as task 12 is removed from the memory ; and vice versa ;

Removing multiply active applications

If more than one application (some of which are e.g. active under different task numbers), are to be removed at the same time, their names are to be put in round brackets, separated by commas and if necessary supplemented by the task number as shown in example 6--12 (Example 6--13). Example 6-13 Removing multiply active applications

[TaskConfiguration] Task3 = name := dienste, TerminateTasks := (rh, aeditor:25) Task7 = name := aeditor, PreLoad := False, TerminateTasks := rh Task25 = name := aeditor, PreLoad := False, TerminateTasks := rh; ; ; ; ; ; ; The program `ASCII editor' (aeditor) is started more than once e.g. by `services' as task 7 and by `programming' as task 25. If `services' is called as task 3, the Regie only deactivates the ASCII editor for `programming' (task 25), however not the editor for `services' itself (task 7). RemoteHelp (rh) will be deactivated in any case.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-185

Regie 6.3 Application with sequence control

03.03

Attribute AccessLevel:

Using this attribute you can set the access permission levels for the tasks in the Regie. Starting from release 3.2 the softkeys for handling the Regie have been added access rights.

Table 6-4 Softkeys for handling the Regie

Machine

Parameter

Program

Services

Diagnosis

Set--up

The default value of the access permission level AccessLevel := 4. The possible levels of access permission are listed in Table 6-5, where the default value is marked with gray background color.

Table 6-5 The eight level of access permission

access S0 S1 S2 S3 S4 S5 S6 S7

permission required system password MTB password system password user password key switch position 3 key switch position 2 key switch position 1 key switch position 0

user group SIEMENS machine tool builder set up / service staff (machine tool builder) privileged user (in--house service) programmer trained operator operator semi--skilled operator (NC start/NC stop, operating panel)

Examplel 6-14 Attribute AccessLevel

[TaskConfiguration] Task2 = Name := ib, AccessLevel := 2; ;Only the set-up staff may access the area application `start-up' by ;entering the MTB password.

Attribute ShowTask

Per default applications are shown when they are being started. If you want an application to be started in iconized form, use the attribute ShowTask := FALSE. In this case you cannot start the application by softkey action.

6-186

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Customizing the keyboard filter

Use the extension described below to customize the 'MMC keys' like area changeover--key, channel switch-- key ... for the different area applications. This allows the OEM application e.g. to process the F10 key on its own and to use another key (parametrized with the ShowAppMenuKey) to start the area changeover. The required settings are entered in the file REGIE.INI in the section [TaskConfiguration] with the new setting items GIMMEKEYS and ShowAppMenuKey:

... [TaskConfiguration] TaskX = name := oemframe, ..., GIMMEKEYS := n, ShowAppMenuKey := m

The parameters n and m are bitmasks: Their meaning is desribed with the attributes.

Attribute GIMMEKEYS:

This is an enabling mask for keys of the regie, which are to be handled by the area application. GIMMEKEYS:=n, with n as a 32--bit bitmask, which defines those REGIE keys that are to be processed by the application on its own. bit0 : area changeover 1=OEMApp wants to process F10, 0=OEMApp wants F10 to be handled as standard (area change--over) bit1 : channel changeover 1=OEMApp wants to process F11, 0=OEMApp wants F11 to be handled as standard bit2 : Cancel--key (BigMac) 1=OEMApp wants to process ESC, 0=OEMApp wants ESC to be handled as standard bit3 : machine area key 1=OEMApp wants to process SH--F10, 0=OEMApp wants SH--F10 to be handled as standard bit4 : End--key instead of Tab--key 1= The End--key is passed to OEMApp, 0= Tab is passed to OEMApp, when the End--key is pressed bit5 : horizontal and vertical softkeys 1=OEMApp wants to process F1--F8 and SH-F8 wants to handle on its own 0=Regie handles F1--F8 and SH-F1--SH-F8 on its own Example: GIMMEKEYS:=15 OEMApp wants to handle F10, F11, ESC, SH--F10 on its own GIMMEKEYS:=1 OEMApp wants to handle F10 on its own,

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-187

Regie 6.3 Application with sequence control

03.03

Note To allow an application to relieve the area switchover from the Regie, GimmeKey must be used to configure that the application wants to handle the F10 key itself; at the same time, the Regie must be told via ShowAppMenuKey=0 that it has no longer to respond.

The following table contains the codes for keys which can be released using the attribute GIMMEKEYS and that can thus be handled directly by the application.

Table 6-6 Key codes Key 1st horizontal softkey bar 2nd horizontal softkey bar Right vertical softkey bar Left vertical softkey bar Virtual key code VK_F1 -- VK_F8 (VK_CONTROL, VK_F1) -(VK_CONTROL, VK_F8) (VK_SHIFT, VK_F1) -(VK_SHIFT, VK_F8) (VK_SHIFT, VK_CONTROL, VK_F1) -- (VK_SHIFT, VK_CONTROL, VK_F8) VK_F9 (VK_SHIFT, VK_F9) VK_F10 (VK_SHIFT, VK_F10) VK_ESCAPE VK_F11 VK_END VK_TAB Key code (hex) 70 --77 (11,70) -- (11,77) (10,70) -- (10,77) (10,11,70) -- (10,11,77)

Recall key ETC key Area switchover key Machine area key (Alarm) Cancel key Channel switchover key End key Tab key

78 (10,78) 79 (10,79) 1B 7A 23 09

6-188

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Attribute ShowAppMenuKey:

Enabling mask for the area changeover key, which is to be used by the application. ShowAppMenuKey:=m, where m is a 32--bit bitmask, that defines, which key within this application is to activate the area changeover (F10 substitute) bit0--7 virtual keycode of the area changeover--key to be defined (see winuser.h VK_xxx entries) bit16 1=Shift must be pressed, 0=Shift may not be pressed bit17 1=Ctrl must be pressed, 0=Ctrl may not be pressed bit18 1=Alt must be pressed, 0=Alt may not be pressed Example: ShowAppMenuKey := 65659 65659 = 0x1007B VK_F12 = 0x7B à Shift--F12 triggers the area changeover function for this application VK_F1 = 0x70, VK_F1 = 0x71, ..., VK_F24 = 0x87

Note If an application is assigned another key for area changeover with 'ShowAppMenuKey', the key 'F10' will still work. Specify 'GimmeKey' explicitly to prevent this.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-189

Regie 6.3 Application with sequence control

03.03

Attribute DisableKeys

The DisableKeys function serves to configure the behavior of the keyboard filter. The keyboard filter can be used, on the one hand, to suppress certain keyboard sequences and, on the other hand, for mapping keys or softkeys. Mapping means the replacement of the original keyboard code with codes created by the keyboard filter. The keyboard filter acts task--specifically. If the keyboard filter is not configured for a certain task, the default behavior will come into effect for this task. The default behavior is defined in the file system.ini under the key "seqact" in the section [Keyboard]. Keyboard sequences The keyboard sequences are enabled/disabled via the entry DisableKeys. The following keyboard sequences are defined: Bit0 Bit1 Bit2 Bit3 Bit4 Bit5 Bit6 Bit7 Bit8 Bit9 Bit10 Bit11 Bit12 Bit13 Bit14 Bit15 Bit16 Bit17 CTRL--ALT ALT--F4 ALT--TAB LEFTSHIFT--ALT--TAB RIGHTSHIFT--ALT--TAB CTRL--ESC ALT--ESC ALT--SPACE (SHIFT)--CTRL--F1 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F2 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F3 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F4 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F5 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F6 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F7 3rd and 4th softkey bar (PCU50) (SHIFT)--CTRL--F8 3rd and 4th softkey bar (PCU50) Left Windows Key (popup Taskmenue) VK_LWIN Right Windows Key (popup Taskmenue) VK_RWIN

A keyboard sequence is suppressed by setting the appropriate bit in the DisableKeys mask. This mask must be entered as a decimal value!

Note The first 8 sequences are absolutely necessary to ensure the correct function of HMI Advanced and may not be suppressed! These sequences may only be disabled if servicing is required. The remaining 8 entries suppress the sequences SHIFT--CTRL--F1 to SHIFT-CTRL--F8 and CTRL--F1 to CTRL--F8. On a PCU50, these sequences correspond to the 3rd and 4th softkey bar. Example: An application app.exe is to receive the key sequences (SHIFT)--CTRL--F1 to (SHIFT)--CTRL--F8.

6-190

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

BitMask = 00FFh corresponds to 255 (decimal) Parameterization in Regie.ini: Task8 = name := app, Timeout := 10000, DisableKeys := 255

Attribute DisableKeysHigh

The keyboard sequences CTRL--F1 to CTRL--F8 can be mapped to the key sequences CTRL--F13 to CTRL--F20 using a mapping function. This can become necessary since the operating system in certain situations already reacts to CTRL--F4 and CTRL--F6; the key mapping is represented via the entry DisableKeysHigh: Bit0--Bit28 Bit29=1: Reserved Key mapping CTRL--F1 to CTRL--F8 --> CTRL--F13 to CTRL--F20 is active Bit30 Reserved Bit31 Reserved The mask must be entered as a decimal value! Example: An application app.exe is to receive the key sequences (SHIFT)--CTRL--F1 to (SHIFT)--CTRL--F8, and the sequences CTRL--F1 to CTRL--F8 are to be mapped to CTRL--F13 to CTRL--F20. DisableKeys:= 00FFh corresponds to 255 (decimal) DisableKeysHigh := 20000000h corresponds to 536870912 (decimal) Parameterization in Regie.ini: Task8 = name := app, Timeout := 10000, DisableKeys := 255, DisableKeysHigh :=536870912

6.3.7

Section [Miscellaneous]

Overview

In the section [Miscellaneous] several parameters of the Regie can be set. Table 6--6 gives an overview. The entries not included in this table are intended for internal use only .

Table 6-7 Entries in the section [Miscellaneous]

entry ExitButton ExitButtonAccessLevel ExitButtonIndex ExitButtonQueryUser

meaning activates the ExitButtons Zugriffsstufe des ExitButtons defines a softkey as ExitButton Rückfragemöglichkeit zum Bestätigen des Exit

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-191

Regie 6.3 Application with sequence control

03.03

Table 6-7

Entries in the section [Miscellaneous]

entry HelpTaskIndex MMCSignOfLife PoweronTaskIndex RemoveIcons ShowMessageBox ShowResources

meaning assignes the substitute task Rhelp sign of life monitoring of the MMC index of the first task following Power On removes icons from the screen displays warnings during start--up displays system resources

Entry ExitButton

You can reserve one of the softkeys of the horizontal Regie softkey bar (see table 6--7) for the ExitButton, i.e. with this softkey you can shut down the MMC system in a controlled way: First the NCDDE--server will be terminated then all other auxiliary and area applications are closed in the reverse order they were opened. This is a function for testing purposes: You can start for example another version of the HMI system.

Table 6-8 Machine Softkeys for operating the Regie with the function Exit Parameter Program Services Diagnosis Set--up Exit

The entry ExitButtonIndex assigns the function Exit to a softkey. ExitButton can activate (Example 6--16) or deactivate this function (Example 6--17). The function Exit finishes the MMC system in a controlled manner using the Regie.

6-192

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Turn on Exit button

Example 6-15 Turn on Exit button

[Miscellaneous] ExitButtonIndex = 7 ; the right hand horizontal softkey is used ExitButton = True ; as exit key

Turn off Exit button

Example 6-16 Turn off Exit button

[Miscellaneous] ExitButtonIndex = 7 ; dthe right hand horizontal softkey is not used ExitButton = False ; as exit key

Entry Exit ButtonIndex

For the function Exit the softkey of the horizontal Regie softkey bar (see table 6--7) is assigned by the entry ExitButtonIndex. Example 6-17 Entry ExitButtonIndex

[Miscellaneous] ExitButtonIndex = 6 ; The softkey Exit(to the right next to the ; Set-Up key)is defined as Exit key

Note Softkey numbering starts with 0.

Entry ExitButtonAccessLevel

This entry can be used to define the access level for the ExitButton. The default setting is ExitButtonAccessLevel :=7 (corresponds to keyswitch position 0). see also Table 6-5.

Entry ExitButtonQueryUser

This entry can be used to activate an interrogation option in the form of a dialog box. After the ExitButton has been actuated, a dialog box will appear to confirm or cancel the process. The default setting is ExitButtonQueryUser := False.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-193

Regie 6.3 Application with sequence control

03.03

Entry HelpTaskIndex:

Additional information: The standard WINDOWS application WinHelp can be integrated as an area application in the MMC system with the substitute Rh (Remote Help):

Defining Remote Help as area application

Example 6-18 Defining Remote Help as area application

[TaskConfiguration] Task3 = Name := RH, Timeout := 10000, HeaderOnTop := False ; Rhelp is defined as fourth area application

The substitute can usually be activated by the Info key or by the function key F12 of a standard keyboard. A substitute is assigned to a task with the entry HelpTaskIndex as follows:

Defining Remote Help as HelpTask

Examplel 6-19 Defining Remote Help as Help--Task

[Miscellaneous] HelpTaskIndex = 3 ; this refers to the example before [TaskConfiguration] Task3 = Name := RH, Timeout := 10000, HeaderOnTop := False

This entry must exist whenever an implicit area selection with SwitchToHelpTask is to be performed. SwitchToHelpTask represents a simplified notation for SwitchToTask(HelpTaskIndex)

Note Theoretically any task may be assigned to the HelpTaskIndex. The info--key represents a kind of HotKey or ShortKey, that allows a direct area selection (without detour via the Regie softkey bar, analogue to the area--key Machine).

6-194

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Entry MMCSignOfLife

Sign--of--life monitoring of the MMC. This enables a feature that might be useful when developing an OEM project: A PLC variable (data module DB19, data word DW16) is incremented once per second. Example 6-20 Entry MMCSignOfLife

[Miscellaneous] MMCSignOfLife = False ; The sign-of-life monitoring not active

Note This function is intended for developing purposes only. It is not authorized for released versions!

Entry RemoveIcons

When starting the system the Regie shifts the icons of the tasks started from the visible display area. For the area change over this has the advantage that screen changes are not disturbed by the icons in the background. During testing and developing phases this might be undesirable. Therefore you can configure this feature of the Regie: Example 6-21 Entry RemoveIcons

[Miscellaneous] RemoveIcons = False ; For testing purposes the icons remain in ; the visible screen area.

Entry PoweronTaskIndex

Additional information: Following a system start--up, the tasks configured in the section [TaskConfiguration] are started beginning with the smallest number. Only the application entered in PoweronTaskIndex ( usually task0 is selected) is started last during start--up. This avoids unnecessary area change--overs. The application entered in PoweronTaskIndex is the task which is active after start--up. With the entry PoweronTaskIndex the user may advance another application than the area 'machine' as shown in the following example for the area 'Installation' (Task3).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-195

Regie 6.3 Application with sequence control

03.03

Examplel 6-22 Entry PoweronTaskIndex

[TaskConfiguration] Task0 = name := maschine ; Machine Task1 = name := param ; Parameter Task2 = name := dpmill ; dialog programming milling Task3 = name := ib ; set-up ; Usually the application `machine' is selected after start-up. [Miscellaneous] PoweronTaskIndex = 3 ;This entry enables you to activate the application `set-up' (task3) ;immediately following Power On.

Entry ShowMessageBox

The entry ShowMessageBox = True can be used to see, whether old DDLs are still loaded. Additional information: During MMC system initialization warnings (WINDOWS MessageBox) are given to the operator, if Dynamic Link Libraries or applications (only those located in the current MMC directory) have already been loaded. These warnings occur in particular when the MMC system is repeatedly being loaded. This indicates to you either that the Dynamic Link Libraries you are using have not been unloaded correctly or that an application has crashed earlier. In this case the application is usually no longer visible on the desktop, but still exists in the internal task list of the WINDOWS kernel. The question in the MessageBox, whether the Dynamic Link Library is to be unloaded or whether the application is to be terminated, should be answered with yes. Only this answer guarantees access to valid software versions.

Note This is a function for testing purposes: ShowMessageBox = True should apply while an OEM application is being developed. If these warnings should nevertheless be suppressed, the flag must be set False. (this might for example be likely for a released version to be delivered). Then the entry will look like this: Example 6-23 Entry ShowMessageBox

[Miscellaneous] ShowMessageBox = False ; This is recommended for released versions only, the DLLs and ; applications will not be unloaded.

6-196

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

Entry ShowResources

Additional information: Since under WINDOWS 3.11 the available WIN--DOWS system resources might be critical, it is necessary to keep track of the used resources when developing applications. By properly setting the flag ShowResources = TRUE (see Example) by pressing F10 (display data area bar on the screen) and F12 or the INFO--key the part of the WINDOWS system resources remaining is displayed in percent. Example 6-24 Entry ShowResources

[Miscellaneous] ShowResources = True ; Important for development! ; displays remaining resources

6.3.8

Section [CommandToTask]

Entry Cycles

This section contains the default values of the command interpreter channel used by the NCK for starting actions on the MMC. Examplel 25: Entry Cycles

[CommandToTask] Cycles=comic ;Among others the measuring cycles are controlled by the command ;interpreter channel

6.3.9

The initialization file language.INI

Overview

The initialization file language.INI includes the softkey texts and the general texts of the Regie. Table 6-9 gives an overview on the section includes.

Table 6-9 Sections of the file language

section HSoftkeyTexts VSoftkeyTexts GeneralTexts DISP Keyboard_State HSoftkeyIcons

meaning texts of the horizontal softkey bar texts of the vertical softkey bar miscellaneous texts, e.g. messages

icons of the horizontal softkey bar

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-197

Regie 6.3 Application with sequence control

03.03

Table 6-9

Sections of the file language

section

meaning

HSoftkeyTextsSh texts of the horizontal softkey bar displayed when configuring ort icons MsgBox texts for user prompts (dialog) when exiting HMI

The file language.INI, e.g. the German version of the file RE_GR.INI, can be edited using any ASCII editor you prefer.

Excerpt of the language.INI

Example 6-26 Excerpt of the language.INI

[HSoftkeyTexts] ; 1. softkey bar HSK0 = "Machine" // 20 HSK1 = "Parameter" // 20 ... [GeneralTexts] GT0 = "SINUMERIK system start-up. Please wait // 50 ... with the following meaning: HSK0 horizontal softkey 0 GT0 general text no. 0 "Maschine" softkey text; create two--line texts by giving two spaces //20 comment specifying the maximum number of characters allowed per text (optional)

6.3.10

Section [HSoftkeyTexts]

This section contains the texts of the horizontal softkeys. Each application which is configured in the section [TaskConfiguration] of the REGIE.INI as task (Task 0 to Task 23), requires the corresponding softkey label in the language.INI. If for example task 6 has been configured in the REGIE.INI and there is no entry in the language.INI under HSK6, the application cannot be started by softkeys. This can be used for locking applications for certain languages.

Assigning softkey labels

Example 6-27 Assigning softkey labels

Excerpt from REGIE.INI: [TaskConfiguration] Task1=name := param, Timeout := 60000, PreLoad := False Excerpt from RE_GR.INI: [HSoftkeyTexts] ; 1. softkey bar HSK1 = "Parameter" // 20

6-198

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.3

Regie Application with sequence control

6.3.11

Section [VSoftkeyTexts]

This section contains the texts of the vertical softkey bar of the Regie. The softkey labeling cannot be reconfigured.

6.3.12

Section [GeneralTexts]

This section contains texts which are shown by the Regie.

6.3.13

Section [HSoftkeyIcons]

This section enables you to configure icons which are displayed on the horizontal softkeys of the area switchover bar. For each softkey on which an icon is to be displayed, you must state the name of the file containing the relevant icon resp. bitmap. Acc. to the resolution, the files (bmp files) must be stored in one of the directories \icons\640, \icons\800 or \icons\1024. These directories are located at the same level as the directory language containing the file sprach.ini in which the configuration described here is performed. The maximum size of the icons/bitmaps for the resolution 640*480 is 33 pixels in height and 26 pixels in width. The icons for the resolution 640*480 (\icons\640) must always be provided. Additional icons are provided as option for the two resolutions 800*600 (\icons\800) and 1024*768 (\icons\1024). If there are no separate icons for these resolutions, the system automatically uses the icons stored in directory 640*480 and zooms them accordingly. Icons can only be configured using the "new" design. HSK0=h_mach_m.bmp ; icon which is to be displayed on the first horizontal softkey. HSK1=h_para_m.bmp ; icon which is to be displayed on the second horizontal softkey.

6.3.14

Section [HSoftkeyTextsShort]

This section contains the texts for labeling the softkeys of the area switchover bar for which an icon has been configured in addition. Due to lack of space, the maximum length of these texts has been limited to 2 lines containing a maximum of 6 characters each (a hard return is generated by entering 2 blanks). Icons can only be configured using the "new" design. As a result, the section HSoftkeyTextsShort is evaluated only when the new design is active. If the "new" design is active, and an icon defined for a softkey without containing a short text, the long text from the section HSoftkeyTexts is displayed without icon. If the "new" design is active containing a short text without having defined an icon, the long text is displayed, too. The structure of the section HSoftkeyTExtsShort is identical to that of the section HSoftkeys.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-199

Regie 6.3 Application with sequence control

03.03

6.3.15

Section [MsgBox]

This section contains the language--dependent texts for the shutdown dialog. This dialog is, as far as configured, displayed when terminating HMI and offers the user the possibility to continue the shutdown procedure (by actuating HSKOK) or abort it (by actuating HSKABBR). MsgText="Do you really want to ... ?" ; Text displayed in the dialog window (user prompt). HSKOK="OK" ; Text displayed on the softkey by means of which the shutdown procedure is continued. HSKABBR="Abort" ; Text displayed on the softkey by means of which the shutdown procedure is aborted.

6-200

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

6.4

Functions of the RegieServer

The functionality of the Regie DLL is available from version 6.0 as COM server. In this Chapter the individual functions are explained. The Reference "Regie COM Server interface" describes all possible functions and parameters in detail.

Note Existing 16Bit applications must be transferred to the RegieServer if they are recompiled. They can access, however, Regie.dll and the Regie Control without recompliation.

Overview of the functions

The RegieServer provides functions for S switching tasks S switching tasks to hidden area S switching tasks (to hidden area) immediately S screen control S locking S command line S miscellaneous. Table 6--9 gives an overview of the functions of the RegieServer:

Overview of functions

Table 6-10 Functions of the RegieServer

name switching task SwitchToHelpTask SwitchToPreviousTask SwitchToTask SwitchToTask2

short description

switch to help task switch to previous task change with TaskIndex (without taking into account ChildTasks) change with TaskIndex or change to the ChildTask

switching task to hidden area SwitchToChild activate task in hidden area using the task number

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-201

Regie 6.4 Functions of the RegieServer

03.03

Table 6-10

Functions of the RegieServer

name SwitchToChildEx SwitchToParent SwitchToParentAndKillMe

short description activate task in hidden area using the task name return to activating program return to activating program and remove task from memory

switching task (to hidden area) immediately SwitchToHelpTaskImmediate SwitchToPreviousTaskImmediate SwitchToTaskImmediate SwitchToChildImmediate SwitchToChild ImmediateEx SwitchToParentImmediate switch to Help (immediately) switch back (immediately) switch with task index (immediately) activate task in hidden area using the task number (immediately) activate task in hidden area using the task name (immediately) return to activating program (immediately)

SwitchToParentAndKillMeImmediate return to activating program and remove task from memory (immediately) screen control MMCScreenOn MMCScreenOff ContrastDown ContrastUp locking LockCurrentNCU UnlockCurrentNCU IsCurrentNCULocked IsChanMenuLocked LockChanMenu UnlockChanMenu command line ReadCmdLine ReadCmdLineMe WriteCmdLine read area command line read command line of current area creating command line for a `son' lock NCU for current task unlock NCU for current task check to see who locked the current NCU determine the disabled status of the channel menu disable channel switchover enable channel switchover turn on screen + interface bit turn off screen + interface bit decrease contrast of the flat screen monitor increase contrast of the flat screen monitor

6-202

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Table 6-10

Functions of the RegieServer

name WriteCmdLineEx

short description creating command line for a `son' (Call using the task name)

miscellaneous AsyncCompleted GetCurrentTaskIndex GetMMCDir GetMMCLanguagePath InitCompleteEx InitSvr ResumeRegieEvents SetMode ChannelSwitchKey Terminate TestAndStopRegieEvents quit event asynchronously determine Taskindex of the task to be called determine MMC directory access current task DLL indicate successful initialization initialize RegieServer, MUST be called first thing release block for new events lock or activate channel switch key quit HMI and initiate shutdown check if Regie is stopped and block new events to be initiated

Use

The functions of the RegieServer are available from C/C++ as well as from Visual Basic.

6.4.1

Switching tasks

Overview

Besides selecting areas by keyboard actions (explicit selection), you can also use a RegieServer method for initiating area changeovers (implicit selection). Table 6--10 gives an overview of the methods of the RegieServer for area changeover.

Table 6-11 Functions of the RegieServer (task changeover)

name switching tasks SwitchToTask

short description change with Taskindex (without taking into account ChildTasks)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-203

Regie 6.4 Functions of the RegieServer

03.03

Table 6-11

Functions of the RegieServer (task changeover)

name SwitchToTask2 SwitchToPreviousTask SwitchToHelpTask

short description change with Taskindex or switch to ChildTask switch to previous task switch to help

SwitchToTask

Description Implicit area selection by calling a DLL function instead of key operation. Restriction It is always branched to the specified task, even if this is overlaid by a ChildTask.

SwitchToTask2

Implicit area selection via function call; it is branched either to the specified task or to its active ChildTask. Restriction The function will not be carried out if the Regie displays its area switchover menu (F10 key).

SwitchToPrevious Task

Description The area that was active previously to the current one is selected. In this sense this function is a counterpart to the implicit area selection by SwitchToTask. You can switch back and forth between two area applications with the function SwitchToPreviousTask.

Note SwitchToPreviousTask is equivalent to pressing the key `area changeover' (F10) twice.

6-204

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

SwitchToHelpTask

Description The function SwitchToHelpTask changes to the area 'help', i.e. to the task specified by the help index. You can find more information in Chapter "Help support".

6.4.2

Switching tasks in the hidden area

Structured area changeover

The RegieServer provides a function family for organizing areas in a father/son relationship. A large area may for example be divided in several small and independent subareas, that are managed as a whole by the function family `switching tasks in the hidden area'. Table 6-12 gives an overview of the RegieServer functions for switching tasks to the hidden area:

Table 6-12 Functions of the RegieServer (switching tasks to the hidden area)

name switching tasks to the hidden area SwitchToChild SwitchToChildEx SwitchToParent SwitchToParentAndKillMe

short description activate task in hidden area using the task number activate task in hidden area using the task name return to activating program return to activating program and remove task from memory

Entry in REGIE.INI for a hidden area

The operating area `diagnosis' includes an editor for editing data areas of different sizes. In order to restrict the size of the file DIAGNOSE.EXE, the functionality of the editor is moved to a second `hidden' area. Example 6-28 Entry in REGIE.INI for hidden area

[TaskConfiguration] Task5 = Name := DIAGNOSE, ... Task24 = Name := AEDITOR, ...

; ASCII editor is located in the ; hidden area

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-205

Regie 6.4 Functions of the RegieServer

03.03

"Hidden" areas

In this context `hidden' means that from the 32 areas to be configured the upper ones from 24 to 31 cannot be accessed via the data area bar (with the ETC--key), but only from within the application (diagnosis in the previous example) with the function call SwitchToChild or SwitchToChildEx where SwitchToChild uses the task number and SwitchToChildEx uses the task name. If the operator uses the editor and switches via the data area bar e.g. to the machine area and back to the diagnosis (with softkey F6), the Regie automatically activates the hidden area AEDITOR. Switching back from the `son' to the `father' is also possible by calling the function SwitchToParent, however not by keyboard actions. When switching back from the son to the father you can save e.g. WINDOWS resources by simultaneously removing the son from the memory. In this case the switch back is done in the son by SwitchToParentAndKillMe. Fig. 6--2 shows the function of the hidden area.

Visible tasks can be accessed via data area bar Task 0 to 7 ETC êêêêêê ê SwitchToChild(Ex) Hidden tasks can be accessed via function

Task 8 to 15 êêêêêê ETC SwitchToParent ê

Task 16 to 23 Task 24 to 31

Fig. 6-2

Using hidden areas

Note When using this function of the Regie, make sure the return value of State_Changed is not set equal 0, because this may interrupt in the Sequence Control further actions like area changeovers or building up displays.

6-206

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Note The two function families SwitchToTask SwitchToPreviousTask SwitchToHelpTask on one side and SwitchToChild SwitchToChildEx SwitchToParent SwitchToParentAndKillMe on the other have been kept disjunct deliberately on purpose, i.e. if an area detoured by SwitchToChild is switched to active by SwitchToTask, not the detoured area is switched to but the area specified in the argument of SwitchToTask.

SwitchToChild

Description Selects an area configured as `son' in the section [TaskConfiguration]: Its task index is in the range of 24 to 63, where the numbers from 51 to 63 may be used for the OEM customers` Child applications.. Thus the selected `son' area superposes or replaces the calling `father': When doing this per keyboard with the data area bar, the `son' is displayed instead of the `father'. This superposing is undone by SwitchToParent or SwitchToParentAndKillMe.

Note This organization in `father'/'son' areas can be nested: A `son' can address a `grandson' by SwitchToChild.

SwitchToChildEx

Description Selects an area which has been configured in the section [Childs] of an application's initialization file. In this section the task index of an area of the section [TaskConfiguration] configured in the REGIE.INI can be assigned a name. The only difference to the function SwitchToChild is, that it is called by the name entered in the section [Childs].

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-207

Regie 6.4 Functions of the RegieServer

03.03

SwitchToParent

Description Returning from the selected `son' area to the calling `father' and undoing the superposing.

Note Calling SwitchToParent twice switches back from `grandson' to `father'.

SwitchToParentAndKillMe

Description Like SwitchToParent : Returning from the selected `son' area to the calling `father' and undoing the superposing. Then the `son' area is closed with a PostMessage using WM_CLOSE.

Note This function is recommended, if you are running out of WINDOWS system resources or if the `son' area is just seldomly called. If SwitchToChild is called again, the Regie will reload it.

6.4.3

Switching tasks (to hidden area) immediately

Overview

Table 6-13 gives an overview of the RegieServer functions for switching tasks immediately:

Table 6-13 Functions of the RegieServer (switching tasks immediately)

name Switching tasks (to hidden area) immediately SwitchToHelpTaskImmediate SwitchToPreviousTaskImmediate SwitchToTaskImmediate SwitchToChildImmediate

short description switch to Help (immediately) switch back (immediately) switch with task index (immediately) activate task in hidden area (immediately) using the task number

6-208

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Table 6-13

Functions of the RegieServer (switching tasks immediately)

name SwitchToChildImmediateEx SwitchToParentImmediate SwitchToParentAndKillMe Immediate

short description activate task in hidden area (immediately) using the task name return to activating program (immediately) return to activating program and remove task from memory (immediately)

Regie-Queue

Additional information: The Regie responds to pressed keys (e.g. F10--F10: return to previous application) and to functions like SwitchToParent. These triggers of Regie actions are internally managed in a Regie queue. Issuing keyboard actions and function results simultaneously might lead to unwanted interruptions of the command sequence. Example: In an application a child application ( e.g. an editor ) is closed by the vertical softkey F8 (short: +F8). At the end of this action the application is supposed to return to the previous application with SwitchToParent. At the same time the expert clicks the key sequence F10, F10, F4 in order to quickly get to the function assigned to softkey 4 of the previous application. This is a race between the execution of SwitchToParent and the key sequence F10, F10, F4 which in Fig. 6--3 results in a messed--up sequence of the actions: The function SwitchToParent is added to the Regie queue too late.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-209

Regie 6.4 Functions of the RegieServer

03.03

key + F8

desired action closing an application step 1: data area bar activated

function function +F8 running function +F8 running

Regie queue + F8

F10

F10

F10

step 2: predecessor activated executing actions with softkey 4

function +F8 running function +F8 running

F10

F4

F4 function +F8 finished calling of SwitchToParent SwitchTo Parent

Fig. 6-3

How SwitchToParent works when keys are pressed quickly: Event SwitchToParent is called after the keys F10, F10 and F4 have been pressed and usually have already been executed

Solution: The function family of the Regie SwitchToHelpTask SwitchToPreviousTask SwitchToTask SwitchToChild SwitchToChildEx SwitchToParent SwitchToParent AndKillMe has been added a second version of immediate Regie functions with the same basic meaning: SwitchToHelpTaskImmediate SwitchToPreviousTaskImmediate SwitchToTaskImmediate SwitchToChildImmediate SwitchToChildImmediateEx SwitchToParentImmediate SwitchToParent AndKillMeImmediate. At the time of the function call they insert the corresponding event at the TOP of the Regie queue, so that the next time the Queue is accessed this event will be taken next.

6-210

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Fig. 6--4 shows the function of SwitchToParentImmediate. desired action closing in application function function +F8 running function +F8 running ÜÜÜ step 1: data area bar activated step 2: predecessor activated executing action with softkey 4 Regie queue + F8 SwitchTo Parent Immediate F10

Key + F8

F10

function +F8 running function +F8 running

ÜÜÜ

F10

F10

F4

function finished

Ü

F4

Fig. 6-4

How SwitchToParentImmediate works when keys are pressed quickly: The event SwitchToParent is inserted directly following the +F8 command.

Conclusion: When developing OEM applications, check to see whether a sequence problem as described above may occur if keys are pressed too quickly. This applies to all keys triggering area changeovers by the Regie respectively a state changeover or an action within an application. If sequence problems might possibly occur, the corresponding immediate version should be used.

6.4.4

Screen control

Table 6-14 gives an overview of the functions of the RegieServer concerning the screen control.

Table 6-14 Functions of the RegieServer (screen control)

name screen control MMCScreenOn MMCScreenOff ContrastDown ContrastUp

short description turn on screen + interface bit turn off screen + interface bit decrease contrast of the flat screen monitor increase contrast of the flat screen monitor

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-211

Regie 6.4 Functions of the RegieServer

03.03

MMCScreenOn, MMCScreenOff

Description Turns screen on/off. The RegieServer provides two functions for turning on or off an MMC operating panel monochrome ­LCD screen: MMCScreenOn MMCScreenOff. MMCScreenOff turns off both the screen and the backlight and additionally sets the interface signal DB19, DBB0, bit 1 (bit 1 = 1). MMCScreenOn turns on both the screen and the backlight and additionally resets the interface signal DB19, DBB0, bit 1 (bit 1 = 0).

ContrastUp and ContrastDown

Description Sets the contrast of the LCD screen. The RegieServer provides two functions for setting the contrast of an MMC operating panel monochrome or STN LCD screen: ContrastUp and ContrastDown. There are 16 levels for setting the contrast, the current level is stored in a counter. After switch--on (system reset) the counter is set to the default contrast 8. The counter can be incremented or decremented step by step with the functions ContrastUp and ContrastDown.

Note Of course a more comfortable setting of the contrast may be realized in area applications (services, diagnosis, etc.). You could for example store the counter in the INI file, so that its value may be restored after a system restart by executing the corresponding number of calls of ContrastUp or ContrastDown.

Application

ContrastUp increases the contrast of the monochrome or STN LCD screen. ContrastDown decreases the contrast of the monochrome or STN ­LCD screen. The function works like ContrastUp, but just in the other direction.

6-212

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

6.4.5

Locking tasks

Overview

From software release 3.2 the MMC operator's interface may be connected to any NCU or PLC module within the net: This is done in the operating area `connection' or with the NCDDE variable 'MachineSwitch'. You can selectively influence a changeover by calling the locking functions of the RegieServer: By locking or unlocking individual NCUs. Tip: Since this function limits the flexibility of the system you should use it just sparingly. Table 6-15 gives an overview of the locking functions of the RegieServer, to be described in more detail in the following text:

Table 6-15 Locking functions of the RegieServer

name locking LockCurrentNCU LockNCU IsCurrentNCULocked IsChanMenuLocked LockChanMenu UnlockChanMenu

short description lock NCU for the current task lock NCU for the specified task check to see if who locked the current NCU Sperrzustand des Kanalmenüs bestimmen Kanal Umschaltung sperren Kanal Umschaltung freigeben

LockCurrentNCU, UnlockCurrentNCU

Description Locks a NCU for the specified task (LockCurrentNCU) respectively unlocks a NCU for the specified task (UnlockCurrentNCU).

IsCurrentNCULocked

Description Reports whether or not an NCU is currently locked.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-213

Regie 6.4 Functions of the RegieServer

03.03

LockChanMenu

Description This function will lock the channel menu. After locking, it is no longer possible to switch to another channel.

UnlockChanMenu

Description This function cancels the lock of the channel menu for the task to be called. It is, however, possible, that other tasks still keep the channel menu loc ked so that a channel switchover is not yet possible.

IsChanMenuLocked

Description This function checks the lock counter of the channel menu. If the channel menu is not locked, the function will return the value --1, otherwise, the task index of the first task which has locked the channel menu.

6.4.6

Functions for managing the command line

Overview

For each area application a command line can be installed: S statically with the attribute CmdLine in the section [TaskConfiguration] of the file REGIE.INI S dynamically with the commands WriteCmdLine or WriteCmdLineEx of the RegieServer. The information of the command lines can be read in by the appropriate version of the command ReadCmdLine. The command line is provided at the start of the application. Table 6-16 gives an overview of the command line functions of the RegieServer:

Table 6-16 Command line functions of the RegieServer

name Command line ReadCmdLine ReadCmdLineMe

short description read area command line read command line of current area

6-214

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Table 6-16

Command line functions of the RegieServer

name WriteCmdLine WriteCmdLineEx

short description installing a command line for a `son' installing a command line for a `son' (call by task name)

ReadCmdLine

Description Reads the command line of an area with ReadCmdLine in C--programs. The area must be specified by its task number.

ReadCmdLineMe

Description Reads the command line of the current area.

WriteCmdLine

Description Installs the command line of a `son' area. The area is specified by its task number.

WriteCmdLineEx

Description Reads the command line of an area with ReadCmdLineVB in VB programs. The area must be specified by its task number.

6.4.7

Subsystems

With software release 6.0 and higher, the Regie can start and quit certain applications from HMIBase not only for HMIAdvanced, but also for other applications, such as SinuCom--NC, ProtoolPro applications, etc. This guarantees that server applications used by different applications together will only be carried out in one instance and that a server application will only be quitted if the last application used by this server terminates. A server combination needed by a certain application is called a subsystem. The following illustration shows the two applications HMIAdvanced and SinuCOM-NC both using the three server applications NCDDE, DH and MBDDE servers. Starting and shutting down of the servers is managed by the Regie. The Regie checks whether the servers required by a certain application are already running and will start server components possibly not yet active. Analogously, when quit-

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-215

Regie 6.4 Functions of the RegieServer

03.03

ting the application, it is checked whether a certain server component is also used by another application. If so, the appropriate server component will not be shutdown.

HMIAdvanced

SinuCOM-NC REGIE

NCDDE

DH

MBDDE

Subsystems are configured as follows: HMI Advanced always define their server configuration in the file REGIE.INI. This guarantees the compatibility to the existing behavior. All the other applications define their required server applications in their own INI file. This INI file contains a [StartupConfiguration] section where the server configuration is stored. The entries in this section use the syntax in the file Regie.ini. Example:

[StartupConfiguration] Startup0 = name := ncdde, Startup1 = name := mbdde, Startup2 = name := dhserver, Timeout := 20000 Timeout := 20000 Timeout := 60000

Starting and quitting of a certain subsystem must be initiated by the appropriate application using the function CRegieSvr::Subsystem(). This function is transferred the path and name of the application--specific INI file. The INI file can be at any position in the file system.

6.4.8

Miscellaneous

Table 6-17 gives an overview of the miscellaneous functions of the RegieServer:

Table 6-17 Functios of the RegieServer (Miscellaneous)

name miscellaneous AsyncCompleted GetCurrentTaskIndex GetMMCDir GetMMCLanguagePath

short description quitting events asynchronously Taskindex der aufrufenden Task bestimmen determining MMC directory accessing current task DLL

6-216

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Table 6-17

Functios of the RegieServer (Miscellaneous)

name InitCompleteEx InitSvr TestAndStopRegieEvents ResumeRegieEvents SetModeChannelSwitchKey Terminate

short description indicating successful initialization initialize RegieServer, MUST be called first thing check if Regie is stopped and block new events to be initiated release block for new events locking or activating channel switch key quit HMI and initiate shutdown

AsyncCompleted

Description Function to quit events asynchronously. See also Chapter"Events of the RegieServer".

GetCurrentTaskIndex

Description This function returns the task index of the calling task. The task index corresponds to the index of the file Regie.ini.

GetMMCDir

Description Determine MMC directory. GetMMCDir returns the MMC directory i.e. the directory that the calling task has been started in. This function is used to access task--specific temporary files, that must be located in a subdirectory of the MMC directory.

Note Programming absolute path names in the MMC software is not recommended, since in this case the handling of more than one MMC software version on one PC will not work.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-217

Regie 6.4 Functions of the RegieServer

03.03

GetMMCLanguagePath

Description Access the current DLL of the task. GetMMCLanguagePath allows access to the currently set language--dependent Dynamic Link Library of the task.

InitCompleteEx

Description Indicates successful initialization. A driver must indicate the end of its internal initialization to the Regie (for reasons of synchronization). To do so, at the end of the initialization an area application calls InitCompleteEx.

Note All servers entered in the section [StartupConfiguration] of the file REGIE.INI must call InitComplete.

Note If you create an OEM area applications with the Sequence Control or if you use the substitute OEMFRAME you do not have to consider InitComplete because the Sequence Control respectively the OEM frame already implies this call (in MDIFORM1.FRM).

InitSvr

Description Initializes the RegieServer. NB: This function MUST be called before any other function of the RegieServer can be called.

ResumeRegieEvents

Description Unlocks events so that they can be activated again. If you, for example, want to retain events which occur when keys are being pressed quickly until the current event is finished without interruption, prevent new events from being activated with TestAndStopRegieEvents. The function ResumeRegieEvents cancels TestAndStopRegieEvent.

6-218

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.4

Regie Functions of the RegieServer

Note You have to make sure, that each call of TestAndStopRegieEvents is followed by a call of ResumeRegieEvents.

TestAndStopRegieEvents

Description Checks whether the Regie has been stopped and prevents events from being activated.

Note If you are sure the Regie already has been stopped by another application (return value 0), calling ResumeRegieEvents might effect the other application in an inadmissible way. So be careful when calling ResumeRegieEvents, if the Regie was not stopped by your own application.

SetModeChannelSwitchKey

Description The function SetModeChannelSwitchKey locks or unlocks the channel switch key.

Note As long as the channel switch key is locked, your OEM application must make sure the MMC--local NCDDE variable /nck/nck/channel is set correctly, if a channel switch becomes necessary.

Terminate

Description This function quits the HMI and all currently active subsystems. Then, a shutdown is initiated.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-219

Regie 6.5 Events of the RegieServer

03.03

6.5

Note

Events of the RegieServer

The Regie Control (Rectlp32.vbx) is no longer available in version 6.0. Instead, the RegieServer must be used. This Chapter deals with the individual functions. The Reference "Regie ­ COM-Server interface" describes the possible functions in deatil and explains necessary arguments.

Note Existing 16Bit applications must be transferred to the RegieServer if they are recompiled. They can access, however, Regie.dll and the Regie Control without recompliation. In this Chapter the events of the RegieServer are described. The event interface of the RegieServer is used by the Sequence Control. Users of the Sequence Control address this event interface indirectly via the Sequence Control. Users creating an own Sequence Control directly access the events of the RegieServer.

Overview

Because the code of the Sequence Control cannot be altered states of the Sequence Control in the events (State_Changed in PRIVATE.BAS) are called synchronously and the user may hook on to it. Regie-Server: Activate Deactivate FormLoad FormUnload QueryForShutdown Sequence Control: AL_ACTIVATE AL_DEACTIVATE, AL_NODEACTIVATE AL_FORMLOAD AL_FORMUNLOAD, AL_NOFORMUNLOAD

The data file ALDEFINE.BAS is extended by the appropriate entries:

Global Const AL_ACTIVATE = ... Global Const AL_DEACTIVATE = ...

...

6-220

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.5

Regie Events of the RegieServer

Note The event Deactivate of the RegieServer shall not be mistaken by the deactivation of an application.

The EventInterface currently consists of one method. In order to use the RegieEventInterface under VB, the RegieServer must be declared with the addition `WithEvents', e.g. Private WithEvents MyRegieServer as RegieServer VB will then automatically provide the method Private Sub MyRegieServer_Notify (ByVal lEvent As Long, ByVal vtParam as Variant, lRetVal As Long)

Note The Sequence Control got already implemented such an interface in the MDIForm1 (in Alstart.frm) and evaluates the RegieEvents.

In VC++ an according interface must be created by the user. HRESULT Notify([in] LONG lEvent, VARIANT vtParam, [in, out] LONG *lRetVal]; The following events are currently supported: FORMLOAD ACTIVATE FORMUNLOAD DEACTIVATE QUERYFORSHUTDOWN GETSPECIALKEY As soon as the Regie has got information for the application, it calls into the method Notify(). The application MUST quit this event. This can be done in one of the two ways: -- synchronously using the ReturnParameter lRetVal, or -- asynchronously using the method AsyncCompleted(); in order to indicate the asynchronous way of quitting is being used the ReturnParameter lRetVal must be set to ­1.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-221

Regie 6.5 Events of the RegieServer

03.03

Events of the RegieServer

In the following text you will find a description of all events of the RegieServer. Generally, there are two series of events which occur during switch--over between area applications: Switch on and switch off of the same area application: Deactivate Ô Activate Switch--over between different area applications: Deactivate Ô FormUnload Ô FormLoad Ô Activate Table 6-18 shows an overview of the events of the RegieServer.

Table 6-18 Events of the RegieServer

event Activate Deactivate FormLoad FormUnload QueryForShutdown

meaning operator has selected an area Operator has deselected an area An iconized area has been selected Area has been deselected Closing applications

Activate

Description Is triggered after activating an area by the user. It is not allowed to modify the focus after the state handling of ACTIVATE because the Regie gives the focus to the active MDI--child window. The application is notified of the Regie event Activate by calling State_Changed in the module PRIVATE.BAS.

6-222

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.5

Regie Events of the RegieServer

Deactivate

Description Is triggered after activating the area bar with Softkey F10 and deactivating the application (the focus switches over to the data area bar of the Regie). The application gets no longer the function keys. If a new area is selected an event FormUnload follows the event Deactivate. The application is notified of the Regie event Deactivate by calling State_Changed in the module PRIVATE.BAS. Tip: The negative acknowledgment of a Deactivate call must be restricted to urgent cases. Possible examples: S Dialog programming: Loading of the simulation S Diagnosis: Determine the configuration Immediately following a negative acknowledgment of this event an event NoDeactivate is generated; here the user can program his commands for that case.

Note After a Deactivate the application is not allowed to process commands which may influence the focus (take care e.g. during asynchronous actions)! The application may now prepare (or at the latest with event FormUnload) a deactivation of the area. Which one of the two events is used, depends on the kind of function: Functions which influence on the focus must now be stopped. Functions which play a part only when unloading the application may be shifted to the event FormUnload.

FormLoad

Description This event is triggered if an iconized area is activated again. The Sequence Control performs a load command for all MDI--Childs which are unloaded in the preceding FormUnload. In this connection the Regie event FormLoad calls the function State_Changed in the module PRIVATE.BAS. The application activates all DDEML--links (LinkMode=1 or LinkMode=2). The event FormLoad is immediately followed by an event Activate.

Note Eine negative Quittierung ist nicht zulässig: Ein im Hintergrund liegender, ikonisierter Bereich muß immer in der Lage sein, geladen zu werden!

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-223

Regie 6.5 Events of the RegieServer

03.03

FormUnload

Description Is triggered during deactivation of an area. The Sequence Control performs an unload command for all MDI--Childs which are projected as unloadable in the .MDI file. The application must take care of closing DDEML--links (LinkMode=0). After acknowledgment (Completed=1) the application is iconized (WindowState=1). If the event is acknowledged negatively (with return value 2 or 3 State_Changed is called immediately with the notification NoFormUnload. Here the user may program his commands for this case. Tip: The negative acknowledgment of a FormUnload is less efficient than Deactivate (the Regie must activate the application again with Activate).

QueryForShutdown

Description

Note Since SW 3.1 two ways are possible to close an application: -- Closing during normal operation -- Closing during closing the Regie (PC--version)

Closing during normal operation: Depending on the configuration of applications (as described in the REGIE.INI) not all applications may reside at the same time in the memory. In these cases some applications must be closed during area switch--over. In the ideal case this runs 'quiet': The Regie issues an event QueryForShutdown , the application acknowledges with Okay and the application is closed without further dialog with the user. Normally the request QueryForShutdown is proposed for applications which remain iconized in the background. If the Sequence Control is used, the Regie event QueryForShutdown calls the function QueryForShutdown in the module SHUTDOWN.BAS. Here the user may program the reaction on an inquiry for quitting. Example In SW 2.2 the user starts an area changeover from Machine to Diagnosis ryForShutdown is sent to the Dialog programming. Que-

If an application responds with NO to QueryForShutdown , then the Regie starts a user dialog, similar to Windows 3.11 (see there under Opening an application with shortage of memory or ressources).

6-224

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.5

Regie Events of the RegieServer

In this case (Dialog programming is loaded, changeover from Machine to Diagnosis) the message is: Not enough memory for area Diagnosis. Please deactivate the area Dialog programming. After acknowledgment of the message by the user the system remains in the area Machine and the user can decide to deactivate the Dialog programming (e.g. to set machine data) or continue with another action. Consequence for area applications: Each area application, which possibly responds with NO to the event QueryForShutdown must offer in the main menu a softkey with the action "Deactivate". If an area is deactivated then an additional QueryForShutdown must be acknowledged with YES. Closing an application when closing the Regie: The above described method is not useful when closing the Regie because the messages are not correct. If an area application is to be closed by the Regie it issues an event QueryForShutdown to all applications concerned. Responding with YES means that the application is closed 'quiet'. If an application responds with NO to QueryForShutdown, then the Regie starts a user dialog, similar to Windows 3.11. See there under Closing of WINDOWS with an active MS--DOS input line. The Regie then issues the message Area Diagnosis still active. Please deactivate that area. After acknowledgment of the message by the user the Regie selects the area which is to be deactivated. The Softkey to close the Regie is ignored.

Note Only functions are allowed which are executable in the iconized state of the area. Furthermore it is not allowed to change the actual focus in the WINDOWS system.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-225

Regie 6.6 Application without sequence control

03.03

6.6

Application without sequence control

For handling a WINDOWS application as an area application you need to take the following steps: 1. Copy the program file to the directory OEM 2. Make an entry in the section TaskConfiguration in the file REGIE.INI in the directory OEM with the placeholder--application OEMFRAME.EXE 3. Install necessary drivers e.g. for a pointing device (mouse) 4. Enter softkey--texts in a softkeytext file in the directory C:\OEM\LANGUAGE 5. Enter special values in a section [PROGRAM NAME] of a file OEMFRAME.INI in the directory OEM

Note It is not possible to enter a WINDOWS application like EXCEL directly in the section [TaskConfiguration] of the file REGIE.INI:

Examplel 6-29 Entries in REGIE.INI

[TaskConfiguration] Task2 = Name := EXCEL ; This does not work! Task2 = Name := OEMFRAME, CmdLine := "C:\\OEM\\EXCEL.EXE"; but this will

Note The OEM frame monitors the application it has started. If the application is closed, the OEM frame closes itself, too.

6.6.1

Entry in the file REGIE.INI

WINDOWS programs are linked with the substitute application OEMFRAME. Example 6-30 Entry in REGIE.INI

[TaskConfiguration] ; Calling the word processing program WinWord with ClassName ; and WindowName and opening the text file Text.DOC Task2 = Name := OEMFRAME, CmdLine := "C:\\WinWord Text.DOC", ClassName := "OpusApp", WindowName := "Microsoft Word" .

6-226

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Note When specifying paths enter a double backslash (\\) instead of a single one (\).

Note You can enter a ClassName or a WindowName It is important to ensure that the window name called WindowName/ClassName can be clearly identified. This is usually only guaranteed if both names are stated.

Note Specifications of the parameter "CmdLine" may not contain any space characters in the directory name or the file name.

Attributes

Valid attributes for a substitute OEMFRAME.EXE are:

Table 6-19 Attributes of substitute application OEMFRAME.EXE meaning Maximum duration provided for running up the OEMFRAME application, in milliseconds. Defines the name of the OEMFRAME application including the command line parameters. Defines whether the standard header is displayed or not. Defines whether the OEMFRAME application is started upon starting the HMI Advanced software or when this is selected for the first time. Defines the access level required to select the OEMFRAME application. ClasseName of the main window of the OEMFRAME application. WindowName of the main window of the OEMFRAME application. Defines which keys processed by the Regie as standard are transferred to the OEMFRAME application. Defines which key is used with active/selected OEMFRAME application to activate the area changeover bar. default 10000 (10 s) "" 1 True

attribute Timeout* CmdLine HeaderOnTop* PreLoad*

AccessLevel* ClassName WindowName GimmeKeys* ShowAppMenuKey* * optional

4 "" "" inactive inactive

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-227

Regie 6.6 Application without sequence control

03.03

6.6.2

Entry in the file OEMFRAME.INI

The initialization file OEMFRAME.INI can be used for additionally parametrizing a substitute application OEMFRAME if needed, but this will usually not be the case. Each WINDOWS program is assigned a special section. The way an application appears on the screen is configured by attributes within a section. Fig. 6-20 gives an overview.

Table 6-20 A section of the file OEMFRAME.INI (example: the editor "notepad")

section notepad

meaning displaying the editor with the attributes: WindowStyle_On = WindowStyle_Off = x=0 y = 100 Width = 560 Height = 325 nDelayInitComplete = xx nSecondsToFindWindow = 30

WINDOW style

Additional information: The appearance of a WINDOWS application on the screen is determined by the WINDOWS--API functions GetWindowLong and SetWindowLong with the argument GWL_STYLE. It is controlled by a word of 8 byte length as shown in table 6-21. With the attributes WindowStyle_On and WindowStyle_Off two of these bytes (marked and described in more detail in the table below) can be changed.

Table 6-21 Ways of configuring the display using WindowsStyle attributes

0000

0000

xxxx 1010 1000 0100 0010 0001

xxxx

0000 caption border) lgframe

0000

0000

0000

scrollbar vertical scrollbar horizontal 1000 0100 system menu Thickframe

6-228

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Table 6-21

Ways of configuring the display using WindowsStyle attributes

0000

0000

xxxx

xxxx 0010 0001

0000

0000

0000

0000

minimize-box maximize-box

The binary values are assigned to the WindowStyle attributes as decimal numbers. Binary numbers can be converted to decimal numbers and vise versa using the WINDOWS calculator usually located in the program group ACCESSORIES. Example 6-31 Determining WINDOWS style

The properties system menu as well as horizontal and vertical scrollbar are to be characterized. Following Table 6--34 these are: 0000 0000 0011 1000 0000 0000 0000 0000 binary or 0038 0000 Hex. S Now call the calculator and S click Hex button S enter the sequence 380000 (leading zeros can be skipped) S click Dec button S select copy from the menu Edit to copy the result 3670016 S insert result to attribute.

Attribute WindowStyle_On:

This attribute characterizes the properties to be assigned to the window. Example 6-32 Attribut WindowStyle_On: The editor NOTEPAD is to be displayed with system menu, vertical and horizontal scrollbar.

[notepad] WindowStyle_On = 3670016

Attribute WindowStyle_Off:

This attribute turns off the properties not to be assigned to the window. Example 6-33 Attribute WindowStyle_Off: The editor NOTEPAD is to be displayed without minimise box and maximise box.

[notepad] WindowStyle_Off = 196608

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-229

Regie 6.6 Application without sequence control

03.03

Attributes X and Y:

These attributes specify the starting coordinates of the WINDOWS application, referring to the upper left corner of the screen as the origin where X is the horizontal and Y is the vertical coordinate increasing downward. The measuring unit is pixel. The available working area is 560 x 325 pixels.

X Y

x,y = 0,0

header

560,0

640,0

0,100

560,100

softkeys

working area

0,425

560,425

0,480 Fig. 6-5

softkeys

640,480

Arrangement of the screen in a pixel coordinate system x, y

Note The application `Header' needs 100 pixels in the Y direction. So if you want to prevent an application from being covered by the header, you have to set Y greater/ equal 100. This has been done in fig. 6--5: the editor is located directly below the header.

Attribute Width:

This attribute sets the width of the window for the WINDOWS application, referring to the origin according the attribute X in pixels.

Attribute Height:

This attribute sets the height of the window for the WINDOWS application, referring to the origin according the attribute Y in pixels.

6-230

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Default setting

If a WINDOWS application is entered in the section [TaskConfiguration] of the file REGIE.INI, but has no special section in the file OEMFRAME.INI, its default values are: WindowStyle_On = 0 WindowStyle_Off = 0 x=0 y=0 Width = width (DesktopWindow) Height = height (DesktopWindow)

Note The values x = 0 and y = 0 will cause the application `Header' to be covered.

Examples

Example 6-34 Settings in the file OEMFRAME.INI for figure 6-6

[programm] WindowStyle_On = 0 WindowStyle_Off = 0 x = 100 y = 150 Width = 300 Hight = 120

X Y header

x,y =

100,150

400,150

program

100,280 400,280

working area softkeys

Fig. 6-6 Example of screen coordinates set by a WINDOWS application program

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-231

Regie 6.6 Application without sequence control

03.03

Attribute nDelayInitComplete:

Once the OEMFRAME has found the window of the application running in the OEMFRAME, it will send an appropriate message to the Regie. The application can then be selected via the Regie. This message can be delayed using the parameter nDelayInitComplete. Such a delay becomes necessary if the application must still carry out actions demanding more time after the window has been created and which have such effects, e.g. that the Regie will display the window not correctly if it is activated too early (Unit: ms, default value 0). Example: After the window has been created, an application plc_app.exe reads further status data from the PLC, which are absolutely necessary to ensure that the application continues to run correctly. The application window may only be displayed after all status data have been read. This reading operation will last approx. 1 sec. on average. The parameterization must be as follows: [plc_app] ;worst case nDelayInitComplete = 2000

Attribute nSecondsToFindWindows:

This setting defines the time after which the OEMFrame cancels searching for the application window. The window to be found by the OEMFRAME is specified by ClassName and/or WindowName in the file Regie.ini. If the window is not found within the specified time, the application can not be managed by the Regie. In such cases, the Regie will output the error message "OemFrame: Didn't post InitComplete". Unit: s, default value 40) Example for an application diagnostic.exe that is assumed to have a very long build--up time (time required to build up the window of the application completely): [diagnostic] nSecondsToFindWindow = 120 You should also make sure that the timeout parameter in the Regie.ini must be adapted accordingly.

Note It is imperative to assign each application an unambiguous ClassName and/or WindowName!

6-232

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Attribute fSearchOnlyForTaskWindow:

This parameter specifies whether or not the window specified in the file Regie.ini via ClassName and/or WindowName also belongs to the task also specified there. If the window belongs to the task, the parameter fSearchOnlyForTaskWindow will be assigned value 1. If the window does not belong to the specified task, fSearchOnlyForTaskWindow must be set to 0. In this case, not only the windows of the task configured in Regie.ini will be taken into account when searching for the specified window, but all windows that exist in the task at the appropriate moment. (flag, default value 1) 1st example The application consists of several processes, e.g. a startup.exe and a user.exe. In the file Regie.ini, (only) the startup.exe must be entered from which then the user.exe is started. The application window belongs to the user.exe and will consequently not be found if only this window is searched among the windows of startup.exe. 2nd example The application is started from a batch file. In this case, too, the window of the application does not belong to the batch process configured in Regie.ini. In both cases, the file oemframe.ini must be configured as follows:

[startup] fSearchOnlyForTaskWindow = 0

Attribute nSwitchToTaskAfterTermination

This parameter controls the behavior when quitting/closing the OEMFRAME application. As a rule, Regie will display the area switchover menu in this situation and the user must explicitly switch over to another task. Using this parameter, it is possible to initiate a switchover to a certain task (e.g. machine) or to a previously active task automatically. Range of values of the parameter: 0 ­ 31 Task0 ­ Task31 ­1 Display of the area switchover menu ­2 Switchover to the previous active task (Unit: task number, default value: --1) Example: When quitting the application closeapp.exe, it will be switched over to Task1: The following parameterization is required: [closeapp] nSwitchToTaskAfterTermination = 1

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-233

Regie 6.6 Application without sequence control

03.03

Note Do not parameterize the task that has currently been closed or quitted! In the example above, the following parameterization would be forbidden if closeapp.exe corresponds to Task16:

[closeapp] nSwitchToTaskAfterTermination = 16

Attribute fRestoreTaskWindow

This parameter determines the behavior of OEMFRAME when quitting an application that has been started from the OEMFRAME application (so--called second task level). This situation cannot be controlled completely by OEMFRAME and should therefore be avoided if possible! By default, OEMFRAME saves the window last active (ForegroundWindow) when the OEMFRAME application is deselected. This window will be re--enabled when the OEMFRAME application is selected again. If another application has been started from the OEMFrame application, the active window will usually belong in this application.

OEMFRAME --> OEM application --> Application --> ForegroundWindow

basic window

OEMFRAME will not see that this application is quitted. Consequently, OEMFRAME can also bring the OEMFRAME application window to the foregound in this situation what sometimes has the effect that wrong scenarios are shown when quitting the second task level. In this case, a certain remedy is provided by the parameter fRestoreTaskWindow. If this parameter contains the value 1, OEMFRAME will always activate two windows when the OEMFRAME application or the application started from the OEMFRAME application is selected. First, the basic window of the OEMFRAME application is always brought to the foreground, and the "ForegroundWindow" is placed over this window. This guarantees that when quitting the second task level the basic window of the OEMFRAME application appears in all cases.

6-234

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Restrictions: If a modal window (dialog box) is active in the OEMFRAME application when the 2nd application is started, then this modal window will lose the input focus when the 2nd application is quitted. In this case, the operator must position the focus explicitly (e.g. using the mouse) on the dialog box. (The task manager of Windows NT will show the same behavior when switching over with ALT--TAB.) Alternative variant: The 2nd application is embedded in the Regie as a separate application/task. In this case, the OEMFRAME application can start this application/task using a Regie method. Furthermore, the OEMFrame of this application/task will be configured such that it is automatically switched over to the original application/task when the application/task is quitted (nSwitchToTaskAfterTermination). fForceTaskFocus (flag, default value . 0) fSearchForPopUps (flag, default value: 1) The two parameters must be discussed together. By default, OEMFRAME saves the window of the OEMFRAME application which was last active when switching over to another task. This window wil be reactivated when the application is selected again. In Windows API, this window is called ForegroundWindow.

OEMFRAME --> OEM application --> ForegroundWindow fForceTaskFocus=0 fSecondForPopUps: irrelevant

basic window

This (default) behavior is recommended for the major part of the applications. There are, however, exceptions for which this behavior can be changed. If the two parameters fForceTaskFocus and fSearchForPopUps are set to the value "1", then it is switched over not to the ForegroundWindow when quitting the OEMFRAME application, but to an active pop--up window that belongs to the basic window of the application. If a pop--up window is found, this is displayed when the OEMFRAME application is selected again. If no pop--up window exists, the basic window of the application is displayed when the application is selected again.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-235

Regie 6.6 Application without sequence control

03.03

OEMFRAME --> OEM application --> PopUpWindow fForceTaskFocus=1 fSearchForPopUps=1

basic window

The search for an active pop--up window is be carried out if the parameter fSearchForPopUps is set to the value "0". In this case, only the basic window of the OEMFrame application is taken into account when the application is selected/deselected. The basic window is specified in the file Regie.ini using ClassName and/or WindowName.

OEMFRAME --> OEM application fForceTaskFocus=1 fSearchForPopUps=0 basic window

6-236

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.6

Regie Application without sequence control

Attribute fKeepPlacement

This function is used to deactivate the zooming carried out by OEMFRAME for the basic window of the OEM application. As a rule, the application is zoomed to screen size before it is displayed. In the case of applications that do not permit zooming of their windows, zooming can result in display problems. In such cases, zooming must be disabled. Example: An application fixres.exe is to be displayed in its programmed window size: [fixres] fKeepPlacement = 1 nInitShowMode (Unit: ShowMode, Std: SW_SHOWMINNOACTIVE)->Start nShowMode (Unit: ShowMode, Std: SW_SHOWNORMAL)->Unhide nUnShowMode (Unit: ShowMode, Std: SW_SHOWMINNOACTIVE)->Hide The three parameters above determine in which form the application window is displayed when the application is started and when the application window is hidden/unhidden. The parameter nShowMode refers to unhiding (task is activated), and the parameter nUnShowMode to hiding. The following range of values exists for the two parameters: 1. The application window is hidden (SW_HIDE). 2. The application window is displayed in its original form (position, size) and receives the input focus (SW_SHOWNORMAL, SW_NORMAL). 3. The application window is minimized in and receives the input focus (SW_SHOWMINIMIZED). 4. The application window is maximized (SW_SHOWMAXIMIZED). 5. The application window is displayed without receiving the input focus (SW_SHOWNOACTIVATE) 6. The application window is displayed and receives the input focus (SW_SHOW). 7. The application window is minimized and loses the input focus (SW_MINIMIZE). 8. The application window is minimized without receiving the input focus (SW_SHOWMINNOACTIVE). 9. The application window is displayed without receiving the input focus (SW_SHOWNA). 10.The application window is displayed in its original form (position, size) (SW_RESTORE). 11. The application is displayed as it was when the application was started (SW_SHOWDEFAULT).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-237

Regie 6.7 Embedding an OEM application in the HMI

03.03

Note The default settings are correct for the applications. With some applications developed with Borland--Delphi, however, display problems can occur (offset windows and the like). In this case, setting the parameter nUnShowMode =0 and fKeepPlacement=1 has been turned out to be a good remedy.

6.7

Embedding an OEM application in the HMI

For installing the software there are several menus which can be activated during system start--up.

6-238

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.8

Regie Adding help support

6.8

Adding help support

Overview

Microsoft--WinHelp files for NC applications on MMC 103, that are navigated via softkeys, can be created with the application Remote Help (called Rh in the following). The standard WINDOWS application WinHelp can be integrated in the MMC system as an area application using the substitute Rh (Remote Help). Task3 = Name := RH, Timeout := 10000, ÄHeaderOnTop := False

Entry in REGIE.INI

The substitute application Rh is entered in the section [TaskConfiguration]. Example 6-35 Entries in the file REGIE.INI

[TaskConfiguration] ... Task8 = Name := RH, Timeout := 30000 PreLoad := False ... [Miscellaneous] HelpTaskIndex = 8

This entry must exist, whenever an implicit selection of areas is to be performed via SwitchToHelpTask. So SwitchToHelpTask represents a simplified notation for SwitchToTask(HelpTaskIndex)

Note Theoretically any task may be assigned to the HelpTaskIndex. The Info--key represents a kind of HotKey or ShortKey, that allows a direct area selection (without detour via the Regie softkey bar, analogue to the area--key Machine).

Calling Rh

There are two ways of calling Rh: S area changeover via Regie S pressing the Info--key within an application (or the function key F12 of a standard keyboard) In the first case the table of contents of the help file is displayed. For reading the help--information, move selection to the keyword and press the softkey follow cross reference.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-239

Regie 6.8 Adding help support

03.03

In the second case the application must make sure, that the two variables (helpflag and helpcontext) have been set before the call. When RHelp is terminated with the softkey OK, the Regie returns to the calling application

Communication

The communication is carried out according to the client--server architecture : The application (client) requests for help texts from Rh (server) using the NC--DDE variables helpflag and helpcontext.

Variables

The variables must be preset in the NC-DDE initialization file (NSK file) as follows: NEW("helpcontext","c:\\vb\\vb.hlp|Index") NEW("helpflag",,"off")

Note If the variables have not been declared, a DDE--connection cannot be established. In this case the default help file and the default context are displayed.

helpflag: When starting the Regie, the variable helpflag is set "off" (to prevent Rh from starting too early.). Before calling the help function helpflag must be set "on". helpcontext: In the variable helpcontext the help file and the index to be searched for (separated by a pipe symbol "|"), are passed to Rh. Example: The character string c:\vb\vb.hlp|Hide indicates, that the help concerning the term "Hide" may be read from the help file "c:\vb\vb.hlp".

Using Rh

Having called Rh the softkeys may be used for navigating the help text according to table 6-22:

6-240

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 6.8

Regie Adding help support

Table 6-22

Softkeys for using Rh

softkey page down page up previous selection next selection follow cross reference back

meaning/action The help text is scrolled down one page The help text is scrolled up one page The selection is moved up one item The selection is moved down one item RHelp instructs WinHelp to take the current selection as a new index item and to display it. RHelp causes WinHelp to return to the previously displayed index item. This is possible until the first index item for which help was requested is reached. RHelp causes WinHelp to display the table of contents quit RHelp adding additional information to the help entry

content OK notebook

Notebook

The notebook feature allows the user to add own texts to an existing help file. entry the user record cancel show Rh opens a text field, where can type in additional information concerning the subject specified in the variable [helpcontext]. with the key OK with the key cancel with the next call of the help function

The information is stored in a file located at the subdirectory user\rh. The file name is generated using the help file name and the help context (e.g. Ihelpcontext.txt).

user rh Subdirectory for Remote Help . . . .txt File with notebook containing the additional information

Fig. 6-7

Storage location of the additional info for help texts

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

6-241

Regie 6.8 Adding help support

03.03

6.8.1

Creating an alarm help file

First create an RTF file and a HPJ file, with key words, that are equal to the alarm numbers. Then the Microsoft help compiler HCP.EXE can then uses them for generating the help file. You may not utilize all existing foot notes. The following foot notes are supported: # $ K context string, name of the help topic title, defines the Topic Title, that appears in a List Box during a search keywords, which may be assigned to the topic

6.8.2

Creating an own help mechanism

If your own help mechanism is to replace the supplied help, first trap the event AL_HELPINFO (info--key pressed) in the function State_Changed of the Sequence Control and then acknowledge it with AL_SwitchToTaskForHelp. From then the job of giving help information is passed over from the Sequence Control to the user. That gives you a chance to activate your own help mechanism.

6-242

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Sequence control

Overview

7

The configuration of the user interface is carried out in Visual Basic Professional. Each application component (window) is opened as a subwindow (MDIchild or application--modal window) within a frame (MDIframe).

Features

The sequence structure provides a frame for SIEMENS standard applications and compatible OEM applications. It offers the following features: S managing the Sequence Control (`menu tree' consisting of states) S query of the softkeys (vertical and horizontal) S query of the NC special keys S displaying the softkey texts S managing the interactive prompt line S language support

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-243

Sequence control 7.1 Introduction

03.03

7.1

Introduction

Summary

This chapter should give you a good idea of the terms and functions of the Sequence Control.

States

The central element for describing the Sequence Control is the state. It is characterized by: S unique state number S initial state S text indices for horizontal and vertical softkeys. Softkey texts are located in a DLL. S list of the MDIchilds to be opened during execution of an application S return string: is passed to an application when a special state is reached with State_Changed or State_Reached S z--flag: save or quit settings The initial state is stored in the first line of a state matrix (file with the name extension ZUS). In the structure diagrams a state is represented by the symbol according to fig. 7-1.

State 1

0

Fig. 7-1

1

2

3

4

5

6

8 9 10 11 12 vertical 13 softkeys 14 15 7

horizontal softkeys

Symbol representing a state

7-244

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Sequence control 7.1 Introduction

Menu tree

These symbols can be combined to a menu tree. Fig. 7-2 shows an example.

8 9 10 11 12 13 14 15 7

state 1

0 1 2 3 4 5 6

state 2

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 3

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 4

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 5

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 6

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 7

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

state 8

0 1 2 3 4 5 6

8 9 10 11 12 13 14 15 7

Fig. 7-2

Example of a menu tree

Actions

Actions result in state transitions. The actions at the operator interface are triggered by S pressing a horizontal softkey S pressing a vertical softkey S pressing the RECALL key S mouse click S change of operation mode. S Actions due to softkey operations are listed in the state matrix (file with the extension ZUS).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-245

Sequence control 7.2 Your first OEM application

03.03

State transitions

Examples for state transitions are: S overwrite sub--windows by other sub--windows S build up DDE connections to variables of the newly opened sub--windows S label softkeys

Files

The Sequence Control of an application PROGNAME utilizes the following six files S REGIE.INI S MMC.INI S PROGNAME.INI S PROGNAME.MDI S PROGNAME.ZUS S LANGUAGE.DLL The files REGIE.INI and MMC.INI have been discussed in the preceding section. Each application PROGNAME has an initialization file containing application--specific information. The file name is stored in the module PRIVATE.BAS as a constant. (initial state) (components of an application, e.g. windows) (descriptions of states and actions)

7.2

Your first OEM application

Summary

With an example this chapter should help you to get started with creating simple OEM applications. It is built up on the OEM example 0.

7-246

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.2

Sequence control Your first OEM application

7.2.1

Directory structure

C:\MMC_OEM.V52

AB ADD ON LANGUAGE

Installation drive (corresponds to drive L:\)

Sequence Control additional Siemens products directory for the language DLLs of additional products

. . .

HMI_ADV ALTMP DH DI_TMP HD MMC2 LANGUAGE RE_xx.INI .. temporary files Datea Management temporary files header files standard user interface MMC102/MMC103 (may not be modified) lanuage files of the standard system hor. und vert. SK texts, highest level lanuage DLLs, text files

.. OEM REGIE.INI USER.NSK .. LANGUAGE O0_GR.DLL .. .. OEMBSPO OEMBSPO.MDI OEMBSPO.ZUS OEMBSP1 OEMBSP1.MDI .. .. MDI-Childs for OEM-example 0 state matrix für OEM-examplel 0 RE_xx.INI directory for OEM applications (.EXE and .INI) OEM-spezific REGIE-INI (differences only) OEM-spezific file directory for the language DLLs German DLL für OEM-example0, language-DLLs, text files difference from \MMC2\LANGUAGE\RE_xx.INI

MDI-Childs für OEM-example 1

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-247

Sequence control 7.2 Your first OEM application

03.03

RE SAMPLERS.OEM LANGUAGE .. OEMBSPO OEMBSPO.WRI OEMEXPO.WRI OEMBSPO.WRI SRC OEM-example 0 description of the example in German description of the example in Englisch reference to the MDI- and ZUS-file, must be copied to \OEM the example's source code Array containing the FormNames OEM.FRM OEMBSP0.MAK OEMBSPO.MDI OEMBSP0.ZUS PRIVATE.BAS PVERSION.BAS SHUTDOWN.BAS OEMBSP12 OEMBSP12.INI USER REGIE.INI USER.NSK .. LANGUAGE RE_xx.INI directory for the Sequence Control's language DLLs Difference from \MMC2\LANGUAGE\RE_xx.INI directory for the user's modifications user--spezific REGIE.INI user--spezific NSK files forms in VisualBasic the project's Makefile the applicatio's MDI-Childs states and actions see Chap. 7.3.3 see Chap. 7.3.3 see Chap. 7.3.3 OEM-directory (in connection with the OEM package only) language files for OEM projects

..

OEM-example 12

..

..

7-248

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.2

Sequence control Your first OEM application

The Siemens user interface automatically enters settings which differ from the default settings in the directory USER and its subdirectories as soon as the user accordingly adapts the interface. OEM--extensions in the files MMC.INI, REGIE.INI and RE_xx.INI (in the directories ADD_ON, OEM and USER) referring to the standard system (in the directory MMC2) are collected during the Regie's start up in the following order of priority: MMC2 (fix system settings) ADD_ON OEM USER

Note The files MMC.INI, REGIE.INI and RE_xx.INI are taken as difference to the corresponding predecessor, i.e. the information is collected. In the case of the USER.NSK the last one found is valid. It completely replaces its predecessor.

7.2.2

Directory structure of SW 6

The directory structure of the HMI environment software version 6 is as follows:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-249

Sequence control 7.2 Your first OEM application

03.03

New developments: S In HMI adv you will find ­ the area applications including their ini files ­ dll files and ­ other MMC--specific data. S In Mmc2 you will find installed ­ the servers and COM objects (NCDDE, MBDDE, DH servers, AR servers ­ the Regie and the according INI and NSK files from HMI base (REGIE, MMCctrls, Ivar, IMCFile ...) and ­ MMC.INI. All other directories are used as in the previous edition.

7.2.3

Building the framework

Step 1

Create a directory BSP_1 under the path L:\SAMPLES.OEM and copy the contents of the directory "L:\SAMPLES.OEM \Oembsp0" with subdirectories to the new directory "L:\SAMPLES.OEM \BSP_1".

Step 2

Rename the following files: L:\SAMPLES.OEM\BSP_1\ OEMBSP0.INI L:\SAMPLES.OEM \BSP_1\BSP_1.INI L:\SAMPLES.OEM \BSP_01\SRC OEMBSP0.vbp OEMBSP0.MDI OEMBSP0.ZUS OEM0.FRM BSP_1.vbp BSP_1.MDI BSP_1.ZUS OEMFRM1.FRM

Step 3

Copy the following language files: (DLLs) L:\OEM\LANGUAGE\ O0_GR.DLL O0_UK.DLL BSP_1_GR.DLL BSP_1_GR.DLL

7-250

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.2

Sequence control Your first OEM application

Step 4

Start Visual Basic and open the project L:\SAMPLES.OEM \BSP_1\BSP_1.vbp Acknowledge the following error message with OK: "File not found 'OEM0.FRM'" Remedy: Use the menu item FILE/ADD File to add the file "OEMFRM1" to your project.

Step 5

Load the form "OEMFRM1.FRM" and change the following properties of the FORMS to "OEMFRM1" S Caption S Name S Tag

Note The properties are case sensitive!

Step 6

Load the module "AMAIN.BAS" and modify the following line of this module: Set g_frmFormName(0) = OEMFRM1

Step 7

Load the module "PRIVATE.BAS" and modify the following line of this module: Global Const TempFile = "BSP_1.6$$" Global Const LOCAL_PROFILE = "BSP_1.INI" Global Const APPL_PREFIX = "BSP_1"

Step 8

Open the file "BSP_1.INI" and modify the following lines: MDIList=BSP_1\BSP_1.MDI ControlFile=BSP_1\BSP_1.ZUS Copy this file to the directory "L:\OEM", too.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-251

Sequence control 7.2 Your first OEM application

03.03

Step 9

Open the file "BSP_1.MDI" and modify the following line: OEM0 "1" change to OEMFRM1 "1"

Step 10

Open the file "BSP_1.ZUS" and modify the following line: [0] 0 0 " OEMFRM1" "" "0" 0

Step 11

Create the subdirectory "BSP_1" in the directory L:\OEM and copy the files "BSP_1.ZUS" and "BSP_1.MDI" to this location.

Step 12

Start the application by clicking F5 in Visual Basic Then the error: "Must have startup form or Sub Main" appears: acknowledge double click Sub Main S select "MDIForm1"

Step 13

Use the Visual Basic's menu item "Make EXE File" to create an executable file. Select "L:\OEM" as destination directory.

Step 14

Enter the following line in the section [TaskConfiguration] of the file "REGIE.INI" in the directory "OEM": Task6 = name:=BSP_1, Timeout:=50000

Step 15

Add the following line to the files "RE_GR.INI" and "RE_UK.INI" in the directory "OEM\LANGUAGE" HSK6="My example"

Step 16

Start the file Regie ( REG_CMD.EXE )

7-252

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.2

Sequence control Your first OEM application

Overview

Overview of the resulting menu tree:

L:\ OEM BSP_1.EXE BSP_1.EXE REGIE.INI BSP_1 BSP_1.MDI BSP_1.ZUS

LANGUAGE BSP_1_GR.DlLL BSP_1_UK.DLL RE_GR.INII RE_UK.INI

7.2.4

Adding an additional window / form

Step 1

Use Visual Basic to add a new form. Enter any string of your choice in the properties Caption, Name and Tag e.g. OEMFRM2.

Step 2

Copy the following Visual Basic routines of the first form S Form_Activate S Form_Deactivate S Form_Load

Step 3

Insert the following line in the file "AMAIN.BAS" Set g_frmFormName(1) = OEMFRM2

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-253

Sequence control 7.2 Your first OEM application

03.03

Step 4

Insert the following lines in the file "L:\OEM\BSP_1\BSP_1.ZUS" [1] 0 0 0 - -1 -1 1 - -1 -1 ... 15 - -1 -1 " OEMFRM2" "" "0" 0 "" "" "" "0" 0 "1" -1 "15" -1

Step 5

Insert the following line in the file "L:\OEM\BSP_1\BSP_1.MDI " OEMFRM2" 1

7-254

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.3

Sequence control Files of the Sequence Control

7.3

Files of the Sequence Control

7.3.1

Initialization file

Overview

Each application PROGNAME has an initialization file containing application--specific information. The file name is stored in the module PRIVATE.BAS as a constant. Definition of an application's INI file as a constant in the module PRIVATE.BAS: Global Const LOCAL_PROFILE = "PROGNAME.INI" This INI file contains among others the following sections (Table 7--1):

Table 7-1 Sections of the file PROGNAME.INI

section CONTROL

meaning directories for softkey pictogram control files, help files and user pictures. example: state matrix PROGNAME.ZUS setting the DEBUG support for the development system. example: full screen

DEBUG

INI file of an OEM-Applikation

Examplel 7-1 INI file of an OEM--application

[CONTROL] MDIList = <progname>.mdi ControlFile = <progname>.zus ; directories for softkey pictograms, ; control files, help files SKPICTO=..\skpicto\ ; directory for user pictograms HLP_DIR=..\hlp\ ; Initial state: If there is no entry present, then the value of Ä INIT_STATE (from PRIVATE.BAS) is assumed as initial state.. InitState=0 ; if the NCCDE-Server is not started (for tests) NO_NCDDE=1 [DEBUG]; MDISize 0 = Debug (for PC), 1 = Full screen (for control) ; When starting via the Regie `Full Screen' is set automatically. MDISize=0; info-, RECALL-, Stop-Button: 0 = button unvisible, i_Button=1 Stop_Button=1 1 = visible

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-255

Sequence control 7.3 Files of the Sequence Control

03.03

7.3.2

Modules and forms of the Sequence Control

The files of the Sequence Control are located in the directory ..\AB. They are listed in table 7--2.

Table 7-2 Files of Sequence Control

file ALCOMMON.BAS ALDECL.BAS ALDEFINE.BAS ALDIALOG.FRM ALENVIR.BAS ALHELP.FRM ALHSOFT.FRM ALLAFCT.BAS ALMODAL.FRM ALPRINFO.BAS ALSTART.FRM

contents collection of functions and procedures for general use contains global variables and data structures contains general constants as for example the screen positions of MDIchilds form for the dialog line: this line is currently being used by the Sequence Control for test output contains functions and procedures, that determine search paths and environment variables form for display of help texts program code for processing of horizontal softkeys program for language switch--over: Manages loading and unloading of forms. standard form for application--modal output test program, e.g. to output the window types the start form (MDIframe) ALSTART.FRM contains among others a label field called SetState, that can be served via a DDE--connection. A change of this text field causes the method SetState_Change to call the procedure Set_State. program code for processing of vertical softkeys contains procedures for the trace feature (internal function only) Bibliothek interner Funktionen und Prozeduren der Ablaufsteuerung (16-Bit-Version) Bibliothek interner Funktionen und Prozeduren der Ablaufsteuerung (32-Bit-Version)

ALVSOFT.FRM ALWTRACE.BAS AB16.DLL AB32.DLL

Only the use of the complete Sequence Control is being supported. If you skip any part, you must take care of the consequences by yourself.

Note You are not allowed to make any changes in these files!

7-256

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.3

Sequence control Files of the Sequence Control

7.3.3

Modules of the application

In addition to the application--specific forms, the application has to provide the following files (Table 7-3):

Table 7-3 Files added by the application

file PRIVATE.BAS

contents contains among others the procedures Private_Init_Def, Private_Init and State_Reached, the function State_Changed and application--specific declarations, procedures and functions. contains information about how to terminate the application. You can find a description of the function QueryForShutDown which is called there in chapter 6.5 under the event of the same name QueryForShutDown.

SHUTDOWN.BAS

Each application must be added a file called SHUTDOWN.BAS. The file may be copied from the SRC directories of the example applications. If this file is missing, an error message is issued by the compiler.

7.3.4

Temporary files of the Sequence Control

The Sequence Control uses temporary files (with the extension .6$$, starting from software release 6.x .6$$), that are stored in a special directory for temporary files, e.g. \ALTMP. The default value C:\ALTMP for the temporary directory is set in the section [Directories] of the initialization file MMC.INI. This directory is created automatically when the MMC 102 base system is installed.

Note Delete this file, if you have modified the order of the states in your application.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-257

Sequence control 7.3 Files of the Sequence Control

03.03

Global constants

The module ALPRDECL.BAS is supplied for defining global constants in an application: It contains patterns for private Defines and Declares. If used, it should be copied to the respective application directory. The constants needed are selected by just deleting the REM identification.

Note Store the global constants in a separate file.

7-258

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

7.4

Language support for your applications

Overview

An application consists of language independent parts like the program code and language dependent parts like dialog texts. In order to keep the user interface language independent, some configuration requirements must be fulfilled: S For each foreign language the minimum legible size of the fonts is of great importance. ( e.g. in far eastern languages the fonts usually need to be 16 pixels high ). S It must be possible to modify and translate each text -- independent of the program code. For this reason language dependent texts are located in DLLs.

7.4.1

User interface and language

Foreign languages

The language dependent part of an application is loaded from a library ( Dynamic Link Library ) supplied by the application. This for example applies to: S labeling of all horizontal and vertical softkeys S text fields with dialog boxes, forms and display fields. Organization The language dependent files are stored in a directory named LANGUAGE. The example shows the storage of the language DLLs of the OEM example 1, which is described in detail in chapter 12.

Organization

The language dependent files are stored in a directory named LANGUAGE. The example shows the storage of the language DLLs of the OEM example 1, which is described in detail in chapter 12.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-259

Sequence control 7.4 Language support for your applications

03.03

Where to store language-DLLs

Example 7-2 Where to store language--DLLs

C:\ OEM LANGUAGE O1_GR.DLL O1_UK.DLL Installation driveI OEM directory language dependent files language DLL for OEM example 1 in German language DLL for OEM example 1 in English

Name of the language DLL

The name of the language DLL is defined in the same way as the name of the file LANGUAGE.INI of the REGIE:

<project contraction>_<language contraction>.dll

Project contraction may not exceed 5 characters, language contractions may not exceed two characters. Both are to be separated by an underscore "_". The project contraction is defined in the module PRIVATE.BAS:

Global Const APPL_PREFIX = "O2"

The possible language contractions are found in the table 11--27.

7.4.2

RC files for texts

First of all texts are entered in RC--files (Resource Compiler) and then are converted to a DLL in a Visual C++--environment which must be available when starting a configuration.

Text entry

When dialog boxes and forms are configured, the text labels to be displayed on the screen must be entered with a unique and sequential text number ( text--Id ) in the RC--file. We recommend to store the labels to be displayed with Visual Basic as arrays, to initialize them with the current texts and to enter these texts serially in the RC--file.

Text areas

The first entries in the RC -- file are reserved for the starting position of each text area (Table 7-4):

7-260

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

Table 7-4

List of text identification

text-Id 0 1 2 3 ff.

meaning start position for the texts of the horizontal softkey -- bar start position for the texts of the vertical softkey -- bar start position for the application--specific texts of dialog boxes and forms at the user's disposal

End of text areas

The text indices of the horizontal and vertical softkey bar (and thus for the texts) may not contain any gaps within the respective area of the horizontal, vertical and application--dependent texts. ( Null - String is the abort criterion when loading these texts! ) Indices of application dependent texts may contain gaps.

Comments in the RC file

To support the translator of an external agency translating the existing RC files in a foreign language, it is useful to give two information as comments: S maximum text length, e.g. //50 means 50 characters S notes explaining the meaning of the texts so he can find proper abbreviations. Besides that comments can be used for clearly structuring large RC files. As an example we show a compressed excerpt from the RC file for the application machine. It can be found in full length under MA\LANGUAGE\MA_.RC.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-261

Sequence control 7.4 Language support for your applications

03.03

Excerpt from the RC file

Example 7-3 Excerpt (compressed) from the RC file for the application machine

STRINGTABLE BEGIN 0 "10" // startindex for horizontal softkey-text 1 "1000" // startindex for vertical softkey-text 2 "2000" // startindex for text, messages, errors ... END //------------------- Horizontal Softkeys --------------------------STRINGTABLE BEGIN 10 " " 11 "Work-piece" // two line texts 12 "Global SP" // complete sequence of the text indices 13 "Macros" END //--------------------- Vertical Softkeys --------------------------STRINGTABLE BEGIN 1000 " " 1001 "show G codes" 1002 "show auxiliary functions" 1003 "Sspindles" END //----------------- normal text, messages, errors ------------------// --- organized in several tables for better overview --// global.bas STRINGTABLE BEGIN 2000 "MKS" // 10 2001 "WKS" // 10 2005 "communication to NC broken down" //50 END // BigIst.frm STRINGTABLE BEGIN 2101 "MKS" // 8 2102 "Position" // 14 END

Start-form and DLL

The start -- form ( ALSTART.FRM, component of the Sequence Control ) opens this DLL and copies the first three start values to the variables g_nBegin_Hsoft, g_nBegin_Vsoft and g_nBegin_App.

Processing of the Load-Method

In the Load - method of each MDIchild a code section has to be provided by the user, that loads -- if necessary in a loop -- the texts from the according DLL -- area and copies them to the internal text array. A flag might prevent the texts from being reloaded every time the Load -- method is called.

7-262

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

Softkey texts

The texts for the horizontal respectively the vertical softkey bars are read from ALHSOFT.FRM respectively ALVSOFT:FRM by the Load - method. Reading an area continues, until either the new area is reached or a gap in the text--Ids is being detected. For example: reading the horizontal softkey texts continues up to the starting index of the vertical texts if there is no gap found in the text--Ids.

7.4.3

Creating the language DLL

The language DLLs for the texts of the Sequence Control are created from the corresponding RC files using the Visual C++'s application studio.

RC file location

The RC files storing the texts of the Sequence Control and of the complete DLL (Excerpt for OEM example 0) are stored as shown in the example below. S The source for the language file is located in the directory C:\Siemens\Sinumerik\HMI ProgrammingPackage\HMI environment\OEMSamples. S The destination for the language file is the directory C:\Siemens\ Sinumerik\HMI advanced\Oem\Language.

Creating the language DLL in English Step 1

Start Visual C++ 6.0

Step 2

Create a new project using the menu File - New ... ->

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-263

Sequence control 7.4 Language support for your applications

03.03

Step 3

Click the tab Projects in the dialog box "New" and enter the following information: S MFC AppWizard (dll) S Project name: enter <project name>, e.g. o16_gr; the DLL is named <project name>.dll; e.g. o16_gr.dllenter location <directory>, e.g. c:\siemens\mmc103\samples.oem\language\gr (In this directory a new subdirectory <project name> is created which comprises all files and directories of the project.)

Step 4

Confirm all other settings and quit the dialog box "New" with OK.

Step 5

Select the following options in the dialog box "MFC AppWizard Step 1 of 1": S What type of DLL would you like to create? Regular DLL using shared MFC DLL

Step 6

Quit the dialog box "MFC AppWizard Step 1 of 1" with Finish.

Step 7

Exit the following dialog box "new Project Information" with OK. Now all files and directories necessary for the project are created.

Step 8

Open the resource kit <project name>.rc2 in the sub--directory "res" with File - Open ... Open as: Text. ->

7-264

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

Step 9

Insert language--specific texts by "including" the existing 16Bit text resource scripts (e.g. #include "o16_.rc"): S Copy the existing resource file (o16_.rc) into the sub--directory "res". S Make sure the last END command is followed by a return since else an error message is produced during the generation of the DLL.

Note The 16Bit text resource scripts can generally be kept in the existing form. The file <project name>.rc2 should not contain new texts, it contains exclusively the include commands bringing together all text resource scripts (*.rc files) required by an application.

Example:

// // o16_GR.RC2 -- resources Microsoft Visual C++ does not edit directly // #ifdef APSTUDIO_INVOKED #error this file is not editable by Microsoft Visual C++ #endif //APSTUDIO_INVOKED #include "o16_.RC"

/////////////////////////////////////////////////////////////// // Add manually edited resources here... //////////////////////////////////////////////////////////////

Step 10

Open the resource script <project name>.rc (e.g. o16_gr.rc) which has been generated by the Wizard in the created directory (e.g. o16_gr) with File - Open ... -> Open as: Text and delete the version information.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-265

Sequence control 7.4 Language support for your applications

03.03

Example:

///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1,0,0,1 PRODUCTVERSION 1,0,0,1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x1L #else FILEFLAGS 0x0L #endif FILEOS 0x4L FILETYPE 0x2L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040704B0" BEGIN VALUE "CompanyName", "\0" VALUE "FileDescription", "o16_gr DLL\0" VALUE "FileVersion", "1, 0, 0, 1\0" VALUE "InternalName", "o16_gr\0" VALUE "LegalCopyright", "Copyright (C) 2000\0" VALUE "LegalTrademarks", "\0" VALUE "OriginalFilename","o16_gr.DLL\0" VALUE "ProductName", "o16_gr Dynamic Link Library\0" VALUE "ProductVersion", "1, 0, 0, 1\0" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x407, 1200 END END

Step 11

Save the resource kit.

Step 12

Generate the DLL. Make sure the `release' mode is used for generation and not the `debug' mode. The DLL gets the name <project name>.dll.

Step13

Copy the generated file <project name>.dll into the directory OEM\LANGUAGE to the other dlls.

7-266

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

7.4.4

Asian languages

The following fonts are used to display language--dependent texts in Asian languages: S MS Song (Simplified Chinese) S MingLiU (Taiwan/Standard Chinese) S MS Mincho (Japanese) S Gulim (Korean) The fonts are delivered with the corresponding language packages and thus avail-able after installing the language packages. When performing the installation, the entries required by the applications to display the languages during runtime are made in file MMC.INI. The language--dependent texts are generated in the form of resource and/or text files. For this, you must use the same codepage as that one used when displaying the texts during program runtime. This codepage is stated in the configuration file MMC.INI in the section concerning the relevant language, e.g.: [China] ... CharSet=936 ...

;Simplified Chinese

Codepage 1252 must be used to generate the language DLL. For this purpose, the instruction #pragma code_page (1252) is entered in the resource file (.RC file). In the OEM application, you must ensure that the font properties of the controls used for the output (such as label) have been set correctly before outputting the language--dependent texts. To do this, call up the function SubSetTCtrlAttr (see chapter 7.7.9) of the User's Guide when displaying a form for the first time resp. after language switchover for all controls used to display language--dependent texts. The function SubSetTCtrlAttr sets the font properties of the controls accordings to the entries made in the file MMC.INI. When Frame Controls are used in a VisualBasic application, one instance of the McJapFrameHook control (McJapaneseFrameHookMod.dll) must still be placed in each form containing VB Frame Controls. This instance is stated when calling up the function SubSetTCtrlAttr in place of all Frame Controls existing in one form, such as SubSetTCtrlAttr McJapFrameHookl, TCTRL_FRAME_HEADER. McJapFrameHookl is the name allocated by the programming engineer for the instance of the McJapFrameHook control. The McJapFrameHook control must be initialized by calling up the Actualise Frames method. This is carried out typically in the Form_Load event of the form affected (e.g. McJapFrameHookl.ActualiseFrames).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-267

Sequence control 7.4 Language support for your applications

03.03

7.4.5

Language selection

Use the softkey 'select language' for configuring the control for other languages. Literature: /IAD/ Installation and Start--Up Guide 840D, Chapter 13 MMC, Configure 'Language selection' softkey.

7.4.6

Editing Texts Using Codepages Different From the Codepage Used by the Operating System

This chapter describes how to edit "multi--byte character" texts in languages which do not belong to the same language family as does the language currently used by the operating system (e.g. editing cyrillic texts on a "german" Windows 2000/XP). These cases require the use of codepages different from the codepage currently used by the operating system.The described procedure applies to both operating systems, Windows 2000 and Windows XP. For text editing the program Microsoft Word 2000 is used. All text files must have the extension ".txt".

Editing an already existing Text

S Select the "Open..." command in the "File" menu. The "Open" dialog pops up. S Select as file type "Encoded Text Files (*.txt)" and then select the file you want to edit.

7-268

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

S Click the "Open" button. The "File Conversion" dialog appears.

S Select the encoding to be used and click "OK". The selected file gets opened for editing.

Note For editing a Cyrillic text make sure to switch the keyboard layout to Cyrillic before you start editing!

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-269

Sequence control 7.4 Language support for your applications

03.03

Save a Newly Created Text

S Select the "Save As..." command in the "File" menu. The "Save As" dialog pops up. S Type in the file name and select as file type "Encoded Text Files (*.txt)".

S Click the "Save" button. A dialog pops up which says format information cannot be saved.

S Go on by clicking "Yes". The "File Conversion" dialog appears.

7-270

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.4

Sequence control Language support for your applications

S Select the needed encoding and click "OK". The file gets saved.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-271

Sequence control 7.5 Types of windows

03.03

7.5

Types of windows

Description of the MDIchilds

For each MDIchild, that belongs to an application, the following information is to be recorded in the file PROGNAME.MDI: S S S S names of the MDIchild as an ASCII - text put in quotation marks (") . Types of MDIchilds (0 to 5) Preload Comment (optional)

Organization of a MDI file

Excerpt from the MDI--file in the application 'machine'. Example 7-4

"Preset" "spin" 2 "vorschub" "Werkzeug"

Organization of a MDI file

1 // This is part of the basic screen machine.

1 1, Preload=TRUE

Table 7-5 shows the different types of MDIchilds (pictures).

Table 7-5 Typs of MDIchilds

type 0 NOUNLOAD 1 UNLOAD 2 RESIZE 3 MODAL 4 OVERLAYED 5 MAYBE_1OR2

action MDIchild is always displayed MDIchild is deleted when being overlaid MDIchild is reduced in size when being overlaid (size 0) MDIchild is an application--modal window MDIchild is not overlaid, might be partially overlaid MDIchild remains in the memory as long as possible

Picture type 0: NOUNLOAD

This picture is always displayed on the screen. It must be unloaded by a function if necessary. MDIchilds of the type '0' are opened at the end of the initialization phase. Usually the type is used dynamically.

7-272

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.5

Sequence control Types of windows

Picture type 1: UNLOAD

The picture is removed from the memory (incl. its data segment): All resources are released. In particular this means, that entered data are no longer valid the picture is reloaded. The function Form_Load is called each time

Picture type 2: RESIZE

The picture remains in the memory, the size is set 0. The function Form_Load is called only once, because the picture is still loaded.

Picture type 3: MODAL

During area change--overs all texts and entries referring to the modal window get lost because it is removed from the memory. By default the Sequence Control stores the content of the first text box in a global variable and enters it in the text box upon return.

Picture type 4: OVERLAYED

Includes pictures of the type 1. The picture may be overlaid by other windows. Pictures of e.g. type 1 would be unloaded when touched or overlaid by another window. If a MDIchild is to be protected from being replaced (overlaid) by another (partially) hiding MDIchild, this MDIchild may be assigned type 4 (possibly temporarily with the function Set_ChildType ).

Picture type 5: MAYBE_1OR2

Form type 5 presently behaves like form type 2. It is planned to assigned the following properties to this form type: When resources are low, form type 5 is transformed to form type 1 and then can be removed from the memory.

Preload (from SW 6)

Die Angabe Preload=True bewirkt, daß diese Form bereits beim Start der Applikation geladen wird.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-273

Sequence control 7.5 Types of windows

03.03

Info-file

The most important specifications of an application's MDI Childs, as there are S the child's name S its type S and a list of the Childs (here only the indices are stored) that need to be removed when opening the child are stored in an info--file with the extension.6$$ in the directory ALTMP with the following properties: S The name of the info -- file may be freely selected by the application. S The name of this file is defined as a constant in the module PRIVATE.BAS e.g.: Global Const TempFile = "OEM1.6$$" S During the installation of a new software release all files with the extension 6$$ are removed from the directory ALTMP. The file is created dynamically to speed up state change--overs.

Creating the info-file

To create the info--file *.6$$, all forms of an application are loaded temporarily in order to read the required information. This procedure can be sped up by aborting the Form_Load--procedure after the Move instruction of a form. The required instruction goes as follows: If AlMakeZwidat = True Then Exit Sub If certain actions are executed during Form_Unload or during Resize (e.g. interrupting DDE--connections), the above line might have to be inserted there also.

7-274

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.5

Sequence control Types of windows

7.5.1

Application-modal windows

Application--modal windows are useful for displaying alarms and messages. They have the following properties: S Each application--modal window may be assigned a separate state with a corresponding softkey bar. S Applications open these windows by calling the procedure ModalDialog or UsrModalDialog. S Calling the procedure ModalDlgEnd - interrupts application--modal windows. -1 S Only one application--modal window may be open at a time. Application--modal windows are of type 3 and are 'Always on Top'. This means, these windows are opened in front of the other application windows and can be closed by a function call only. Such application--modal windows must not be MDIchilds ( property MDIchild = False ), but are handled by the Sequence Control like MDIchilds ( The property Always on Top does not apply to MDIchilds in Windows 3.1 and Windows 95! ).

Positioning windows

To specify the position of these windows, the value Top must always be added a constant offset. For example: Move BeArtleft, BeArttop + MDIstart , 3000, 1500 This constant contains the difference between the starting position of the MDIframe and the starting position of the output area for the applications.

Note Constants are added (unit: twips) for the following reason: modal windows are not MDI Childs; therefore their origin is located in the upper left corner of the screen. For correct positioning, the origin coordinates of the MDI frames must be added.

Standard form

Together with the Sequence Control a form ApplModal in the data file ALMODAL.frm is delivered, which opens a standard form for application modal windows. With the procedure WriteModalDlg this window may be used multiple times with different texts.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-275

Sequence control 7.5 Types of windows

03.03

7.5.2

Displaying messages/notes

The Sequence Control provides the procedure Write_Dialog for displaying messages. It writes the text specified in the parameter text for the application in the standard dialog line of the Siemens user--interface outside of its own form.

7-276

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Sequence control 7.6 Menu control

7.6

Menu control

7.6.1

State table

State table

All states and all actions of an application are recorded as a state table in the file PROGNAME.ZUS:

Table 7-6 Structure of a state table

State/ action

access level

Htext

Vtext

Childs

Return

Z - Flag / succeedi ng state 1 17 --1 3 3

comment

999 "Description of state 10" 10 0 14 15 16 999 "Description of state 17" 17 0 4 ht0 --1 vt0 --1 "a" "b" "" "" "0017" "SK0" 0 0 "state17" "Softkey0" John 3 Mary ht0 --1 --1 --1 vt0 --1 --1 --1 "x1" "x2" ... "" "a1" "" "" "" "abc" "SK0" "SK14" "OK" "state 10" "Softkey0" "abort" "OK" "RECALL-key"

State

After each state changeover or whenever an action is performed the current state (state number) and the action that caused this state ( ASCII -- string ) is indicated to the application. This is done by calling the function State_Changed ( func, status, CurrState) provided by the application in the module PRIVATE.BAS.

Note Character strings (comments and return values) in the state table must not contain any backslashes ( " \ " )

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-277

Sequence control 7.6 Menu control

03.03

State/Action

Specifies the state respectively the actions associated with this state. S The state descriptions always starts with a unique states number. -- put in square brackets -- followed by the initial values of this state. S These initial values define the scenario to be opened when entering this state. S These values are updated upon request when the state is left. ( Z - Flag = 1 see below). S The states are recorded in ascending order in the file (Since SW 2.2 not necessary). The actions of a state are numbered from 0 to 15, according to the horizontal ( 0 ... 7 ) and vertical ( 8 ... 15 ) softkeys . The RECALL--key is number 16. S An action describes what is to be done, when a specific softkey has been pressed. If there are no softkey numbers defined for a state, the pressing of these softkeys will not result in any action. S A comment line is characterized with the action number 999.

Levels of access permission for softkeys

Each softkey can be assigned an access level (AccessLevel). The state matrix PROGNAME.ZUS has been added a new attributeAccessLevel. This attribute allows you to set the access rights or the key switch positions necessary for operating this softkey. When loading a softkey bar the current key switch position is compared to the values specified in the matrix. In order to check to see whether an action is allowed. If this is not the case, the softkey text is no longer displayed. If the entry is missing or invalid, the AccessLevel = 7, i.e. the softkey has not been assigned any access permission level and therefore it is always effective. Table 7-7 gives an overview of the possible access permission levels. The default setting is marked with gray background color.

Table 7-7 The eight levels of access permission

access level: --1 0 1 2 3 4 5

permission required: always system password MTB password service password user password key switch position 3 key switch position 2 everyone SIEMENS

user group

machine tool builder set up / service staff (machine tool builder) privileged user (in--house service) programmer trained operator

7-278

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Sequence control 7.6 Menu control

Table 7-7

The eight levels of access permission

access level: 6 7

permission required: key switch position 1 key switch position 0 operator

user group

semi--skilled operator (NC start/NC stop, operating panel)

Symbolic user classes

In order to allow you to define symbolic user classes, you can also enter symbolic names to the state matrix instead of just numbers. The value assigned to such an entry is taken from an application--specific INI file where a section [ACCESSLEVEL] must be created containing the corresponding entries.

Example for symbolic user classes

The application PROGNAME contains the following entries in the section [ACCESSLEVEL] of its INI file PROGNAME.INI: Example 7-5 Entry for symbolic user classes

[ACCESSLEVEL] John=2 // access for MTB service employee John George=3 // access for user George Mary=4 // access for NC programmer Mary

So there are three ways to define access permission levels in the state matrix: 1. not specifying any access permission, i.e. there is no difference to the previous releases 2. specifying the access permission with numbers 3. specifying the access permission with symbolic values. The three ways are contained in Table 7-7.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-279

Sequence control 7.6 Menu control

03.03

Htext / Vtext

Text indices for the horizontal and vertical softkeys for the state or the respective action. S The softkey labels are stored in Dynamic Link Libraries (DLL). S The respective text index points to the first element of the softkey bar. A setting less than 0 (e.g. --1) indicates, that the texts of the according softkey bar should not be modified. S The text indices for the horizontal and the vertical softkey bar in the state description have to be set relative to the first text block of the DLL. If the texts for the vertical softkey bar in the DLL start at position 64, this corresponds to the vertical softkey index 0 in the state description. The second text block begins at position 72 corresponding to the index 8 in the state description and so on.

Childs

List of MDIchilds to be opened for a state respectively for an action of an application with the following characteristics: S The maximum number of MDIchilds is determined by the constant MaxFormNbr (in the module ALDECL.BAS). S If less MDIchilds are to be displayed, the last element of the list is an empty string. S The standard forms do not need to be included in the list, since they are opened automatically when the application is being started. Standard forms are for example: forms for softkey bars, dialog field, status lines.

Return

ASCII -- text, that is returned to the application when a state is reached or an action has been triggered including S name of a procedure S state number S name of the form.

7-280

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Sequence control 7.6 Menu control

Z-Flag / succeeding state

The entry has different meanings, dependent on its occurrence in either the state description or the action description: state description: The Z--Flag indicates, whether the current settings ( softkey texts and list of opened MDIchilds ) are to be saved ( Z-Flag = 1 ) or not ( Z-Flag = 0 ) when the state is terminated action description: The succeeding state specifies the state to be established due to the action ( at the end of the action ). When the state changes to its successor the corresponding scenario is opened. If this setting is less than 0, only the specified action is triggered, the current state however is not changed

Comment

(optionally): Comment giving an explanation; length max. 25 characters.

Structure of the table

For each possible state the table contains one line for the state description and maximum 17 lines for the description of the reactions corresponding to this state. The state table can be extended at any time. To format the data space lines and tabs within a line are allowed. The character "\" (backslash) is not allowed in a state table because it is interpreted as extension of the softkey--bar.

7.6.2

State transitions

State transitions usually result in sub windows being hidden by other sub windows, i.e. a new sub window being loaded and the previous sub window being unloaded. State transitions are caused by the following events: S clicking a softkey which has been assigned a configured succeeding state in the state matrix S calling functions of the state control, e.g. Set_State e.g. as a reaction on a PLC signal

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-281

Sequence control 7.6 Menu control

03.03

Pressing Softkeys

Following actions are triggered in the Sequence Control when a softkey is pressed or a state transition occurs: Pressing a softkey results in a call of the procedure Set_Action (SoftkeyIndex) and thus: 1. the MDIchild belonging to the current state is displayed 2. the message to the application is sent (by calling the function State_Changed) 3. and -- if the state must be left-- the state sequencing is performed 4. function State_Reached. The functions State_Changed and State_Reached are provided by the user and contains the application--specific reactions to the actions respectively to a state transition. The Sequence Control passes in the argument func of the function State_Changed the return string specified in the state matrix, and enters the status number in the argument status. The function returns 0 (change--over state) or unequal 0 (do not change--over state). The argument CurrState contains the number of the current state. Especially when terminating, the call State_Changed ( - - - ) informs the -1, -1, -1 application about the end.

Other initial states

If an application should have another initial state, this state must be defined in the user function State_Changed in the module PRIVATE.BAS with Set_State. As you can see in the following examples, there are several possibilities to do so.

Entering the initial state in the INI file

The application OEMBSP1 starts with state 1. Example 7-6 Entering the initial state in the INI file

[CONTROL] MDIList=OEMBSP1\OEMBSP1.MDI ControlFile=OEMBSP1\OEMBSP1.ZUS InitState=1

If no entry exists there for the initial state, the value specified in the constant INIT_State ( in PRIVATE.BAS) is used as initial state. Global Const INIT_State = 0

7-282

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Sequence control 7.6 Menu control

Modifying the initial state in State_Changed

Let an application start with state 10, in the function State_Changed. Only an excerpt is shown. Example 7-7 Modifying the initial state in State_Change

' Modifying the initial state Function State_Changed (ByVal action As String, ByVal newstate As Integer, ByVal oldstate As Integer) As IntegerIf func = AL_ACTIVATE then Set_State (10) 'number of the desired initial states Endif ' Here the old state is displayed and then the desired initial state ' is immediately installed, when an application is selected. End Function

If an application is loaded by the Sequence Control, the functions PRIVATE.DEF (declaration of constants) and PRIVATE.INI are executed (only once, if the application is not terminated with TerminateTask).

Start

When the application is started the user--supplied procedure Private_Init_Def is called. Then the Sequence Control is initialized and finally the user procedure Private_Init is called.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-283

Sequence control 7.7 Procedures and functions

03.03

7.7

Procedures and functions

This chapter contains descriptions of the functions and procedures to be used by the applications. Table 7--10 gives an overview ordered according to the following criteria: S S S S S S S S S state control inquiry function MDIchild function unlocking/locking softkeys softkey text function text display modal window function action function (dynamic change of the state matrix) attributes for forms and controls

Overview

Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)

name state control Set_Previous_State Set_State State_Changed State_Reached inquiry function AlGetAccessLevel AlGetSkByAction Get_FormIdx2 Get_FormIndex MDIchild function ChildActivate ChildDeactivate Hide_Childs Set_ChildType Show_Focus AlSkipFocus Hide_A_Child

F/P P P F P F F F F P P P F P P

meaning return to previous state state change over return application state following an action user procedure like State_Changed read current access level read softkey number of the current state returning a specific value provides an index for form names provides an index for ASCII form names declare a MDIchild to the Sequence Control disconnect a MDIchild from the Sequence Control hide all open MDIchilds set type of MDIchild a specific MDIchild gets the entry focus exclude MDIchild from getting the focus hide specified Childs

7-284

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Table 7-8

Overview of the functions and procedures (F/P: F = function, P = procedure)

name Show_Hidden_Childs Lock_Softkey Unlock_Softkey

F/P P P P

meaning show all hidden Childs lock softkeys or softkey bars unlock softkeys or softkey bars

unlocking/locking softkeys

LockSkByState UnlockSkByState LockSkByAction UnlockSkByAction LockSkByState AndAction UnlockSkByState AndAction softkey text functions AlGetDllEntries AlGetDllEntriesI Change_SkTextOnScr Al_GetSkTextByIndex Al_SetSkTextByIndex Al_GetSkTextByState Al_SetSkTextByState Change_SKtext SK_Highlight SK_HighlightUn text display Write_Dialog modal window functions ModalDialog ModalDialogEnd

P P P P P

lock all state softkeys resulting in a specific state unlock all state softkeys resulting in a specific state lock all state softkeys returning a specific return value unlock all state softkeys returning a specific return value lock all state softkeys resulting in a specific state and returning a specific return value unlock all state softkeys resulting in a specific state and returning a specific return value read several texts from the language DLL with end index read several texts from the language DLL without end index change softkey text on the screen read softkey text change softkey text read softkey text for a specific state change softkey text for a specific state change softkey text highlight a softkey highlight a softkey immediate write text to dialog line open application modal window close a modal dialog

P

F F P F P F P P P P P F F

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-285

Sequence control 7.7 Procedures and functions

03.03

Table 7-8

Overview of the functions and procedures (F/P: F = function, P = procedure)

name ModalDialogInfo UsrModalDialog SysModalDialog AlDisableSkAction AlEnableSkAction AlNewActionEntry AlNewActionEntries AlNewSoftkeyAction subSetTFrmAttr subSetTCtrlAttr subSetTFrmAttr subSetTCtrlAttr AlGetPrivateProfileString AlGetPrivateProfileInt AlWriteProfileString

F/P F F F P P F F F P P P P F F F

meaning is a modal dialog active wait loop for modal dialog system modal dialog disable softkey actions enable softkey actions change a softkey action change several softkey actions change subsequent state set attribute for forms set attribute for controls set attributes for form set attributes for control read entries from INI files read numeric entries from INI files write entries to INI files

action functions (dynamic change of the state matrix)

action functions (dynamic change of the state matrix)

attributive functions for dynamic graphic resolution

functions for reading/ writing INI file entries

7-286

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

7.7.1

State control

Overview

Use the following functions for changing--over states:

Set_Previous_State

Description Diese Prozedur ermöglicht das Umschalten zu dem für den Recall-Softkey projektierten Zustand. Application This procedure allows to change to the previous state of an application without the OEM application passing the state number and without any softkey actions. Syntax Set_Previous_State Arguments none

Set_State

Description This procedure allows to transit from the present state to any selectable state. Application Change to a new state of an application. The number of this state is specified. Syntax Sub Set_State (ByVal state As integer ) Arguments

Table 7-9 Arguments of Set_State

Argument state

Data type integer

description state to be changed to

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-287

Sequence control 7.7 Procedures and functions

03.03

State_Changed

Description The function State_Changed must be implemented in each OEM application in the module "PRIVATE.BAS". This function is executed on each state transition of the application and by each clicking of a configured softkey. The function State_Changed allows applications to specifically react on certain events, e.g. softkey actions and state change--overs. In particular pressing the EXIT button indicates the end to the application by calling State_Changed.

Note If the application returns a negative value of State_Changed on EXIT, EXIT is rejected.

Application Allows an application e.g. to store certain data when changing--over states or to refuse a state change--over under certain circumstances. Syntax Function State_Changed (ByVal action As String, ByVal newstate As Integer, ByVal oldstate As Integer) As Integer Arguments

Table 7-10 Arguments of State_Changed

Argument action newstate oldstate

Data type string integer integer

description a function called by this is e.g. configured in the application's .zus file state to be changed to previous state

Return value The return value of the function State_Changed specifies, whether the state is to be changed respectively the proposed action is to be performed (return value = 0) or interrupted (return value unequal 0). The user procedure State_Changed can execute actions, when a softkey is pressed.

7-288

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Note For each state respectively for each action the application gets a message indicating the present state (state number) and which action had caused this state (ASCII string, see below) by calling the function State_Changed (action, newstate, oldstate).

For the following messages from the Sequence Control to the application the global constants listed below have been changed: S S S S S S S S S Global Const AL_ACTIVATE = "--990" Global Const AL_DEACTIVATE = "--991" Global Const AL_FORMLOAD = "--992" Global Const AL_FORMUNLOAD = "--993" Global Const AL_NODEACTIVATE = "--994" Global Const AL_NOFORMUNLOAD = "--995" Global Const AL_ETCINFO = "--996" Global Const AL_EXITINFO = "--998" Global Const AL_HELPINFO = "--999"

In these cases the argument newstate always returns the present state! When finishing an application, the application will no longer be called with --1 but with AL_EXITINFO:

nRet = State_Changed(AL_ EXITINFO, g_nCurrState, Val(AL_EXITINFO))

State_Reached

Description The procedure State_Reached must be implemented in each OEM application in the module "PRIVATE.BAS". This function is called as soon as a state is reached, i.e. the function State_Changed returns the value 0 before. Application Allows to execute actions if a state is reached, i.e. initializing a variable Syntax Sub State_Reached (ByVal action As String, ByVal newstate As Integer, ByVal oldstate As Integer)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-289

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-11 Arguments of State_Reached

Argument action newstate oldstate

Data type String Integer Integer

description An action called by this function is configured e.g. in the file .zus. state the application changed to last/previous state

Note This function must be programmed by the user.

7.7.2

Inquiry functions

AlGetAccessLevel

Description This function of the Sequence Control allows the OEM user to inquire the present access level of the system. For this the Sequence Control has a hotlink connection to the NCDDE Server. (LinkItem= "/Nck/Configuration/accessLevel"). Application The OEM application may lock or unlock certain operator actions depending on the access level. Syntax Function ALGetAccessLevel() as integer Arguments none Return value The function ALGetAccessLevel returns the current access level (respectively 100 in case of error).

7-290

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

AlGetSkByAction

Description The function AlGetSkByAction returns the softkey number of a state. It can be used to perform a certain action. Application Allows the OEM user to inquire the softkey number which performs a certain action. Syntax Function AlGetSkByAction(ByVal action As String) as Integer Arguments

Table 7-12 Arguments of AIGetSkByAction

Argument action Return value

Data type string

description searched action text of the softkey

The return value is the softkey number. In case of error, a value less than 0 is returned.

Note Only the length of the string passed is compared, i.e. if the string entered in the .zus file is longer, the rest is not taken into account.

Get_FormIdx2

Description The function Get_FormIdx2 provides for a form the corresponding index under which it is assigned to the global array g_frmFormName in the module "AMAIN.BAS". This index can be used as an argument for other procedures and functions. Application This function allows the OEM user to use the form's index as an argument for other procedures and functions where he must address different forms. Syntax Function Get_FormIdx2 ( FormName As Form ) as integer

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-291

Sequence control 7.7 Procedures and functions

03.03

Argument

Table 7-13 Arguments of Get_FormIdx2

Argument FormName

Data type Form name of the form

description

Return value The return value is the index in the global array g_frmFormName; in case of error a value less than 0 is returned.

Get_FormIndex

Description The function Get_FormIndex provides for a form name the corresponding index (as string), under which it is assigned to the global array g_frmFormName in the module "AMAIN.BAS". It can be used as an argument for other procedures and functions. Application This function allows the OEM user to use the form's index as an argument for other procedures and functions where he must address different forms. Syntax Function Get_FormIndex (ByVal Name As String) as integer Arguments

Table 7-14 Arguments of Get_FormIndex

Argument name

Data type String name of the form

description

Return value The return value is the index in the global array g_frmFormName; in case of error a value less than 0 is returned.

7-292

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

7.7.3

MDIChild functions

AlSkipFocus

Description The procedure AlSkipFocus allows exclude certain MDIchilds from the focus distribution. Application Erlaubt es dem OEM-Anwender, die Softkeynummer abzufragen, mit der eine bestimmte Aktion ausgelöst wird. Syntax Sub ALSkipFocus (ByVal ChildIndex As Integer, OnOff As Integer) Arguments

Table 7-15 Arguments of AISkipFocus

Argument ChildIndex OnOff

Data type integer integer

Description specifies the index of the MDIchild to be excluded from focus distribution True Child is skipped when the focus is distributed False Child is re--added to the list of Childs that can get the focus.

Note The call ALSkipFocus does not work for modal windows.

ChildActivate

Description The procedure ChildActivate announces a MDIchilds to the Sequence Control. Application This procedure must be called in each MDIchild in the event routine Form_Activate. Syntax Sub ChildActivate ( FormName As Form )

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-293

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-16 Arguments of ChildActivate

Argument FormName

Data type Form

Description form to be announced

Note This procedure must be called in the event routine Form_Activate

ChildDeactivate

Description The procedure ChildDeactivate deactivates an MDIchilds in the Sequence Control. The active form gets a focus frame. Application This procedure must be called in each MDIchild in the event routine Form_Deactivate. Syntax Sub ChildDeactivate (FormName As Form) Arguments

Table 7-17 Arguments of ChildDeactivate

Argument FormName

Data type Form

Description form to be deactivated

Note This procedure must be called in the event routine Form_Deactivate.

7-294

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Hide_A_Child

Description The procedure Hide_A_Child allows to hide individual MDIchilds. Application Syntax Sub Hide_A_Child (FormName As Form) Arguments

Table 7-18 Arguments of Hide_A_Child

Argument FormName

Data type Form

Description MDIchild/Form to be hidden

Hide_Childs

Description The procedure Hide_Childs hides all loaded MDIchilds from being displayed on the screen and sets the flag CH_HIDDEN in the Childs' descriptions. Application The procedure Hide_ Childs allows to hide all MDIchilds presently loaded. Syntax Sub Hide_Childs Arguments none

Set_ChildType

Description The function Set_ChildType allows to modify the type of individual MDIchilds during run time. The possible types are listed in table 7--7. Application This function can be used for dynamically changing the types defined in the file *.MDI. Syntax Function Set_ChildType (ByVal ChildIndex as Integer, ByVal new Type As Integer) as Integer

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-295

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-19 Arguments of Set_ChildType

Argument ChildIndex newType

Data type Integer Integer

Description MDIchild/Form to be hidden Child type to be set TYPE_NOUNLOAD TYPE_UNLOAD TYPE_RESIZE TYPE_MODAL TYPE_OVERLAYED TYPE_MAYBE_1OR2 0 1 2 3 4 5

Return value The return value is the child's preceding type as integer.

Show_Focus

Description The procedure Show_Focus allows to set the entry focus on the MDIchild. Application This procedure allows to set the entry focus following a state transition only. Syntax Sub Show_Focus(mdiChild as Form) Arguments

Table 7-20 Arguments of Show_Focus

Argument mdiChild

Data type Form

Description MDIChild/Form to get the focus

7-296

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Show_A_Hidden_Child

Description The procedure Show_A_Hidden_Child opens a MDIchild which is flagged CH_HIDDEN. The flag is changed to CH_LOADED. Application The procedure Show_A_Hidden_Child allows to show a MDIChild which is presently hidden. Syntax Sub Show_A_Hidden_Child(ByVal fname As Form) Arguments none

Show_Hidden_Childs

Description The procedure Show_Hidden_Childs opens all MDIchilds which are flagged CH_HIDDEN. The flag is changed to CH_LOADED. Application The procedure Show_Hidden_Childs allows to open all MDIChilds which are presently hidden. Syntax Sub Show_Hidden_Childs Arguments none

7.7.4

Locking/unlocking softkeys

LockSkByAction

Description The procedure LockSkByAction locks all softkeys of the current state, that have a ReturnString (action from the state matrix) identical with the specified argument action. Application Allows to specifically lock softkeys which result in a certain action. Syntax Sub LockSkByAction(ByVal action As String)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-297

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-21 Arguments of LockSkByAction

Argument action

Data type String

Description action to be locked

LockSkByState

Description The procedure LockSkByState locks all softkeys of the present state, that lead to the state specified by the argument state. Application Allows to specifically lock softkeys which change to a certain state. Syntax Sub LockSkByState(ByVal state As Integer) Arguments

Table 7-22 Arguments of LockSkByState

Argument state

Data type Integer

Description state to be locked for softkey operation

LockSkByStateAndAction

Description The procedure LockSkByStateAndAction locks all softkeys of the present state, that lead to the state specified in the argument state and which have a ReturnString (action from state matrix) identical with the specified argument action. Application Allows to specifically locks softkeys which result in a certain action and change to a certain state. Syntax Sub LockSkByStateAndAction(ByVal state As Integer, ByVal action As String) Arguments

Table 7-23 Arguments of LockSkByStateAndAction

Argument state action

Data type Integer String

Description state to be locked for softkey operation action to be locked

7-298

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Lock_Softkey

Description The procedure Lock_Softkey allows the explicit lock individual softkeys respectively the complete horizontal and/or vertical softkey bar. The numeral values of H_Lock, V_Lock and HV_Lock are defined in the module ALDECL.BAS. Softkeys are unlocked automatically when a new softkey bar is placed at the same position! Locked softkeys are marked with light gray background color (as common for WINDOWS) by the WINDOWS constant GRAY_TEXT=&H8000 0011 'grayed (disabled) text. The procedures Lock_Softkey and Unlock_Softkey are only effective on those softkeys, for which an action has been configured; i.e. they are not effective on softkeys S which texts are empty or contain space characters, S that were not configured for an action, S that were explicitly disabled by AlEnableSkAction. Application This procedure locks the specified softkeys or softkey bars of a state. Syntax Sub Lock_Softkey(skIndex As Integer) Arguments

Table 7-24 Arguments of Lock_Softkey

Argument skIndex

Data type integer H_Lock V_Lock HV_Lock

Description lock horizontal softkey bar lock vertical softkey bar lock horizontal and vertical softkey bars 0 .. MaxSoftKeys lock softkey with the index SoftkeyId

Note After a state change--over previously locked softkeys are unlocked.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-299

Sequence control 7.7 Procedures and functions

03.03

UnlockSkByAction

Description The procedure UnlockSkByAction unlocks all softkeys of the present state, that have a ReturnString (action from the state matrix) identical with the specified argument action. Application Allows to unlock softkeys which result in a certain action. Syntax Sub UnlockSkByAction( ByVal action As String ) Arguments

Table 7-25 Arguments of UnlockSkByAction

Argument action

Data type String

Description action to be released

UnlockSkByState

Description The procedure UnlockSkByState unlocks all softkeys of the present state, that lead to the state specified by the argument state. Application Allows to unlock softkeys which change to a certain state. Syntax Sub UnlockSkByState(ByVal state As Integer) Arguments

Table 7-26 Arguments of UnlockSkByState

Argument state

Data type Integer

Description state which is to be released for softkeys

7-300

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

UnlockSkByStateAndAction

Description The procedure UnlockSkByStateAndAction unlocks all softkeys of the present state, that lead to the state specified in the argument state and which have a ReturnString (action from state matrix) identical with the specified argument action. Application Allows to unlock softkeys which change to a certain state. Syntax Sub UnlockSkByStateAndAction(ByVal state As Integer, ByVal action As String) Arguments

Table 7-27 Arguments of UnlockSkByStateAndAction

Argument state action

Data type Integer String

Description state which is to be released for softkeys action to be released

Unlock_Softkey

Description The procedure Unlock_Softkey cancels the lock of a individual softkey or the complete horizontal or vertical softkey bar. Application Allows to unlock softkeys. Syntax Sub Unlock_Softkey(skIndex As Integer) Arguments

Table 7-28 Arguments of Unlock_Softkey

Argument skIndex

Data type integer H_Lock V_Lock HV_Lock

Description unlock horizontal softkey bar unlock vertical softkey bar unlock horizontal and vertical softkey bars 0 .. MaxSoftKeys unlock softkey with the index skIndex

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-301

Sequence control 7.7 Procedures and functions

03.03

7.7.5

Softkey text functions

ALGetDLLEntries

Note As of Software Version 6, the function AlGetDLLEntriesI shall be used instead of AlGetDLLEntries.

Description The Sequence Control provides the function ALGetDLLEntries for reading several texts at the same time from the language DLL. The texts can be read form--specifically (accessing the language DLL once) and can be assigned the according labels in the form. Application Should always be used for reading several texts from a language DLL. This is much more effective than reading each text separately. Syntax Function ALGetDLLEntries (ByVal hLang As Integer, ByVal t_beg As Integer, ByVal t_end As Integer, ByVal t_max As Integer, dllt As variant) As Integer Arguments

Table 7-29 Arguments of ALGetDLLEntries

Argument hLang

Data type integer

Description hLanguageLibHandle specifies the language--DLL, is returned when loading the DLL marks the beginning of a text area marks the end of the text area maximum number of texts specifies the structure that the texts are to be written to; this structure is provided as a type declaration in the Sequence Control:

t_beg t_end t_max dllt

integer integer integer DLLEntry

Return value The function returns the number of texts actually read as integer. Reading several texts from the language-DLL The function ALGetDLLEntries loads 10 texts from a language--DLL and assigns them to the respective Visual Basic Controls.

7-302

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Example 7-8

Reading several texts from the language DLL

Sub Form_Load () Dim g_tDI_DlgText() As Variant, nRet As Integer Const TEXTSTART = 26 Const TEXTZAHL = 10 ReDim g_tDI_DlgText(0 To TEXTZAHL - 1) nRet = ALGetDLLEntries(g_hLanguageLibHandle, TEXTSTART, TEXTSTART + TEXTNUM, TEXTNUM, g_tDI_DlgText(0)) Label1.Caption = g_tDI_DlgText(0).DLLText Label1.Caption = g_tDI_DlgText(1).DLLText End Sub

ALGetDLLEntriesRaw

Note As of Software Version 6, the function ALGetDLLEntriesIRaw shall be used instead of ALGetDLLEntriesRaw.

Description The sequence control provides the function ALGetDLLEntriesRaw in order to read several texts from the DLL language at once. The function will read DLL language entries without converting the double--blanks to carriage returns. Application Should be used whenever several texts are read from the language--DLL without an end index. This is much faster than reading the texts separately. Syntax Function ALGetDLLEntriesRaw (ByVal hdl As Long, ByVal t_start As Integer, ByVal t_end As Integer, ByVal t_maxRead As Integer, Sktext As Variant) As Integer Arguments

Table 7-30 Arguments of ALGetDLLEntries

Argument hLang t_beg t_end t_max dllt

Data type Integer Integer Integer Integer Variant

Description hLanguageLibHandle specifies the language DLL; is returned when loading the DLL specifies the start of the text area specifies the end of the text area maximum number of texts specifies the structure that the texts are to be written to; this structure is available in the sequence control as a type definition.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-303

Sequence control 7.7 Procedures and functions

03.03

ALGetDLLEntriesI

Description The Sequence Control provides the function ALGetDLLEntriesI for reading several texts without end index at the same time from the language DLL. The function reads text entries from the language DLL starting from the specified position up to either an Index-gap in the language--DLL or the specified number is reached. The return value is the number of texts actually read ( in this context Index-gap means, that in the specified range a text number was not assigned; the C--function LoadString takes this gap for terminating). Application Should be used whenever several texts are read from the language--DLL without an end index. This is much faster than reading the texts separately. Syntax Function ALGetDLLEntriesI (ByVal hLang As Integer, ByVal t_beg As Integer, ByVal t_max As Integer, dllt As variant) As Integer Arguments

Table 7-31 Arguments of ALGetDLLEntriesI

Argument hLang

Data type integer

Description hLanguageLibHandle specifies the language--DLL, is returned when loading the DLL marks the beginning of a text area maximum number of texts specifies the structure that the texts are to be written to; this structure is provided as a type declaration in the Sequence Control

t_beg t_max dllt

integer integer variant

Return value The return value is the number of text entries actually read as integer. Reading several texts of a language-DLL The function ALGetDLLEntriesI loads 10 texts from a language DLL and assigns them to the respective Visual Basic Controls.

7-304

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Example 7-9

Reading several texts from a language--DLL

Sub Form_Load () Dim g_tDI_DlgText As Variant, nRet As Integer Const TEXTSTART = 26 Const TEXTNUM = 10 nRet = ALGetDLLEntriesI(g_hLanguageLibHandle, TEXTSTART, TEXTNUM, g_tDI_DlgText) Label1.Caption = g_tDI_DlgText(0) Label1.Caption = g_tDI_DlgText(1) End Sub

ALGetDLLEntriesIRaw

Description The Sequence Control provides the function ALGetDLLEntriesI for reading several texts without end index at the same time from the language DLL. The function reads entries from a language DLL without converting the double-blanks to carriage returns. Application Should be used whenever several texts are read from the language--DLL without an end index. This is much faster than reading the texts separately. Syntax Function ALGetDLLEntriesRaw (ByVal hdl As Long, ByVal t_start As Integer, ByVal t_maxRead As Integer, Sktext As Variant) As Integer Arguments

Table 7-32 Arguments of ALGetDLLEntriesIRaw

Argument hLang t_beg t_max dllt

Data Type Integer Integer Integer Variant

Description hLanguageLibHandle specifies the language DLL, is returned when loading the DLL marks the beginning of a text area maximum number of texts specifies the structure that the texts are to be written to; this structure is provided as a type declaration in the Sequence Control

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-305

Sequence control 7.7 Procedures and functions

03.03

AL_GetSKState

Description The function detects, whether a softkey is locked. Application Allows to inquire whether a softkey state is locked or not. Syntax Function AL_GetSKState(sk As Integer) As Integer Arguments

Table 7-33 Arguments of ALGetSKState

Argument sk

Data type integer softkey number

Description

Return value The return value is FALSE if the softkey is locked, otherwise it is TRUE.

AL_GetSKTextByIndex

Description The procedure AL_GetSKTextByIndex allows the application to read a individual softkey text independent on the present state. Application Allows to read softkey texts during run time independent on the present state. Syntax Function AL_GetSKTextByIndex(ByVal hv As Integer, ByVal Index As Integer) As String Arguments

Table 7-34 Arguments of ALGetSKTextByIndex

Argument hv

Data type integer True False

Description horizontal softkey vertical softkey

Return value The procedure returns the softkey text as string.

7-306

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

AL_SetSKTextByIndex

Description The procedure AL_SetSKTextByIndex allows the application to overwrite the text of each softkey with the text contained in the argument sktext. This overwriting is not performed in the text DLL and is valid only until the application terminates. Application This procedure is useful for modifying softkey texts dependent on the present state during run time, e.g. for displaying a softkey text contained in an INI file. Syntax Sub AL_SetSKTextByIndex(ByVal hv As Integer, ByVal Index As Integer, ByVal sktext As String) Arguments

Table 7-35 Arguments of ALSetSKTextByIndex

Argument hv Index sktext

Data type integer integer string True False

Description horizontal softkey vertical softkey

position number in the language DLL text to be assigned to the softkey

AL_GetSKTextByState

Description The function AL_GetSkTextByState supplies a softkey text specified by the arguments state, Action and sk. Application This function reads softkey texts, depending on the present state. Syntax Function AL_GetSkTextByState(ByVal state As Integer, ByVal action As Integer, ByVal sk As Integer) As String

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-307

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-36 Arguments of ALGetSKTextByState

Argument state action sk

Data type integer integer integer state

Description position number in the language--DLL softkey number

Return value The return value is the softkey text as a string.

AL_SetSKTextByState

Description The routine AL_SetSkTextByState allows to modify the softkey texts specified by the arguments state, Action and sk. Application Allows to write softkey texts depending on the present state. Syntax Sub AL_SetSkTextByState(ByVal state As Integer, ByVal action As Integer, ByVal sk As Integer, ByVal sktext As String) Arguments

Table 7-37 Arguments of ALSetSKTextByState

Argument state action sk sktext

Data type integer integer integer string state

Description position number in the language--DLL softkey number text to be assigned to the softkey

7-308

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Change_SkText

Description The procedure Change_SkText allows the application to overwrite the text of a single softkey specified as SoftkeyId with the text SkText during run time. This overwriting is not performed in the text DLL and is valid only until the application terminates. Application Allows to modify softkey texts during run time, e.g. if a softkey text from an .INI file should be displayed. Syntax Sub Change_SkText ( SoftkeyId As Integer, SkText As String ) Arguments

Table 7-38 Arguments of Change_SkText

Argument SoftkeyId SkText

Data type integer string

Description number of the softkey text to be assigned to the softkey

Change_SkTextOnScr

Description The routine Change_SkTextOnScr changes the softkey text specified by the argument index directly on the screen, however not in the internal data structure (Sequence Control). Application This routine is useful for modifying a program's softkey texts until the state changes. Syntax Sub Change_SkTextOnScr (SoftkeyId As Integer, SkText As String) Arguments

Table 7-39 Arguments of Change_SkTextOnScr

Argument SoftkeyId SkText

Data type integer string softkey number

Description text to be assigned to the softkey

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-309

Sequence control 7.7 Procedures and functions

03.03

SK_Highlight

Description The procedure SK_Highlight highlights the softkey addressed by the parameter Index (in the contrary to the procedure SK_HighlightUn, which immediately highlights the corresponding softkey!). Syntax Sub SK_HighLight(ByVal Index As Integer).

SK_HighlightUn

Description The procedure SK_HighlightUn immediately highlights the softkey addressed by the parameter Index with a blue background (in the contrary to the function SK_Highlight, which highlights the corresponding softkey not before the end of an action!) Syntax Sub SK_HighlightUn(ByVal Index As Integer)

7.7.6

Displaying texts

Write_Dialog

Description The procedure Write_Dialog writes the ASCII text specified by the argument Text to the dialog line. Application This function is useful e.g. for displaying dialog lines for dialog fields. Syntax Sub Write_Dialog(ByVal DText As String) Arguments

Table 7-40 Arguments of Write_Dialog

Argument DText

Data type string

Description text for the dialog line

7-310

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

7.7.7

Modal window functions

Overview

The modal dialogs of the new form are no longer handled by the state matrix, but by calling the function ModalDialog. The procedure WriteModalDlg for writing the contents of a modal window is no longer necessary.

Note Like before, only one application--modal (either ModalDialog or UsrModalDialog) dialog may be open at a time.

This new procedure essentially simplifies using modal dialogs and especially handling the acknowledgment of a modal dialog. Additionally the number of states of an application has been reduced. Since the modal form is unloaded at the end of a modal dialog before the user is notified (by the clicked softkey), modal dialogs with entry fields can only be realized by this new function, if the current value is temporarily stored in the Change event of the entry field respectively in the Unload event of the form. Modal dialogs with entry fields can no longer be realized as modal dialogs but rather as state a change--over.

ModalDialog

Description The function ModalDialog allows the application to open an application modal dialog. The application remains in the wait loop until the dialog is terminated, or interrupted by the function ModalDialogEnd --1. The modal dialog too is a MDIChild and must be added to the Sequence Control. (see chapter 7.22 and 7.23). S Showing the softkey. The value --1 for hsk respectively vsk means that no softkey is labeled in the corresponding softkey bar; at least one value of hsk respectively vsk must be unequal --1. S Opening the modal window and displaying the modal title and the modal text. S Waiting for termination by a softkey. ----> e.g. clicking softkey 15 S S S S Closing the modal window. Restoring softkey bars and the focus. Return value = 15 assuming the vertical softkey 15 is used. User evaluates the return value.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-311

Sequence control 7.7 Procedures and functions

03.03

Application Can be used for displaying inquiry and message dialogs. Syntax Function ModalDialog(ByVal Title As String, ByVal midx As Integer, ByVal hsk As Integer, ByVal vsk As Integer, ByVal mtext As String) As Integer Arguments

Table 7-41 Arguments of ModalDialog

Argument Title midx hsk vsk mtext

Data type string integer integer integer string

Description title bar of the modal dialog index of the modal window in g_frmFormName horizontal softkey bar --1 no softkeys vertical softkey bar --1 no softkeys text for the modal window

Return value The function returns either the index of the softkey which acknowledges the modal dialog or --1, if the dialog was interrupted by the function ModalDialogEnd --1. Opening a dialog Opens a dialog with the title "delete" without horizontal softkeys, vertical softkeys start with index 8 in the language --DLL. Example 7-10 Opening a dialog

nRet = ModalDialog ("delete", Get_FormIndex("ApplModal1"), -1, 8, "are you sure, you want to delete?")

ModalDialogEnd

Description Terminates an application--modal dialog which has been opened by the function UsrModalDialog or with the function ModalDialog . Application Can be used for terminating inquiry and message dialogs. Syntax Sub ModalDialogEnd(ByVal Index As Integer)

7-312

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Arguments

Table 7-42 Arguments of ModalDialogEnd

Argument Index

Data type integer

Description The value --1 terminates the dialog.

Closing a dialog Closes an application--modal dialog Example 7-11 Closing a dialog

ModalDialogEnd -1

ModalDialogInfo

Description The function indicates, whether a modal dialog is open. Application Useful for indicating, whether a modal dialog is open. Syntax Function ModalDialogInfo() As Integer Arguments none Return value The function returns the value TRUE if a modal or a system--modal window is open.

UsrModalDialog

Description The function UsrModalDialog allows the application to program the wait loop for the modal dialog by itself. For this, after the modal window was opened the application is called by the message State_Changed with the following arguments: nRet = State_Changed (AL_USRMODALDLG, g_nCurrState, Val(AL_USRMODALDLG)) The function UsrModalDialog returns the index of the softkey that terminates the modal dialog. This index is stored in a global variable that can be inquired by the function UsrModalDialogIndex: Index = UsrModalDialogIndex This return value allows the user to leave the wait loop. A modal dialog can be finished from the program by calling ModalDialogEnd -1.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-313

Sequence control 7.7 Procedures and functions

03.03

In this case the caller of UsrModalDialog himself must decide whether he agrees to this abort. The function UsrModalDialog allows the application to open an application--modal dialog. The application remains in a wait loop within this function until the dialog has been acknowledged or finished by the function ModalDialogEnd --1. The user has to program the wait loop. Application This function is useful for programming inquiry and message dialogs with a wait loop of their own. Syntax Function ModalDialog(ByVal Title As String, ByVal midx As Integer, ByVal hsk As Integer, ByVal vsk As Integer, ByVal mtext As String) As Integer Arguments

Table 7-43 Arguments of UsrModalDialog

Argument Title midx hsk vsk mtext

Data type string integer integer integer string

Description title line of the modal dialog index of the modal window in g_frmFormName horizontal softkey bar --1 no softkeys labeled vertical softkey bar --1 no softkeys labeled text for the modal window

Return value The function returns either the index of the softkey which acknowledges the modal dialog or --1 if the dialog is finished by the function ModalDialogEnd --1. Opening a dialog Opens a dialog with the title "delete" without horizontal softkeys, vertical softkeys starting with index 8 in the language--DLL. Example 7-12 Closing a dialog

ModalDialogEnd -1

SysModalDialog

Description The function SysMododalDialog allows the application to open a system--modal dialog. The module ALMODAL.FRM must be embedded in the project (with the form ApplModal) when using this function; the form however does not necessarily have to be listed in the state matrix respectively in the list of MDI Childs (Amain.bas respectively xxx.mdi). If an application modal dialog is open when calling the function SysModalDialog, after terminating of the system modal dialog control returns to the application modal dialog.

7-314

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Note Only one system modal dialog may be open at a time!

Note If you are using an own form called ApplModal, it must contain a label with the name title and a TextBox called ModalText! The form ApplModal supplied with the Sequence Control already contains these two Controls. S Displaying the softkey. The value --1 for hsk respectively vsk means that no softkey is labeled in the corresponding softkey bar; at least one value of hsk respectively vsk must be unequal --1. S Opening the modal window and displaying the modal title and the modal text. S Waiting for termination by a softkey ----> e.g. clicking softkey 15 S Closing the modal window. S Restoring the softkey bars and the focus S Return value = 15 assuming that softkey 15 was configured for being used S The user evaluates the return value. Application Useful for opening application--modal dialogs. Syntax Function SysModalDialog(ByVal Title As String, ByVal hsk As Integer, ByVal vsk As Integer, ByVal mtext As String) As Integer Arguments

Table 7-44 Arguments of SysModalDialog

Argument Title hsk

Data type string integer

Description title line of the modal dialog horizontal softkey bar --1 no softkey labeled

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-315

Sequence control 7.7 Procedures and functions

03.03

Table 7-44

Arguments of SysModalDialog

Argument vsk mtext

Data type integer string

Description vertical softkey bar --1 no softkey labeled text for system modal windows

Return value The application remains in a wait loop of this function until the dialog has been acknowledged or finished by the function ModalDialogEnd --1. Opening a system-modal dialog Open a dialog with the title "warning" without horizontal softkeys, vertical softkeys starting with index 8 in the language--DLL. Example 7-13 Opening a system--modal dialogs

nRet = SysModalDialog ("warning", -1, 8, "MODAL-TEXT")

7.7.8

Action functions (dynamic change of the state matrix)

ALDisableSKAction

Description The procedure ALDisableSKAction allows you to dynamically disable a softkey action (temporarily) that was configured in the state matrix state and SKIndex. The corresponding softkey text is then removed from the softkey bar, the softkey itself is locked. Application This procedure is useful for dynamically disabling softkey actions. Syntax Sub ALDisableSKAction(ByVal state As Integer, ByVal SkIndex As Integer) Arguments

Table 7-45 Arguments of ALDisableSKAction

Argument state SkIndex

Data type integer index

Description number of the state number of the softkey

7-316

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

ALEnableSKAction

Description The procedure ALEnableSKAction allows you to dynamically enable a softkey action specified by the arguments state and SKIndex and disabled by ALDisableSKAction. The corresponding softkey text is then displayed in the softkey bar, the softkey is unlocked. Application This procedure is useful for dynamically enabling softkey actions. Syntax Sub ALEnableSKAction(ByVal state As Integer, ByVal SkIndex As Integer) Arguments

Table 7-46 Arguments of ALEnableSKAction

Argument state SkIndex

Data type integer index state number softkey number

Description

ALNewActionEntry

Description The function ALNewActionEntry allows you to change the action with the number SkIndex corresponding to a present state during run time; thus you can reconfigure the application's reactions during run time. If the modification refers to the current state, the horizontal respectively the vertical softkey bar is redrawn if necessary.

Note You cannot change MDIchilds that are to be opened during an action.

Application This function is useful for changing states transitions of an application during run time. Syntax Function ALNewActionEntry(ByVal state As Integer, ByVal Skindex As Integer, ByVal AccessLevel As Integer, ByVal HskTextId As Integer, ByVal VskTextId As Integer, ByVal ReturnString As String, ByVal Successor As Integer) As Integer

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-317

Sequence control 7.7 Procedures and functions

03.03

Arguments

Table 7-47 Arguments of ALNewActionEntry

Argument state SkIndex AccessLevel HskTextId VskTextId ReturnString Successor

Data type integer index integer integer integer string integer state number softkey number access level

Description

horizontal softkey text bar vertical softkey text bar return string successor state

Return value The function returns 0 or --1 in case of error. Add area change-over The following example enters a successor state 7 in state 3 of the internal state matrix but lets the access level unchanged. Beispiel 7-14 Add state change--over

nRet = ALNewActionEntry (3, 8, -1, 0, 32, "abc", 7)

ALNewActionEntries

Description The function ALNewActionEntries allows you to change all entries (actions) of the state matrix for an current state hat are specified by the arguments ...(i).SkIndex (i.e. index 0 to index 16) during run time; thus you can reconfigure the application's reactions during run time. The new values for the state matrix are passed in an array of VB structures: Type Sk_MatEntry SkIndex As Integer AccessLevel As Integer HskTextId As Integer VskTextId As Integer ReturnString As String Successor As Integer End Type `action `access level `horizontal SK text bar `vertical SK text bar `return text `subsequent state

The type definition Sk_MatEntry can be found in the module ALDECL.BAS.

7-318

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Note You cannot change MDIchilds that are to be opened during an action.

Application This function is useful for changing state transitions of an application during run time. Syntax Function ALNewActionEntries(ByVal state As Integer, SkMatEntry() As Sk_MatEntry) As Integer Arguments

Table 7-48 Arguments of ALNewActionEntries

Argument state SkMatEntry()

Data type integer Sk_MatEntry state number softkey number

Description

Return value The function returns 0 or --1 in case of error. Add state change-overs The following example enters several actions in state 3 of the state matrix. Example 7-15 Opening a dialog

ReDim xxSkMatEntry(4) As Sk_MatEntry xxSkMatEntry(0).SkIndex = 8 xxSkMatEntry(0). AccessLevel xxSkMatEntry(0). HskTextId = xxSkMatEntry(0). HskTextId = xxSkMatEntry(0).ReturnString xxSkMatEntry(0). Successor = xxSkMatEntry(1).SkIndex = 10 xxSkMatEntry(1). AccessLevel xxSkMatEntry(1). HskTextId = xxSkMatEntry(1). HskTextId = xxSkMatEntry(1).ReturnString xxSkMatEntry(1). Successor = usw. nRet = ALNewActionEntries (3, xxSkMatEntry() ) = -1 0 32 = "abc" 7 = -1 40 48 = "xyz" 13

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-319

Sequence control 7.7 Procedures and functions

03.03

ALNewSoftkeyAction

Description With the function ALNewSoftkeyAction you can modify during run time both the subsequent state of a current state (i.e. index 0 to 16) and the value to be returned to the application during run time. The ReturnString is changed only if the argument ReturnString is not an empty string. Application This function is useful for modifying softkey actions within a program until the next change--over takes place. Syntax Function ALNewActionEntry(ByVal state As Integer, ByVal SkIndex As Integer, ByVal ReturnString As String, ByVal Successor As Integer) As Integer Arguments

Table 7-49 Arguments of ALNewActionEntries

Argument state SkIndex ReturnString Successor

Data type Integer Index String Integer state number softkey number return string

Description

horizontal softkey text bar

Return value The function returns 0 or --1 in case of error. New assignment of an action Assign the successor state 7 to the softkey 8 in state 3: Example 7-16 Opening a dialog

nRet = ALNewSoftkeyAction (3, 8, "abc", 7 )

Weitere Funktionen siehe Kapitel 7.8.4.

7.7.9

Functions for dynamic graphic resolution

Overview

In order to display the PC version of MMC applications in the set screen size, the Sequence Control of P5 scales the size of the forms, as well as controls and texts displayed on the forms. This is however possible only for forms and controls which are known to the Sequence Control respectively which sizes are modified by the Sequence Control (SC). The SC scales the control sizes only, it cannot modify the contents (e.g. grid, list-

7-320

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

box: there are dependencies which are not known by the SC, as e.g. the line spacing of a listbox). In order to make use of this feature available for applications have to activate it in the global INI file MMC.INI and might need some slight modification of their program code: Entry in the global INI--file MMC.INI in the section [CONTROL] : ;==Resolution: 0=fixed (640x480), 1=variable, default:0 Resolution=1 ;==BaseScreen: 640x480, 800x600, ... default: 640x480 BaseScreen=640x480 S Resolution=1 (variable) means, that the screen resolution actually set on the PC is used. S BaseScreen=640x480 specifies, for which resolution the application has been developed; in our case this so far always (!!!) has been 640x480 (default setting); i.e. usually the entry does not have to be modified. The INI entry ScreenTwips (in the application--specific INI file) is ignored if Resolution=1. (ScreenTwips=1 sets the number of twips per pixel to 15 independently of the actual conditions--according to the value set at the control. The Sequence Control contains a global data structure which holds all data that are relevant for the application: Type AppRes_Info HSize As Integer VSize As Integer HFact As Single VFact As Single End Type horizontal resolution vertical resolution (exc. Task bar) X--factor referring to BaseScreen--X Y-- factor referring to (BaseScreen--Y-- Task bar)

Global g_tAppRes As AppRes_Info The width res. the height of a form res. of a control are multiplied with e.g. the quantity g_tAppRes. HFact res. g_tAppRes. Vfact. The procedures subSetTCtrlAttr and subSetTFrmAttr have an optional parameter, specifying whether the font size of the corresponding control is to be multiplied with the factor g_tAppRes. Hfact or not: if no parameter has been specified or if the parameter is FALSE, the factor is 1, otherwise it is g_tAppRes. Hfact. With software release 6 and higher, with higher resolution (greater than 640x480) only the window border can be maximized, not the content. It is thus possible to incorporate more information in a window. This is done by making the following entry in the application--specific INI file: [CONTROL] Control/Resolution=0

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-321

Sequence control 7.7 Procedures and functions

03.03

The default value is 1, i.e. all controls are adapted in their size. If Contro/Resolution=0, individual parts (such as the header line of a form) can be adapted by the calls MDI_ControlResolution Header MDI_ControResolution IblTitleText

subSetTCtrlAttr

Description The procedure subSetTCtrlAttr sets for the control transferred in the parameter Ctrl suitable font properties for the currently set language. Application The procedure subSetTCtrlAttr is called up for all controls used in one form to display language--dependent texts. They are called typically when displaying the form for the first time resp. repeatedly if a language switchover took place in the meantime. Syntax subSetTCtrlAttr (Ctrl As Control, wType As Integer, Optional ByVal size As Variant) Parameter

Table 7-50 Parameter of subSetTCtrlAttr

Parameter Ctrl wType

Datentyp Control Integer

Description Control the font properties of which are to be set. Depending on the type of control transferred in the parameter Ctrl, the following values are to be used for wType. TCTRL_WINDOW_HEADER: Text/control located in the window header TCTRL_FRAME_HEADER: Text displayed by a Frame Control TCTRL_CHECK_FIELD_TEXT: Text displayed by a checkbox control TCTRL_WINDOW_TEXT: Other This parameter is optional. If it is set and has the value True, the font size is converted in addition to the currently set resolution.

size

Variant

7-322

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

subSetTFrmAttr

Description The procedure subSetTFrmAttr sets for the control transferred in the parameter Frm suitable font properties for the currently set language. Application The procedure subSetTFrmAttr is called up only for such forms which display the language-dependent texts also directly, that means without using controls. Typically, the procedure subSetTFrmAttr is called up when the form concerned is displayed for the first time or repeated if a language switchover has been carried through in the meantime. Syntax subSetTFrmAttr (Frm As Form, wType As Integer, Optional ByVal size As Variant) Parameter

Table 7-51 Parameter of subSetTFrmAttr

Parameter Frm wType

Datentyp Control Integer

Beschreibung Control the font properties of which are to be set. Depending on the display location of the texts, the following values must be used for wType. TCTRL_WINDOW_HEADER: Text/control located in the winsow/form header TCTRL_WINDOW_TEXT: Other This parameter is optional. If it is set and has the value True, the font size is converted in addition to the currently set resolution.

size

Variant

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-323

Sequence control 7.7 Procedures and functions

03.03

7.7.10

Functions for reading/ writing INI file entries

AlGetPrivateProfileString

Description The function AlGetPrivateProfileString enables the user to read INI file entries. If `IpFileName' is followed only by the file name, the function takes into consideration the SINUMERIK--specific file structure, i.e. it returns the current entry from INI files with the same name from the directories user, oem, add_on, mmc2 and Hmi_adv (where it starts searching in the directory user and disrupts the search on the first hit.) If the file name is entered including the entire path, only this INI file is searched. Application to read INI file entries Syntax Function AlGetPrivateProfileString (ByVal lpApplicationNameAs String, ByVal lpKeyName As String, ByVal lpDefault As String, lpReturnedString As String, ByVal nSize as Long, ByVal lpFileName As String) As Long Arguments

Table 7-52 Arguments of ALGetPrivateProfileString

Argument IpApplication Name IpKeyName IpDefault

Data type String String String section name key name

Description

default return value returned entry

IpReturnedStr String ing

7-324

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.7

Sequence control Procedures and functions

Table 7-52

Arguments of ALGetPrivateProfileString

Argument nSize IpFileName

Data type Long String INI file name

Description size of IpReturnedString

Return values Number of characters returned Syntax in C++ long_stdcall ALGetPrivateProfileString ( LPCTSTR lpApplicationName, LPCTSTR lpKeyName, LPCTSTR lpDefault, LPTSTR lpReturnedString, long nSize, LPCTSTR lpFileName);

AlGetPrivateProfileInt

Description The function AlGetPrivateProfileInt enables the user to read numeric INI file entries. If `IpFileName' is followed only by the file name, the function takes into consideration the SINUMERIK--specific file structure, i.e. it returns the current entry from INI files with the same name from the directories user, oem, add_on, mmc2 and Hmi_adv (where it starts searching in the directory user and disrupts the search on the first hit.) If the file name is entered including the entire path, only this INI file is searched. Application to read numeric INI file entries Syntax Function AlGetPrivateProfileInt ( ByVal lpApplicationNameAs String, ByVal lpKeyName As String, ByVal nDefault As Integer, ByVal lpFileName As String) As Integer Argument

Table 7-53 Arguments of ALGetPrivateProfileInt

Argument IpApplication Name IpKeyName

Data type String String section name key name

Description

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-325

Sequence control 7.7 Procedures and functions

03.03

Table 7-53

Arguments of ALGetPrivateProfileInt

Argument nDefault IpFileName

Data type Integer String INI file name

Description default return value

Return values Numeric value of the string following the specified key name in the specified INI file. If the key is not found, the default value is returned. If the value is below `0', `0' is returned. Syntax in C++ UINT_stdcall ALGetPrivateProfileInt ( LPCTSTR lpApplicationName, LPCTSTR lpKeyName, INT nDefault, LPCTSTR lpFileName);

AlWritePrivateProfileString

Description The function AlWritePrivateProfileString enables the user to write entries into INI files. If `IpFileName' is followed only by the file name, the function takes into consideration the SINUMERIK--specific file structure, i.e. it writes the current entry into the INI file with the same name in the directory user. If the file name is entered including the entire path, only this particular INI file is written to. Application to write INI file entries Syntax Function AlWritePrivateProfileString( ByVal lpApplicationNameAs String, ByVal lpKeyName As String, ByVal lpString As String, ByVal lpFileName As String) As Long Argument

Table 7-54 Argument of ALGetPrivateProfileString

Argument IpApplication Name IpKeyName

Data type String String section name key name

Description

7-326

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.8

Sequence control Horizontal and vertical softkeys

Table 7-54

Argument of ALGetPrivateProfileString

Argument IpString IpFileName

Data type String String INI file name

Description value the key has to get

Return values `0' if successful, `0' in case of an error Syntax in C++ BOOL_stdcall ALWritePrivateProfileString( LPCTSTR lpApplicationName, LPCTSTR lpKeyName, LPTSTR lpString, LPCTSTR lpFileName);

7.8

Horizontal and vertical softkeys

Overview

The Sequence Control provides the functions and procedures for managing the horizontal and vertical softkeys including the procedures for changing softkey labels respectively for indicating the softkey currently pressed.

8 9 10 11 12 13 14 15 0

Fig. 7-3

1

2

3

4

5

6

7

Softkey numbering

The horizontal softkeys range from 0 to 7, the vertical ones from 8 to 15, the RECALL--key is located on 16.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-327

Sequence control 7.8 Horizontal and vertical softkeys

03.03

Note In order to enable a softkey to release an action, the language DLL must contain a text entry or a pictogram name. If the DLL only contains spaces, the softkey does not have any effect.

Two line softkey texts

Softkeys usually are labeled using two left aligned text lines. This is attained by inserting two blanks at the joint.

Note In long texts VB automatically inserts a new line character at the place a space character is found. In the Sequence Control two blanks always force a new line insertion.

One line picture fonts

Texts written in a picture font like e.g. Chinese are displayed in just one line.

Actions

The reactions following a pressed softkey have to be recorded in the state table under the indices 0 to 15. This state table exists once per application and is stored in an ASCII -- file of the MMC system directory together with the linked applications.

RECALL - key The Sequence Control handles the RECALL -- key like a softkey, i.e. in the state table the action following a pressed RECALL -- key can be determined under the Index 16.

7-328

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.8

Sequence control Horizontal and vertical softkeys

7.8.1

Icons for softkeys

You can use pictograms instead of texts for labeling softkeys. pictograms (Bitmap-- files with the extension .BMP) can be created with the WINDOWS drawing tool PAINTBRUSH. The size of the drawing area available for the softkeys is: 74 x 36 pixels for horizontal softkeys, 79 x 34 pixels for vertical softkeys. Creating icons is achieved in three steps: S Create a directory for the pictograms (should be located in the corresponding directory of the application) \OEM\... S Specify the path in the application--specific .INI file, e.g. [CONTROL] SKPICTO=OEMBSP5\skpicto\ S Substitute the softkey text for the name of the pictogram in the language DLL. Pay attention to small and capital letters. Besides that, specify the file name extension, e.g.: \\PICTNAME.BMP

Note If an application is to be assigned a special icon, this icon must have the application title as name ( in the Visual Basic Makefile: application title ).

The softkey pictograms are entered in the RC file with their names and extensions following two backslashes. If in the language--DLL (starting with \\) a file name has been specified for a softkey, this file name is interpreted as the name of a bitmap (type BMP). It is completed by the base path SKPICTO from the application--specific INI file. This file is searched in the directories USER, OEM, HMI_ADV, ADD_ON and MMC2 and ­if found-- the bitmap contained is displayed on the screen (SW P4). New in P5: If a bitmap file is specified with an absolute path (e.g. L:\...) , this bitmap will be displayed, if it exists there! Attention: In the DLL 'must be tagged by a preceding '\'. (e.g. L:\\...)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-329

Sequence control 7.8 Horizontal and vertical softkeys

03.03

Entry in the RC-file

For how to enter a softkey pictogram in the RC file of the OEM example 0 see the example 7--17: Example 7-17 Entry in the RC-file

STRINGTABLE BEGIN 0 "10" // start index of the horizontal softkey texts END //------------------- Horizontal Softkeys ----------------------STRINGTABLE BEGIN 10 \\SKBILD1.BMP // bitmap file for softkey pictogram 11 "Work-piece" // two line text 12 "Global SP" // sequence of text indices without gaps 13 "macros" END

Creating softkey pictograms

The easiest way is to start from an existing pattern like the softkey pictograms of the dialog programming. They are contained in our example installation under the path C:\MMC2\DP\SKPICTO. Example: File DP0_1.BMP

7.8.2

Configuring the softkey bars

The number of text fields contained in each softkey bar can be configured. This is done by including the following lines in the section [CONTROL] of the application-specific INI--file.

Number of Softkeys

Configuration of 4 horizontal softkeys and no vertical softkey in the file PROGNAME.INI: Example 7-18 Number of softkeys

[CONTROL] NbrHorSoftkeys = 4 NbrVerSoftkeys = 0 ;number of horizontal softkeys = 4 ;number of vertical softkeys = none

If one of these entries is missing, the standard case with 8 softkeys for each is set. If 0 is entered, the softkey bar is not displayed at all. If a value greater than 8 is entered, then the value is limited to 8.

7-330

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.8

Sequence control Horizontal and vertical softkeys

Note If the softkey bars are switched off due to a parameter setting 0, the application must take care of the unused screen area. The Sequence Control does not support this configuration.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-331

Sequence control 7.8 Horizontal and vertical softkeys

03.03

7.8.3

Extending the Softkey bar

adding ETC

The horizontal softkey bar can be extended via the input fields ETC1 and ETC2. To do so, the identification 0\8\16 is to be added to the state description recorded in the .ZUS file in the column Htext. This identification means:

0\8\16 ETC2-texts ETC1-texts standard bar Table 7-55 Extension of the state table for ETC (Excerpt)

state/ action

access level

Htext

Vtext

Childs

Return

Z - Flag / succeedin g state 1

Commen t

999 "description of state 10 with softkey bar extended by ETC" 10 0\8\16 vt0 "Figure 1" "abc" " state10 with softkey bar extended by ETC " "Softkey0 "

0

--1

--1

"a1" ""

"SK0"

17

This extension applies to the softkey texts only. To indicate to the application, that ETC bar is active, the global variable g_nEtcLevel is returned with one of the following values:

Table 7-56 Returned information of the ETC level

g_nEtcLevel 0 1 2

meaning Softkey texts of the standard bar Softkey texts of the extension ETC1 Softkey texts of the extension ETC2

7-332

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.8

Sequence control Horizontal and vertical softkeys

7.8.4

New functions as from software version 6.2

ChangeEtcAccesslevel

Using this function, the user can change the access level of a softkey. If the optional parameter nEtcLevel is not specified, this call will act on the current EtcLevel (if EtcLevel=0, also on the basic softkey bar). Syntax Sub AL_ChangeEtcAccesslevel(ByVal state As Integer, ByVal SkIndex As Integer, ByVal Accesslevel, Optional nEtcLevel As Variant)

ALNewEtcSuccessor

The function ALNewEtcSuccessor can be used to change the follow--on status of a softkey of the ETC bar. Syntax Function ALNewEtcSuccessor(ByVal state As Integer, ByVal SkIndex As Integer, ByVal EtcLevel As Integer, ByVal Successor As Integer) As Integer

ALNewEtcReturnstring

The function ALNewEtcReturnstring can be used to change the "Returnstring" of a softkey of the Etc bar. Syntax Function ALNewEtcReturnstring(ByVal state As Integer, ByVal SkIndex As Integer, ByVal EtcLevel As Integer, ByVal ReturnString As String) As Integer

ALDisableEtcSKAction

Using this function, it is possible to deactivate softkeys of the Etc bar. In this case, the appropriate softkey text will no longer appear in the bar, and the softkey itself will be disabled (see also Section 7.7.8, keyword ALDisableSKAction). Syntax Sub ALDisableEtcSKAction(ByVal state As Integer, ByVal SkIndex As Integer, ByVal EtcLevel As Integer)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-333

Sequence control 7.8 Horizontal and vertical softkeys

03.03

ALEnableEtcSKAction

Using this function, it is possible to re--enable softkeys of the Etc bar which have been disabled by ALDisableEtcSKAction. In this case, the appropriate softkey text will appear in the softkey bar again, and the softkey itself will be re--enabled (see also Section 7.7.8, keyword ALEnableSKAction). Syntax Sub ALEnableEtcSKAction(ByVal state As Integer, ByVal SkIndex As Integer, ByVal EtcLevel As Integer)

7-334

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 7.9

Sequence control Global variables of the Sequence Control

7.9

General

Global variables of the Sequence Control

Besides functions and procedures, the Sequence Control provides several global variables which save memory space and increase the efficiency.

g_chNCDDEServiceName

Description Contains the LinkTopic of the NCDDE--Server e.g. NCDDE|NCU840D

g_chMBDDEServiceName

Description Contains the LinkTopic of the Alarm--Server e.g. mbdde|alarme

g_chGlobalProfile

Description Contains the path and file name of the file MMC.INI e.g.: c:\mmc2\MMC.INI

g_chLocalProfile

Description Contains the file name of the initialization file of the OEM application without path

g_chMMCPATH

Description Contains the HMI_Advanced path of the system e.g.: <drive>: ... \Hmi_adv

g_chHMIBASE

Description Contains the HMI_Base path of the system, e.g. <drive>: ... \mmc2

g_hLanguageLibHandle

Description Contains the handle for accessing the language DLL presently being used.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

7-335

Sequence control 7.10 The Menu Tree Generator

03.03

g_nAccessLevel

Description Contains the present access level of the system (see table 7--9)

g_nAppRunning

Description Contains the number of the presently active application / task on the MMC.

g_nHelpInfo

Description Indicates, whether help is available (true) or not (false).

g_chHelpContext

Description Indicates, where the help file is located.

7.10

The Menu Tree Generator

Overview

The Menu Tree Generator is no longer part of the HMI environment package (from ver. 6).

7-336

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Interface HMI <=> NCK/PLC

Overview

8

OPC-DataAccess DCTL-Control

The NCDDE Server provides the following three services for the developers of applications: Variable Service accessing NC, PLC and drive data via or Domain Service

copying files from HMI to NCK and vice versa file access via data management with and or IMC-File IADS FileViewer-Control

PI Service:

starting program--invocation services of the NC IMC-Command

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-337

Interface HMI <=> NCK/PLC 8.1 General

03.03

8.1

General

The communication between applications and NC/PLC is carried out via the OPC or Sinumerik-COM interfaces. For compatibility reasons, access is still continued to be granted via the NCDDE server. With new developments, however, it is strongly recommended to use the new COM interfaces for access.

HMI

COM FileViewer Control Application DCTL Control OPC/ Sinumerik server

NCDDE server

M P I

M SINUMERIK P 840D/PLC I

Fig. 8-1

Overview

The NCDDE Server can be configured using initialization files so you can adapt it to match your specific development environment. Is there a control available for testing purposes? Are there one or more NCUs which data you want to access?

Note Due to the use of the WINDOWS environment the communication with NCK shows restricted real time behavior. Therefore you should prefer to implement functions, that rely on real time reaction directly in the NCU using the OEM package NCK.

8-338

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.2 Basics of DDE

8.2

Basics of DDE

Overview

The WINDOWS operating system supports the Dynamic Data Exchange (DDE). This allows the application developer to transfer data from one WINDOWS process to another.

DDE features

DDE under WINDOWS features the following: S S S S S S S DDE is communication between WINDOWS applications DDE is executed with two processes following the client--server model One process acts as client : it requests data from the server. The other process acts as server: it provides the data for the client. The connection is established by the client A program may act as server as well as client. The communication is specified according to the internal WINDOWS protocol.

Establishing a DDE connection

In order to establish connections to the DDE Server, the client developer must be familiar with the following terms: S Link Server S Link Topic S Link Item S Link Mode name of the DDE Server subject the data item to be accessed type of the connection

DDE Link-Mode

S Request S Warmlink S Hotlink S Poke S Execute The client inquires data only once. The Server informs the client of data having been changed. Then the client can access this data item. If the data has been changed, the Server automatically supplies the current data value to the client. The client instructs the Server to write a data item. The client instructs the Server to execute a command.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-339

Interface HMI <=> NCK/PLC 8.3 Configuring the NCDDE Server

03.03

8.3

Configuring the NCDDE Server

8.3.1

The initialization file MMC.INI

Description

The initialization of the NCDDE Server is performed with the file MMC.INI section [GLOBAL]. This file is located in the directory \MMC2 of the OEM system. Here the Link Server and the Link Topic are defined with which the local NCDDE Server must establish the connection. By editing four lines in the section [GLOBAL] of the file MMC.INI the NCDDE Server can be configured in four basic ways: S establishing a connection to an NC (default) S Verbindungsaufbau zu einer oder mehreren NCs (for the M:N features see Chapter 8.3.3) S local operation mode on a PC Allows the developer to test his application locally on his PC without a connected NC. In this case the NCDDE Server supplies substitute values, that can be defined with the command "NEW" (Chapter 8.8) and modified with the command "ANIMATE" (Chapter 8.8) to simulate an active NC. S local operation mode on a PC with NC simulator Allows the developer to test his application locally on his PC without a connected NC. With the NC simulator it is possible to achieve a behaviour very close to a real CNC.

NcddeServiceName

DDE--Link--Service name of the NCDDE Server. The default name is always "ncdde".

Note All examples in chapter 8 assume "NcddeServiceName = ncdde". If this is not the case, you have to modify the examples accordingly to keep them working.

8-340

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.3

Interface HMI <=> NCK/PLC Configuring the NCDDE Server

Ncdde-MachineName

Here the NCU name for the standard applications is entered.If "MachineSwitch" has been entered here, you can switch between several NCUs (for the M:N feature see chapter Kapitel 8.3.3).

NcddeDefault-MachineName

This initializes the M:N feature, i.e. this NCU is connected when the MMC starts up.

Ncdde-MachineNames

Here the names of the NCUs that can be connected are entered. For each NCU name entered here a section of the same name must exist in the file MMC.INI.

NcddeStartupFile

The NSK file (chapter 8.3.2) that should be loaded when starting--up the NCDDE Server. It contains the variable definitions.

NcddeMachineNamesAdd1

This attribute in the section [GLOBAL] of the file MMC.INI characterizes an installed NC simulator. In no NC simulator is installed, this entry has no meaning. In the following example the setings of the file MMC.INI is shown for an installation on a PC without NC and without NC simulator.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-341

Interface HMI <=> NCK/PLC 8.3 Configuring the NCDDE Server

03.03

Example 8-1 Excerpt of the file MMC.INI

[GLOBAL] ; for using M:N function ; for working without NC ; for working with SIMNC ; for connecting to a NC NcddeMachineName=local set set set set NcddeMachineName=MachineSwitch NcddeMachineName=local NcddeMachineName=SIM1 NcddeMachineName=NCU840D

; for using M:N function set NcddeDefaultMachineName=net:NCU_1 ; for working without NC set NcddeDefaultMachineName=local ; for working with SIMNC set NcddeDefaultMachineName=SIM1 ; for connecting to a NC set NcddeDefaultMachineName=NCU840D NcddeDefaultMachineName=local ; for using M:N function ; for working without NC ; for working with SIMNC ; for connecting to a NC NcddeMachineNames= set set set set NcddeMachineNames=net,NCU840D NcddeMachineNames= NcddeMachineNames=SIM1 NcddeMachineNames=NCU840D

; for using M:N function set NcddeStartupFile=ncdde5.nsk ; for working without NC set NcddeStartupFile=ncdde202.nsk ; for working with SIMNC set NcddeStartupFile=sim1dde5.nsk ; for connecting to a NC set NcddeStartupFile=ncdde5.nsk NcddeStartupFile=ncdde202.nsk

Name spaces

In the LOCAL--mode the NCDDE--Server does not distinguish the 'name spaces' of variables. 'Name space' means a distinction regarding TOPIC. If a variable has been created for the TOPIC LOCAL and the same variable has been created for the TOPIC Sim0, the NCDDE does not distinguish them. This may have the effect, that e.g. the current block display does not work in the simulation mode, once a screen with current block display has been selected in the area application MACHINE. In this case the program creates local variables which overdefine the 'simulation variables`.

8-342

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.3

Interface HMI <=> NCK/PLC Configuring the NCDDE Server

8.3.2

Command files of the NCDDE Server

NSK files

The command files (with the extension NSK) contain for example the Link--Items the NCDDE--connections refer to. These files may contain commands that are described in chapter 8.8. In these files the data -- Link Items -- that can be accessed are described. Further NSK files may be included using the CALL instruction. This allows structuring. Example 8--2 shows a Link--Item (LastError) and the structuring of the global variables for the HMI using CALL instructions.

Note You may load your own NSK files with CALL instructions. The NSK files can be created with a MAP function ( chapter 8.6.3).

Example 8-2

The file NCDDE311.NSK in the directory \mmc2

REM NSK ROOT FOR 840D =========================================================== REM REM WRITE-ACCESS FOR NC-BUSADDRESS LINK("/Nck/Nck/busAddress",200,"7 31 0 0 E0# /NC 1 0 11",10) LINK("/Nck/Nck/busState",300,"",0); REM REM ACCESS TO CONNECTION ERROR STATE LINK("LastError",1,"",0); REM REM IMPORT 840D BASIC NC VARIABLES CALL(nc311.nsk) REM REM IMPORT 840D BASIC PLC VARIABLES CALL(plc311.nsk) REM REM IMPORT ADDITIONAL LINK VARIABLES CALL(add311.nsk) REM REM IMPORT COMIC STARTS CALL(comic.nsk) REM

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-343

Interface HMI <=> NCK/PLC 8.3 Configuring the NCDDE Server

03.03

8.3.3

Connecting several NCs

M:N - feature This feature allows to connect several MMCs to several NCUs. You can e.g. access data contained in two NCUs from only one HMI. The file NETNAMES.INI (which is defined in the section [net] of the file MMC.INI is interpreted for this basic configuration.

Connection part

The section [conn MMC_1] specifies the partners the MMC may be connected to.

Network parameters

In the section [param network] the transfer rate is set, depending on the bus--configuration: BTSS MPI 1,5 Mbit 187,5 Kbit

Bus participants

In the sections [param NCU_n] the bus addresses of the NC and the PLC as well as the NCU name are set. The HMI must use these names to address the NCU. For each NCU a description must be given.

8-344

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.3

Interface HMI <=> NCK/PLC Configuring the NCDDE Server

Example 8-3

The file NETNAMES.INI

; owner TECHNICAL reference to the bus addresses ; computer-specific [own] owner= MMC_1 ; Description of possible connections [conn MMC_1] conn_1= NCU_1 conn_2= NCU_2 ; Description of significant net-parameters ; btss =1,5MBit ; mpi =187,5 KBit [param network] bus= btss ; Bus addresses for all bus participants [param MMC_1] mmc_address= 1 [param NCU_1] nck_address= 10 plc_address= 10 name=Standard_Machine [param NCU_2] nck_address= 11 plc_address= 11 name=Test_Maschine

Application

In order to ensure that OEM applications have a correct behavior within an M:N configuration, please observe the following: S For any communication to the NC, only "machineswitch" should be used as LinkTopic. This ensures that the application always communicates with the NC selected upon M:N resp. NC switchover. If, when setting up a communication link in the LinkTopic, the name of a certain NCU is entered, e.g. NCU1, this is not considered upon M:N switchover, that means, when switching over the operator panel from NCU1 to another NC, this connection remains established. Such "permanent" resp. static connections to a certain NC may be established by an application only if the operator panel on which the application runs has been configured as M:N server. S An NC switchover has the same effect on the OEM application as an NC-Reset resp. a communication failure. The application should thus have the same behavior as it shows after NC-Reset resp. communication failure. You can detect an NC-Reset by setting up a hotlink to the OPI variable /bag/state/opmode. In the case of an NCK-Reset, the hotlink outputs the value "#".

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-345

Interface HMI <=> NCK/PLC 8.3 Configuring the NCDDE Server

03.03

S In order to ensure that communication procedures running in the background such as file transfers are not interrupted resp. aborted due to an M:N resp. NC switchover, the NC switchover should be disabled before starting such procedures resp. enabled again after their termination. To do this, the functions LockCurrentNCU/LockChanMenu resp. UnlockCurrentNCU/UnlockChanMenu (see section 6.4) are available. Whereas LockCurrentNCU only disables switchover to another NC, but still permits channel switchovers on the currently selected NC, LockChanMenu also blocks channel switchover. S If certain services or variables are only available on a certain NCU, you must check before the application accesses these services or variables whether there is a current connection to the NCU. The NCU with which a connection has been established can be determined by reading out the variable "machineswitch" (KinkItem).

8-346

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.4

Interface HMI <=> NCK/PLC Establishing a DDE connection

8.4

Establishing a DDE connection

Overview

This subchapter shows how to establish a DDE connection to the NCDDE Server with Visual Basic and with Visual C++.

Note In the examples below the DDE communication uses the Standard Visual Basic Control "LABEL" only. An OEM application however should use the DCTL control from Siemens for DDE communication (see chapter 8.9.3). The following requirements must be fulfilled so that the examples below will work:

Development environment

S We recomend MS Visual Basic 4.0_16 S MPI--communication between PC and SINUMERIK 840D to test the examples and Configuration of the NCDDE Server for NC--operation. When using the NCDDE Server without SINUMERIK 840D, you can not access all of the data. S The NCDDE Server ( C:\MMC2\NCDDE.EXE ) must have been started (e.g. with the explorer or the START menu).

8.4.1

Establishing a DDE connection with Visual Basic

For the Standard Visual Basic Controls that are able to establish DDE client connections e.g. S Label S Textbox S Picture the Link -- Service and the Link -- Topic are combined in the Property (attribute) "LinkTopic". They are separated by the pipe symbol "#" (e.g. LinkTopic = "ncdde|llocal").

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-347

Interface HMI <=> NCK/PLC 8.4 Establishing a DDE connection

03.03

Reading variables only once

The following example reads the actual position of the first axis in the first channel referring to the workpiece coordinate system once. The example below requires the NCDDE Server to be configured for local operation mode and the NcddeServiceName to be set ncdde, i.e. in this case the NCK is not accessed. For this type of reading the LinkMode must have been set 2.

Note For reading a value only once, set LinkMode equal 2. The first channel then requests the value with the method "Link Request".

Example 8-4 Reading variables only once

Sub Form_Load () Label1.LinkTopic = "ncdde|local" Label1.LinkItem="/Channel/GeometricAxis/actToolBasePos[u1,1]" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Note If the channel identifier "u1" is not specified, the first channel is accessed by default.

Updating when changed

The following example automatically updates ( hotlink ) the actual position of the third axis in the second channel referring to the machine coordinate system in the "label1", i.e. the current actual position of this axis is displayed.

Note For hotlink "LinkMode" must be set 1.

Example 8-5

Updating when changed

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem="/Channel/MachineAxis/actToolBasePos[u2,3]" Label1.LinkMode = 1 'Hotlink End Sub

8-348

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.4

Interface HMI <=> NCK/PLC Establishing a DDE connection

Notifying when changed

In this example the NCDDE Server notifies the application/client, if the first PLC byte has been changed ( Warmlink). Then the "Sub LinkNotify" of Label1 runs automatically. There you have to call a "LinkRequest" in order to get the data. Thus you can check and modify or convert the data before they are displayed.

Note For notifying when changed (Warmlink) "LinkMode" must be set 3.

Example 8-6

Notifying when changed

Label1.LinkMode = 3

Sub Form_Load ( ) Label1.LinkTopic = "ncdde|ncu840D" Label1.LinkItem = "/PLC/Input/Byte[1]" End Sub Sub Label1_LinkNotify ( ) Label1.LinkRequest End Sub

Writing NC data

In this example the Client writes the value "4" to the first R--parameter R[1] of the first channel.

Note For writing data ( Poke ) "LinkMode" must be set 2. LinkPoke writes the value.

Example 8-7

Writing NC data

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/Channel/Parameter/R[1]" Label1.LinkMode = 2 'Manual Label1.Caption = "4" Label1.LinkPoke End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-349

Interface HMI <=> NCK/PLC 8.4 Establishing a DDE connection

03.03

Writing PLC data

In this example the Client writes the value "250" to the flag byte 5 of the PLC. Example 8-8 Writing PLC-data

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/PLC/Memory/Byte[5]" Label1.LinkMode = 2 'Manual Label1.Caption = "250" Label1.LinkPoke End Sub

Executing a command

The commands to be executed are described in chapter 8.6.1, 8.6.3, 8.7 und 8.8 beschrieben werden. The following example starts the transfer of the file "test.mpf" from the MMC to the NCK.

Note For executing commands ( Execute ) "LinkMode" must be set 2. LinkExecute executes the command.

Example 8-9

Executing a command

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC(""C:\NC\test.mpf"", /NC/_N_MPF_DIR/N_TEST_MPF, trans)" End Sub

8.4.2

Establishing a DDE connection with Visual C/C++

Overview

C/C++ can make use of all features of the DDE interface. It especially allows asynchronous calls of the DDE interface. Using the OEM Visual Basic Controls like e.g. DCTL, this is possible in Visual Basic, too.

8-350

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.4

Interface HMI <=> NCK/PLC Establishing a DDE connection

Note DDE with C/C++ is recommended only for OEM users who are familiar with C--programming under WINDOWS and who just need a partial or even no integration in the Sequence Control of the OEM package.

DDE access with C / C++

This example shows how to establish a Hotlink (Advise) connection (with acknowledgment) between S C/C++ program S Variable "/Channel/GeometricAxis/toolBaseDistToGo[1]" S NcddeServiceName = ncdde S NcddeMachineName = local The changes of a variable's value are received in a XTYP_ADVDATA transaction by a call back routine which has been announced to the DDEML. Example 8-10 Hotlink on C level

DWORD HSZ HCONV hszService hszTopic hszItem idInst; // created with DdeInitialize hszService, hszTopic, hszItem; // String Handles hConv; // Conversation Handle = DdeCreateStringHandle ( idInst , "ncdde" , NULL ); = DdeCreateStringHandle ( idInst , "local" , NULL ); = DdeCreateStringHandle ( idInst , Ä"/Channel/GeometricAxis/toolBaseDistToGo[1]" , NULL );

hConv

= DdeConnect(idInst,hszService,hszTopic,NULL); // establishing a connection to the server // hotlink follows if ( DdeClientTransaction ( (LPBYTE)NULL , 0 , hConv , hszItem , ÄCF_TEXT ,XTYP_ADVSTART|XTYP_ACKREQ , 1000 , NULL ) Ä==TRUE) { } // hotlink successfully established

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-351

Interface HMI <=> NCK/PLC 8.5 Variable Service

03.03

8.4.3

Establishing a DDE connection from MS Excel

Overview

Under Excel you can build up Advise (Hotlink)--connections to the NCDDE Server's interface for variables using cell formulas.

Syntax in an EXCEL cell

Inside a cell you have to define = NcddeServiceName|NcddeMachineName!Variables

Displaying a PLC-Bit in Excel

The following example shows an Advise (Hotlink)--connection from a cell in Excel (German version) to the 3rd bit in byte 9 of data block 100. The variable's name is: "/Plc/DataBlock/Bit[c100,9.3]". The name of the machine connected by the NCDDE Server is "ncu840D". Example 8-11 Displaying a PLC bits in MS Excel A 1 =ncdde|ncu840D!'/Plc/DataBlock/Bit[c100,9.3]' A 1 1

Left you see the cell formula, right the resulting, continuously updated display.

8.5

Variable Service

Overview

Access to variables of the NC is carried out either via or via the

DCTL Control OPC Data

.

For compatibility reasons, access to the variables is continued to be granted via DDE. The variable service of the NCDDE Server offers two kinds of data access: S single variable access S array variable access In the Link Item you can specify variables by an additional data format and array range if necessary. This allows you to request the data from the NCDDE Server in such a way that in most cases further conversion is not necessary.

8-352

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.5 Variable Service

Note In chapter 11 Reference and in the variables online--help you will find a complete description of the variables that can be accessed.

Formats of the NCDDE variables

Formatting instructions for the NCDDE variables are added at the end of the Link Item. The internal preparation of the data allows to format the types integer, floating number and text. The format is specified as an extended `printf'--format of the high level programming language C. The syntax of a NCDDE format instruction is: format: arguments: "" `!' `b' `!' `d' `!' `l' `!' `t' `!' `#' <arguments> <arguments> <arguments> <arguments> <arguments> <arguments> <`printf' format> // converting to a bit--string // d for double as 64bit float // l for long as 32bit integer // t for text as a string // # , the index of the variable-// access as 32bit integer

The data type of the corresponding DDE variables can be found in chapter 11 or in the "NCDDE variable help".

Note If the types of the data selection and the variable actually read do not match, no automatic conversion of the data format is performed, i.e. the wrong data are displayed.

Formatting a number value

Here the actual position of the second axis is read from the NC and is displayed with maximum 11 digits before and three after the decimal point. Without formatting you will get just three digits after the decimal point. Example 8-12 Formatting max. 11 digits before and fix three after the decimal point

Sub Form_Load ( ) Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/Channel/MachineAxis/actToolBasePos[2] Ä(""!d%11.3lf"")" Label1.LinkMode = 2 'Manual Label1.LinkRequest End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-353

Interface HMI <=> NCK/PLC 8.5 Variable Service

03.03

Converting to hexadecimal format In this example the flag byte 5 is read from the PLC and then displayed with leading zeros. Example 8-13 Converting to hexadecimal format

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/PLC/Memory/Byte[5] (""!l%02lx"")" Label1.LinkMode = 2 'Manual Label1.LinkRequest End Sub

Converting to a bit string

In this example the flag byte 5 is read and then displayed as a 32--bit--string. Example 8-14 Converting to a bit string

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/PLC/Memory/Word[5] (""!b%16.16s"")" Label1.LinkMode = 2 'Manual Label1.LinkRequest End Sub

Result: 10101010101010101

Reading a string from the PLC

In this example 10 bytes are read from the data module 81 starting from byte 20 and then are displayed as a string with terminating zeros. Example 8-15 Reading a string from the PLC

Sub Form_Load () Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/PLC/DataBlock/Byte[c81,20,#10] (""!l%lc"")" Label1.LinkMode = 2 'Manual Label1.LinkRequest End Sub

Result: e.g. Hello

8.5.1

Single variable access

If you are working within the Sequence Control (see chapter 7), it is advantageous to use the global variable "g_chNCDDEServiceName" as LinkTopic. It always contains the NCDDEServiceName and the NcddeMachineName as they have been entered in the file MMC.INI. They are separated by the pipe symbol ("|").

8-354

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.5 Variable Service

Single access to three variables In the following example the names of the first three geometry axes are read out. Example 8-16 Single access to the three variables

Sub Form_Load achsname(0).LinkTopic = g_chNCDDEServiceName achsname(0).LinkItem = "/Channel/MachineAxis/name[1]" achsname(0).LinkMode = 2 achsname(0).LinkRequest achsname(1).LinkTopic = g_chNCDDEServiceName achsname(1).LinkItem = "/Channel/MachineAxis/name[2]" achsname(1).LinkMode = 2 achsname(1).LinkRequest achsname(2).LinkTopic = g_chNCDDEServiceName achsname(2).LinkItem = "/Channel/MachineAxis/name[3]" achsname(2).LinkMode = 2 achsname(2).LinkRequest End Sub

PLC-bit access

With the following Link Item bit 4 of the input byte 2 can be accessed. /Plc/Input/Bit[2.4]

PLC-byte access

With the following Link Item the output byte 4 can be accessed. /Plc/Output/Byte[4]

PLC-word access

With the following Link Item the register word 4 can be accessed. /Plc/Memory/Word[8] How to access other variables is described in chapter 11.1.5

8.5.2

Array variable access

Application

An array--access is advantageous when several data are to be read from an area. Thus the computing load of the NCDDE Server can effectively be reduced compared to multiple access of single variables. Example 8--16 gives a bad example for this.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-355

Interface HMI <=> NCK/PLC 8.5 Variable Service

03.03

Note Array accesses speed up the data access and as well the speed of the complete system, since the time needed for communication is considerably reduced.

Syntax

As an introduction here is a short glimpse on the syntax of array areas: Variable name[ c, u, StartIndex, [EndIndex]]

Parameters

Table 8-1 Parameters for accessing array data

name variable name c

description name of the NCK/PLC variable (see chapter 11) when accessing NCK variables (see chapter 11 ) the column index c stands for column and applies to multi dimensional arrays only. when accessing PLC variables c characterizes the data module to be accessed. unit index only for NCK variables (e.g. channel): u stands for unit index of the variable to be read when accessing arrays this gives the first value to be read for array access only specifies the number of values to be read

u StartIndex EndIndex (optional)

Accessing an axis name array

The following example reads the first three axis names from the NCK. The result is a string which contains these axis names e.g. X1,Y1,Z1 in the format "X1Y1Z1". Using the Visual Basic functions "Trim$" and "Mid$" the axis names can be extracted from this result string.

8-356

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.5 Variable Service

Example 8-17 Accessing an axis name array

m_a_namen.LinkTopic = g_chNCDDEServiceName m_a_namen.LinkItem = "/Channel/MachineAxis/name[u1,1,3]" m_a_namen.LinkMode = 2 m_a_namen.LinkRequest 'extracting single names from the text array achsname1.Caption = Trim$(Mid$(m_a_namen.Caption,1,2)) achsname2.Caption = Trim$(Mid$(m_a_namen.Caption,4,2)) achsname3.Caption = Trim$(Mid$(m_a_namen.Caption,7,2))

Accessing axis name arrays

In the following example the axis names of two axes in the second channel are read out, starting with axis 3. The names of axis three and four are read. Apart from the following line it is the same as example 8--16. Example 8-18 Access an axis name array in channel 2

... LinkItem = "/channel/machineaxis/name[u2,3,4]" ...

Accessing PLC array data

The following example reads three bytes of DB 8 starting from byte 2 (i.e. bytes 2,3 and 4 ) as two--digit numbers in hexadecimal format from the PLC. The bytes are then extracted using the Visual Basic functions "Trim$" and " Mid$". Example 8-19 Accessing PLC array data

Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/PLC/Datablock/Byte[c8,2,4](""!l%02lx"")" Label1.LinkMode = 1 'hotlink 'extracting single bytes in hexadecimal format byte_1 = Trim$(Mid$(Label1.Caption,1,2)) byte_2 = Trim$(Mid$(Label1.Caption,3,2)) byte_3 = Trim$(Mid$(Label1.Caption,5,2))

PLC-access specifying the number

The following example reads 5 words of DB 8 starting from word 2 as a four--digit hexadecimal number from the PLC. The words are separated with "_". Example 8-20 Reading a specified number of PLC array data

Label1.LinkItem = "/PLC/Datablock/Word[c8,2,#5](""!l%04lx_"")"

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-357

Interface HMI <=> NCK/PLC 8.5 Variable Service

03.03

Accessing R parameter arrays

This example writes the following values to the three R parameters R3, R4 and R5: R3 = 2,2 R4 = 3,5 R5 = 4,9. Example 8-21 Accessing R parameter arrays

Label1.LinkTopic = "ncdde|ncu840d" Label1.LinkItem = "/CHANNEL/PARAMETER/R[U1,3,5]" Label1.LinkMode = 2 'Manual Label1.Caption = ":2.2:3.5:4.9" Label1.LinkPoke

8-358

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

8.6

File transfer Services (Domain Services)

Overview

The Domain Services can be used to transfer files between the areas (domains) HMI and NCK/PLC. For transfer between HMI and NCK/PLC, IMC File ,

IADSl

IMC Domain and are provided. For compatibility reasons, the data transfer is continued to be possible via DDE. In total, five commands are provided which are summarized in Table 8-2; they operate as a background activity. From SW release 3.3 on there are extended copy functions between the areas can be used. These are especially suitable for editing programs in the NC. The new functions are described in more detail in chapter 8.6.2.

Table 8-2 Commands of the Domain Service

command COPY_TO_NC COPY_TO_NC_BINARY COPY_FROM_NC COPY_FROM_NC_BINA RY MAP_ACC_NC

description copy from MMC to NCK with additional information copy from MMC to NCK without additional information copy from NCK to MMC with additional information copy from NCK to MMC without additional information load ACC files from the NCK and prepare for use in the DDE interface

The state of the data transfers can be monitored with a special state variable.

8.6.1

Transferring data between the HMI and the NC/PLC

Description

Using these functions you can transfer data/data files between the HMI and the NC/PLC.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-359

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Application

You can use these functions e.g. for transferring part programs and tool data to the NC or for transferring S7 and C programs to the PLC. Functions without the extension "BINARY" can transfer files e.g. part programs to the NC. The NCDDE Server adds a block header to the data. This header contains the size and date of the block and path in the NCK file system.

Note Used for data transfer to the NC.

Note Can not be used for transferring files to the PLC, because there is always a NC block header added to the data stream.

BINARY function

Functions without the extension "BINARY" can transfer files e.g. part programs to the NC, but also PLC--modules to the PLC. The NCDDE Server transfers those files without adding a NC block header.

Note Can be used for transferring files to the PLC and to the NC.

Note PLC modules are always copied to the passive file system of the PLC. At that time they are not yet active. The passive modules still have to be activated (compare example 8--33).

8-360

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Syntax

The copy functions must be written as strings following the syntax: COPY_FROM_NC (WinFile,NcFile,TransferState) COPY_TO_NC (WinFile,NcFile,TransferState) COPY_FROM_NC_BINARY (WinFile,NcFile,TransferState) COPY_TO_NC_BINARY (WinFile,NcFile,TransferState) Arguments

Table 8-3 Arguments of the commands COPY_TO/FROM_NC(_BINARY)

name WinFile NcFile TransferState

description source or destination of the information in the MMC area file name for the NCK/PLC environment variable characterizing the transfer state

Argument WinFile

Describes the source and the destination of the information on the MMC side. The first character specifies the type. This parameter is the default file name in a WINDOWS environment. It should include the drive specification, the path and the file name. e.g. "C:\NC\test.MPF"

Piping with the argument WinFile

If the first character of WinFile is a @--character, the argument is interpreted as a pipe name. In connection with the function COPY_TO_NC the service `Copy via pipes' can be executed.

Note Suitable for reading and writing blocks up to a size of 500 bytes. Larger blocks are refused by the NCDDE Server.

During transfers to the NCK/PLC (download) DDE--pokes fill the pipeline and thus provide a direct transfer to the NCK/PLC. An empty poke indicates the end of the transfer (see example 8--27). During transfers from the NCK/PLC (upload) DDE--requests empty the pipeline, that is being filled for the running transfer. If a request returns empty data, this indicates the end of the transfer.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-361

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Shared Memory access with the argument WinFile

If the first character of WinFile is a #--character followed by a number in hexadecimal format, this is interpreted as WINDOWS Shared Memory which is assigned to the Global Heap. The memory allocated with the WINDOWS function GlobalAlloc must be initialized with the following structure. Following this header the utilizable data can be appended. The next example shows the use in Visual Basic. Example 8-22 Shared memory access with WinFile

struct NCDDE_DOMAINMAP_HEADER { unsigned short handle; unsigned short header_size; unsigned long shared_size; unsigned long fill_count; //

// buffer handle (HGLOBAL) (is preset by the client) header length (is preset by the client)

// //

usable length of the data area // (is preset by the client) number of valid bytes in the data area // (is preset by the client during download // and set by the Server during upload) // // // // // // // // // corresponds to the transfer state variable of the transfer command < 100: transfer is running, "state" approximately reflects the percentage of the file, that has already been transferred ==100: transfer successfully terminated > 100: transfer was stopped with error, "state" shows the NCDDE error code (is set by the server)

//

unsigned long state;

//

unsigned long file_mod_time;

//

file modification time // (is preset by the client during download // and set by the server during upload) server-specific data (is set by the server) client-specific data (is set by the client)

unsigned long server_private; unsigned long client_private; unsigned long magic;

// // //

signature for an additional type check // the value is always NCDDE_MAGIC = 0xF6F7F8F9 // (preset by the client)

};

8-362

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Argument NcFile

The argument "NcFile" is the path name in the NCK/PLC environment. This name is built up of a configurable part, that is required for addressing the affected CNC and additionally of the domain path in the CNC environment. Domains in NCK are addressed via the NCDDE Server using an NC file name. /NC /_N_MPF_DIR /_N_WS03_MPF which area: PLC or NC path specification for the NC file name

Argument TransferState

The argument TransferState is the name of a local variable of the server ( variable type: fixed ) to be used for returning the state of the transfer that is carried out in the background. If it is not specified, this variable is created from the Server. The variable TransferState characterizes the state of the file transfer.

Table 8-4 Characterizing the transfer state

transfer state transfer is started transfer is running 0

number

meaning The opening protocol to the CNC is being handled. Transfer is running. The number approximately reports the percentage of the file, that already has been transferred (see note). The closing protocol to the CNC is being handled. The job has been executed without error Transfer is stopped. TransferState contains the reported error code (chapter 11.7).

1 to 98

transfer is terminated transfer successful transfer stopped with error code

99 100 > 100

The range of value has been chosen, so that values <=100 indicate normal conditions, whereas all other values indicate error conditions.

Note As long as the variable has a value between 0 and 99 (transient state) it cannot be used for carrying out further file transfers.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-363

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Stopping the file transfer

In order to stop a running file transfer, the transfer variable must be overwritten with a proper error code, i.e. each byte of the transfer variable which is defined as "LONG" (4 bytes) must have a value not equal 0. Example for a proper error code: 16909060

Visualization

For visualizing the transfer state, the variable TransferState may be used e.g. in a bar display via an Advise/Hotlink connection.

Note During a transfer in BINARY mode and during a transfer using pipes there is no information on the file size available. Therefore the variable TransferState cannot be supplied with the current percentage of transferred data: It is constant at 50%. For very short files the display may jump from 1 to 99. This is a principle problem with Hotlinks and is due to the fact, that the client/application can not quickly enough call for the data from the NCDDE Server.

Uploading a part program

The following example copies the part program "BSP.MPF" to the file "test.mpf" in the directory "C:\NC". The file "test.mpf" is newly created. The part program "BSP.MPF" must exist in the NCK. Example 8-23 Uploading a part program

Sub Form_Load () Label1.LinkTopic = "NCDDE|ncu840d" Label1.LinkMode = 2 Label1.LinkExecute "COPY_FROM_NC (C:\nc\test.mpf, Ä/NC/_N_MPF_DIR/_N_BSP_MPF,trans)" End Sub

Shared memeory access

The following example (Example 8-24 und 8-25) copy the part program "TEST.MPF" to the shared memory area and from there to the Visual Basic variable FILE$ of the type "String". From VB you can access these Data with the functions Memoryread and -write only. You can utilize this feature much better with C++.

8-364

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Note When initializing from Visual Basic, all elements must be written to the string in the NCDDE_DOMAINMAP_HEADER structure in the Intel format, i.e. with high byte and low byte reversed. Example 8-24 Shared Memory part 1: "general declarations"

'Windows SDK functions Declare Function GlobalAlloc Lib "Kernel" (ByVal wFlags As Integer, ByVal dwBytes As Long) As Integer Declare Function GlobalFree Lib "Kernel" (ByVal hMem As Integer) As Integer Declare Function GlobalLock Lib "Kernel" (ByVal hMem As Integer) As Long Declare Function GlobalUnlock Lib "Kernel" (ByVal hMem As Integer) As Int ger Declare Function GlobalHandleToSel Lib "toolhelp.dll" (ByVal hMem%) As Int ger Declare As Any, Declare As Any, Function MemoryWrite Lib "toolhelp.dll" (ByVal wSel%, ByVal dwOffset&, lpvBuf ByVal dwcb&) As Long Function MemoryRead Lib "toolhelp.dll" (ByVal wSel%, ByVal dwOffset&, lpvBuf ByVal dwcb&) As Long

Const HeaderSize = 32

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-365

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Example 8--25 Shared Memeory part 2

Sub Form_Load () Dim ncdde_global_memory$ Static byte(1 To HeaderSize) As Integer Dim ptrToBuffer, ergPtr As Long LenOfFile$ = Space$(5) 'Hotlink, so the NC connection is established when Copy_FROM_NC is called Label2.LinkTopic = "NCDDE|NCU840D" Label2.LinkItem = "/Bag/State/resetActive" Label2.LinkMode = 1 ' allocating the shared Memory handleglobal = GlobalAlloc(&H2102, 1024) ptrToBuffer = GlobalLock(handleglobal) 'NCDDE_DOMAINMAP_HEADER Aufbauen 'handle byte(1) = handleglobal Mod 256 byte(2) = handleglobal \ 256 'header length byte(3) = HeaderSize byte(4) = 0 'number of usable data area byte(5) = &HE0 byte(6) = &H3 byte(7) = 0 byte(8) = 0 'initialize the next 20 bytes with 0 for i=9 to 28 byte(i) = 0 next i 'initialize the NCDDE-Magic also byte(29) = &HF9 byte(30) = &HF8 byte(31) = &HF7 byte(32) = &HF6 'build up string For i = 1 To HeaderSize ncdde_global_memory$ = ncdde_global_memory$ + Chr$(byte(i)) Next i 'initialize shared memory area nBytes& = MemoryWrite(GlobalHandleToSel(handleglobal), 0&, ByVal Äncdde_global_memory$, Len(ncdde_global_memory$)) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 'Copy_From NC execCommand = "COPY_FROM_NC(#" + Hex$(byte(2)) + Hex$(byte(1)) + Ä",/NC/_N_MPF_DIR/_N_TEST_MPF,trans)" Label1.LinkExecute execCommand ' reads data area from shared memeory nBytes& = MemoryRead(GlobalHandleToSel(handleglobal),8, ByVal LenOfFile$, 4) 'read length of usable data from Shared Memory nDataLen& = (Asc(Mid$(LenOfFile$, 2, 1)) * 256) + Asc(Mid$(LenOfFile$, 1,1)) File$ = Space$(nDataLen&) 'read usable data from Shared Memory nBytes& = MemoryRead(GlobalHandleToSel(handleglobal), HeaderSize, ByVal ÄFile$, nDataLen&) erg = GlobalUnlock(handleglobal) erg = GlobalFree(handleglobal) End

8-366

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Downloading a part program

The following example copies a file called "test.mpf" from the directory "C:\NC" to the NC directory "_N_MPF_DIR". In the NC the part program's name is "BSP.MPF". Example 8-26 Downloading a part program

Sub Form_Load () Label1.LinkTopic = "NCDDE|ncu840d" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC(C:\NC\test.MPF, Ä/NC/_N_MPF_DIR/_N_BSP_MPF,trans)" End Sub

Downloading a part program with piping

The following example shows an application of the Pipe mechanism. The file PIPE1.MPF is created in the NC and the NC block "G01 F11111 X5555" is written to it. Example 8-27 Downloading a part program with piping

Sub Form_Load () 'start Pipe Label1.LinkTopic = "NCDDE|ncu840d" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC(@pipe, /NC/_N_MPF_DIR/_N_PIPE1_MPF,trans)" 'describe Pipe Label2.LinkTopic = "NCDDE|NCU840D" Label2.LinkMode = 2 Label2.LinkItem = "@pipe" Label2.Caption = "G01 F11111 X5555" Label2.LinkPoke 'close Pipe Label2.Caption = "" Label2.LinkPoke End Sub

Downloading a S7 - module to the PLC Transferring the module "OB1.PLC" to the PLC's passive file system.

Note PLC modules are always copied to the passive file system of the PLC. At that time they are not yet active. The passive modules still have to be activated (see Example 8--33).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-367

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Example 8-28 Downloading a S7 module to the PLC

Label1.LinkItem = "ncdde|ncu840d" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC_BINARY(C:\TMP\OB1.PLC, Ä/PLC/_0800001P, trans)"

8.6.2

Extended copy functions between the HMI and the NC/PLC

Description

These functions allow to transfer files between the NC/PLC and the MMC.

Application

These functions are especially suitable for transferring single blocks, sections of part program or for editing part programs stored on the NC.

Note The differences between the regular and the "BINARY" variants of the functions are described in chapter 8.6.1.

Syntax

The extended copy functions must be written as strings following the syntax below: COPY_FROM_NC (WinFile,NcFile,seekPos,seekLen,compare String,skipCount) COPY_FROM_NC(_BINARY) (WinFile,NcFile,seekPos,seekLen,compare String,skipCount) COPY_TO_NC (WinFile,NcFile,seekPos,seekLen,compare String,skipCount) COPY_TO_NC(_BINARY) (WinFile,NcFile,seekPos,seekLen,compar String,skipCount)

Arguments

The arguments are described in Table 8-5.

8-368

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Table 8-5

Arguments of the commands COPY_TO/FROM_NC

name WinFile NcFile seekPos seekLen compareString skipCount

description source or destination of the information in the MMC area file name in the NC/PLC environment seek pointer: Starting point of the copy procedure identifier B for block or C for character window size: area to be transferred identifier B for block or C for character search string, maximum length is 32 characters number of found search--strings to be skipped

The commands return after having completely processed all of its sub--commands. Errors which are occurred during the execution of the command, can be analyzed using the variable LastError. The following examples show some typical applications of the new commands.

File transfer of a program part

File transfer of the first 1024 bytes of the part program "TP1.MPF" to the file "test.dat" in the directory "C:\NC" Example 8-29 File transfer program part

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute"COPY_FROM_NC(C:\NC\test.dat, Ä/NC/_N_MPF_DIR/_N_TP1_MPF,1 ,1024 , , 0 )" End Sub

Transferring single blocks

Pipe transfer of the blocks 2 to 4 to the part program X.MPF. Existing blocks are overwritten. Examplel 8-30 Transferring single blocks

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute " COPY_TO_NC_BINARY ( @xpipe , Ä/NC/_N_MPF_DIR/_N_X_MPF , B2 , 3 , , 0 )" End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-369

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Transferring one block

Text transfer ( max. text length: 200 bytes ) to the 2nd block of the part program TEST.MPF. The second block is overwritten. Example 8-31 Transferring one block

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC ( ""!Dies wird der Inhalt des Ä2.Satzes"" , /NC/_N_MPF_DIR/_N_TEST_MPF, B2 , Ä1 , , 0 )" End Sub

8.6.3

MAP-functions between domains

MAP_ACC_NC

Description This function allows to announce global user data (GUD) and NCK machine data to the NCDDE Server. These data are stored in files with the extension ACC which are located in the NCK and contain the variables' access descriptions. Application The command MAP_ACC_NC allows to read ACC files from the NCK and to prepare them for use in the DDE interface i.e. the corresponding connections to these files are created in the NCDDE Server.

Note Allows the user to notify the NCDDE Server of new NCK data. Otherwise these variables/data could not be accessed.

The command works in the same manner as the command COPY_FROM_NC with an extension: the information from the ACC--file is decoded and conditioned for a presentation at the DDE interface. Syntax The call follows the syntax below: MAP_ACC_NC Ä(WinFile, NcFile, TransferState, Area, DataBlock, Timeout, Prefix) Arguments Table 8-6 contains a more detailed description of the arguments. The first three arguments are similar to those of the other Domain Services (see chapter 8.6.1). To get an overview they are included in the following table.

8-370

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

Table 8-6

Arguments of the command MAP_ACC_NC

name WinFile NcFile TransferState Area

description source or destination of the information in the MMC area file name in the NC/PLC environment variable characterizing the state of the transfer area address of the ACC--data, described in chapter 11.1.1. Table 11--1. Here is a complete list: area area address NCK 0 mode group 1 channel 2 axes 3 tool offset 4 feed drive 5 main spindle drive 6 reserved 7 Module type for Variable Service: Numerical hexadecimal value ranging from 00 to FF, described in chapter 11.3.1, for example (excerpt): module identification system state data (Y) global user data (GUD) OEM tool data (TU) magazine directory (TMV) module number 10 17 24 2B

DataBlock

Timeout Prefix

Monitoring the execution time of a NC--MMC transaction in seconds String, to be inserted in front of the ACC variable

Note If the argument WinFile is a file with the extension .NSK, the Domain Service in addition to an ACC file creates a NSK file, which contains the corresponding LINK commands.

ACC files

/NC/_N_NCK_GD2_ACC /NC/_N_CH02_GUD_ACC /NC/_N_AX_SEA_ACC /NC/_N_CH_TEA_ACC ; ; ; ; global NCK user variable MGUD global user variable in the 2nd channel axis specific setting data channel specific NC machine

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-371

Interface HMI <=> NCK/PLC 8.6 File transfer Services (Domain Services)

03.03

Establishing connections for drive machine data

MAP_ACC_NC command header L:\MMC2\NCMDACC.NSK file name in the WINDOWS environment /NC/_N_VS_DIR/_N_VS_TEA_ACCNC--Domain transvariable TransferState 5 area, here number 5 stands for the area address of "drives" 7F DataBlock, here address 7F stands for the module "service values of drives" 10 time monitoring, here 10 seconds /ACC/driveVSA/MD/ prefix, here the string which will be used for accessing the data later. Example 8-32 Establishing connections for drive machine data

Sub Form_Load () Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "MAP_ACC_NC (L:\MMC2\NCMDACC.NSK, /NC/_N_VS_DIR/_N_VS_TEA_ACC,trans,5,7F,10,/ACC/driveVSA/MD/)" End Sub

Accessing already established connections

Accessing a link already established in the previous example with the following components: /ACC/driveVSA/MD/ prefix resulting from the preceding call of the MAP command $MD_TORQUE_THRESHOLD_X[1] name of the machine data, starting with $. Example 8-33 ccessing established connections

Sub Form_Load () Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkItem= "/ACC/driveVSA/MD/$MD_TORQUE_THRESHOLD_X[1]" Label1.LinkRequest End Sub

Accessing global user variables

Chapter 8.13 shows how to access global user variables.

Examples of some MAP_ACC_NC commands

Make sure the parameters WinFile and NcFile are followed by a comma and a space character. Example 8-34 Examples of MAP_ACC_NC commands

all machine data: MAP_ACC_NC(c:\tmp\c.nsk, /NC/_N_COMPLETE_TEA_ACC, trans,0,1A,10,/MD/)

8-372

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.6

Interface HMI <=> NCK/PLC File transfer Services (Domain Services)

all NCK-machine data: MAP_ACC_NC(c:\tmp\nc.nsk, /NC/_N_NC_TEA_ACC, trans,0,1A,10,/NC/) channel machine data of channel 1: MAP_ACC_NC(c:\tmp\ch1.nsk, /NC/_N_CH1_TEA_ACC, trans,2,1A,10,/CH1/) all axis-specific machine data: MAP_ACC_NC(c:\tmp\ax.nsk, /NC/_N_AX_TEA_ACC, trans,3,1A,10,/AX/) all NC-global setting data: MAP_ACC_NC(c:\tmp\sea.nsk, /NC/_N_NC_SEA_ACC, trans,0,16,10,/SEA/) all axis-specific setting data: MAP_ACC_NC(c:\tmp\axs.nsk, /NC/_N_AX_SEA_ACC, trans,3,16,10,/AXSEA/) all NC-global user data: MAP_ACC_NC(c:\tmp\gud.nsk, /NC/_N_NC_GUD_ACC, trans,0,17,10,/GUD/) all channel-specific user data: MAP_ACC_NC(c:\tmp\gud.nsk, /NC/_N_CH_GUD_ACC, trans,2,17,10,/GUD/) all NC-global user data 1 (=SGUD): MAP_ACC_NC(c:\tmp\gd1.nsk, /NC/_N_NC_GD1_ACC, trans,0,17,10,/GUD1/) all channel-specific user data 1 (=SGUD): MAP_ACC_NC(c:\tmp\gd1.nsk, /NC/_N_CH_GD1_ACC, trans,2,17,10,/GUD1/) all NC-global user data 2 (=MGUD): MAP_ACC_NC(c:\tmp\gd2.nsk, /NC/_N_NC_GD2_ACC, trans,0,2D,10,/GUD2/) all channel-specific user data 2 (=MGUD): MAP_ACC_NC(c:\tmp\gd2.nsk, /NC/_N_CH_GD2_ACC, trans,2,2D,10,/MGUD/) all NC-global user data 3 (=UGUD): MAP_ACC_NC(c:\tmp\gd3.nsk, /NC/_N_NC_GD3_ACC, trans,0,2E,10,/GUD3/) all NC-global user data 4 (=GUD4): MAP_ACC_NC(c:\tmp\gd4.nsk, /NC/_N_NC_GD4_ACC, trans,0,2F,10,/GUD4/) all NC-global user data 5 (=GUD5): MAP_ACC_NC(c:\tmp\gd5.nsk, /NC/_N_NC_GD5_ACC, trans,0,30,10,/GUD5/) all NC-global user data 6 (=GUD6): MAP_ACC_NC(c:\tmp\gd6.nsk, /NC/_N_NC_GD6_ACC, trans,0,31,10,/GUD6/) all NC-global user data 7 (=GUD7): MAP_ACC_NC(c:\tmp\gd7.nsk, /NC/_N_NC_GD7_ACC, trans,0,32,10,/GUD7/) all NC-global user data 8 (=GUD8): MAP_ACC_NC(c:\tmp\gd8.nsk, /NC/_N_NC_GD8_ACC, trans,0,33,10,/GUD8/) all NC-global user data 9 (=GUD9): MAP_ACC_NC(c:\tmp\gd9.nsk, /NC/_N_NC_GD9_ACC, trans,0,34,10,/GUD9/)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-373

Interface HMI <=> NCK/PLC 8.7 PI Services

03.03

8.7

PI Services

Overview

IMC Command To carry out program invocation (PI) services on the NC/PLC, is provided. For compatibility reasons, the possibility of providing jobs to the NCK and the PLC is continued to be provided via DDE. A list of the PI services is to be found in PI.hlp .

The PI Services of the NCDDE Server are: PI_START PI_START_BINARY PI_STOP PI_STOP_BINARY PI_RESUME PI_RESUME_BINARY instructs the NCK to execute a command instructs the PLC to execute a command instructs the NCK to stop the execution of a command instructs the PLC to stop the execution of a command instructs the NCK to resume a stopped execution instructs the PLC to resume a stopped execution

PI_START(_BINARY)

Description This functions allows you to send an instruction from the MMC to the NCK. Application These functions are suitable for starting jobs in the NCK. The non--binary transfer is suitable for transfers to the NCK. The binary transfer is suitable for transferring data to the PLC, the NC and to the drives. Syntax The command line for calling PI Services follow the syntax: PI_START(server name, argument 1, argument 2 ... argument n, PI name) PI_START_BINARY (server name, argument, PI name) The PI name for the NC starts with _N_ , followed by 6 characters. Slightly different conventions apply to the PLC. Arguments The arguments are described in detail in the online help, since the arguments' functions depend on the PI Service they are used in.

8-374

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.7 PI Services

Selecting a part program

This example shows, how the PI Service "SELECT" (selecting a program for execution in a channel) selects the part program "BSP.MPF". Note the fact, that you must enter the area path in this command , not the NC file path. Example 8-35 Selecting a part program

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "PI_START(/NC,201,/_N_MPF_DIR/ _N_BSP_MPF, _N_SELECT)" End Sub

Activating OB 1

Activate an OB1 already stored in the passive file system: Example 8-36 Activating OB 1

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "PI_START_BINARY( /PLC, ""@[email protected]@@0800001P"", _INSE)" End Sub

Stop selecting a part program

This example shows how the PI Service "SELECT" (select program for execution in a channel) for the part program "BSP.MPF" is stopped. Example 8-37 Stop selecting a part program

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "PI_STOP(/NC,201,/_N_MPF_DIR/ _N_BSP_MPF, _N_SELECT)" End Sub

Stop activating OB 1 Examplel 8-38 Stop activating OB 1

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "PI_STOP_BINARY( /PLC, ""@[email protected]@@0800001P"", _INSE)" End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-375

Interface HMI <=> NCK/PLC 8.8 More NCDDE Server commands

03.03

8.8

More NCDDE Server commands

Overview

Further commands of the NCDDE Server are listed in Table 8-7:

Table 8-7 Further commands of the NCDDE-Servers

command NEW FREE ANIMATE CALL PLC_ MEMORYRESET create local variables delete variables

meaning

continuously change a local variable execute NCDDE--commands in files reset the PLC memory

NEW

Description Creates a local/internal variable in the NCDDE Server which can then be accessed. Application With the command NEW a new local variable of the NCDDE Server is created. When accessing this variable, no communication with the NCK takes place. If a variable by the name VarName already exists, it is deleted before the new one is created. (analogously to the FREE command in chapter 8.8). Syntax NEW Arguments

Table 8-8 Arguments of NEW

(VarName , value)

argument VarName value

syntax <string> <number>

description name of the variable to be created initialization value for the variable

Creating an internal variable Creates the variable "test" in the NCDDE Server and initializes it with the value 10.0.

8-376

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.8

Interface HMI <=> NCK/PLC More NCDDE Server commands

Example 8-39 Creating an internal variable

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute " NEW ( test , 10.0 )" End Sub

FREE

Description Deletes a variable in the NCDDE Server Application The command "FREE" deletes variables created by the commands "NEW" and "LINK". If the variable is just being used by a file transfer service (chapter 8.6.1) as a state variable, the command "FREE" is rejected. If there exist Advise Links (Hotlinks) to the variables, these links are removed. Other transactions with the NCK and PLC are aborted. Syntax FREE Argument

Table 8-9 Arguments of FREE

(VarName)

argument VarName

syntax < String >

description name of the variable to be deleted

Deleting an internal variable Deletes the variable "test" in the NCDDE Server Example 8-40 Deleting an internal variable

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute " FREE( test )" End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-377

Interface HMI <=> NCK/PLC 8.8 More NCDDE Server commands

03.03

ANIMATE

Description Causes the NCDDE Server to continuously change the value of a local variable that has been created with "NEW". Values are incremented in cycles of approximately 1 second. Application Used for testing your application. Syntax ANIMATE Argument

Table 8-10 Arguments of Animate

(VarName)

argument VarName

syntax < String>

description name of the variable to be changed

Changing an internal variable Continuously changes the value of the variable "test" in the NCDDE Server. Example 8-41 Changing an internal variable

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute " ANIMATE( test )" End Sub

CALL

Description Interprets command files Application With the command CALL NCDDE commands recorded in a file are executed. Each line of the file is passed as a command to the parser of the NCDDE Server. The file may contain comments and space lines. The extension .NSK is to be used for all NCDDE--command files.

Note Allows you to customize the NCDDE Server for your applications.

Syntax CALL

(FileName)

8-378

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.8

Interface HMI <=> NCK/PLC More NCDDE Server commands

Argument

Table 8-11 Arguments of CALL

argument FileName

syntax < string >

description name of the NCDDE-- command file

Example see file "\MMC2\ NCDDE311.NSK"

PLC_MEMORYRESET

Description The command PLC_MEMORYRESET of the NCDDE Server resets the PLC memory. Specify /PLC as area address. Application Resets the PLC memory Syntax PLC_MEMORYRESET(AreaAddr) Argument

Table 8-12 Argument of PLC_MEMORYRESET

argument AreaAddr

syntax < String > area address

descriptions

Resetting the PLC Resets the PLC, which however must have been stopped before. Example 8-42 Resetting the PLC

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|NCU840D" Label1.LinkMode = 2 Label1.LinkExecute "PLC_MEMORYRESET(/PLC)" End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-379

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

8.9

OEM-Visual Basic Controls (OCX files)

Overview

Using this Control some of the insufficiencies of the DDE--communication with standard Controls of Visual Basic are overcome.

Note When developing an OEM application, it is recommended to use these OEM--Visual Basic Controls for accessing the NCDDE--Server.

Standard Controls as for example "label" and "text field" supply DDE communication. This communication however has some insufficiencies: S Events might get lost. The change--procedure of the VB program is not guaranteed to be called, when the value of a DDE variable changes in Linkmode = 1 ( the only remedy is to poll the value via timer control ) S The DDE functionality cannot be nested. Within a DDE--change--procedure no further DDE features of the Controls can be activated. ( again the only remedy is using a timer etc. ) S Only synchronous transactions are realized. The response time intervals for installed Hotlinks and for Requests are quite long. This especially applies, when these actions involve more than one CPU ( NCK, PLC ). S Demand for resources is high For each Control instance that uses DDE, a DDE conversation is installed. This conversation uses 2 WINDOW handles and thus it blocks scarce user resources. S LastError is not handled conveniently in NCDDE. When communication with the NCU is being carried out via NCDDE, the NCDDE Server provides the DDE variable "LastError" for detailed analysis of errors. This variable is specific for each DDE conversation and is valid only if the DDE return is DDE_FNOTPROCESSED.

8.9.1

File DDECTL.VBX

The file DDECTL.VBX is no longer used as an effect of the transfer of VB applications from 16Bit versions to 32Bit versions. (See also Chapter "Transfer of VB applications from 16Bit to 32Bit.)

8-380

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

8.9.2

Filei DCTL.VBX

The file DCTL.VBX was renamed to DCTL.OCX as an effect of the transfer of VB applications from 16Bit versions to 32Bit versions. (See also the following Chapter and Chapter "Transfer of VB applications from 16Bit to 32Bit.)

8.9.3

File DCTL.OCX

Overview

The ActiveX Control DCTL.OCX is a graphical control with extended DDE capabilities. It is similar to the Standard Control Label but in addition to that you will benefit from the following: S Minimized demand of WINDOWS Resources: "DDE Requests", "DDE Pokes" and "DDE Executes" take resources only temporarily. The "DDE Hotlinks" of a WINDOWS Process using the Control DCTL.OCX take all together only one WINDOWS Handle. S Close cooperation with the NCDDE Server: e.g. it delivers the "LastError" value for unsuccessful transactions. S Higher speed: Applications are speeded up because it allows multiple parallel transactions with a server. S Faster output: Optimized screen output and index filtering allows faster screen display. Additionally it makes the BASIC programming easier. S Avoiding side effects: Typical side effects of Visual Basic Controls like aborting programmed connections by pressing the ESCAPE key can be avoided. In this chapter first the properties of this new control, then the additional events are pointed out. This chapter is concluded by some examples, which show the application of the DCTL.OCX.

Properties

Most properties of the DCTL.OCX--Control correspond to the properties of Visual Basic standard controls. These include: S S S S S Style properties Color properties Base properties Drag properties Font properties.

Some properties distinguish the DCTL.VBX control from other controls of Visual Basic:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-381

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

S S S S S S S S S S S

DDE properties HorAlignment property VertAlignment property WordBreak property TabSize property LastError property Data property DataToCaption property LinkCmd property LinkNext property LinkFilter property

DDE properties

The DDE properties are LinkItem LinkTopic (by default the preset NCDDE)LinkTimeout (for synchronizing the LinkCmd ).

HorAlignment property

This property controls the horizontal text justification of the caption display:

Table 8-13 Horizontal text justification

value LeftJustify RightJustify HorCenter left justified (default) right justified centered

property

VertAlignment/Multiline property

This property controls the vertical text justification of the caption display; alternatively to a vertical text justification you can select multiline display. In this case the word wrapping is determined by the WordBreak Property:

Table 8-14 Vertikal text justification

value VertCenter TopJustify BottomJustify MultiLine top justified bottom justified multiline

property vertically centered (default)

8-382

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

WordBreak property

If the property VertAlignment/Multiline has been set Multiline, the property WordBreak determines the word wrapping:

Table 8-15 Types of word wrapping

value False True

property word wrap by CR/LF (carriage--return line--feed sequence) Automatic word wrap if the word does not fit in the line. A carriage--return line--feed sequence will also wrap the line

TabSize Property

Specifies the number of space characters for each tab. The default value is eight; the maximum number allowed is 255.

LastError property

This property allows to send error messages. This value is reset to 0 when a DDE transaction with a server is started. When an error occurs during a transaction and DCTL Control detects this error, it then will ask for a detailed error code, that can be accessed using the property LastError.

Note The DCTL Control does not decode errors which are transferred as data: that includes '#'--characters or spaces from the NCDDE Server.

The variable LastError is described in chapter 11.7.1.

Data property

The Data property is used as an argument for the following DDE transactions:

Table 8-16 Arguments of DDE-transactions

DDE transaction Request Advise Link Poke Execute

argument requested variable value, if the "DataToCaption" property is set FALSE updated values, if the "DataToCaption" property is set FALSE value to be transferred command to be executed

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-383

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

DataToCaption property

The DataToCaption property determines the destination of data received by DDE-transactions.

Table 8-17 Data destination

value True False

meaning data destination is the Caption property data destination is the Data property

LinkCmd property

Changing the property LinkCmd starts the DDE activities of the DCTL Control. If there is no activity, LinkCmd is equal 0.

Table 8-18 LinkCmd property

no. 1

change to Advise Link

DDE activity Establishes an AdviseLink. Returns after the Advise Link has been established. The AdviseLink can be deleted by the Stop command.

terminated by Stop

2

Advise Link_ NotifyData Advise Link_ NotifyDataWhenVi sible Advise LinkAsync

Like "1 -- AdviseLink", additionally action Stop (1) when DDE Data have been received. Like "1 -- AdviseLink", additionally action Stop (2) when DDE Data have been received. Establishes an AdviseLink. Returns before the Advise Link has been established. The AdviseLink can be deleted by a Stop Command. Stop

3

4

5

Advise LinkAsync_ Like "4 -- AdviseLinkAsync", additionally NotifyData action (1) when DDE Data have been received. Advise LinkAsync_ Like "4 -- AdviseLinkAsync", additionally NotifyDataWhenVi action (2) when DDE Data have been sible received. Stop StopAsync StopAsync_ Notify Deletes an AdviseLink. Returns after the AdviseLink has been deleted. Deletes an AdviseLink. Returns before the AdviseLink has been deleted.

Stop

6

Stop

7 8 9

itself Sync

Like "8 -- StopAsync", additionally action Sync (1) when the deletion has been completed

8-384

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

Table 8-18

LinkCmd property

no. 10

change to StopAsync_ NotifyWhenVisible Request RequestAsync RequestAsync_ Notify RequestAsync_ NotifyWhenVisible Execute

DDE activity

terminated by

Like "8 -- StopAsync", additionally action Sync (2) when the deletion has been completed Reads a DDE variable. Returns after the reading has been completed. Reads a DDE variable. Returns before the reading has been completed. Like "12 -- RequestAsync", additionally action (1) when reading has been completed Like "12 -- RequestAsync", additionally action (2) when reading has been completed Sends a command to the server. Returns after the execution of the command is completed. Sending a command to the server. Returns before the execution of the command is completed. Like "16 -- ExecuteAsync", additionally action (1) when the execution of the command has been completed. Like "16 -- ExecuteAsync", additionally action (2) when the execution of the command has been completed. Writes a DDE variable. Returns after the writing has been completed Writing a DDE variable. Returns before the writing has been completed. Like "20 -- PokeAsync", additionally action (1) when writing has been completed. Like "20 -- PokeAsync", additionally action (2) when writing has been completed. Terminates asynchronous commands like synchronous commands. No operation if there is no asynchronous command working. itself Sync Sync

11 12 13

14

Sync

15

itself

16

ExecuteAsync

Sync

17

ExecuteAsync_ Notify ExecuteAsync_ NotifyWhenVisible Poke PokeAsync PokeAsync_Notify

Sync

18

Sync

19 20 21

itself Sync Sync

22

PokeAsync_ NotifyWhenVisible Sync

Sync

23

itself

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-385

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

Actions

The actions (1) and (2) used in the above table are: Action (1) The DdeNotify event procedure is tried to be called. If Visual Basic does not call an event procedure at this point or if the parameter of the event procedure has not been changed, the DCTL control tries ten times per second to send this event as long as the argument of the DdeNotify event procedure is unchanged. Action (2) The DCTL control calls the DdeNotify event when it receives a paint message from WINDOWS. To guarantee the creation of these paint messages to be created by WINDOWS, the pixel in the upper left corner of the control is held invalidated as long as the argument of DdeNotify is unchanged. In effect this mechanism suppresses the display if the control is not visible.

Note New DDE activities should be started only after preceding DDE activities have been terminated. This can be achieved using the argument in the rightmost column (terminated by) of the table. The Hotlinks of all DCTL controls located in the same WINDOWS process share one DDE connection if they use the same "LinkTopic" property. The DDE connections of the other activities (excluding hotlink ) are dynamically created and deleted. Because of that and since a DCTL Control does not own a window, the demand of WINDOWS resources is reduced dramatically.

Note Changing the LinkCmd property evaluates the LinkTopic, the LinkTimeout and the LinkItem property. Some errors regarding these properties are therefore reported when the LinkCmd property is changed. Therefore they must be evaluated at this point.

LinkNext property

The optional property LinkNext holds the name and optionally the index of another DCTL Control. If the LinkNext property is not empty, the DCTL control scans a string transmitted via AdviseLink for the NCDDE index specifications ( 5 digits followed by `:' ). It separates the string into indexed substrings and forwards these along the chained list of DCTL Controls built up by the LinkNext properties. The control whose LinkFilter property matches the index receives the corresponding substring. Substrings that do not be taken in this way, get lost.

8-386

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

LinkFilter property

The LinkFilter value may range from 0 to 65535. How to use it, was described in the paragraph LinkNext.

Events for DCTL.OCX

Most events of the DCTL Control are completely equal to other Visual Basic standard controls as: S S S S S S S S S S Click DblClick MouseDown MouseMove MouseUp DragDrop DragOver KeyDown KeyPress KeyUp.

Event DdeNotify

Especially for the DDE communication the event DdeNotify has been realized: it indicates that new AdviseLink data have been received or that an asynchronous DDE--transaction has been terminated. How to use it, was described in the paragraph LinkCmd (actions (1) and (2)).

Syntax

Sub ctlname_DdeNotify (Flag As Integer) with the argument Flag indicating to the DCTL control, that the event actually has arrived at Basic level. It is expected, that the value of Flag is changed on every call of the event procedure. Because the DCTL Control starts the DdeNotify event until the flag argument is changed. If it is not changed, a cooperative permanent activity results, that unnecessarily loads the system.

8.9.4

Applying DCTL.OCX

Reading and displaying a variable

Assume you want to read a DDE variable and, you want to use the read value immediately and the value should be displayed on the screen. In this case you place a DCTL control ( name e.g. Dctl1 ) on the screen where you want the variable value to be displayed. Your code should look like this:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-387

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

Example 8-43 Reading and displaying a variable

Sub Form_Load ( ) Dctl1.LinkItem = "/Channel/Parameter/R[1]" ' the variable name Dctl1.DataToCaption = TRUE 'that's default, can be omitted Dctl1.LinkCmd = 11 ' commands the reading ' here Dctl1.Caption holds the value of the DDE variable End Sub

Reading a DDE variable in Data Property

Assume you want to read a DDE variable, you want to use the value read immediately and the value should not be displayed on screen. In this case you use one of the labeling DCTL controls (name e.g. Dctl1) on a form and your code should look like this: Example 8-44 Reading in Data Property

Sub Form_Load ( ) Dctl1.LinkItem = "/Channel/Parameter/R[1]" ' the variable name Dctl1.DataToCaption = FALSE ' routing data to the Data property Dctl1.LinkCmd = 11 ' commands the reading ' here Dctl1.Data holds the value of the DDE variable End Sub

Writing a DDE variable

Assume you want to write a DDE variable. In this case you use one of the labeling DCTL controls ( name e.g. Dctl1 ) on a form and your code should look like this: Example 8-45 Writing a variable

Sub Form_Load ( ) Dctl1.LinkItem = "/Channel/Parameter/R[1]" ' the variable name Dctl1.Data = 12 ' the value Dctl1.LinkCmd = 19 ' commands the writing ' here the NC variable is already successfully set to 12 End Sub

Executing a DDE command

Assume you want to send a DDE command to a server. In this case you use one of the labeling DCTL controls ( name e.g. DCTL1 ) on a form and your code should look like this: Example 8-46 Executing a command

Sub Form_Load () Dctl1.Data = "Pi_start(/NC,001,_N_SET_OF)" ' the command Dctl1.LinkCmd = 15 ' sends the command ' here the command is already successfully executed End Sub

8-388

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

Display DDE Hotlink

Assume the value of a DDE variable should be displayed on the screen. In this case you place a DCTL control ( name e.g. DCTL1 ) on the screen where you want the variable value to be displayed. Further you choose only to initiate the hotlink creation making the creation task to a background activity of the DCTL control. Your code can look like this. But it's also possible to perform the coded property setting at design time. Example 8-47 Hotlink to DCTL

Sub Form_Load ( ) Dctl1.LinkItem = "/Channel/Parameter/R[1]" ' the variable name Dctl1.DataToCaption = TRUE ' that's default, can be omitted Dctl1.LinkCmd = 4 ' initiates the creation of a hotlink End Sub

Speed up DDE: parallel actions

Assume a form is loaded and some independent DDE activities have to be performed. In this case you are interested in a fast form load. This is -- regarding DCTL control -- best achieved if you perform DDE activities in parallel. The following code shows an example.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-389

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

Example 8-48 Speeding up doing things in parallel

Sub Form_Load ( ) ' start reading variable 1 Dctl1.LinkItem = "/Channel/Parameter/R[1]" Dctl1.LinkCmd = 12 ' start reading variable 2 Dctl2.LinkItem = "/Channel/Parameter/R[2]" Dctl2.LinkCmd = 12 ' start reading variable 3 Dctl3.LinkItem = "/Channel/Parameter/R[3]" Dctl3.LinkCmd = 12 ' start a hotlink into display Dctl4.LinkItem = "/Channel/Parameter/R[4]" ' Dctl4.DataToCaption = TRUE Dctl4.LinkCmd = 4 Dctl5.Data = "Pi_start(/NC,001,_N_SET_OF)" Dctl5.LinkCmd = 16 'the variable name ' initiates the reading ' the variable name ' initiates the reading ' the variable name ' initiates the reading the variable name ' that's default, can be omitted ' creates the hotlink ' start a command execution ' the command ' commands execution ' here the tree variable ' accesses, the hotlink crea' tion and the ' 'command are ' working in parallel. You ' can not be sure that any of ' them has completed. ' wait until variable 1 read ' wait until variable 2 read ' wait until variable 3 read ' wait until command executed ' here the variable accesses and ' the command have completed, ' the hotlink will 'show it's value on screen ' as soon as possible.

Dctl1.LinkCmd Dctl2.LinkCmd Dctl3.LinkCmd Dctl5.LinkCmd

= = = =

23 23 23 23

End Sub

Speeding up DDE: text arrangement

Assume you need to display many data items at high frequency. Then your program should not enter the BASIC Language for the display task. Further you should minimize the amount of data transferred. On NCDDE side the array access and a combination of array access and "Field" data preparation support this requirement. Fitting to these features the DCTL control provides multiline display and index filtering.

8-390

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.9

Interface HMI <=> NCK/PLC OEM-Visual Basic Controls (OCX files)

Example 8-49 Speeding up using the text arrangement features

'NCDDE array access with "Field" data preparation - Dctl index filtering: ' high frequency display of 5 values in 5 different controls Dctl1.LinkItem = "/Channel/Parameter/R[1,5](!""!d%12.5g"")" ' variable Dctl1.LinkFilter = 1 ' index of accepted data Dctl1.LinkNext = "Dctl2" ' linkage to the next control Dctl2.LinkFilter = 2 ' index of accepted data Dctl2.LinkNext = "Dctl3" ' linkage to the next control Dctl3.LinkFilter = 3 ' index of accepted data Dctl3.LinkNext = "Dctl4" ' linkage to the next control Dctl4.LinkFilter = 4 ' index of accepted data Dctl4.LinkNext = "Dctl5" ' linkage to the next control Dctl5.LinkFilter = 5 ' index of accepted data Dctl1.LinkCmd = 4 ' initiates the creation of a hotlink NCDDE array access - Dctl multiline display: ' high frequency display of 5 values in a column Dctl1.LinkItem = "/Channel/Parameter/R[1,5](""!d%12.5g" Dctl1.LinkItem = Dctl1.LinkItem + Chr$(13) + Chr$(10)+""")" Dctl1.DataToCaption = TRUE ' that's default, can be omitted Dctl1.VertAlignment = 3 ' multiline selection Dctl1.LinkCmd = 4 ' initiates the creation of a hotlink

Using the notification features

Assume your screen display layout depends on a variable which is accessible by DDE. Then you can hotlink this variable into a DCTL control and you can use the DCTL notification feature to rearrange your layout when the variable value changes. For rearranging is a time--consuming task you are interested in performing the rearrangement only when your form is visible on screen. Example 8-50 Using the notification features

Sub Form_Load ( ) `basic code that creates a hotlink with notification "when visible" Dctl1.LinkItem = "/Channel/Parameter/R[1]" `the variable name Dctl1.LinkCmd = 6 `ìnitiates the creation of a hotlink `handler for the notification event End Sub Sub Dct1_DdeNotify ( Index As Integer, Flag As Integer ) Flag = Flag + 1 `Flag MUST change ... `rearrangement to be done End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-391

Interface HMI <=> NCK/PLC 8.9 OEM-Visual Basic Controls (OCX files)

03.03

Error handling

Typical error handling on reading, writing and executing Example 8-51 Errorhandling

On Error Goto TypicalErrorHandling Dctl1.LinkCmd = 11 ' a DDE activity ... TypicalErrorHandling: Select Case Dctl1.Lasterror \ 16777216' selection by error source Case 2 ' MPI level error ... ' e. g. no connection to NC Case 3 , 5 ' NC/PLC level error ... ' e. g. non existing variable Case 7 ' Dctl level error Select Case Dctl1.Lasterror MOD 256 ' selection by error code Case 7 ' Dctl level timeout occurred ... Case Else ' other Dctl level errors ... End Select Case Else ' other error sources ... End Select ...

8-392

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.10

Interface HMI <=> NCK/PLC Diagnosis features for NCDDE-access

8.10

Diagnosis features for NCDDE-access

8.10.1

Testing functions of the NCDDE Server

Overview

Among others, the testing functions of the NCDDE Server give information on the local and external variables that have been declared in the NCDDE Server at the time the file has been created. They are called as follows: 1. starting the NCDDE Server in the program group SINUMERIK 840D MMC-OEM 2. changing with ALT+TAB to the program NCDDE i.e. the NC--communication DDE--Server: an icon is created 3. clicking the icon: the following window appears:

Fig. 8-2

Standard display of the NCDDE Server

These functions are mainly intended for debugging in the environment of the NCDDE Server.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-393

Interface HMI <=> NCK/PLC 8.10 Diagnosis features for NCDDE-access

03.03

Hotlinks

Here a list is created which contains all existing Advise Links (Hotlinks and Warmlinks). It is organized as a 5--column--table with the following meanings:

Table 8-19 Hotlinks

column 1 2

info PDU reference Advise Link

remarks internal value: possible PDU reference for communicating with the NCU and the PLC LOCAL REMOTE PILED link to a local variable link to an external variable external Advise Link was added to another job

3 4

Update time LastError variable

time of the last refresh PDU in an internal time unit of the NCDDE Server LastError specification following chapter 11.14 of this documentation. It is not necessarily identical to the value reported at the server's DDE interface, since there the last error of several transactions corresponding to one connection may be shown. variable name following chapter 11.

5

Variable name

Variables

Here a list is created, that contains all variables, the NCDDE Server is connected to and the device they are located: "LOCAL" or "PLC/NC".

Snapshot

Pressing this button creates a file named "NCDDE_X.TXT", that contains the status, the Hotlinks and the variables of the NCDDE Server.

DDE Test

Pressing this button starts a testing program "DDETEST.EXE" featuring the following:

Table 8-20 DDE testing commands

command Passive Hotlink Request

action none start DoIt

meaning reset state, no function active establish Advise Link read variable

8-394

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.10

Interface HMI <=> NCK/PLC Diagnosis features for NCDDE-access

Table 8-20

DDE testing commands

command Poke Execute

action DoIt DoIt write variable execute a service

meaning

Specify the installed NC under Service|Topic e.g.: NCDDE|NCU840D. "DEFAULT_NC" reads the default setting from the file "MMC.INI". The function Command is switched by clicking one of the 5 choices. The error messages LastError are described in chapter 11.7.

8.10.2

State of a connection

Variable NcState

The server indicates the state of its connection to the CNC via its local variable NcState. This variable exists immediately after the server has been started. It differs from the other local variables of the server only by the fact, that it cannot be modified via the DDE interface. The variable indicates one of the following states:

Table 8-21

States of the variable NcState meaning

value 0 1 2 3 4 normal operation

some connections with CNC broke down all connections with CNC broke down interpreting the startup file server initialization

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-395

Interface HMI <=> NCK/PLC 8.10 Diagnosis features for NCDDE-access

03.03

8.10.3

Troubleshooting

Error-messages from NCK

Error conditions as for example lack of resources, access violations, wrong operating mode etc. are communicated from NCK via acknowledgments of transactions. If the NCDDE Server cannot handle these error conditions, the according transactions Request, Peek and Execute of the DDE interface are terminated with an error state i.e. the application does not get an result.

Variable LastError

A detailed diagnosis is provided by the variable LastError that holds information about the last transaction. It can be read via the Link Item LastError. After being read this variable is set 0. It always indicates the last error registered in the NCDDE Server. The variable LastError consists of 4 bytes. The following error groups can be found in the according byte in descending order (high byte è low byte): S superordinate error class, error source S error area S error class S error code The meaning of the different error codes can be found in chapter 11.7 in the paragraph NCDDE error messages.

Connection break down with NCK

When the connection is broken, the NCDDE Server acknowledges the active transactions Request, Poke and Execute 'negatively'. As long as the connection is broken, the execution of further transactions is refused. At the same time the server tries to resume the broken connection with the CNC. The state of the connection is indicated by the server's local variable NcState.

Handling Advise Links

If an Advise Link connection is broken down, the value returned by the NCDDE Server is the character `#'. Advise Links are restored on the NCK after the connection has been reestablished.

Lack of resources in the NCDDE Server

If a lack of resources occurs for the NCDDE Server, the affected transactions of the DDE interface are terminated with an error code.

8-396

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.11

Interface HMI <=> NCK/PLC How to configure the NCDDE Server for access via network

8.11

How to configure the NCDDE Server for access via network

Beta release

This is a feature, that is admitted for use in a development environment only, but not for your product release.

Overview

In the MMC area the operating system WINDOWS 95 is used. This generally makes it feasible to access the data of NCK from any WINDOWS--PC connected to the PC--network.

Note Under WINDOWS 95 pay attention to the following: The folder "AUTOSTART" must contain a link to the program "\WINDOWS\NETDDE.EXE"

It is supposed that the HMI is integrated into the WINDOWS network by hardware and software (Fig. 8-3). This is done following the steps below: S physically connecting with a network adapter inserted in the ISA slot or a network adapter on the serial port S connecting to the network via Windows S adding an entry in the section [DDEShares] of the file SYSTEM.INI of the HMI with network DDE share manager S appropriately modifying the files MMC.INI and REGIE.INI of the WINDOWS-PC S starting the HMI S starting the WINDOWS--PC S testing the connection

Windows- PC OEMapplication OEMapplication

MMC 102 DDE NCDDE- P Server I

M M P I

SINUMERIK 840D/PLC

Windows network

e.g. Ethernet link

Wondows network

Fig. 8-3

Networking the MMC103

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-397

Interface HMI <=> NCK/PLC 8.11 How to configure the NCDDE Server for access via network

03.03

Application

Allows you to run the MMC 103 User interface on a PC. You can also run your own application and access data of the NCK via "NETDDE".

Configuring the MMC 103

The NCDDE Server has to be declared to the WINDOWS network via the "Network DDE Share Manager" "\MMC2\DDESHARE.EXE" using the command "New Share" and the items of Table 8--23. The program "DDESHARE.EXE" is supplied with the OEM package. Use the following configuration:

Table 8-22 Configuring DDESharefor networking

identification Share Name Application Name Topic Name

entry NCU840D$ ncdde NCU840D

meaning identifier of the HMI, under which it is known in the network name of the application that shall become available for the system via network access part of the name for establishing the DDE connection (must be the same as defined by NcddeMachineName in the file MMC.INI of the PC write/read access without password lock

Access Type

Full

Note The following example applies to WINDOWS 3.x only. Under WINDOWS 95 this is entered in the registry by the program "DDESHARE.EXE".

When the Share Manager is terminated it enters the following line in the section [DDEShares] of the file "SYSTEM.INI".

DDEShares

Example of an entry in the section [DDEShares] of the file SYSTEM.INI. Example 8-52 DDEShares

[DDEShares] MMC2HW0$=ncdde,NCU840D,,15,,0,,0,0,0

8-398

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.11

Interface HMI <=> NCK/PLC How to configure the NCDDE Server for access via network

Note The entry "Share Name" is optional (in this case NCU840D$).The entries "Application Name" and "Topic Name" must be identical to the entries "NcddeMachineName" and "NcddeServiceName" in the section [GLOBAL] of the file MMC.INI of the HMI.

Having restarted the MMC 103, accessing the NCDDE Server via the network is possible.

Configuring the WINDOWS-PC

On the WINDOWS--PC, that expects NCK data to be communicated to a running MMC--OEM--application via the WINDOWS network , the files MMC.INI REGIE.INI must be modified as follows:

Entry in MMC.INI

In the section [GLOBAL] of the file MMC.INI the following entries must be made: Example 8-53 Entry in the file MMC.INI

[GLOBAL] NcddeMachineName=NCU840D$ ; this is the Share Name NcddeServiceName=\\SIN840D\NDDE$ ; this is the computer's name

Entry in REGIE.INI

If the entry Startup2 = name := ncdde is marked as a comment in the section [StartupConfiguration] of the file REGIE.INI on the WINDOWS--PC, its own NCDDE Server must be prevented from being started, because the NCDDE Server of the HMI system (i.e. not his own one) should be used via network: Example 8-54 Marking the start--up entry as a comment in the file REGIE.INI

[StartupConfiguration] ; do not start the own NCDDE Server ; Startup1 = name := ncdde, Timeout := 20000

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-399

Interface HMI <=> NCK/PLC 8.11 How to configure the NCDDE Server for access via network

03.03

Starting sequence of the servers

Before the NCDDE communication is started via network, the NCDDE Server located on the client system (in this case MMC 103) must be started. Then the WINDOWS PC is started again, so the changes made in the files MMC.INI and REGIE.INI become effective. Following this the same instruction syntax as for local NCDDE Server access can be used.

Testing the connection

The program `NCDDE test' can be used for checking the correct access of the external WINDOWS--PC to the NCDDE Server of the MMC 103. To do this the entry "Service/Topic" must be set "\\SIN840D\NDDE$|NCU840D$" (and of course the NCDDE Server must be running on the MMC 103).

Several HMIs in the network

If several MMC 103 are to be addressed via network, these must be assigned different Share Names with DDESHARE.EXE.

8-400

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.12

Interface HMI <=> NCK/PLC Extensions of the NCDDE server

8.12

Extensions of the NCDDE server

8.12.1

Multi variable service

Overview

The multi variable service allows to access several variables in one NCDDE job. This speeds up the access of several single variables. Available for reading and writing access only. (not hotlink). The items are specified like the items of the corresponding single variables/ arrays access separated by '|'. Data obtained by reading accesses are tightly packed when accessing arrays. Separators have to be parametrized like before when accessing arrays with format specifications or with a new access modifications (see chapter 8.12.3). During writing access the first character of the written data is interpreted as a separator for the different data blocks.

Limitations

S Each job consists of max. 8 tightly packed PDUs. This usually allows access to more than 100 variables in one job. (the exact number can be determined by trial) S The PDUs are sent to a destination address. Therefore PLC-- and NC--accesses may not be mixed in one job. Furthermore access to channel--specific variables in different channels may not be mixed. (NC--requirement). The same applies to the access to drive--specific variables. S The multi--variable--service can address real variables only (BTSS--interface/ PLC--BUB). It cannot address date, time, system state list, directory information etc. S Attention, the DDE item size is limited to 255 characters. If the itemstring exceeds this limit, the item has to specified indirectly (see below). Example for both writing and reading with the multi--variable service Item: /channel/parameter/r[1,2](|"!l%ld")|/channel/parameter/r[10](|) Data e.g.: |1|2|10.000000

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-401

Interface HMI <=> NCK/PLC 8.12 Extensions of the NCDDE server

03.03

8.12.2

Indirect item specification

The indirect item specification allows to use items >255 characters (up to 4KB ). The contents of an NCDDE--local variable may be used as item for the DDE access. In this case the name of the local variable must be specified as an item with a leading '>'--character. Example for R10 access: Exec: Item: Data e.g. NEW(x,"/channel/parameter/r[10]") >x 10.000000

Note The data length in the NCDDE--Server for writing variables and executing commands is limited to 4KB. Exceeding this value results in an error 0X01050414.

8.12.3

New access modifications

Can be added to Itemstring in parenthesis: '|' inserts a '|' ­ symbol before each single item on CF_TEXT--reading access. It is not evaluated on writing access. See multi--variable--service example chapter 8.12.1 The hotlink--deactivation is not valid for a variable with such a tag (DEBA/DEBR).

'^'

8-402

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.13

Interface HMI <=> NCK/PLC Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

8.13

Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

Overview

Global user variables are available for both the NCK and for each channel. The NCK--specific global user variables exist in one instance per control. They are used for channel independent settings as well as for program coordination between channels. Channel--specific global user variables exist once for each channel. They are used for channel--specific settings and for data transfer between different programs running in one channel. The same applies to local user data. First of all you have to define and activate user variables, before the NCDDE--Server can access them. For clustering the variables you then have to create and embed the corresponding NSK files. This is done in five steps: 1. 2. 3. 4. 5. create a definition file copy this definition file to the directory /_N_DEF_DIR of the NCK activate the user data as *.ACC--file by loading an INITIAL.INI file. create the *.NSK--file with the MAP command add the created *.NSK file to the NSK file of the NCDDE Server

Definition file:

Global user variables must be defined in definition files (modules) with fix names: S S S S S _N_GUD_DEF for GUD _N_SGUD_DEF for GD1 = SGUD global data Siemens _N_MGUD_DEF for GD2 = MGUD global data machine tool builder _N_UGUD_DEF for GD3 = UGUD global data user _N_GUD4_DEF to _N_GUD9_DEF for GD4 to GD9

These files must be stored in the directory /_N_DEF_DIR of the NCK. The total number of files, that define global data depends on the value of the according machine data 18118 (MM_NUM_GUD_MODULES). The default value of this machine data is 4.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-403

Interface HMI <=> NCK/PLC 8.13 Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

03.03

Defining global data

Global data are defined by: S S S S S S definition header area type variable name dimension comment DEF NCK or CHAN e.g. REAL or INT e.g. LIFTOFF_DIST in square brackets optional text starting with a semicolon

You can find more details in the 840D Programming Guide.

Creating definition files

Definition files can be created in the NCK or in the HMI. In the NCK: A definition file for global variables as they can be created on the part program level in the NCK must be located in the directory /_N_DEF_DIR. It includes: S S S S program identifier in the first line comment line with path specification (will be evaluated ) definitions terminating instruction M02, M17 or M30.

%_N_MGUD_DEF ; $PATH=/_N_DEF_DIR DEF NCK REAL RUECKZUG DEF CHAN INT TABELLE[100] DEF CHAN REAL BLF_OFFS_X M17

Example 8-55 Defining global variables in the NCK

; ; ; ;

defining a global variable defining a channel-specific array defining a channel-specific variable terminate this line with RETURN

In the HMI: A definition file for global variables with the file name MGUD.DEF as it can be created in the MMC is located in the directory C:\TMP and consists of: S definitions S terminating instruction M02, M17 or M30. Example 8-56 Defining global variables in the HMI

DEF NCK REAL LIFTOFF DIST DEF CHAN INT TABLE[100] DEF CHAN REAL BLF_OFFS_X M17 ; ; ; ; defining a global variable defining a channel-specific array defining a channel-specific variable terminate this line with RETURN

8-404

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.13

Interface HMI <=> NCK/PLC Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

Note The MMC must transfer this file to the directory /_N_DEF_DIR of the NCK using the Domain Service COPY_TO_NC:COPY_TO_NC(C:\TMP\MGUD.DEF,/NC/_N_DEF_DIR/ ÄN_MGUD_DEF,trans)

Activating user data:

User data are activated by copying a file named INITIAL.INI to the NCK. This file might be very short: Entering M17 followed by RETURN is sufficient. The following applies to a file INITIAL.INI located in the directory C:\TMP: COPY_TO_NC(C:\TMP\INITIAL.INI, /NC/_N_INITIAL_INI, Ätrans) This generates in the NCK two ACC files named: _N_NCK_GD2_ACC _N_CH_GD2_ACC for the global user variables for the channel--specific user variables

Note Backup all programs, frames and machine data before you load the file INITIAL.INI, since this reformats the static memory of the NCK.

Creating an NSK-file for the NCK

Calling the MAP command creates from the ACC files the corresponding NSK files for the global user variables. These files have the same name as the ACC files. The example shows the call under Visual Basic. Calling the "MAP_ACC_NC" command C:\MMC2\MGUD_NCK.NSK: file name in the WINDOWS environment /NC/_N_NCK_GD2_ACC : NC domain trans : variable TransferState 0 : area NCK 2D : module type MGUD 10 : time limit of the transaction: 10s /ACC/NCK/MGUD : arbitrary string to be used as prefix of the variable names

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-405

Interface HMI <=> NCK/PLC 8.13 Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

03.03

Example 8-57 Creating a NSK file for the NCK--GUDs

Sub Form_Load ( ) Label1.LinkTopic = "NCDDE|MMC2HW0" Label1.LinkMode = 2 Label1.LinkExecute "MAP_ACC_NC(C:\MMC2\MGUD_NCK.NSK, /NC/_N_NC_GD2_ACC, trans, 0, 2D , 10, /ACC/NCK/MGUD/)" End Sub

Creating a NSK-file for a channel

Calling the MAP command creates from the ACC files the corresponding NSK files for the channel--specific global user variables. These files have the same name as the ACC files. The example shows the call under Visual Basic. Calling the "MAP" command C:\MMC2\MGUD_CH.NSK /NC/_N_CH_GD2_ACC trans 2 2D 10 /ACC/CH/MGUD : file name in the WINDOWS environment : NC domain : variable TransferState : area channel : module type MGUD : time limit of the transaction 10s : arbitrary string to be used as prefix of the ; variable names

Example 8-58 Creating a NSK file for the channel--specific GUDs

Sub Form_Load () Label1.LinkTopic = "NCDDE|MMC2HW0" Label1.LinkMode = 2 Label1.LinkExecute "MAP_ACC_NC(C:\MMC2\MGUD_CH.NSK,/NC/_N_CH_GD2_ACC Ä,trans,2,2D,10,/ACC/CH/MGUD/)" End Sub

Note The NSK file is generated in both binary format (*.MAP) and ASCII format (*.NSK).

Merging the NSK the file of the NCDDE-server

Merge the files MGUD_NCK.NSK and MGUD_CH.NSK generated in this example into the NSK file of the NCDDE Server NCDDE311.NSK as follows:

REM IMPORT ADDITIONAL USER VARIABLES CALL(MGUD_NCK.NSK) CALL(MGUD_CH.NSK) REM

8-406

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 8.13

Interface HMI <=> NCK/PLC Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

Accessing NCK user variables

The example below shows how the NCK user variable LIFTOFF_DIST is read from the NCK. Example 8-59 Reading the NCK user variable LIFTOFF_DIST

Sub Form_Load ( ) CtlName1.LinkTopic = g_chNCDDEServiceName CtlName1.LinkItem = "/acc/nck/mgud/RUECKZUG" CtlName1.LinkMode = 2 CtlName1.LinkRequest CtlName1.LinkMode = 0 End Sub

Accessing channel-specific

The example below shows how to read a channel--specific user variable like BLF_OFFS_X of the 2nd channel Example 8-60 Reading a channel--specific user variable

Sub Form_Load( ) CtlName.LinkTopic = g_chNCDDEServiceName CtlName.LinkItem = "/acc/ch/mgud/BLF_OFFS_X[u2]" '2nd channel CtlName.LinkMode = 2 CtlName.LinkRequest CtlName.LinkMode = 0 End Sub

Note You can find more details on how to create and apply user data in the Installation and Start--up Guide /IAD/ and in the Programming Guide /PA/ .

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-407

Interface HMI <=> NCK/PLC 8.14 Online-help for variables

03.03

8.14

Online-help for variables

Overview

The online--help for variables supports the OEM programmer when selecting and defining data from the NCK area. It is structured like all other help files under WINDOWS and offers the same features. The online--help for variables is independent of the OEM package MMC and is stored as a help file named BTSS_VAR.HLP in the directory MMC2.

Target systems

The use of the online--help for variables is not restricted to the OEM programming of the MMC 103: it is also suitable for customizing the MMC 100 and the NC--Var Selector in the PLC programming environment.

Features

The online--help for variables offers information on all NCK variables as listed in chapter 11 and described in more detail in the list book /LIS/ . You can get to the information on a special variable using several description levels. Starting from the data area with: data area module variable example or in alphabetical order using the module: module variable example or using the function SEARCH (FIND) to search for key words. Key words are: short description of the variable name of the variable short description of the module e.g. spindle type e.g. variable spindleType e.g. SSP (for spindle state data).

Copying data

You may copy parts from the displayed help topic and merge it in other files. This is especially useful for inserting the examples of the online--help for variable in your own OEM programs. To do so, proceed as follows: select the menu Edit select the item Copy select the required text using the mouse click Copy switch to the other application insert text.

8-408

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Interface HMI <=> NCK/PLC 8.15 Troubleshooting

Other features

Using the online--help for variables you can also S print topics S insert your own comments to each topic S define bookmarks for quickly finding the most frequently needed information.

Note Comments on the online--help for variables are stored in the file BTSS_VAR.ANN (ANN is short for annex), the bookmark is located in the file WINHELP.BMK (BMK is short for bookmark) in the WINDOWS--directory.

8.15

Troubleshooting

8.15.1

Connection break down with NCK/PLC

S S S S S check connection cable check installation of MPI drivers check MMC.INI WINSTART.BAT S7DPMPI.INI

8.15.2

...didn't respond to DDE-Initiate

S check Link -- Topic S check Link -- Item S has the variable been declared, especially for PLC access: has the data module been declared ?

8.15.3

Form Load takes long because many Hotlinks are being established

S use DCTL Control S establish asynchronous Hotlinks

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

8-409

Interface HMI <=> NCK/PLC 8.16 Determining the active bus nodes

03.03

8.15.4

First Execute commando doesn't work

Reason

For some commands the NCDDE Server expects an existing connection to the NC.

Solution

First establish a hotlink to a NC variable.

8.16

Determining the active bus nodes

In the system control, open the file "Set PG/PC Interface". In the dialog window displayed, select the active communication interface (e.g. CP5611 (MPI) <Active>) in the list "Interface Parameter Assignment Used" and actuate the "Diagnostics" button. With the "Test" button in the subsequently displayed dialog, you can determine whether the selected communication interface is operable. By means of the "Read" button, you can determine the active bus nodes. Via the program, the active bus nodes can be determinded by reading out the variable /Nck/Nck/BusState. The system outputs a 32-bit value in which set bits display an active bus node (bit 0 set = active note at bus address 0, bit 1 set = active node at bus address 1, etc.) The function are available at the MPI and Profibus. The 32 "lower" addresses of the local bus segment are considered.

8-410

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Alarms (Alarm Handling)

Overview

9

The alarms&events server provides the current system alarms and messages for HMI via COM interfaces. For compatibility reasons, access to the alarm server (mbdde.exe) is continued to be granted via DDE. The following COM servers are provided: OPC-Alarm&Event IMC-EventList IMC-EventCreation ... is intended to trace alarms and events ... provides a list of all existing alarms and events ... is intended to create HMI alarm

System alarms/messages

The following alarms/messages may occur in the system: S S S S S S S NCK alarms drive alarms cycle program alarms PLC alarms Compile--Cycles alarms PLC messages HMI alarms

Features

The DDE Alarm Server provides the following registry features for messages: S registering alarms S acknowledging alarms S query functions: highest priority alarm second priority alarm number of active alarms number of alarms occurred list of active alarms S recording log files S displaying the alarm texts in the selected language

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-411

Alarms (Alarm Handling) 9.1 Communication

03.03

9.1

Communication

Client Server

The WINDOWS application (DDE client) communicates with the Alarm Server via the DDE interface supplied by WINDOWS. Fig. 9--1 gives an overview of the features of the Alarm Server. The following must be specified for each communication job: S Service S Topic S Item S Mode name of the DDE--Server to be addressed topic of the connection data to be accessed type of connection

For basic information on the DDE communication refer to chapter 8.1. For more details see chapter 8.3 of the OEM documentation. Service and Topic have to be entered in the section [mbdde] of the initialization file mbdde.ini. The following settings apply to the DDE Alarm Server: Service = mbdde (mb is short for the registry module) Topic = alarms Item = <string> (character string identifying a specific service)

9-412

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Alarms (Alarm Handling) 9.1 Communication

HMI

Siemens and OEM application (Clients)

COM

Alarm&EventServer

DDE communication

Alarm Server (MBDDE.EXE)

NCDDEServer MPI MPI SINUMERIK 840D (NCK/PLC) Fig. 9-1 Communication with the registry module

Protocol files

Programming in VB

In Visual Basic the Service and the Topic name are combined in the property "LinkTopic". There they are written separated by a pipe symbol "|" (e.g. "mbdde|alarms" ).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-413

Alarms (Alarm Handling) 9.2 Types of Services (DDE link mode)

03.03

9.2

Types of Services (DDE link mode)

The DDE Alarm Server provides three types of services. These are listed in Table 9-1.

Table 9-1 Type of services of the Alarm-Server

link mode Execute Advise ( Hotlink ) Request

meaning requests a service from the Server example: generating an alarm message instructs the Server to monitor certain data. If these data are changed the client will be informed or the data will be updated automatically. requests data the Server has to transmit afterwards

9.3

Services of the Alarm DDE Interface

Overview

Table 9-2 Services of the Alarm-Server

chapter 9.3.1 9.3.2 9.3.3

contents Commands of the Alarm Server Advise variables of the Alarm Server Request variables of the Alarm Server

9.3.1

Alarm Server commands

Note the following when executing these commands: S The Visual Basic label property LinkMode must have been set 2 for `Manual'. S The command itself must be executed with LinkExecute.

9-414

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.3

Alarms (Alarm Handling) Services of the Alarm DDE Interface

AlarmFree

Description This command clears alarms from the MMC Application Alarms can be cleared by any application, if the corresponding acknowledgment variable is known. Syntax AlarmFree (Quitvar) Argument

Table 9-3 Arguments of AlarmFree

argument Quitvar Example 9-1

syntax <string>

description name of the acknowledgment variable

Clear all alarms, that correspond to the acknowledgment variable test (AlarmFree)

Sub Form_Load ( ) Label1.LinkTopic = "mbdde|alarme" Label1.LinkMode = 2 Label1.LinkExecute "AlarmFree ( test )" End Sub

AlarmMsg

Description Sets an alarm Application An application can set an alarm in any of the connected NCUs. Syntax AlarmMsg( No,[Prio],[Var1...Var4],[TimeDate],Type,[NCU],Quitvar) Arguments

Table 9-4 Arguments of AlarmMsg

arguments No Prio

description the identification number of the alarm to be set the priority of the alarm message (optional): The messages are added to the list in the order of their priority. The priority of each message type can be set in the file mbdde.ini. the contents of the variables to be inserted in the alarm string to be displayed. Up to four variables (%1 to %4) may be specified (optional)

Var1 ... Var4

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-415

Alarms (Alarm Handling) 9.3 Services of the Alarm DDE Interface

03.03

Table 9-4

Arguments of AlarmMsg

arguments TimeData

description the desired time/date (optional). If the argument Time is specified, its value is taken as the time the alarm occurred, otherwise mbdde.ini determines the time type of the alarm 1 2 3 4 PowerOn Reset Cancel NC--Start

Type

NCU Quitvar Example 9-2

name of the NCU the acknowledgment variable Setting the alarm 1019 with priority 100 (AlarmMsg)

Sub Form_Load ( ) Text1.LinkTopic = "mbdde|alarme" Text1.LinkMode = 2 Text1.LinkExecute "AlarmMsg (1019,100,1 2 3 4,26.07.99,1,NCU_1,quit1)" End Sub

9.3.2

Advise variables of the Alarm Server

These variables of type string can be accessed by the services Advise and Request. When using the Advise Service note the following: S The label property (Visual Basic) LinkMode must be set 1 (Automatic) or 3 (Notify). S 1 means, that the value of the variable that is for example being displayed, is updated automatically S 3 means, that the Warmlink just informs the client about the change of data. To get the new value, the client must read the data by LinkRequest. When using the Request service note the following: S The label property (Visual Basic) LinkMode must have been set 2 ( Manual ) S Read the value of the variable by LinkRequest.

9-416

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.3

Alarms (Alarm Handling) Services of the Alarm DDE Interface

AlarmList

Description Contains the current alarm list. The character preceding the first `#'--character is the number of active alarms. The rest is shown in Example 9--5. Application Allows an application to access the alarm list for displaying or editing. Syntax AlarmList Arguments none Example 9-3 Displaying the alarm list in label 1 (AlarmList)

Sub Form_Load ( ) Label1.LinkTopic = "mbdde|alarme" Label1.LinkItem ="AlarmList" Label1.LinkMode = 1 End Sub

DialogAlarm

Description Contains a dialog box alarm (display area 1), if such an alarm is active. Application Allows an application to display the currently active dialog box alarm Syntax DialogAlarm Arguments none Example 9-4 Displaying the dialog alarms in label 1 (DialogAlarm)

Sub Form_Load ( ) Label1.LinkTopic = "mbdde|alarme" Label1.LinkItem = "DialogAlarm" Label1.LinkMode = 1 End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-417

Alarms (Alarm Handling) 9.3 Services of the Alarm DDE Interface

03.03

FirstAlarm

Description Contains the alarm that currently has the highest priority Application Allows an application to access the alarm with the highest priority via Request or to automatically have it updated. Syntax FirstAlarm Arguments none Example 9-5 Reading the alarm with the highest priority via Request (FirstAlarm)

Sub Form_Load ( ) Label1.LinkTopic = "mbdde|alarme" Label1.LinkItem = "FirstAlarm" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result: "12080#100#NCU_1: channel 1 block syntax error in text eal h #03.01.97 20:57:08#0#12#NEW#5#NCU_1#hlp\alarm_GR.hlp#12080" 12080 100 NCU_1: channel ... 03.01.97 ... 0 12 NEW 5 NCU hlp\alarm_GR.hlp 12080 alarm number priority of the alarm name of the NCU and the alarm text date and time display area "message line" acknowledgment variable "12" internal value of the acknowledgment variable alarm type "NC--Start" sender of the alarm: "NCU_1" path and name of the help file again the alarm number

9-418

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.3

Alarms (Alarm Handling) Services of the Alarm DDE Interface

MZ1

Description Contains the contents of the message line 1 Application Allows an application to display the current contents of message line 1 Syntax MZ1 Arguments none Example 9-6 Displaying the contents of the message line 1 in the label Message line (MZ1))

Sub Form_Load ( ) Meldezeile.LinkTopic = "mbdde|alarme" Meldezeile.LinkItem = "MZ1" Meldezeile.LinkMode = 1 End Sub

MZ2

Description Contains the contents of message line 2 Application Allows an application to display the current contents of message line 2 Syntax MZ2 Arguments none Example see Example 9--6

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-419

Alarms (Alarm Handling) 9.3 Services of the Alarm DDE Interface

03.03

NrOfAlarm

Description Contains the number of active alarms Application Allows an application to read the number of active alarms to implement e.g. a life display of this number. If no alarms are active, `0' is returned. . Syntax NrOfAlarm Arguments none Example 9-7 Displaying the number of alarms in the label "AnzAlarm" using the service Advise--Notify (NrOfAlarm)

Sub Form_Load () AnzAlarm.LinkTopic = "mbdde|alarme" AnzAlarm.LinkItem = "NrOfAlarm" AnzAlarm.LinkMode = 3 'Advise-Notify End Sub Sub AnzAlarm_LinkNotify () AnzAlarm.LinkRequest 'mit LinkRequest lesen Print AnzAlarm.Caption End Sub

9.3.3

Request variables of the Alarm Server

These variables of type string can be accessed via the alarm service Request. When using the Request service, note the following: S The Visual Basic LinkMode must be set 2 ( Manual ) S The contents of the variable can be read with LinkRequest

9-420

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.3

Alarms (Alarm Handling) Services of the Alarm DDE Interface

AlarmSeqNr

Description Contains the number of alarms that occurred since the last power--on (including the already acknowledged ones). Application Allows an application to access the number of alarms that occurred since the last power--on of the MMC . Syntax AlarmSeqNr Arguments none Example 9-8 Reading the overall number of alarms (AlarmSeqNr)

Sub Form_Load () Label1.LinkTopic= "mbdde|alarme" Label1.LinkItem = "AlarmSeqNr" Label1.LinkMode = 2 Label1.LinkRequest End Sub

AlarmTextForID

Description Reads the alarm text corresponding to a specific alarm identification number. Application Allows an application to inquire the alarm text corresponding to a specified alarm number. Syntax AlarmTextForID(alarmNo) Arguments

Table 9-5 Arguments of AlarmTextForID

argument alarmNo

description identification number of the alarm which corresponding alarm text is to be returned

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-421

Alarms (Alarm Handling) 9.3 Services of the Alarm DDE Interface

03.03

Example 9-9

Inquiring the alarm text corresponding to alarm no. "12080" (AlarmTextForID)

"mbdde|alarme" "AlarmTextForID(12080)" 2

Sub Form_Load ( ) Label1.LinkTopic = Label1.LinkItem = Label1.LinkMode = Label1.LinkRequest End Sub

Result: 012080 0 0 "channel %1 block %2 syntax error in text %3 " 012080 0 0 "channel ..." alarm number display area (here: message line) helpfileId (here: File0) alarm text

HelpForID

Description Contains the name of the help file corresponding to an alarm number. Application Allows the application to find the help file corresponding to a specific alarm number. Syntax HelpForID(alarmNo) Argument

Table 9-6 Arguments of HelpForID

argument alarmNo

description number of the alarm the help file is to be determined for

Example 9-10 Reading the name of the help file corresponding to alarm no. 1080 ( HelpForID)

Sub Form_Load () Label1.LinkTopic = "mbdde|alarme" Label1.LinkItem = "HelpForID(1080)" Label1.LinkMode = 2 Label1.LinkRequest End Sub

9-422

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.4

Alarms (Alarm Handling) Initializing the Alarm Server

9.4

Files

Initializing the Alarm Server

The Alarm Server (registry module) uses the following files : MBDDE.INI NETNAMES.INI alarm text files

9.4.1

The file MBDDE.INI

Description The file MBDDE.INI contains, among others, the following sections:

Table 9-7 Sections of MBDDE.INI

section Alarms TextFiles

meaning general information concerning the alarm list. example: time and date format of the registry entries path and file names of the alarm text lists example: MMC=..\dh\mb.dir\alm_ for MMC alarm texts in the directory mb (registry module). names and paths of the help files example: File0=hlp\alarm_ default definition of the priorities of the different alarm types example: POWERON=100 characteristics of the log file example: file=.\proto.txt name and path of the log file information about the keys that may be used to clear an alarm example: Cancel=+F10 clear alarm with the key combination Shift+F10

Helpcontext DEFAULTPRIO PROTOCOL

KEYS

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-423

Alarms (Alarm Handling) 9.4 Initializing the Alarm Server

03.03

Section [Alarms]

Description The settings in this section determine various properties of the alarm list. Example 9-11 Section [Alarms] in the file MBDDE.INI

[Alarme] TimeFormat=%d.%m.%y %H:%M:%S MaxNr=50 ORDER=LAST PLCTIME=5000

TimeFormat Here the format, that should be used for displaying time and date is to be entered. It follows the CTime::Format defined for the Microsoft Foundation Classes (described in: Microsoft Reference Volume I, Class Library Reference For the Microsoft Foundation Class Library). MaxNr Determines the maximum size of the alarm list. ORDER Determines the order in which the alarms are inserted in the alarm list. The option FIRST makes newer alarms stand on top of the list, the option LAST inserts the newest alarm at the bottom. PLCTIME Siemens internal item used for PLC software releases before 3.2.

Note Do not modify the entry for PLCTIME!

Section [TextFiles]

Description In this section the names and the paths of the text files for the alarms are set. The server reads language--dependent help texts from these lists. The textlists are described as follows: message source_language.com . Example: MMC messages in English are contained in the file alm_gb.com . The identifier alm_ , that is specified in the INI file is extended automatically by the registry module according to the selected language. The corresponding file is opened.

9-424

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.4

Alarms (Alarm Handling) Initializing the Alarm Server

Example 9-12 Section [TextFiles] in the file MBDDE.INI (Voreinstellung)

[TextFiles] MMC=\dh\mb.dir\alm_ NCK=\dh\mb.dir\aln_ PLC=\dh\mb.dir\alp_ ZYK=\dh\mb.dir\alz_ CZYK=\dh\mb.dir\alc_ UserMMC= UserNCK= UserPLC= UserZYK= UserCZYK= ;MMC alarms ;NCK alarms ;PLC alarms ;cycles alarms ;Compile--Cycles alarms ;user defined MMC alarms ;user defined NCK alarms ;user defined PLC alarms ;user defined cycles alarms ;user defined Compile--Cycles alarms

Note The alarm texts in the files specified under UserMMC, UserNCK, UserPLC, UserZYK and UserCZYK overload the corresponding texts of the files defined in MMC, NCK, PLC, ZYK and CZYK. Therefore the user should modify files according to the needs of his system exclusively in UserMMC, UserNCK, UserPLC, UserZYK and UserCZYK.

Message texts, externally generated

Creating message and alarm text with any DOS--editor may cause problems with special characters, like ä, ö or ü: The reason are the different character sets OEM and ANSI. Windows generally uses ANSI. An automatic recognition is not possible. To nevertheless import DOS generated files, add a blank and the string "DOS" after the name of the text file in MBDDE.INI (upper and lower case allowed). The alarm server MBDDE then automatically performs a conversion from OEM to ANSI.

Note After the parameter DOS has been set or reset, the date of the effected text file must be updated (by just opening and saving), since otherwise the change of the parameter will not be noticed by the system.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-425

Alarms (Alarm Handling) 9.4 Initializing the Alarm Server

03.03

Example 9-13 Section [TextFiles] in the file MBDDE.INI (with user defined texts)

[TextFiles] MMC=\dh\mb.dir\alm_ ;MMC alarms NCK=\dh\mb.dir\aln_ ;NCK alarms PLC=\dh\mb.dir\alp_ ;PLC alarms ZYK=\dh\mb.dir\alz_ ;cycle alarms CZYK=\dh\mb.dir\alc_;Compile-Cycles alarms UserMMC= ;user defined MMC alarms UserNCK= ;user defined NCK alarms UserPLC= c:\dh\mb.dir\myplc_ DOS ;user defined PLC alarms as DOS file UserZYK= c:\dh\mb.dir\mycyc_ ;user defined cycle alarms UserCZYK= ;user defined Compile-Cycles alarms

Section [Helpcontext]

Description This section specifies the names and paths of the help files that contain help texts in the WinHelp format. This list may include a maximum of 10 entries. The help files are described in the same way the textlists are: messagesource_language .hlp . Example: Help texts for the English OEM messages are located in the file oem_gb.hlp . The identifier hlp\OEM_, that is specified in the INI file is extended automatically by the message module according to the selected language. The corresponding file is opened. Example 9-14 Section Helpcontext in the file MBDDE.INI

[HelpFilescontext] File0=hlp\alarm_ File1=hlp\oem_ ... File9=hlp\xyz_.

File The name of the help file that corresponds to the help--id and the alarm number can be determined via the function `HelpForAlNr'.

9-426

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.4

Alarms (Alarm Handling) Initializing the Alarm Server

The alarm text file contains the data in the following format: 100001 0 With alarm number: 100001 display location: 0 HelpfileID: 0 alarm text: `Function has not yet been implemented!' The HelpfileID 0 specifies the index of the file to be scanned for the help text; in this case File0. The entry File0 must have been assigned a help file. In example 9-14 this is the file "alarm_gb.hlp" in the directory `hlp', when the English language is selected. The substitution is carried out by the MBDDE Server. The calling application is supplied with the name of the help file and a HelpID ( that is equal to the alarm number from now on ). 0 `Function has not yet been implemented!'

Section [DEFAULTPRIO]

Description The value for each priority is set '100' by default. Modifying the priorities of the alarm types is possible via the following entry in the INI--file.

Note Changing priorities might lead to lower priority alarms, like e.g. NC--start alarms being displayed before Reset--alarms, even though the Reset--alarms are more important and might have the more rigor consequences. Example 9-15 Section [DEFAULTPRIO] in the filei MBDDE.INI

[DEFAULTPRIO] MMC=100 CANCEL=100 RESET=100 POWERON=100 NCSTART=100 PLC=100 PLCMSG=100

File Path and name of the log file Filter

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-427

Alarms (Alarm Handling) 9.4 Initializing the Alarm Server

03.03

Sektion [PROTOCOL]

Description This section defines different characteristics of the protocol that specifies how particular error messages are to be registered. Example 9-16 Section [PROTOCOL] in the file MBDDE.INI

[PROTOCOL] File=.\proto.txt Filter=Mode!1 Records=20 RecLen=300 FlushTime=10 DiskCare=0

File Path and name of the log file Filter Criteria for selecting the alarm messages to be recorded. The following notation can be used: [IDENTIFIER][RELATION][CHARACTERISTICS][OPERATORS] IDENTIFIER: S S S S S Nr Prio Mode Type From alarm number priority message/alarm line or dialog box alarm type ( PowerOn, Cancel, ... ) sender of the alarm acknowledgment variable equal less than greater than not

S Quitvar RELATION: S S S S ':' '<' '>' '!'

CHARACTERISTICS: S numbers S strings OPERATORS S ',' S '' S '#' # S '#' # comma stands for a logical or, only inside a filter space stands for a logical and between different filters pipe stands for a logical or between different filters Pipe bedeutet log. oder zwischen einzelnen Filtern.

9-428

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.4

Alarms (Alarm Handling) Initializing the Alarm Server

Example: Filter=Typ<3 Only POWERON and RESET alarms are registered. Example: Filter=From:NCU_1 Only NCU_1 alarms are registered. Example: Filter=From:NCU_1 Typ:1,3 Only POWERON and CANCEL alarms from NCU_1 are registered. Records Characterizes the numbers of entries in the log file. If the actual number exceeds this value, the server starts to override old entries (principle: ring buffer). RecLen length of an entry in bytes FlushTime When buffered input/output is used, after this period of time (in seconds) the contents of the buffer are transferred to the log file. DiskCare For the message module MBDDE now it be configured, whether the alarm protocol is written on the hard disk (file mmc2\proto.txt ) and when. Up to now the alarm protocol was written on the hard disk each time an alarm appeared or disappeared. The entry "DiskCare" in the section [PROTOCOL] of the file MBDDE.INI now controls, when the protocol file is to be written. The following parameters may be set: DiskCare = --1 (default) The MBDDE server runs the alarm protocol in the main memory. The protocol is written to the hard disk only when this is ordered by a softkey in the diagnosis mode. This also means, that the alarm protocol is not available after the control has been turned off, unless it has been written to the hard disk before. DiskCare = 0 DiskCare = n The protocol file is saved immediately after a change (like earlier behavior). Changes of the alarm state are written to the protocol file, if for n seconds no change has occurred.

The entry DiskCare is evaluated during start--up only.

Sektion [KEYS]

Description With the following entry a function--key (e.g. Shift+F10) is assigned the cancel function.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-429

Alarms (Alarm Handling) 9.4 Initializing the Alarm Server

03.03

Example 9-17 Section [KEYS] in the file MBDDE.INI

[KEYS] Cancel=+F10

This makes it possible to acknowledge cancel--alarms on the PC development system, too.

Section [MmcAlarmDisable]

Description The sender identifications which are entered here are disabled and will not be accepted in the AlarmMsg--job. In MBDDE.INI "PLC", "NCU" and "MBDDE" are disabled by default. Example 9-18 Section [MmcAlarmDisable] in the file MBDDE.INI

[MmcAlarmDisable] DisableSenderOfMmcAlarm0 DisableSenderOfMmcAlarm1 DisableSenderOfMmcAlarm2 DisableSenderOfMmcAlarm3 = = = = PLC NCU MBDDE .....

The maximum number of entries is 100 (0 to 99). The OEM user can apply these entries to disable special sender identifications.

9.4.2

The file NETNAMES.INI

Description The file NETNAMES.INI contains the bus addresses of all bus participants. The Alarm Server needs it to determine, which NCUs are available as well as which names they have. Thus the NCU's name can be displayed in the alarm message. Example 9-19 NETNAMES.INI (excerpt)

[param NCU_1] nck_address= 13 plc_address= 13 name=Standard Machine [param NCU_2] nck_address= 13 plc_address= 13 name=Test Maschine

9-430

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.4

Alarms (Alarm Handling) Initializing the Alarm Server

9.4.3

Alarm text files

Description Alarm text files always have the extension .COM , e.g. alm_gb.com ;MMC alarms English

These files are located in the Data Management tree \DH in the directory \MB. Example: C:\DH\MB\alm_gb.com The language--specific text file is loaded corresponding to the currently selected language. Language abbreviations In the names of language DLLs and alarm text files the language is characterized by a two character abbreviation:

Table 9-8 Language abbreviations

Language Chinese (peoples republic) Chinese (Taiwan) English French German Italian Korean Spanish CH TW GB FR GR IT KO SP

Shortcut

You can find these abbreviations in the section [LANGUAGE] of the data file MMC.INI under LanguageList. Alarm text file The alarm text file is structured as follows:

Table 9-9 Contents of the alarm text file

entry alarmNo display alarm number

meaning 0 display in the alarm/message line of the header 1 display in the dialog box

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-431

Alarms (Alarm Handling) 9.4 Initializing the Alarm Server

03.03

Table 9-9

Contents of the alarm text file

entry help--Id text

meaning assigning a help file to the alarm help text (max. 110 characters) The number of any other alarm might be entered here. In this case the help text of that alarm will be displayed.

The alarm text file may include comments. These must begin with "\\". Example 9-20 An entry in the file ALN_GR.COM

027011 0 0 "axis %1 Safe velocity exceeded"

9-432

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 9.5

Alarms (Alarm Handling) Alarm areas of the Sinumerik 840D

9.5

Alarm areas of the Sinumerik 840D

Table 9-10 Areas of alarm numbers

alarm number 000 000 to 009 999 010 000 to 019 999 020 000 to 029 999 030 000 to 039 999 040 000 to 059 999 060 000 to 062 999 063 000 to 064 999 065 000 to 067 999 068 000 to 069 999 070 000 to 079 999 080 000 to 099 999

alarm area NCK alarms general alarms channel alarms axis/spindle alarms functional alarms reserved cycle alarms SIEMENS reserved cycle alarms user reserved Compile--Cycles and OEM alarms reserved MMC alarms/messages

alarm text file ALN_xx.COM ALN_xx.COM ALN_xx.COM

ALZ_xx.COM

ALN_xx.COM, ALC_xx.COM

100 000 to 109 999

MMC 100

100 000 to 100 999 basic system 101 000 to 101 999 diagnostics 102 000 to 102 999 services 103 000 to 103 999 machine 104 000 to 104 999 parameter 105 000 to 105 999 programming 106 000 to 106 999 reserved 107 000 to 107 999 OEM 108 000 to 109 999 reserved 110 000 to 119 999 120 000 to 129 999 130 000 to 139 999 140 000 to 199 999 (200 000 to 299 999 MMC 101 MMC 103 OEM reserved MCU alarms ALM_xx.COM

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

9-433

Alarms (Alarm Handling) 9.5 Alarm areas of the Sinumerik 840D

03.03

Table 9-10

Areas of alarm numbers

alarm number 300 000 to 399 999

alarm area drive alarms PLC alarms/messages

alarm text file ALN_xx.COM

400 000 to 499 999 500 000 to 599 999 600 000 to 699 999 700 000 to 799 999 800 000 to 899 999 810 000 to 810 009 900 000 to 999 999 xx = Language shortcut

general alarms channel alarms axis/spindle alarms user area execution chains / graphs system error messages of the PLC reserved

ALP_xx.COM

ALP_xx.COM ALP_xx.COM

9-434

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Data Management

Overview

10

The communication with the data management server is carried out via the COM interfaces. For compatibility reasons, the possibility of communicating with the data server is continued to be provided via DDE. The data management server uses the NCDDE server as an inteface to the NCK. The Data Management provides the interfaces for handling files and directories: S S S S S S S S creating deleting copying listing downloading (copy from MMC to NCK, source is deleted) uploading (copy from NCK to MMC, source is deleted) setting access permission perform auxiliary functions.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-435

Data Management 10.1 General

03.03

10.1

General

Overview

The Data Management is based on the description of the data structure on the hard disk (data scheme) which can be read at run time in the system. The communication with the Data Management Server works via the Windows -DDE (Dynamic Data Exchange) -- interface (see chapter 8.1). The Data Management--Server uses the NCDDE--Server as interface to the NCK.

HMI

Siemens and OEM applications (clients)

IMC File

IADS

IMC Domain

Data Management Server (DHSERVER.EXE)

Windows file system

NCDDE server MPI

MPI SINUMERIK 840D (NCK/PLC

Fig. 10-1

Data Management Server in the complete system

Types of calls

Three types of calls are realized corresponding to the complexity of the functions: S request jobs: S simple Execute jobs: S complex Execute jobs: simple requests returning data simple requests not returning data complex requests returning data. These jobs might run for a long period of time

10-436

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.2

Data Management Directory structure of the Data Management

10.2

Directory structure of the Data Management

Directory tree

All files being managed by the MMC Data Management are organized in a special directory tree within the DOS file system. The structure of this directory tree is defined in the Data Scheme. The path that determines the starting point of this structure (called ROOT) must be entered in the file DH.INI. e.g.: C:\DH

Initialization file

The file DH.INI contains among others the following sections:

Table 10-1 Sections of the file Datei DH.INI

section DHSTART

meaning root directory of the MMC Data Management on the hard disk example: mmchome=l:\dh access permission example: access level=4 name of the binary parts of the data scheme example: sceme=schema.bin

SCEME

Data scheme

The Data Scheme is the definition of a directory structure to be taken into account by the Data Management when processing and managing files. It consists of S the description of the single elements (file/directory) and S the description of the directory structure Thus the Data Scheme describes the structure of the elements that can be created by the Data Management in a directory tree on the MMC hard disk.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-437

Data Management 10.2 Directory structure of the Data Management

03.03

File systems MMC/NCK

The elements described in the Data Scheme can be located in the DOS file system of the PCU50 hard disk as well as in the file system of NCK. The directory structure described in the Data Scheme contains an image of the directory structure existing in the NCK file system. The Data Management provides a complete overview and a unified access to the files contained in both systems. During run time, the functions of the Data Management can access the specifications given in the Data Scheme in order to keep the structures for files and directories consistent.

Note The consistency of the defined structure can be checked for files and directories located on the PCU50 hard disk only.

Data Management path

The Data Management path contains the part of the filename which is similar to HMI and NCK.

10.2.1

Properties of the elements in the directory tree

The directory structure defined in the Data Scheme is combined of separate elements in the directory tree. From the Data Management's point of view an element could be a file or a directory. For each element of the directory tree the following information is recorded and can be read via certain functions of the Data Management. The data type description includes the description of the part program-- specific characteristics. An element is described by characteristics according to table 10-2.

Table 10-2 Characteristic of elements

characteristic name extension explanation data format

meaning name of the file or the directory extension of name in the DOS file system identifier for displaying the element in readable form directory or file

10-438

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.2

Data Management Directory structure of the Data Management

Name

This is the name used to store a file or directory in the directory tree. If the element is an image of a file/directory in the NCK system and if this system requires a fixed name, this name is used here. If the name of the file/directory to be created is arbitrary, " * " is used as name. The maximum length of the name is 25 characters.

Extension

All files/directories defined in the Data Scheme can be archived in a DOS file system. For this purpose a name extension of 3 characters must be defined in the Scheme for each element. The files/directories being managed by the NCK file system and being part of the elements handled by the Data Management already have a 3 character name extension. Therefore the elements that can be stored in the NCK as well as in the MMC file system are added the extensions defined by the NCK system. For elements not handled by NCK, extensions are defined that are used on the PCU50 hard disk only.

Explanation

For each element a language dependent explanation is recorded. This allows to display the file or directory names in a comprehensible, language dependent manner, if fixed names are used by NCK. Example 10-1 Example for explanation

Definition in the Data Scheme: explanation workpieces workpiece oder: parts part name WPD * WPD * extension DIR WPD DIR WPD workpieces shaft1 parts shaft1 possible display:

Data format

The data format specifies an object of the directory tree to be of type file or directory.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-439

Data Management 10.2 Directory structure of the Data Management

03.03

Storage location

Whenever a new object is created within the directory tree the Data Management uses the corresponding access mask. A more detailed description can be found in this chapter in the sections 'access permission' and 'access mask'. There are three possible storage locations for files in the complete system: S in the MMC file tree on hard disk S exclusively in the data structure of the NCK file system S on the MMC hard disk as well as in the NCK file system The storage location is part of the information provided by the LIST function of the Data Management. The following coding applies: FM DM FN DN file MMC directory MMC file NCK directory NCK

Note Functions of the Data Management expecting the storage location of a file or a directory as an input argument, e.g. copy will work correctly only if the specified storage location matches the location defined in the Data Scheme.

Access permission

There are eight levels of access permission applying to each file and directory.

Table 10-3 The 8 level of access permission

access level: S0 S1 S2 S3 S4 S5

required: system password password of the machine tool builder password of the service user password key switch position 3 key switch position 2 SIEMENS

user group

machine tool builder set up staff, service (machine tool builder) privileged user (in--house service) programmer trained operator

10-440

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.2

Data Management Directory structure of the Data Management

Table 10-3

The 8 level of access permission

access level: S6 S7

required: key switch position 1 key switch position 0 operator

user group

semi--skilled operator (NC start/NC stop, operating panel)

The access permission level 0 sets the highest, level 7 the lowest permission. The actual access permission of the system is set via the current key switch position or the entry of a password.

Access rights

The following rights can be set for files: READ WRITE EXECUTE SHOW DELETE

Access mask

Each element of the directory tree is assigned an access mask in the Data Scheme. Here the access rights are set depending on the current access permission level. These access masks are described by a 5 digit number. 1st digit READ 2nd digit WRITE 3rd digit EXECUTE 4th digit SHOW 5th digit DELETE

Example for an access mask: 7 4 7 7 5 Access level 0 -- access level 4 may write. Access level 0 -- access level 5 may read. All access levels may read, execute and view. The access masks of an element can be determined with the Data Management function Get_Attributes and modified with SetAccess.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-441

Data Management 10.2 Directory structure of the Data Management

03.03

Modifying access permission

The access right for a certain access level may be modified only when having a higher protection level. For doing this, the SetAccess function of the Data Management is provided. The predefined access mask from the Data Scheme with global validity can not be modified using this function.

10-442

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Data Management 10.3 Elements in the MMC Data Scheme

10.3

Elements in the MMC Data Scheme

The following files or directories can be managed using the functions of the Data Management.

Table 10-4 Elements of the data scheme

element access description archive boot data

extension ACC

name *

format file

contents/meaning /use describes the access to certain NCK variables dependent on the access permission actually set data stored on the MMC hard disk for archiving purposes machine data in binary format needed for setting NCK and the 611D drives into operation directory for temporary stored files of the Data Management file containing arbitrary ASCII text data for interpolated compensations data needed by the system functions as definitions any directory in the directory tree machine--specific user data (GUD Global User Data) machine--specific settings of various types of NCK or MMC data, without specification of a specific type NCK machine data (TEA Testing Data Active). directory of NC machine data. any data defined by the OEM user NC part program of the type 'main program' or 'subprogram' local variables defined in the part program (LUD Local User Data). settable zero point offsets and frames (UFR User Frame).

ARC BOT

* *

file file

clipboard comment compensation data definitions directory global user data initialization program

CLP COM IKA DEF DIR GUD INI

CLIP * * * * * *

direc--tory file file file direc--tory file file

machine data NC data OEM--specific data part program part program -specific/local user data settable zero point offset and frames (UFR User Frame).

TEA MDN USR MPF LUD

* * * * *

file direc--tory file file file

UFR

*

file

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-443

Data Management 10.3 Elements in the MMC Data Scheme

03.03

Table 10-4

Elements of the data scheme

element setting data subprogram

extension SEA SPF

name * *

format file file

contents/meaning /use setting data (SEA Setting Data Active). NC subprogram: Cycles Programs and all programs to be called by others data needed for the execution of system functions tool compensation (TOA Tool Offset Active) all files needed to completely describe a workpiece for machining

system data tool compensation workpiece directory

SYF TOA WPD

* * *

file file direc--tory

The respective data types are described in the following:

Archive

Data stored on the MMC hard disk for archiving purposes.

Boot data

Machine data in binary format needed for setting the NCK and the 611D drives into operation. Boot data are data for installing the main spindle and the feed drives. There may be several of them. Because each drive has individual set--up data, a file type with a fixed name is defined for each drive containing the corresponding data.

10-444

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Data Management 10.3 Elements in the MMC Data Scheme

Clipboard

Directory for temporary stored files of the Data Management In this directory each file type defined in the Scheme may be stored as it is defined in the complete data structure. This means, the complete directory tree may be stored under this knot a second time. The directory is used as a temporary storage directory by the Data Management.

Comment

File containing arbitrary ASCII text Several comment files are defined as special file types with fixed names, since they have specific contents. They can be identified by the Data Management via a combination of name and extension.

Compensation data

Data for interpolated compensations

Settable zero point offset /FRAME

Settable zero point offsets and frames (UFR User Frame).

Definitions

Data required as definitions by the system functions. Different file types with fixed names that exist only once in NCK are defined here.

Directory

Any directory in the data tree An example for a special directory is the workpiece directory. explanation: extension: name: format: attribute: workpieces DIR WKS directory --

Only files of the type `workpiece' / WPD may be created in this workpiece directory.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-445

Data Management 10.3 Elements in the MMC Data Scheme

03.03

Global User Data

Machine specific User Data (GUD Global User Data) In a file of this type (GUD Global User Data) the user may define machine--specific data he needs for use within part programs and Cycles programs. Global valid R--parameters belong to this category. Via configuration of the screen display these data can be displayed and their values can be entered from MMC, too.

Initializationprogram

Machine--specific settings of various types of MMC or NCK data An initialization file contains settings of various types of MMC or NCK data, without being restricted to a certain type. This module can be stored in the workpiece directory (see there).

Machine Data

NCK machine data (TEA Testing Data Aktive).

NC Data

Directory of the NC machine data In this directory files can be stored, that contain the information needed for restoring a special NCK configuration. These files can represent an image of the active file system of NCK stored on MMC hard disk.

OEM-specific Data

Any data defined by the OEM user Here various data types with fixed name can be defined, too.

Part Program

NC part program of the type main program or sub program. A file of this type is an NC part program of the type main program or sub program. NCK does not distinguish main and sub programs.

Note These variables exist during execution of the respective module of the part program only. They may however be stored as a file to give access via the Data Management.

10-446

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Data Management 10.3 Elements in the MMC Data Scheme

Part program-specific/local user data

Local variables that are defined in the part program )LUD Local User Data). A file of this type contains local variables defined in the part program.

Note These varables exist during execution of the respective module of the part program only. They may however be stored as a file to give access via the Data Management.

Setting Data

Setting data (SEA Setting Data Active).

Sub program

NC subprogram: Cycles Programs and all programs that are called by other programs. NCK does not distinguish main and sub programs.

System Data

Data required for the execution of system functions

Tool Compensation

Tool compensation (TOA Tool Offset Active).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-447

Data Management 10.3 Elements in the MMC Data Scheme

03.03

Workpiece directory

All data types needed for a complete description of a workpiece for machining A workpiece directory may contain several file types: in fact all those types needed for completely machining a workpiece including part programs, setting data, tool compensations, initialization modules etc. Particularity of the data type workpiece / WPD: A workpiece may be selected for machining like a part program in NCK. In the Data Scheme this property is expressed with the EXECUTE permission in the access mask. When a workpiece is selected for machining, the INI file having the same name as the workpiece is loaded to NCK. At the same time the main module of the part program having the same name as the workpiece is selected. If no part program / MPF with the same name is found, an error message is sent and the part program selected before is kept selected. If the INI module of the same name is not available, other initialization files may be executed manually by explicit actions of the operator.

Tool Compensation

Tool compensation (TOA Tool Offset Aktive).

10-448

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

10.4

Functions of the Data Management Server

Overview

The Data Management provides the interfaces for handling files and directories: S S S S S S S S creating deleting copying listing downloading (copy from MMC to NCK, source is deleted) uploading (copy from NCK to MMC, source is deleted) setting access permission perform auxiliary functions

The Data Management Server uses the description of the file structure on hard disk (Data Scheme) that can be read during run time. Uploading and downloading correspond to a MOVE--command, because the source--file is deleted. The functions of the Data Management are implemented as DDE Server interface DHSERVER.EXE.

Types of calls

Three types of calls are realized corresponding to the complexity of the functions: S request jobs: S simple Execute jobs: S complex Execute jobs: simple requests returning data simple requests not returning data complex requests returning data. These jobs might run for a long period of time

Table 10-5 gives an overview of the functions.

10.4.1

Establishing DDE connections with the Data Management Server

The developer must be familiar with the components below if he wants to establish a DDE connection with the Data Management Server. S S S S Link--Server Link--Topic Link--Item Link--Mode name of the DDE server topic data to be accessed link mode

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-449

Data Management 10.4 Functions of the Data Management Server

03.03

Table 10-5

Functions of the Data Management (Overview)

function Activate Activate2 Best_Datatype Cancel Convert_Possibl e_Datatypes Copy Create Del Exist Extern Get_Attributes Get_Properties Get_ Propertynames Get_Realpath List Passivate

type execute: complex execute: complex request execute: simple request

item ----------name extension -----data type extension

meaning copy a file or directory to the NCK file system, in the same directory like Activate, the source file is not deleted looks for the data type that matches best the given name and extension abort all jobs with the result variable passed List the data types which can be copied to a data file copy a file source to the file destination create a file or a directory delete a file or a directory check, whether a file exists in NCK or MMC select a file for execution from external returns the attributes of a file or a directory. returns the properties of a file or a directory according to the data scheme supplies the language--dependent shortcut for the specific bits of the property list returns the path of a DOS or a NCK file or directory read the contents of a directory of the Data Management. transfer a file or a directory from NCK to the MMC file system, in the same directory. lists those data types that can be stored in a directory of the Data Management Rename a data file in NewName select a file for execution in NCK set permission of a file or directory

execute:co -----mplex execute:co -----mplex execute: complex execute: simple execute: simple request request request request ---------------dhpath dhpath -- mode dhpath -- mode dhpath -- mode

execute:co -----mplex execute: complex request execute:si mple execute: simple execute: simple ------

Possible_ Datatypes Rename Select Set Access

dhpath -- mode ----------------

10-450

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Table 10-5

Functions of the Data Management (Overview)

function Startsave

type execute: simple execute: simple

item ------

meaning Establishing a memory range in the server named VarName The memory range VarName is released

Stopsave

------

These functions are discussed in more detail in the next chapters.

10.4.2

Request Jobs

Realization

Simple requests of data are realized as DDEML Request. They are executed synchronously. This type of call is used for simple jobs with short execution times. The name of the function is passed as the Topic, the argument as Item of the request. The function get_realpath is an example of this type.

Realization in C/C++

In C or C++ the result of the job is passed directly to the result buffer of the request. Errors are indicated by refusing the request.

Realization in Visual Basic

In Visual Basic the request is called and the result is recorded in a text or label control. The application is informed via a CHANGE event of this control. The contents of the control is updated at the end of the REQUEST--call and may be inquired. Errors must be processed by a suitable error handler. Therefore the error variable "Err" must be evaluated. "DHServer|" and the corresponding function name are specified as Linktopic, the arguments are specified as Linkitem as far as necessary.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-451

Data Management 10.4 Functions of the Data Management Server

03.03

Best_Datatype

Description Looks for the data type that matches best the given arguments name and extension. The data type which name and extension matches best with the arguments is returned. The extension must match exactly. The name either matches or a wild card character "*" is searched. The returned result is the data type without extension. Application Allows to determine a suitable data type for a certain directory of the Data Management. Syntax LinkTopic: LinkItem : Arguments

Table 10-6 Arguments of Best_Datatype

DHServer|best_data type name extension

Argument name extension

Description name of the file or directory extension of the file or directory

Determining a suitable data type Determine the most suitable data type for the work piece "welle1.wpd" Example 10-2 Determining a suitable data type

Sub Form_Load () Label1.LinkTopic= "DHServer|best_datatype" Label1.LinkItem = "welle1 wpd" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result:

*

here any data type is allowed

10-452

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Determining a suitable data type Looks for the suitable data type for the work piece directory "wks.dir" Example 10-3 Determining a suitable data type

Sub Form_Load () Label1.LinkTopic= "DHServer|best_datatype" Label1.LinkItem = "wks dir" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result:

WKS

here only the data type WKS is allowed.

Note The job is rejected, if no matching file type can be found, as it is the case for standard DOS files or directories.

Convert_Possible_Datatypes

Description This function lists all data types in which a specific data file may be copied. A part program data file Part1o. mpf for example may be copied as subprogram data file Part1u in the directory for subprograms. Application Inquires possible destination directories for a file name in the Data Management. Syntax LinkTopic: LinkItem : Arguments

Table 10-7 Arguments of Convert_Possible_Datatypes

DHServer|convert_possible_datatypes name extension

Argument name extension file extension

Description file name or "*" as substitute

Determining possible data types Determines possible data types to which a part program may be copied to.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-453

Data Management 10.4 Functions of the Data Management Server

03.03

Example 10-4 Determine possible data types

Sub Form_Load () Label1.LinkTopic= "DHServer|convert_possible_datatypes" Label1.LinkItem = "* mpf" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result: #part program(MPF) * MPF#initialization program(INI) * ÄINI#subprogram(SPF) * SPF#

Note If no suitable data type can be found -- as it is the case for standard DOS files or DOS directories -- the job is rejected.

Get_Attributes

Description Supplies the attributes of a file or directory. The list of attributes corresponds to the file attributes in the List Job. Application Reads the attributes of a file or directory. Syntax LinkTopic: LinkItem : Arguments

Table 10-8 Argumenzts of Get_Attributes

DHServer|get_attributes name extension

Argument name extension directory name file extension

Description

Reading the attributes of the Data Management Determine possible data types which can be copied to a part program:

10-454

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Example 10-5 Reading the attributes of the Data Managment

Sub Form_Load () Label1.LinkTopic= "DHServer|get_attributes" Label1.LinkItem = "\mpf.dir" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result: MPF part programs DIR MPF 0 848506846 DM 77770

Note This function can be applied to MMC files and directories only.

Get_Properties

Description This function supplies the properties of the data type of a data file or a directory as it is defined in the data scheme. The result is a bit list, which is coded as LONG-number. Alternatively it is possible to define their data type, consisting of name and extension. Application Determines for example, whether a part program may be edited. Syntax LinkTopic: LinkItem : Arguments

Table 10-9 Arguments of Get_Properties

DHServer|get_properties name mode

Argument name mode Work piece editable

Description name of the Data Management path or file name --m for MMC or - for NCK -n

Inquires, whether the work piece "bolzen.wpd" can be edited.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-455

Data Management 10.4 Functions of the Data Management Server

03.03

Example 10-6 Work piece editable

Sub Form_Load () Label1.LinkTopic= "DHServer|get_properties" Label1.LinkItem = "\wks.dir\bolzen.wpd" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result:

1

Note Presently only bit 0 is defined to be editable.

Get_Propertynames

Description This function supplies the language--dependent shortcut for the specific bits of the property list which may be inquired by get_properties. Application Allows to get the language--dependent identifier of each bit. Syntax LinkTopic: Arguments none Language-dependent identifiers Determining language--dependent identifiers Example 10-7 Language--dependent identifiers

Sub Form_Load () Label1.LinkTopic= "DHServer|get_propertynames" Label1.LinkMode = 2 Label1.LinkRequest End Sub

DHServer|get_propertynames

Result:

e.g. for german

#editable#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#

Note During start--up of the Data Management server this list is initialized depending on the selected language.

10-456

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Get_Realpath

Description Returns the DOS or NCK path of a file and its type. This path can be used for calling the functions of the file system interface of the DOS or the NCK file system. Application Determines for example where the part program is physically located. Syntax LinkTopic: LinkItem : Arguments

Table 10-10 Arguments of Get_Realpath

DHServer|get_realpath dhpath mode

Argument dhpath mode

Description name of the Data Management path or file name --m for MMC or - for NCK -n

Absolute path in the NCK Determines the absolute path in the NCK of the work piece "bolzen.wpd". Example 10-8 Absolute path in the NCK

Sub Form_Load () Label1.LinkTopic= "DHServer|get_realpath" Label1.LinkItem = "\wks.dir\bolzen.wpd -n" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result:

Path of the file in the NC /NC/_N_WKS_DIR/_N_BOLZEN_WPD *

Absolute path in the MMC Determine the absolute path in the MMC for part programs Example 10-9 Absolute path in the MMC

Sub Form_Load () Label1.LinkTopic = "DHServer|get_realpath" Label1.LinkItem ="\mpf.dir -m" Label1.LinkMode = 2 Label1.LinkRequest End Sub

Result:

Path of the file in the MMC c:\mmc2\dh\MPF.DIR MPF

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-457

Data Management 10.4 Functions of the Data Management Server

03.03

Note When the NCK is being accessed, it is not checked, whether the file or directory exists. When the MMC is being accessed, it is checked, whether the file / directory exists. If it doesn't, the request is rejected with error.

Possible_Datatypes

Description Lists the file types that can be stored in a directory of the Data Management. Application Determines the data types for certain directories. Syntax LinkTopic: LinkItem : Arguments

Table 10-11 Arguments of Possible_Datatypes

DHServer|possible_datatypes dhpath [mode}

Argument dhpath mode Possible data types

Description name of the Data Management path or file name --m for MMC or - for NCK -n

List of possible file names for the work piece "bolzen.wpd" Example 10-10 Possible data types

Sub Form_Load () Label1.LinkTopic= "DHServer|possible_datatypes" Label1.LinkItem = "\wks.dir\bolzen.wpd -n" Label1.LinkMode = 2 Label1.LinkRequest End Sub

10-458

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Result:

List of possible data types, separated by "#" #Part--program(MPF) * MPF #Autoturn--program * 41 #Time--calculation(DAT) * DAT #DP--initialization DPWP * INI #Initialization--program(INI) INI #Compensation--data(IKA) * IKA #Tool--offsets(TOA) * TOA #Machine--data(TEA) * TEA #Setting data(SEA) * SEA #Channel--user--data(GUD) * GUD #Comment(COM) * COM #Subroutine(SPF) * SPF #ZeroOffset/Frame(UFR) * UFR#

10.4.3

Simple Execute jobs

Realization

Simple jobs not returning data are realized as DDEML Execute. The result of the call is contained in the returncode of the DDEML function. This returned value can be either DDE_FACC, DDE_FBUSSY or DDE_FNOTPROCESSED.

Realization in C/C++

The instruction and the argument are passed in C or C++ as string in the transfer buffer of the DDEML call.

Realization in Visual Basic

In Visual Basic the EXECUTE calls are linked to a Text or a Label Control. Here the errors must be processed by a suitable error handler. Therefore the variable "Err" must be evaluated. "DHServer|Result" must be specified as Linktopic, the Linkitem is not evaluated by the Data Management Server. In order to satisfy the requirements on the VB syntax it must nevertheless be given, but its value can be arbitrary.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-459

Data Management 10.4 Functions of the Data Management Server

03.03

Cancel

Description Cancels all jobs ( complex Execute jobs ) with the indicated result variable. Application Cancels a complex job Syntax LinkExecute: Arguments

Table 10-12 Arguments of von Cancel

cancel DHServer-Variable

Argument DHServerVariable Canceling a job Cancel a jobs with the result variable "StatVar" Example 10-11 Cancel a job

Description Variable specified as result variable when a complex execute job is started

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "cancel StatVar" if Err = 0 Then ' no error Else ' error End If End Sub

Result:

Err=0: Err <>0:

all jobs were canceled command was not executed correctly

10-460

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Exist

Description Checks, whether a file exists on NCK or MMC. Application Determines, whether e.g. a work piece exists. Syntax LinkExecute: Arguments

Table 10-13 Arguments of Exist

exist dhpath mode

Argument dhpath mode File exists

Description name in the Data Management path --m for MMC or - for NCK -n

Check, whether the work piece "welle1.wpd" exists in the MMC. Example 10-12 File exists

Sub Form_Load () Text1.LinkTopic = "DHServer|Result" Text1.LinkMode = 2 On Error Resume Next Text1.LinkExecute "exist \wks.dir\welle1.wpd -m" If Err = 0 Then ' workpiece exists Else ' workpiece does not exist End If End Sub

Result:

Err=0: Err<>0:

file exists file does not exist

Note From these error messages you cannot distinguish whether the job has not been executed or the file has not been found.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-461

Data Management 10.4 Functions of the Data Management Server

03.03

Extern

Description Provides the feature for working with external NC programs. First only one file is selected in the MMC with EXTERN command. This file may not exist in the Data Management. Then the file must be copied from the MMC to the NCK with a function of the NCDDE--Server. This is done with the Domain Service COPY_TO_NC (Chapter 8.6) Application Selects a part program for execution from external. Syntax LinkExecute: Arguments

Table 10-14 Arguments of Extern

extern dhpath channel

Argument dhpath channel name

Description specification of a channel number ( always two digits )

Execution from external Select the part program "test.mpf" for execution from external in the first channel. Example 10-13 Execution from external

Sub Form_Load () Label1.LinkTopic= "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "extern \mpf.dir\test.mpf 01" If Err = 0 Then ' selection worked Else ' selection did not work End If Label1.LinkTopic = "ncdde|ncu840D" Label1.LinkMode = 2 Label1.LinkExecute "COPY_TO_NC(C:\tmp\mpf1.mpf, Ä/NC/_N_MPF_DIR/_N_TEST_MPF,trans)" End Sub

Result:

Err=0: Err<>0:

selection worked selection did not work

10-462

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Note The selection always applies to the file located in NCK under the specified Data Management path. The file must not exist when the EXTERN command is executed for the first time, otherwise an error occurs.

Rename

Description Provides the functions for renaming files of the MMC and the NCK. It is not chekked, if the data types are consistent (see the function Convert_Possible_Datatypes) Application Renames e.g. work pieces and part programs. Syntax LinkExecute: Arguments

Table 10-15 Arguments of Rename

rename dhpath -mode NeuName [datatype] extension

Argument dhpath mode NeuName datatype extension

Description path of Data Management --n=NCK, --m=MMC directories are renamed on the NCK and the MMC new name of data file new data type, * or name--scheme, for example WKS new extension. Together with the data type it defines the new data type of the data file

Renaming a part program Renaming the part program "mpf1.mpf" to "mpf2.mpf" in the MMC.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-463

Data Management 10.4 Functions of the Data Management Server

03.03

Example 10-14 Renaming a part program

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "rename \mpf.dir\mpf1.mpf -m mpf2 *.mpf" If Err = 0 Then ' renamed Else ' not renamed End If End Sub

Result:

Err=0: Err<>0:

renamed not renamed or not existing

Note The error message does not distinguish, whether the file does not exist or whether it could not be renamed.

Select

Description Selects part programs and work pieces. They must have been loaded in the NC already. Application Allows an application to select part programs and work pieces. Syntax LinkExecute: Arguments

Table 10-16 Arguments of Select

select dhpath channel

Argument dhpath channel

Description name in the Data Management path two digit channel number

Selecting a part program Selects the part program "MPF1.mpf" in the first channel.

10-464

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Example 10-15 Selecting a part program

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "select \MPF.DIR\MPF1.mpf 01" If Err = 0 Then ' selected Else ' not selected End If End Sub

Result:

Err=0: Err<>0:

part program selected part program not selected

Note The NC variable "/Channel/ProgramInfo/ progName [uKanal]" checks, whether the part program has been selected.

Setaccess

Description Sets the access permission of a file or a directory. The currently active user class must be less than or equal to the value set in the access description of the file or directory. Another way to set the access permission is to enter `_'. The permissions specified via `_' are not modified and therefore the validity of a change is not chekked. Generally the EXECUTE permission is not taken into account when the validity is being checked. Application Sets the access rights for files and directories. Syntax LinkExecute: setaccess dhpath access [mode]

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-465

Data Management 10.4 Functions of the Data Management Server

03.03

Arguments

Table 10-17 Arguments of Setaccess

Argument dhpath access mode

Description name in the Data Management requested access permission --m for MMC; --n for NCK If mode is not specified the access rights are set for the MMC as well as the NCK file. For directories always both permissions are set. An eventually specified mode will be ignored.

Setting the access permission for part programs Set the access permission of a part program "MPF1.mpf" on NCK from 47774 to 54774 former access permission of the file: current user class: 4 current user class: 5 47774 access permission is changed access permission is not changed

Example 10-16 Set the access permission for part programs

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "setaccess \WKS.DIR\WELLE1.WPD\MPF1.mpf Ä54774 -n " If Err = 0 Then ' access permission has been changed Else ' access permission has not been changed End If End Sub

Result:

Err=0: Err<>0:

access permission has been changed access permission has not been changed

Note For directories the permission is set on MMC as well as on NCK in order to guarantee a unified view on these directories.

10-466

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Startsave

Description Establishing a memory range in the server named VarName. If you define the name as a result variable, the actual contents of the result variable is stored until you release the memory range with stopsave. The contents of the variable may be read with a request--instruction (Topic: result, Item: result variable). The variable may be used for several instructions in sequence. Application This call can be used by applications which inquire the result of a job using repeated request jobs rather than hotlink connections. Syntax LinkExecute: Argument

Table 10-18 Arguments of Startsave

startsave VarName

Argument VarName name of the variable

Description

Creating a result variableAnlegen einer Ergebnisvariable Example 10-17 Create a result variable "test"

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkMode = 2 On Error Resume Next Label1.LinkExecute "startsave test" If Err = 0 Then ' no error Else ' error End If End Sub

Result:

Err=0: Err<>0:

variable created variable not created

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-467

Data Management 10.4 Functions of the Data Management Server

03.03

Stopsave

Description Complementary function to startsave: The memory range VarName is released. Application Removes a result variable from the Data Management Server. Syntax LinkExecute: Arguments

Table 10-19 Arguments of Stopsave

stopsave VarName

Argument VarName name of the variable

Description

10.4.4

Complex Execute jobs

Area of use

Functions that might under some circumstances take too much time are executed asynchronously, i.e. the application can execute other actions while the DH Server is executing the requested command.

Realization in Visual Basic

In order to issue a complex job, the application first establishes a hotlink to a freely chosen result variable. For this purpose the topic "DHServer|Result" is reserved. As item the result variable is set. If now the Linkmode is set 1 or 2, the Data Management Server internally creates the variable and indicates changes to the application, if requested. Then the actual command can be sent. Here also specify "DHServer|Result" as Linktopic. The Linkitem is not evaluated but must nevertheless be set due to VB. Specify 2 (automatic) as Linkmode. Now you can call the command with Linkexecute.

10-468

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Call

A complex Execute job has the following syntax in the command line within the transfer buffer:

functionname resultvariable argument1 ...... ÄargumentN

The name of the function , the resultvariable and the arguments are passed within the job in the transfer buffer as a string. The Data Management Server enters the job in its job list. The entry in the list is replied with a positive, a refuse with a negative acknowledgment (see simple EXECUTE job). The application can cancel an established Hotlink with the completion of the job or can keep it for another job. The Data Management Server works according to the job list independently of the applications.

Result

Using result variables the application can inquire the state of a job. The indication is performed in C or C++ via the CALLBACK function XTYPE_ADVDATA. In Visual Basic the application can establish a hotlink to the result variable. The result buffer is filled in the CF_TEXT format. The elements of the result buffer are separated by #. The first element contains the state of the command, the remaining elements are job--specific.

State of the command

The state can be one of the following values: 0--99 100 >100 job execution is n percent, with n from 0 to 99 job has been executed correctly error occurred during execution

During the execution of a job the progress of the job is reported continuously via Hotlink by sending the state of the job's progress in percent to the application. Just when the state contains 100 or an error identifier greater than 100, the job is completed and the results have been passed.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-469

Data Management 10.4 Functions of the Data Management Server

03.03

Note For development convenience a textual error message is inserted following the error code. This text is not part of the official interface of the Data Management Server. Example:#106#error when creating or opening the file

In the next step the Hotlink can be deestablished. During execution of the job by the Data Management, the application is ready to accept further operator actions. The Data Management Server can receive further jobs from the application. The application itself is responsible for the coordination of these jobs. The detailed contents of the result buffer are described where the corresponding function is described. The result is returned in the format CF_TEXT, in order to allow a direct connection to Visual Basic.

Activate

Description Copies a file/directory to the NCK file system under the same directory. The source file is deleted after a successful transfer. If directories are copied, the source is not deleted. Application Loads a part program / work piece in the NCK Syntax LinkExecute: Arguments

Table 10-20 Arguments of Activate

activate ergvar source [--f]

Argument ergvar source -f

Description result variable: contains the present state of the job Data Management path of the source file --f (force= overwrite) (if destination file exists)

Access permission Required access permission: read write delete source destination directory, destination source.

10-470

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Activating a part program Moving the part program "TP1.MPF" from the MMC to the NCK. Example 10-18 Activate a part program

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "activate transStat \MPF.DIR\TP1.MPF" End Sub

The result variable "transStat" contains the result buffer in the following format: #state# absolute path of the file on the MMC e.g. #100#c:\mmc2\dh\MPF.DIR#

Note If the destination file has a fixed name, the fixed name belonging to the file type is set automatically as file or directory name, independent of the indicated name of the destination file.

Activate2

Description Copies a file/directory to the NCK file system under the same directory. The source file is not deleted after a successful transfer. Application Loads a part program to the NCK without deleting it from the MMC. Syntax LinkExecute: activate2 ergvar source [--f]

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-471

Data Management 10.4 Functions of the Data Management Server

03.03

Arguments

Table 10-21 Arguments of Activate2

Argument ergvar source -f Access permission

Description result variable: contains the present state of the job Data Management file of the source file (force= overwrite) (if destination file with same name exists)

Required access permission: read source write destination directory, destination

Copy

Description Copies a file source to the file destination. Types are converted only if a new destination type has been specified, otherwise source and destination must be of the same data type. The function copy also copies DOS files and directories to the hard disk. The Argument mode determines the storage location of source and destination. It can be set m = MMC hard disk or n = NCK. The destination may be optionally specified with the Argument f (force= overwrite, if existing). Application Copies elements of the Data Management Syntax LinkExecute: Arguments

Table 10-22 Arguments of Copy

copy ergvar source -mode target -mode[f] [datatype]

Argument ergvar source mode target

Description result variable: contains the present state of the job Data Management path of the source file --m for MMC; --n for NCK Data Management path of the destination file

10-472

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Table 10-22

, FortsetzungArguments of Copy

Argument mode -f

Description --m for MMC; --n for NCK (force overwrite) (if destination file with same name exists)

Access permission Required access permission: read source write

destination directory, destination

Copying a work piece Copy the work piece "WELLE.WPD" from the NCK to "WELLE3.WPD" in the MMC. Example 10-19 Copy a work piece

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "copy transStat \WKS.DIR\WELLE.WPD -n Ä\WKS.DIR\WELLE3.WPD -m" End Sub

The result variable "transStat" contains the result buffer in the following format: #state# absolute path of the file in the MMC # #100#c:\mmc2\dh\WKS.DIR\WELLE3.WPD#

Note If the destination file has a fixed name, the fixed name belonging to the file type is set automatically as file or directory name, independent of the indicated name of the destination file.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-473

Data Management 10.4 Functions of the Data Management Server

03.03

Create

Description Creates a file or a directory in the directory dirpath with the name name, the data type data type and extension are used. Application Creates a part program / work piece in the NCK or MMC. Allows to add texts to the Data Management. Syntax LinkExecute: Arguments

Table 10-23 Arguments of Create

create ergvar dirpath name ext data type -mode [file]

Argument ergvar dirpath name ext datatype

Description result variable: contains the present state of the job Data Management path of the directory in which the file or the directory is being created name of the file or the directory extension of the file or the directory * or fixed NCK name according to the pattern For DOS file "DOSFILE", for DOS directories "DOSDIR" --m for MMC; --n for NCK --f for overwrite --r Source file will not be copied to the data management tree, but will be moved. The source file must be in the same drive as the target directory. Optional specification of a DOS file that contains the contents of the new object of the Data Management. It may not be contained in the Data Management tree in order not to circumvent the write protection. file may be e.g. a file in the directory "tmp".

mode

file

Access permission Required access permission: write destination directory, destination Creating a part program Create a part program "WELLE.MPF" in the NCK. If a program with this name

10-474

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Example 10-20 Create a part program

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "create transStat \MPF.DIR\ WELLE MPF End Sub

* -nf"

The result variable "transStat" contains the result buffer in the following format: #state# DOS--or NCK path of the file# #100#//NC_N_MPF_DIR/_N_WELLE_MPF#

Note If the file type of the directory has a fixed name in NCK, the fixed name belonging to the file type is set automatically as directory name, independent of the passed name for the destination file. The same applies to directories with fixed names on MMC.

Del

Description Deletes a file or a directory, if the access permission allows this. Directories can be deleted only if they do not contain any files. Application Deletes a part program / work piece from the NCK or from the MMC. Syntax LinkExecute: Arguments

Table 10-24 Arguments of Del

del ergvar dhpath [mode]

Argument ergvar dhpath mode

Description result variable: contains the present state of the job Data Management file of the source file --m for MMC --n for NCK

Access permission Required access permission: write directory delete file.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-475

Data Management 10.4 Functions of the Data Management Server

03.03

Deleting a work piece Remove a work piece "WELLE2.WPD" from the NCK. You can only delete this work piece if it does not contain any programs. Example 10-21 Delete a work piece

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "del transStat \WKS.DIR\WELLE2.WPD -n" End Sub

The result variable "transStat" contains the result buffer in the following format: #state#clear text# e.g. #100# #102#file does not exist# delete successful delete not successful

10-476

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Note The file/directory is deleted, if the access permission allows this. Directories that are not empty will not be deleted, independent on the access permission.

List

Description Reads the contents of a directory of the Data Management The files/directories are supplied in alphabetical order. Application Lists the contents of a directory. Syntax LinkExecute: Arguments

Table 10-25 Arguments of List

list ergvar dirpath [mode]

Argument ergvar dirpath mode -f Data Management path

Description result variable: contains the present state of the job --m for MMC; --n for NCK overwrite (if destination file with same name exists)

Access permission Required access permission: read source directory display individual file. Listing the contents of a directory List the contents of the sub directory "\SPF.DIR". Example 10-22 List the contents of a directory

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "list transStat \SPF.DIR" End Sub

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-477

Data Management 10.4 Functions of the Data Management Server

03.03

The result variable "transStat" contains the result buffer in the following format: #state#lname data type text extension realname length date attribut# State information of List The result is built up in CF_TEXT format with one entry per line characterizing one file or directory. Each line contains the following elements:

Table 10-26 State information of List

Info lname datatype

Meaning name of the file in the Data Management (NC files without _N_) name of the file type according to the Data Scheme: files that are not contained in the scheme are represented by the place holder "--------" explanation of the file type (see table in chapter 10.2) file extension "true" name of the file in the DOS file system or in the NC file system This name is needed e.g. for opening a file length of file. For directories 0 is entered. date of the last write access. The time of day is given in seconds since 01.01.1970. list of properties of the file or the directory: D directory F file N is located in NCK, or located in MMC and NCK M is located in MMC access permission: read, write , execute, show, delete

text extension realname

length date attribute

access

For each entry in the directory values from lname to attribute are supplied. The entries are separated by #. #100#U1 * sub program(SPF) SPF U1 31 857568254 FM 64774 #

Note The contents of a directory are returned. For a directory that exists on the NC as well as on the MMC hard disk the contents consist of both directories on MMC and NC.

Note For conversion to the system time use the Visual Basic function CVDate. That function is described in the online help of VB.

10-478

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 10.4

Data Management Functions of the Data Management Server

Passivate

Description Copies a file/directory to the NCK file system under the same directory. The source file is deleted when the transfer has succeeded. If directories have been copied, the source will not be deleted. The argument mode can be specified with --f (force= overwrite). Without this parameter a possibly existing destination is not overwritten. Application Removes a part program / work piece from the NCK, i.e. the part program / work piece is moved from the NCK to the MMC. Syntax LinkExecute: Arguments

Table 10-27 Arguments of List

passivate ergvar source [mode] [--f]

Argument ergvar source mode

Description result variable: contains the present state of the job Data Management path for the source file --f overwrite (if a file with the same name exists)

Access permission Required access permission: read source write destination directory, destination delete source. Deleting a part program Load the part program "TP1.MPF" from the NCK. Example 10-23 Delete a part program

Sub Form_Load () Label1.LinkTopic = "DHServer|Result" Label1.LinkItem = "transStat" Label1.LinkMode = 1 Label2.LinkTopic = "DHServer|Result" Label2.LinkMode = 2 Label2.LinkExecute "passivate transStat \MPF.DIR\TP1.MPF" End Sub

The result variable "transStat" contains the result buffer in the following format: #state# DOS path of the file# #100#c:\mmc2\dh\MPF.DIR\TP1.MPF#

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

10-479

Data Management 10.4 Functions of the Data Management Server

03.03

Note If the file type of the directory has a fixed name in NCK, the fixed name belonging to the file type is set automatically as directory name, independent of the passed name for the destination file.

10-480

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Reference

11

This Chapter contains all the information you need for using the online--help and the PI Services. You can find more details in the listbook /LIS/ or access them with the help function NCDDE Data Help. The data access is described in Chapter 8 NCDDE Server.

11.1

Overview

11.1.1

Areas of the NC

The figure below shows the NC's areas, the following table lists their addresses.

NCK

mode group channel channel tool/ magazine

mode group

main spindle drive

Fig. 11-1 Areas of the NC

PLC feed drive

Table 11-1 area NCK mode group channel axis

List of the areas identifier for link item Nck Bag Channel Axis area address 0 1 2 3 identifier for PI Service 001 1xx 2xx 3xx identifier for area N B C A

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-481

Reference 11.1 Overview

03.03

Table 11-1 area

List of the areas identifier for link item Tools Plc DriveVSA DriveHSA 5 6 5xx 6xx K00 P01 area address 4 identifier for PI Service 4xx T ? V H identifier for area

tool offsets, tool magazine data PLC feed drive main spindle drive communication module passive file system

11.1.2

File systems of the NC

The data in the NCK component are --from an external point of view-- divided into two parts that will be referred to as active and passive file system from now on.

Active file system

The active file system represents the main memory of the NCK. It is structured in areas and several units of these areas. Active files are always directly assigned to a combination of unit and area. They cannot be deleted and their handling (download and upload) differs from that of passive files. Table 11--2 lists the files of the active file system.

Table 11-2 Files of the active file system (excerpt)

data type all NC data _N_INITIAL_INI file name

all machine data all global NC machine data all channel specific machine data machine data of channel n all axis specific machine data machine data of axis n

_N_COMPLETE_TEA _N_NC_TEA _N_CH_TEA _N_CHn_TEA _N_AX_TEA _N_AXn_TEA

all setting data all global NC setting data

_N_COMPLETE_SEA _N_NC_SEA

11-482

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.1

Reference Overview

Table 11-2

Files of the active file system (excerpt)

data type file name _N_CH_SEA _N_CHn_SEA _N_AX_SEA _N_AXn_SEA

all channel specific setting data setting data of channel n all axis specific setting data setting data of axis n

all option data (MMC 103 only) all global NC option data all channel specific option data (MMC 103 only) all axis specific option data (MMC 103 only)

_N_COMPLETE_OPT _N_NC_OPT _N_CH_OPT _N_AX_OPT

all global user data all global NC user data all channel specific user data user data of channel n

_N_COMPLETE_GUD _N_NC_GUD _N_CH_GUD _N_CHn_GUD

all tool/magazine data all tool data tool data of area t all magazine data magazine data of area t

_N_COMPLETE_TOA _N_TO_TOA _N_TOt_TOA _N_TO_TMA _N_TOt_TMA

all protection areas all global NC protection areas all channel specific protection areas channel protection areas of channel n

_N_COMPLETE_PRO _N_NC_PRO _N_CH_PRO _N_CHn_PRO

all R parameters all channel specific R parameters channel R parameters of channel n

_N_COMPLETE_RPA _N_CH_RPA _N_CHn_RPA

all zero point offsets all global NC zero point offsets all channel specific zero point offsets channel zero point offsets of channel n

_N_COMPLETE_UFR _N_NC_UFR _N_CH_UFR _N_CHn_UFR

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-483

Reference 11.1 Overview

03.03

Table 11-2

Files of the active file system (excerpt)

data type file name

all interpolated compensation data

_N_NC_CEC

all quadrant error compensation data quadrant error compensation data of axis n

_N_AX_QEC _N_AXn_QEC

all lead screw error compensation data lead screw error compensation data of axis n

_N_AX_EEC _N_AXn_EEC

The passive file system

The passive file system represents the mass storage of the NCK. Its structure is hierarchical. The passive file system gives an intermediate storage for files that will be activated later. There for example the part programs are stored. The passive file system is built up of partly constantly predefined, partly dynamically variable structures. Table 11--3 lists the standard directories of the passive file system.

Table 11-3 Standard directories of the passive file system (excerpt) data type

MMC display machine data workpieces global part programs global subprograms user cycles Siemens standard cycles comment data files definition files for macros and global user data main spindle drive machine data in binary format feed drive machine data in binary format user data (OEM) system data _N_BD_DIR _N_WKS_DIR _N_MPF_DIR _N_SPF_DIR _N_CUS_DIR _N_CST_DIR _N_COM_DIR _N_DEF_DIR _N_HS_DIR _N_VS_DIR _N_OEM_DIR _N_SYF_DIR

directory name

11-484

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.1

Reference Overview

11.1.3

Domain Service

Domain Services are provided for transferring data between the MMC and the NCK. Aplications are shown in chapter 8.6 Interface MMC ó NCK/PLC. They are listed in table 11-4.

Table 11-4 Overview of the Domain Services

command COPY_FROM_NC COPY_FROM_NC_BINARY COPY_TO_NC COPY_TO_NC_BINARY MAP_ACC_NC

description copy from NCK to MMC with additional information copy from NCK (PLC) to MMC without additional information copy from MMC to NCK with additional information copy from MMC to NCK (PLC) without additional information Load ACC files from NC kernel and prepare for DDE interface

11.1.4

PI Service

The PI Services (program invocations) are used to invoke particular self consistent functions of the NCK. Applications are shown in chapter 8.7 Interface MMC ó NCK/PLC. They are listed in the following table.

Table 11-5

Overview of the PI Service

function group NCfunctions Set--up

meaning Reconfiguraton Domain option argument MMC semaphore PI Service addressed to Compile--Cycles Work piece counter Select file for upload DeleteMDA memory

PI name _N_IBN_SS _N_CONFIG _N_DOMOPT _N_MMCSEM _N_CMPCYC _N_TMPCIT _N_F_XFER _N_F_DMDA

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-485

Reference 11.1 Overview

03.03

Table 11-5

Overview of the PI Service

function group

meaning Cancel NC alarms Digitizing on Digitizing off Setting of measurement system: inch--metric

PI name _N_CANCEL _N_DIGION _N_DIGIOF _N_SCALE _N_SELECT _N_EXTMOD _N_EXTERN _N_FINDBL _N_SETUFR _N_OST_ON _N_OST_OF _N_ASUP__ _N_F_OPEN _N_F_CLOS _N_F_RENA _N_F_COPY _N_F_DELE _N_F_SEEK _N_SETUDT _N_DELVAR _N_NEWPWD _N_LOGIN_ _N_LOGOUT _N_F_PROT _N_CREATO _N_TMCRTO _N_CREACE _N_DELETO _N_TMFDPL

NCprogramfunctions

Select program for execution in a channel Select program for external execution from external Select program for external execution from external Activate search Set User Frame Overstore on Overstore off Assign interrupt

file functions

Open file Close file Rename file Copy file within NCK Delete file Position the file search pointer Activate actual user data Delete variable--aera

access level functions

New password Login Logout Add file protection to a file

tool functions

Create tool Create tool for tool management Create new cutting edge Delete existing tool Lock--up for empty place for loading

11-486

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.1

Reference Overview

Table 11-5

Overview of the PI Service

function group

meaning Provide magazine place for loading, unload tool Positioning a magazine place or tool Create cutting edge for existing tool Delete cutting edge for existing tool Create tool: Given are name, tool number and duplo number Lock--up for empty place: type, magazine and space for tool Lock--up for T number: Given are tool name and duplo no. Initiate check of unique D numbers Activate tool in sister tool group Set active wear group in a magazine Create tool with defined number of cutting edges Reset the active state

PI name _N_TMMVTL _N_TMPOSM _N_CRCEDN _N_DELECE _N_TMCRTO

_N_TMFPBP

_N_TMGETT _N_CHEKDM _N_SETTST _N_TMAWCO _N_TMCRTC _N_TMRASS _INSE _DELE _PROGRAM s. PLC_ MEMORYRESET

PLC functions

Activate a module Delete a passive module Start/Stop the PLC Reset the PLC memory

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-487

Reference 11.2 Variable definition

03.03

11.1.5

Data formats

This description uses the following data formats:

Table 11-6 Overview of the data formats length (bit) 8 16 32 64 nx8 8 16 32 32 64 1 2 4 8 n 1 2 4 4 8 4 succeeding bytes are interpreted as floating point--number 8 succeeding bytes are interpreted as floating point--number length (byte) 0 to 255 0 to 65535 --2.147.483.648 to +2.147.483.647 range

data type char unsigned long double string Byte (PLC) Word (PLC) Doubleword Float Double

±10 --307 to ±10308

set of ASCII characters, terminated with "\0"

11.2

Variable definition

11.2.1

General

The online--help contains a list of the NC variables you can access via the DDE interface. Notes on how to use it are contained in chapter 8 "Interface HMI ó NCK/ PLC".

11-488

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.2

Reference Variable definition

11.2.2

Shared modules of active and passive NCU file system

These modules can be stored in the active and in the passive file system of the NCU. In order to offer an easy way to classify these files, according to the convention each one of them must end with an extension. The main characteristic of these data is the possibility to access them with the Domain Service and the variable service. In order to remain compatible to DOS the length of the file name extension may not exceed 3 characters. Each module type is characterized by a name extension. For the data structures of the active and the passive file system refer to the chapter 'PI Service'.

Table 11-7

Overview: common modules for the Domain Service

EXT ACC

module type access description for NCU variables asynchronous sub programs binary file

file system area N,C,A,V,H, Passive Passive Passive

meaning describes the properties of NCK variables needed to access NCU variables (ACCess).

ASP BIN

BIN (BINary File) are NC part programs (main and sub programs are not distinguished) that are available in compiled form or general binary files. COM (COMment File). Arbitrary ASCII--Text

COM CEC CYC DIR

comment beam sag / angular errors cycle programs directory

Passive N,Passive Passive Passive

The module of the type DIR (DIRectory) contains the information concerning the modules that can be accessed under this knot. Modules of all types can reside in this directory. Restrictions are given by conventions only (Data Scheme). In order to edit files, a section of the files is loaded up from the NCU--memory and then edited in the editor window

EDI

editor window

N

EEC

error compensation of the encoder global/channel--s pecific user data

A,Passive

GUD

N,C,Passive

The user (machine tool builder, OEM) has the possibility to use the module type 'user data' (Global User Data) in order to create his own machine--specific data. These data can be addressed from part programs and Cycles. GUDs can also be addressed for display purposes when configured in MMC.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-489

Reference 11.2 Variable definition

03.03

Table 11-7

Overview: common modules for the Domain Service

EXT INI

module type initialization module

file system area Passive

meaning Initialization modules (INItial File) are not physically a part of the active file system. They have a special function. They contain settings of variables without being restricted to a specific type. An initialization module can be transferred to the active file system, but does not exist there as a physical module. The contained values are set in the corresponding modules of the active file system during the download process. The user has the possibility to define local data within a program. MPF (Main Program File) are NC part programs of the type 'main program'. option data (OPTion File)

LUD MPF OPT PRO QEC RPA SEA SPF SYF TEA

local/program--sp C,Passive ecific user data main programs option data protection area quadrant error compensation calculation parameters setting data sub program system data machine data Passive N,Passive N,C,Passive A,Passive C,Passive N,C,A, Passive Passive Passive N,C,A,V,H, Passive

Setting Data (SEtting data Active) SPF (Sub Program File) are NC part programs of the type 'sub program'. A system file (SYFile) contains information concerning the complete system. machine data

11-490

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.2

Reference Variable definition

Table 11-7

Overview: common modules for the Domain Service

EXT TMA

module type magazine description

file system area T,Passive

meaning contains: · directory of the magazines TMV defined in one channel (area unit) (Tool Magazine Directory V) · magazine control block for one channel (area unit) TMC (Tool Magazine Control) · description of the magazines TM used in one channel (area unit) (Tool Magazine Active) · state and occupation of the magazine places for one channel (area unit) TP (Tool Magazine--Data Place Active) · hierarchy of the types of places in the magazine in one channel (area unit) TT (Tool Magazine--Data Place Type) · description of multi assignments with the corresponding distances of external places referring to the exchange places of the referenced magazines.(Tool Magazine Place Multi) tool compensations(Tool Offset Active) with: · tool compensation TO (Tool Offset Active) · general tool data TD (Tool Data Active) · grinding--specific tool compensation TG (Tool Grinding Active) · tool supervision data TS (Tool Supervision Active) · user--specific (OEM) tool data TU (Tool User Active) · cutting edge data TUE (Tool User EdgeData Active) · tool directory TDV (Tool Data Directory V) (per area unit). contains FRAMES (User input Frames) (settable zero point offset extended) The module of the type WPD (Work Piece Directory) contains all information concerning the modules that can be accessed via this knot. Modules of each type can be stored in a workpiece directory (except DIR and WPD).

TOA

tool compen--sations

T,Passive

UFR WPD

User FRAMES workpiece directory

C,Passive Passive

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-491

Reference 11.3 Module types for the active file system

03.03

11.3

Module types for the active file system

These modules (files) cannot be stored in the passive file system. Only the active modules exist. An important characteristic of these modules is, that they can be accessed via the Variable Service only.

Table 11-8 Module types for the active file system

data type

areas in active file system N, C N C C T C N,C,A N,C C C N,C,A,V*,H* N C T T T T T T T T T T T T N,C N,C N,C

type

no. (hex) 10 11 12 13 14 15 16 17 18 19 1A 1F 20 21 22 23 24 25 26 27 28 29 2A 2B 2C 2D 2E 2F

system state data NC instruction group list user frame current frame tool compensation arithmetic parameter Setting data Global user data GUD (=GD1=SGUD) local part program data interpolated compensation machine data Compile-Cycles external frames general tool data tool supervision data tool data for grinding OEM tool data tool user cutting edge data tool data directory magazine description magazine place data multi-assignment to magazine place data types of magazine places magazine directory magazine control block Global user data 2 (=MGUD) Global user data 3 (=UGUD) Global user data 4

Y YNCFL FU FA TO RP SE GUD LUD IK M CC FE TD TS TG TU TUE TV TM TP TPM TT TMV TMC GD2 GD3 GD4

11-492

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.3

Reference Module types for the active file system

Table 11-8

Module types for the active file system

data type

areas in active file system N,C N,C N,C N,C N,C N,C

type

no. (hex) 30 31 32 33 34 35 37 6E 6F 70 71 72 73 74 75 76 77 78 79 7A 7B 7C 7D

Global user data 5 Global user data 6 Global user data 7 Global user data 8 Global user data 9 protected area Nibble data state data messages (drive, servo) program pointer interrupted extended state data geometry axes extended state data machine axes state data spindles state data geometry axes state data machine axes state data latest alarm state data oldest alarm state data alarms state data synchronous actions state data block search pointer state data program pointer state data NC functions state data Interrupt_Status state data part program infos

GD5 GD6 GD7 GD8 GD9 PA NIB SDME

C C C C C C N N N C C C C C C

SPARPI SEGA SEMA SSP SGA SMA SALAL SALAP SALA SSYNAC SPARPF SPARPP SNCF SINT SPARP

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-493

Reference 11.3 Module types for the active file system

03.03

Table 11-8

Module types for the active file system

data type

areas in active file system C N,B,C,V*,H*

type

no. (hex) 7E 7F

state data channel effecting state data *Data with Syntax--ID 611D

SINF S

11.3.1

Examples

Example 1

Let the following variable address be given: Value of a H-function in the second channel The value of the variable and the variable address in general result in the following DDE connection: LinkTopic LinkItem NC--DDE|local /area /module type/column index

This means for our example: The online--help's section C contains a list of the modules defined there. The module SSYNAC and specifically the variables Hval supplies a description of the indices put in parenthesis. Using the reference example (at the top) you can display what the Linkitem should look like in the MMC103: /Channel/SelectedFunctions/Hval[u<areaIndex>, <lineIndex>] <areaIndex> = channel number <lineIndex> = consecutive number This results in the LinkItem: /Channel/SelectedFunctions/Hval[u2,3]

Example 2 Tool correction data

Next we want to introduce to you another example that shows an application somewhat more complex. Tool correction data of a TO--area are required. The organization of the tool correction data you will find in the programming manual and the function description W1. See the online-- help for more information.

11-494

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.4

Reference Machine data

The general format of the link item for tool corrections is: Link Item general with x y n m /Tool/Compensation/Edgedata [ux, cy, n (-m)] TO--area Tool number Tool parameter optional parameter

For tools with more than one cutting edge the desired cutting edge is addressed by the parameter n in the following way: n = (CuttingEdgeNo -- 1) * MaxNumParam + ParamNumber where MaxNumParam = 25 (maximum number of tool parameters) and ParamNumber ranging from 1 to 25 (see the example 2.3 below). Example 2.1 Search for the length 1of the first cutting edge of the 2nd tool in the TO--area 1: Link Item/Tool/Compensation/Edgedata[u1,c2,3] with u1 means c2 means 3 means TO--area 1 second tool geometric length offset (parameter 3).

Example 2.2 Search for the length 1 and length 2 of the first cutting edge of the 2nd tool in the TO--area 1: Link Item/Tool/Compensation/Edgedata[u1,c2,3,4] with u1 means c2 means 3 means 4 means TO--area 1 second tool geometric length offset (parameter 3) geometric length offset (parameter 4)

Example 2.3 Search for the length 2 of the second cutting edge of the 3rd tool in the TO--area 1: Link Item/Tool/Compensation/Edgedata[u1,c3,29] with u1 means TO--area 1 c3 means third tool 29 means geometric length offset (parameter 4) of the second cutting edge (add 25)

11.4

Machine data

Many system data which can be accessed by part programs as so--called $--variables, may also be accessed by the MMC. These $ variable are in the file btss_uk.hlp.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-495

Reference 11.5 PLC data

03.03

11.5

PLC data

11.5.1

Introduction

Inputs, outputs, flag data and data blocks can be accessed similar to NC variables. The variable identifiers are built up of three parts, supplemented by the optional parameter (--FAST) for setting the cycle time for warm/hot links at the DDE interface:

Table 11-9

Variablenames for PLC data

1. part 2. part

/PLC /Input /Output /Memory /DataBlock /Directory /Bit /Byte /Word /DoubleWord /Float /Double /Hierarchy1 /Hierarchy2 /Hierarchy3 /S7Timer /S7Counter /TimeAndDate /Statelist/Complete /Messages

constant part of the name for accessing inputs (internal image) for accessing outputs (internal image) for accessing flags for accessing data blocks for accessing directories of the PLC access width: 1 bit access width: 1 byte ( 8 bit ) access width: 1 word ( 2 byte, 16 bit ) access width: 1 double word ( 4 byte, 32 bit ) for accessing 4 consecutive bytes to be interpreted as a float--number for accessing 8 consecutive bytes to be interpreted as a float--number for accessing the list of all module types for accessing the list of one module type for accessing the list of one specific module type for accessing timer--contents, unit: milliseconds for accessing counters, format: integer for accessing the clock, format is explained below for accessing the complete system state list of the PLC for accessing PLC messages/alarms For cyclic services to PLC variables the scan/cycle interval is 500 ms. For these and all other variables of the same cluster the scan/cycle interval is 100 ms.

3. part

4. part

no parameter parameter: --FAST

11-496

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.5

Reference PLC data

Indices

Specific bits, bytes etc. are usually addressed via indices. The indices are to be understood as follows: S From the ND--DDE server's point of view the row index specifies a Byte/Word/ DWord offset. Attention! Difference to S7: S7 uses byte offsets only! S When bits are being accessed, the row index must be added the bit--number. This is done by adding a number ranging from 0 to 7, separated by '.'. S When data blocks are being accessed, the block is specified by the column index c.

!

Caution Addressing PLC data by the NC--DDE Server differs from the addressing used in S7 programs!

Example: Addressing double word 5 (DWORD 5)

Table 11-10 Different addressing by PLCprograms and the NCDDE-Server

variable DWORD 5

PLC program in S7 accesses: WORD 5 + 6 BYTE 5+6+7+8

NCDDE Server accesses: WORD 10 + 11 BYTE 20 + 21 + 22 + 23

Example: Valid PLC variable identifiers are: /Plc/Input/Word[9] /Plc/Memory/Bit[9.3] /Plc/Output/Doubleword[7] /Plc/DataBlock/Bit[c100,9.3] accessing input bytes 18 and 19 accessing bit 3 in the flag data byte 9 accessing the output bytes from 28 to 31 accessing bit 3 in byte 9 of the data block 100

The description of all PLC data can be found in the Installation & Start up Guide of the SINUMERIK 840D (chapter 'PLC Interface'). Therefore we skip a detailed description of these data here. The data you intend to use in your MMC application have to be entered in your current NSK file according to the file PLC202.NSK. Then they are known after the next system start--up.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-497

Reference 11.5 PLC data

03.03

11.5.2

Table 11-11

Summary of the PLC data

Variable names in the MMC for PLC data

data type PLC-input input bit input byte input word input double word PLC-output output bit output byte output word output double word PLC flag data flag data bit flag data byte flag data word flag data double word

parameter range 0 to 7 0 to 63 0 to 31 0 to 15

identifier, parameter

/Plc/Input/Bit[input byte bit] /Plc/Input/Byte[input byte] /Plc/Input/Word[input word] /Plc/Input/DoubleWord[input double word]

0 to 7 0 to 63 0 to 31 0 to 15

/Plc/Output/Bit[output byte.bit] /Plc/Output/Byte[output byte] /Plc/Output/Word[output word] /Plc/Output/DoubleWord[output double word]

0 to 7 0 to 255 0 to 127 0 to 63

/Plc/Memory/Bit[flag data byte.bit] /Plc/Memory/Byte[flag data byte] /Plc/Memory/Word[flag data word] /Plc/Memory/DoubleWord[flag data double word]

PLC data block data bit data byte data word data double word floating point PLC timer PLC counter 0 to 127 0 to 63 0 to 7 0 to 1023 0 to 511 0 to 255 /Plc/DataBlock/Bit[cdata block, data byte.bit] /Plc/DataBlock/Byte[cdata block, data byte] /Plc/DataBlock/Word[cdata block, data word /Plc/DataBlock/DoubleWord[cdatablock,data double word] /Plc/DataBlock /Float[cdata block, data byte] /Plc/S7timer[timerNumber] /Plc/S7Counter[counterNumber]

11-498

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.5

Reference PLC data

Table 11-11

Variable names in the MMC for PLC data

data type PLC clock 1

parameter range

identifier, parameter /Plc/TimeAndDate[month.day.year hour:minute:second:millisecond day of week status]

PLC-Hierarchy list of all modules list of one module type list of one module PLC system state PLC alarms 1 1 1 1 1 /Plc/Directory/Hierarchy1 /Plc/Directory/Hierarchy2["data Block Type"] /Plc/Directory/Hierarchy3["data Block name"] /Plc/Statelist/Complete /Plc/Messages

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-499

Reference 11.5 PLC data

03.03

PLC: counters, timers and clock

The corresponding variable identifiers for counters, timers and the clock of the PLC are: /Plc/S7Timer /Plc/S7Counter /Plc/TimeAndDate Timers and counters are selected with the row index. The counter and timer values are supplied as real numbers in the DDE interface. Timer values are normalized in milliseconds. Speed up the access with the optional supplement --FAST (100 ms cycle instead of 500 ms standard). The variable "/Plc/TimeAndDate" allows to access date and time of the PLC ( no Hot/Warmlink possible ). Accessing the PLC clock is possible only via the clipboard format CF_TEXT. The data set contains an area for each S date ( "<month> . <day> . <year>" ) S time ( "<hours> : <minutes> : <seconds> . <mill seconds>" ) S day of week Dow ( "SUN", "MON", "TUE", "WED", "THU", "FRI" or "SAT" ) S clock status (hexadecimal coded), separated by space characters. The status of the PLC--clock is returned in <Status> using hexadecimal format. Bit 3 and bit 4 of the bits 0 to 15 specify the resolution. The assignment is shown in the table below.

Table 11-12 Resolution of the clock

bit 3 0 0 1 1

bit 4 0 1 0 1

resolution 1 ms 10 ms 100 ms 1000 ms

Example for Monday, July 26th 1999, 15.30 , resolution 1 second: <month>.<day>.<year> <hour>:<min>:<sec>.<millisec> <DoW> <status> 07.26.99 15:30:00:000 MON 0018

11-500

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.5

Reference PLC data

PLC: messages and alarms

The variable "/Plc/Messages" provides an interface to the message and alarm system of the PLC. A hotlink to this variable returns the PLC messages and alarms. Note, that the MMC is not a real--time system: It is not guaranteed that all messages will be returned. This restriction is avoided to the greatest possible extend if the messages/alarms are accessed via the registry module. It is described in more detail in chapter 9 "Alarm--Server". You can filter special messages with an optional row index. If an index is given in the advise--link, messages are returned only, if bit 2 (first message nibble) of the index has been set. If there is no index, all available messages/alarms will be returned. The access must be executed binarily.

PLC: System state

The variable "/Plc/Statelist/Complete" allows to read (no Hot/Warmlink) the complete system state list of the PLC. This access may only be executed binarily. Außerdem ist ein Zugriff nur mit C++ möglich.

PLC block list

The directory variables /Hierarchy1 /Hierarchy2 /Hierarchy3 accessing the module list of all module types accessing the module list of one module type accessing the module list of a specific module

allow a reading access ( however no Hot/Warmlink ) to the PLC directory information. The variable "/Plc/Directory/Hierarchy1" has no parameters. It returns in several data sets ( separated by <CR><LF> ) the number of modules available for one module type. Each data set contains the fields module type and number, separated by <TAB>. If for one module there is a variant available in the passive file system of the PLC and there is also a variant available in the active file system of the PLC (chained module), both are counted. Example: variable: result: The PLC contains 3 OBs (Type 08), 8 FBs (Type 0E) 1 FC (Type 0C) and 4 DBs (Type 0A) /Plc/Directory/Hierarchy1 08 <TAB> 3 <CR><LF> 0E <TAB> 8 <CR><LF> 0C <TAB> 1 <CR><LF> 0A <TAB> 4

The variable "/Plc/Directory/Hierarchy2" expects a module type as parameter. It provides short information on the modules in several data sets ( separated by <CR><LF> ). Each data block contains the following fields, separated by <TAB>:

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-501

Reference 11.5 PLC data

03.03

module number module status (coded in hexadecimal format) storage location ( values: "RAM", "EPROM", "???" ) state ( values: "ACTIVE", "PASSIVE", "???" ) Example: Variable: Result: The PLC contains 8 function modules of the type 0E, located in the RAM and active: /Plc/Directory/Hierarchy2["0E"] 1 <TAB> 1201 <TAB> RAM <TAB> ACTIVE <CR><LF> 2 <TAB> 1201 <TAB> RAM <TAB> ACTIVE <CR><LF> ...... 8 <TAB> 1201 <TAB> RAM <TAB> ACTIVE <CR><LF>

The variable "/Plc/Directory/Hierarchy3" expects a module name without attribute1 as parameter. (Attribut1 is the file identifier with "$" (= module header for up--loading) or "_" (= complete module) ). It provides one or two data sets for the specified module ( separated by <CR><LF> ), depending on whether information was requested on the passive (P), the active (A) or both modules (B). Each data set contains fields separated by <TAB>: module name module status (coded in hexadecimal format) storage location ( values: "RAM", "EPROM", "???" ) state ( values: "ACTIVE", "PASSIVE", "???" ) module header ( six double words coded in hexadecimal format and separated by space characters: 24 bytes) optional header extension ( e.g. 46 bytes: 11 double words coded in hexadecimal format and separated by space characters followed by a word ). Example: Variable: In the PLC an organization module OB1 is active: /Plc/Directory/Hierarchy3["0800001A"]

Result: 0800001A <TAB> 1230 <TAB> RAM <TAB> ACTIVE <TAB> 07070001 01080001 000000f2 00000000 01edce06 110c01ed <CR> ce06110c .... <CR><LF> .......

11-502

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.6

Reference PI Services

11.6

PI Services

Chapter 11.1.4 and the online--help contain a list of the available PI Services.

Parametrizing

The PI name for the NC starts with _N_ , followed by 6 characters; the name of the PLC services slightly differs from this convention. The command line for calling a PI Service is structured as follows: PI_START(Server--Name, Parameter 1, Parameter 2 ... Parameter n, PI--Name) Eine Übersicht über die angebotenen PI-Dienste finden Sie im Kapitel 11.1.4 oder in der Online-Hilfe. Hinweise zur Verwendung finden Sie im Kapitel 8.7 NC-DDE-Server.

Table 11-13 Supplying parameters to the PI Service PI numeric identifier argument description argument description : argument description

PI symbolic identifier 1st argument (name) 2nd argument(name) : nth argument(name) PI symbolic identifier

The first parameter specifies the area or the unit. The following identifiers are used (xx stands for two digits): 001 1xx 2xx 3xx 4xx 5xx 6xx K00 P01 NCK--specific service BAG--specific service channel--specific service axis--specific service tool--specific service VSA--specific service HSA--specific service service concerning the COM module service for the passive file system

The following notation of path and file names is used in the parameter description: The following notation of path and file names is used in the parameter description: xxx yyyyy zzz = DIR or WPD (i.e. directory) = any string (max. 25 characters) for names of files or directories = any string (max. 3 characters) for file extensions

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-503

Reference 11.6 PI Services

03.03

Example:

Selecting a part program with the PI Service general SELECT: PI_START( NC, channel, path name/program name, _N_SELECT). Applying the parameters channel 1 = 201 and path name/program name = MPF_DIR/TEST_MPF results in the command line PI_START( NC, 201, /_N_MPF_DIR/_N_TEST_MPF, _N_SELECT).

11-504

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

11.7

NCDDE - Error messages The NC--DDE Server provides a connection--specific error variable (lastError). This variable can be evaluated by 'Request' after a negative acknowledgment of the command. Following the 'Request' lastError is reset automatically to 00 00 00 00 .

11.7.1

Variable LastError

The variable 'lastError' is a value of the type long int, that consists of 4 components (bytes): 1st byte general error class number 2nd byte error region number 3rd byte error class number 4th byte error code number

When using the DDETest the 8--digit hex value is displayed in the right column. If the returned variable contains only five digits, add a leading zero before applying the tables below. The four sections characterize the following: 1. general source of error, e.g. NCDDE Server or DCTL.OCX control 2. area within this source, e.g. error occurred during a file transfer 3. class within the area, e.g. synatx error 4. error code in this class, e.g. too many arguments

general region class code

The default is:

00 00 00 00

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-505

Reference 11.7 NCDDE - Error messages -

03.03

11.7.2

General error class definitions

general

region

class

code

Table 11-14

General error classes

No. 00 01 02

identifier UNKNOWN_GENERAL_CLASS NCDDE_ERROR MPI_ERROR

meaning general class not (yet) set ncdde server generated errors layer 4 transport error at profibus interface, refer to profibus-interface-errors section of this file for a more detailed error interpretation layer 7 error told from NC errorclass and errorcode have been taken from the corresponding S7-protocol entries (ERRCLS/ERRCOD) in this case layer 7 error detected within the server protocol--handler layer 7 error told from NC the errorcode has been taken from the 'Zugriffsergebnis' S7-protocol entry other layer 4 errors errorclass and errorcode have been taken from the Layer 4 errortable in this case Errors detected by the DCTL-control itself error was delivered by a dos call errorcode/errclass hold the "errno" value unexpected error at ddeml interface errorcode/errclass hold a ddeml error value

03

L7_ERROR

04 05

L7_ADDITIONAL_ERROR L7_ACCESS_ERROR

06

L4_ERROR

07 08 09

DCTL_ERROR DOSERRNO_ERROR DDEML_ERROR

Note The meaning of the 3rd and 4th byte depends on the value of the first byte.

11-506

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

11.7.3

Definition of the Error Region

XX

region

class

code

Table 11-15

Error regions

No. 00 01 04 05 06 08 09 0A 0B 0E F3 F4 FF FT_ERROR

identifier UNKNOWN_REGION REQUEST_ERROR POKE_ERROR DIAGNOSE_ERROR PI_ERROR EXECUTE_ERROR ADVISE_ERROR CLIENT_ERROR COMIC_ERROR NO_ACCESS NO_ERROR NO_REGION

meaning region not yet set filetransfer errors error reading a single variable error writing a single variable error when announcing or disannouncing for diagnose pi-command error error executing a dde-exec-cmd advise error error during an XACT_COMPLETE transaction error executing a comic command no access to reagion information internal only region not known until the error occurs

11.7.4

Details for general = 1, 4 and 6

01,04,06

xx

class

code

Table 11-16

Error classes for general = 1, 4, 6

class 00 01 02

identifier UNKNOWN_CLASS TIMEOUT_ERROR TRANSPORT_ERROR

meaning errorclass not (yet) set timed out wait for communication quit, the error code shows the timeout used [sec] error delivered by layer 4

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-507

Reference 11.7 NCDDE - Error messages -

03.03

Table 11-16

Error classes for general = 1, 4, 6

class 03 04 05 06 07 08 09 0A 0B 0C 0D 0E

identifier DDE_ERROR GENERAL_ERROR FILEIO_ERROR SYNTAX_ ERROR ARGUMENT_ERROR PDU_ACCESS_ERROR VAR_ACCESS_ERROR PROTOCOL_ERROR CONVERSION_ERROR DOM_STATUS CFILE_ERROR COMIC_ERROR

meaning error at dde--interface other error classes error delivered by ferror call syntax error was detected one of the user arguments not acceptable set when 'Zugriffsergebnis' entry means the whole pdu set when 'Zugriffsergebnis' entry means a single variable error caused by NC-Communication error occured when converting data error ISO--layer 7: domain transfer status follows as error code error delivered by CFileException, is an I/O-error error occured within a comic

01,04,06

xx

xx

code

Table 11-17

Error codes for general = 1, 4, 6

code 00 01 02 03 04 05 06 07 08

identifier UNKNOWN_CODE LOCATION_ERROR UNKNOWN_TOPIC_ ERROR UNKNOWN_ITEM_ERROR UNKNOWN_ CLIPFORMAT_ERROR ADRMAP_ERROR ARGCNT_ERROR ARG_ERROR UNKNOWN_CMD_ERROR

meaning errorcode not (yet) set used when a layer 4 addres not acceptable try to communicate with unknown topic spec try to communicate with unknown item spec try to communicate with unknown clipboard format address map missing number of arguments not accepted argument not acceptable command not known

11-508

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

Table 11-17

Error codes for general = 1, 4, 6

code 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14 15 16 17 18 19 1A 1B 1C 1D 1E 1F 20 21 22 23 24

identifier TOKENIZE_ERROR VARIABLE_IN_USE_ ERROR VARIABLE_TYPE_ERROR VARIABLE_CREATION_ ERROR NODATA_ERROR FRAMING_ERROR PDU_TOO_LARGE_ ERROR TOO_MANY_ARGS_ ERROR CAN_NOT_CONVERT DATA_CORRUPTED UNDEF_FORMAT DATA_TOO_LARGE SLICE_NOT_ALLOWED SAME_ITEM_ADVISED REMOTE_DOWN CONNECTING BROKEN_LINE NO_LINE UNSUPPORTED_INDEX FORMATTING_ERROR UNEXPECTED_PDU FTSTOP_ERROR EXIT_ABORT UNKNOWN_TRANSPORT_ TYPE OUT_OF_RESOURCES CAN_NOT_OPEN_DEV CAN_NOT_INIT_DDEML NO_SERVER

meaning command not known variable currently in use variable type not acceptable error creating a variable (low memory) no data accessible or delivered wrong pdu construction detected cluster too large number of arguments too large no data conversion possible data inconstency detected format provided in LINK Command is unknown data too large for handling an index range is not allowed this item is already advised on this connection no communication to this remote unit possible communication may be poss. soon communication not possible communication not possible a variable index is not accepted wrong format for textconversion this kind of pdu was not expected, pdu syntax error both lower errorcode Bytes must be set, when interrupting a filetransfer canceled on ncdde exit the requested transport class is not available some resources are exhausted the transport device can not be opened DdeInitialize call failed DDE--Connecting to NC failed

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-509

Reference 11.7 NCDDE - Error messages -

03.03

Table 11-17

Error codes for general = 1, 4, 6

code 25 26 27 28 29 2A 2B 2C 2D 2E

identifier NC_NOT_RESPONDING BOOT_REJECTED SYNC_ERROR OUT_OF_MEMORY BUFOVERFLOW_ERROR PROTOCOL_UNKNOWN OUT_OF_RESOURCES ADRMAP_SELF HEADER_CORRUPTED ARITH_ERROR

meaning NC lifesign stopped NC rejected bootrequest/bootdata NC does not synchronize memory is low an internal fixedlen buffer is too small no L7 protocolhandler available windows resources exhausted ADDRESS: /SELF undefined or syntax error a filtransfer failed, because the header was not decodable error evaluating an arithmetic expression e.g. unknown variable or wrong variable type unexpected index type syntax error decoding an item value not decodeable the textparameter of a linkstatement is not decodable string syntactically wrong ncdde-atomtable overflow missing data for an index rejected during ncdde exit shared memory selector not not decodable delivered shared memory selector not usable timecode corrupted shm too small shm not acceptable a acc--file entry was not mappable datasink for pipe variable already exists poke to pipe variable after eof-poke no filetransfer for this access

2F 30 31 32 33 34 35 36 37 38 39 3A 3B 3C 3D 3E 3F

INDEX_ERROR ITEM_SYNTAX VALUE_SYNTAX LINK_SYNTAX STRING_SYNTAX ATOM_TUNING INDEX_NOTAVAIL EXIT_REJECT SHARED_MEMORY_ SYNTAX SHARED_MEMORY_ ACCESS INVALID_TIME SHARED_MEMORY_ EXHAUSTED SHARED_MEMORY_ CORRUPTED MAP_ERROR PIPE_IN_USE_ERROR EOF_ERROR NO_TRANSFER

11-510

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

Table 11-17

Error codes for general = 1, 4, 6

code 40 41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E FC FD FE FF

identifier DDEINIT_ERROR UNKNOWN_COMIC COMIC_ALREADY_EXISTS NO_CONV_ESTABLISHED TRANSIENT_STATE NO_LASTERROR_ PROVIDED OUT_OF_ STRINGHANDLES WRITE_PROTECT OUT_OF_AMAPS ADVISE_NOT_ SUPPORTED REQUEST_NOT_ SUPPORTED POKE_NOT_SUPPORTED EXECUTE_NOT_ SUPPORTED DEVICE_NOT_PRESENT DATA_COUNT INTERNAL_ERROR UNEXPECTED_ EXCEPTION CAN_NOT_OPEN_ERROR NO_ERRCODE

meaning error initializing DDE-NC-Interface addressed comic does not exist addressed comic does already exist DdeConnect failed refused action ( retry later ) no lasterror info from extern ncdde too many synonymous stringhandles poke not allowed topic count too high, retune ncdde.exe ??? Was kann der Anwender da tun ??? hot/warmlink not possible request transactions not supported poke transactions not supported execute transactions not supported ncdde did not find the requested device index range not equal to datafields ncdde internal problem unexpected exception fopen failed no errcode available

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-511

Reference 11.7 NCDDE - Error messages -

03.03

11.7.5

Details for general = 2

02

xx

class

xx

Table 11-18

Error classes for general = 2

class 01 WRITE

identifier

meaning error detected during a non fatal return of ihi_write: the errorcode corresponds to the profibus opcode (see below) the interface did unexpectedly not response to a command: the errorcode corresponds to the profibus opcode (see below) at this point unexpected response from profibus interface: the errorcode corresponds to the profibus interface response code fatal error received on call to ihi_read: hard-/software configuration must be checked fatal error received on call to ihi_write: hard-/software configuration must be checked

02

TIMEOUT

03

RESPONSE_ ERROR

04 05

READ_FATAL WRITE_FATAL

02

xx

class

code

Table 11-19

Error codes for general = 2

class 01, 02 01, 02 01, 02 01, 02 01, 02 03 03 03

code 00 01 06 07 0C 02 04 06 OPEN_REQ

identifier open error SEND_CONN_REQ SEND_EOM_DATA RECEIVE_DATA CLOSE_REQ INVALID_REQ NO_RESOURCES UNKNOWN_REFERENCE

meaning initialisation layer 4 connection write data error read data error close error internal problem low memory below 1 Mbyte internal problem

11-512

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

Table 11-19

Error codes for general = 2

class 03 03 03 03 03 03 03 03 03

code 0C 0E 10 12 14 16 18 1A 1C

identifier ILLEGAL_REQ REM_ABORT LOC_TIMEOUT UNKNOWN_CONN_CLASS DUP_REQ CONN_REJECT NEGOT_FAILED ILLEGAL_ADDRESS NETWORK_ERROR

meaning internal problem remote station rejection remote station not responding internal problem internal problem remote station connection rejection incompatible stations wrong address parameter network error

11.7.6

Details for general = 3

Byte 3 and 4 of LastError are generated by the NCU if general=3. Therefore they depend on the software version of the NCU.

11.7.7

Details for general = 5

05

xx

xx

code

Table 11-20

Error codes for general = 5

number 01 03 05 06 07 0A hardware error accessing the object not allowed invalid address data type not supported data type inconsistent object does not exist

description

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-513

Reference 11.7 NCDDE - Error messages -

03.03

11.7.8

Detailsfor general = 7

07

xx

xx

code

For errors of the DCTL controls (general = 7) the error code is 1.

Table 11-21 Error codes forr general = 7

number 01 02 03 04 05 06 07 08 09 0A 0C 0D 0F 10 11 12

description overload of the task list: more than 20 tasks are presently using the DCTL control wrong syntax detected in the property LinkTopic WINDOWS' Atomtable exceeded no connection can be established to a server maximum length of the characterstring in the property LinkTopic exceeded (max. 512 characters) too many identical items: The DCTL Control limits identical items in one process to 100 time limit exceeded invalid value of the property LinkCmd server refused transaction but did not return an error code LastError initialization of DDEML library failed invalid value of the property LinkTopic call of DDEClient transaction unexpectedly failed overflow of link list: this task has Hotlinks with more than 20 different LinkTopics connection interrupted by the server last error not set The caller tries to parametrize a transaction (Read/Write/Execute or Advise) for a DCTL Control, while a synchronous transaction for the same Control is still active. This is not allowed: The DCTL Control cannot execute the next transaction until the preceding one has been finished.

11-514

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

11.7.9

Details for general = 8

08

xx

integer von DOS

For DOS error messages (general = 8) the 2nd byte is of no importance. The length of the code returned by DOS is one word and is passed in the 3rd and 4th byte.

Table 11-22 Error messages from MS-DOS

number 02

identifier ENOENT

description No such file or directory. The specified file or directory does not exist or cannot be found. This message can occur whenever a specified file does not exist or a component of a path name does not specify an existing directory. Arg list too long. Under DOS: The argument list exceeds 128 bytes, or the space required for the environment information exceeds 32K. Exec format error. An attempt was made to execute a file that is not executable or that has an invalid executable--file format. Bad file number. The specified file handle is not a valid file--handle value or does not refer to an open file; or an attempt was made to write to a file or device opened for read--only access (or vice versa). No child processes No more processes. An attempt to create a new process failed, because there are no more process slots, or there is not enough memory, or the maximum nesting level has been reached. Not enough core. Not enough memory is available for the attempted operator. For example, this message can occur when insufficient memory is available to execute a child process, or when the allocation request in a _getcwd call cannot be satisfied.

07

E2BIG

08

ENOEXEC

09

EBADF

0A 0B

ECHILD EAGAIN

0C

ENOMEM

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-515

Reference 11.7 NCDDE - Error messages -

03.03

Table 11-22

Error messages from MS-DOS

number 0D

identifier EACCES

description Permission denied. The file's permission setting does not allow the specified access. This error signifies that an attempt was made to access a file (or, in some cases, a directory) in a way that is incompatible with the file's attributes. For example, the error can occur when an attempt is made to read from a file that is not open, to open an existing read--only file for writing, or to open a directory instead of a file. Under MS--DOS versions 3.0 and later, EACCES may also indicate a locking or sharing violation. The error can also occur in an attempt to rename a file or directory or to remove an existing directory. Files exist. An attempt has been made to create a file that already exists. For example, the _O_CREAT and _O_EXCL flags are specified in an open call, but the named file already exists. Cross--device link. An attempt was made to move a file to a different device (using the rename function). Invalid argument. An invalid value was given for one of the arguments to a function. For example, the value given for the origin when positioning a file pointer (by means of a call to fseek) is before the beginning of the file. Too many open files. No more file handles are available, so no more files can be opened. No space left on device. No more space for writing is available on the device (for example, when the disk is full). Math argument. Result too large. An argument to a math function is too large, resulting in partial or total loss of significance in the result. This error can also occur in other functions when an argument is larger than expected (for example, when the path--name argument to the _getcwd function is longer than expected). Resource deadlock would occur. The argument to a math function is not in the domain of the function.

11

EEXIST

12 16

EXDEV EINVAL

18 1C

EMFILE ENOSPC

21 22

EDOM ERANGE

24

EDEADLOCK

11-516

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.7

Reference NCDDE - Error messages -

11.7.10

Details for general = 9

Here byte 3 and 4 contain the error messages from DDEML, which is a part of WINDOWS. This does not indicate an error in the communication of the NCU and the MMC, but rather that the communication between the NCDDE--Server and the application has been interrupted. You can find the complete definitions of the codes in the file ddeml.h, which is part of nearly all WINDOWS compilers.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-517

Reference 11.8 Error messages of the Data

03.03

11.8

Table 11-23

Error messages of the Data

Error messages from the Data Management

error code 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121

text of error message error at create or open of a DOSfile file does not exist file is read--only no matching knot found no matching data type found file/directory already exists no valid path of the Data Management argument error error during block copy invalid source data type of destination invalid transfer error no read permission no write permission no execute permission no show permission no delete permission

meaning do not create a file in a read--only directory do not open an existing file do not overwrite a write--protected file, do not delete a directory that is not empty path does not match the Data Scheme do not use this data type here, e.g. MPF in SPF directory do not overwrite existing file do not use an invalid path do not call an incomplete or erroneous set of arguments read/write error on harddisk detected path of Data Management invalid do not copy e.g. a SPF to a MPF sum error message of the connection to NCU do not access data without sufficient read permission do not access data without sufficient write permission do not access data without sufficient execute permission do not access data without sufficient show permission do not access data without sufficient delete permission resource error on the NCU error during allocation of memory in MMC remedy: close application error in the file containing additional information (25 character file name, access permission, etc.) remedy: delete info file and restore from DOS files. fixed buffer length of 64 kbyte exceeded

no general access permission sum message for access violation on the NCU resource error memory (malloc) error infofile error

122

list buffer overflow error

11-518

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

Table 11-23

Error messages from the Data Management

error code 123 124 125 126 200

text of error message Hardisk is full Command canceled Disk is open No further type of file possible DDE error

meaning the remaining capacity of the hardisk is not sufficient to finish the running job command canceled by CANCEL disk drive open during access to floppy disk error during DDE communication in the MMC area

11.9

Directory structure of the Data Management

|--ROOT.DIR ||--*.CLP ||--*.MDN |||--*.INI |||--EEC.DIR ||||--AX%a_EEC.INI ||||--AX_EEC.INI |||--GUD.DIR ||||--CH_GUD.DIR |||||--CH%c_GUD.DIR ||||||--CH%c_GD1.INI ||||||--CH%c_GD2.INI ||||||--CH%c_GD3.INI ||||||--CH%c_GD4.INI ||||||--CH%c_GD5.INI ||||||--CH%c_GD6.INI ||||||--CH%c_GD7.INI ||||||--CH%c_GD8.INI ||||||--CH%c_GD9.INI ||||||--CH%c_GUD.INI |||||--CH_GUD.INI ||||--COMPLETE_GUD.INI ||||--NC_GUD.DIR |||||--NC_GD1.INI |||||--NC_GD2.INI |||||--NC_GD3.INI |||||--NC_GD4.INI |||||--NC_GD5.INI |||||--NC_GD6.INI |||||--NC_GD7.INI |||||--NC_GD8.INI |||||--NC_GD9.INI MMC data Clipboard NC data backup Initialization program(INI) Spindle pitch/encoder error compensation Axis spindle pitch/encoder error compensation All spindle pitch/encoder error compensation User data (global) Channel user data User data channel User data 1 channel User data 2 channel User data 3 channel User data 4 channel User data 5 channel User data 6 channel User data 7 channel User data 8 channel User data 9 channel User data all channel All channel user data All user data Global user data Global user data 1 Global user data 2 Global user data 3 Global user data 4 Global user data 5 Global user data 6 Global user data 7 Global user data 8 Global user data 9

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-519

Reference 11.9 Directory structure of the Data Management

03.03

|||||--NC_GUD.INI |||--NC_CEC.INI |||--OPT.DIR ||||--AX_OPT.INI ||||--CH_OPT.INI ||||--COMPLETE_OPT.INI ||||--NC_OPT.INI |||--PRO.DIR ||||--CH_PRO.DIR |||||--CH%c_PRO.INI ||||--COMPLETE_PRO.INI ||||--NC_PRO.INI |||--QEC.DIR ||||--AX%a_QEC.INI ||||--AX_QEC.INI |||--RPA.DIR ||||--CH%c_RPA.INI ||||--CH_RPA.INI |||--SEA.DIR ||||--AX_SEA.DIR |||||--AX%a_SEA.INI |||||--AX_SEA.INI ||||--CH_SEA.DIR |||||--CH%c_SEA.INI |||||--CH_SEA.INI ||||--COMPLETE_SEA.INI ||||--NC_SEA.INI |||--TEA.DIR ||||--AX_TEA.DIR |||||--AX%a_TEA.INI |||||--AX_TEA.INI ||||--CH_TEA.DIR |||||--CH%c_TEA.INI |||||--CH_TEA.INI ||||--COMPLETE_TEA.INI ||||--NC_TEA.INI |||--TO.DIR ||||--TO_INI.INI ||||--TO_TMA.DIR |||||--TO%t_TMA.INI |||||--TO_TMA.INI ||||--TO_TOA.DIR |||||--TO%t_TOA.INI |||||--TO_TOA.INI |||--UFR.DIR ||||--CH_UFR.DIR |||||--CH%c_UFR.INI |||||--CH_UFR.INI ||||--COMPLETE_UFR.INI

Global user data all All sag/angularity compensation Option data Axis option data Channel option data All option data NC option data Protection areas Channel protection areas Protection areas channel All protection areas NC protection areas Quadrant error compensation Quadrant error compensation axis All quadrant error compensation R parameter R parameter channel All R parameter Setting data Achs--Settingdaten Setting data axis All axis setting data Channel setting data Setting data channel All channel setting data All setting data General setting data Machine data Axis machine data Machine data axis All axis machine data Channel machine data Machine data channel All channel machine data All machine data NC machine data Tool/magazine data All tool/magazine data Magazine data Magazine data unit All magazine data Tool offset active Tool offset active TO All tool offsets active Zero offsets (user frame) Channel zero offsets Zero offsets channel All channel zero offsets All zero offsets

11-520

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

||||--NC_UFR.INI ||--ARC.DIR |||--*.ARC ||--BD.DIR |||--*.TEA ||--CMA.DIR |||--*.AWB |||--*.COM |||--*.CYC |||--*.LST |||--*.SPF |||--DPWP.INI |||--HLP.DIR ||||--*.BMP ||||--*.PDF ||||--*.TXT ||--COM.DIR |||--*.COM |||--HLP.DIR ||||--*.BMP ||||--*.PDF ||||--*.TXT ||--CST.DIR |||--*.AWB |||--*.COM |||--*.CYC |||--*.LST |||--*.SPF |||--DPWP.INI |||--HLP.DIR ||||--*.BMP ||||--*.PDF ||||--*.TXT |||--SC.COM ||--CUS.DIR |||--*.AWB |||--*.COM |||--*.CYC |||--*.LST |||--*.SPF |||--COV.COM |||--DPWP.INI |||--HLP.DIR ||||--*.BMP ||||--*.PDF ||||--*.TXT |||--UC.COM ||--DEF.DIR |||--GUD4.DEF

General zero offset Archives Archive file(ARC) Display machine data Machine data(TEA) Manufacturer cycles Display description(AWB) Comment files(COM) Preprocessed cycle Display list(LST) Subprogram fileSPF) DP initialization DP help Bitmap for interactive programming tools(BMP) Help file(PDF) Help index(TXT) Comments Comment file(COM) DP help Bitmap for interactive programming tools(BMP) Help file(PDF) Help index(TXT) Standard cycles Display description(AWB) Comment file(COM) Preprocessed cycle Display list(LST) Subprogram fileSPF) DP initialization DP help Bitmap for interactive programming tools(BMP) Help file(PDF) Help index(TXT) Call description/system User cycles Display description(AWB) Comment file(COM) Preprocessed cycle Display list(LST) Subprogram file(SPF) Overview of cycles DP initialization DP help Bitmap for interactive programming tools(BMP) Help file(PDF) Help index(TXT) Call description/user Definitions NC user data 4

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-521

Reference 11.9 Directory structure of the Data Management

03.03

|||--GUD5.DEF |||--GUD6.DEF |||--GUD7.DEF |||--GUD8.DEF |||--GUD9.DEF |||--MGUD.DEF |||--MMAC.DEF |||--SGUD.DEF |||--SMAC.DEF |||--UGUD.DEF |||--UMAC.DEF ||--DG.DIR |||--*.UMA ||||--BITMAP.DIR |||||--*.BMP ||||--DAU.DIR |||||--*.DAC ||||--FG.DIR |||||--*.FGC ||||--IPOTRC.DIR |||||--*.COM ||||--KFT.DIR |||||--KFTDIA.DIR ||||||--*.SUD |||||--KFTPAR.DIR ||||||--*.SUP ||||--MCC.DIR |||||--MCCGR1.DIR ||||||--*.MC1 |||||--MCCGR2.DIR ||||||--*.MC2 |||||--MCCPAR.DIR ||||||--*.MCC ||||--MDAX.DIR |||||--*.TEA ||||--MDBT.DIR |||||--*.TEA ||||--MDCH.DIR |||||--*.TEA ||||--MDCOMP.DIR |||||--*.COM ||||--MDHSA.DIR |||||--*.TEA ||||--MDNC.DIR |||||--*.TEA ||||--MDVSA.DIR |||||--*.TEA ||||--MPC.DIR |||||--MPCGR1.DIR

NC user dataNC 5 NC user dataNC 6 NC user dataNC 7 NC user dataNC 8 NC user dataNC 9 Global data/global data machine tool manufacturer Macros/global data machine tool manufacturer Global user data/system Macros/system Global data/user Macros/user Diagnosis Machine Graphic data Bitmap for interactive programming tools(BMP) D/A converter D/A conversion configuration data Function generator Function generator configuration data Interpolator trace Comment file(COM) Circularity test Diagram from circularity test Setup diagram from circularity test(SUD) Circularity test parameter Setup parameter(SUP) Current control loop MCC graphic1 MCC graphic1 data MCC graphic2 MCC graphic2 data MCC parameter MCC parameter data Machine data/axis Machine data(TEA) Machine data/panel Machine data(TEA) Machine data/channel Machine data(TEA) Machine data comparison Comment fileCOM) Machine data/MSD Machine data(TEA) Machine data/NC Machine data(TEA) Machine data/FDD Machine data(TEA) Position control circuit MPC graphic1

11-522

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

||||||--*.MP1 |||||--MPCGR2.DIR ||||||--*.MP2 |||||--MPCPAR.DIR ||||||--*.MPC ||||--MSC.DIR |||||--MSCGR1.DIR ||||||--*.MS1 |||||--MSCGR2.DIR ||||||--*.MS2 |||||--MSCPAR.DIR ||||||--*.MSC ||||--SVTRC.DIR |||||--SVTGR1.DIR ||||||--*.ST1 |||||--SVTGR2.DIR ||||||--*.ST2 |||||--SVTPAR.DIR ||||||--*.SVT |||--BITMAP.DIR ||||--*.BMP |||--DAU.DIR ||||--*.DAC |||--FG.DIR ||||--*.FGC |||--INIT.DIR ||||--*.INI ||||--*.ZIP |||--IPOTRC.DIR ||||--*.COM |||--KFT.DIR ||||--KFTDIA.DIR |||||--*.SUD ||||--KFTPAR.DIR |||||--*.SUP |||--KLB.DIR ||||--*.KLB |||--LOGFILES.DIR ||||--*.COM |||--MCC.DIR ||||--MCCGR1.DIR |||||--*.MC1 ||||--MCCGR2.DIR |||||--*.MC2 ||||--MCCPAR.DIR |||||--*.MCC |||--MDAX.DIR ||||--*.TEA |||--MDBT.DIR

MPC graphic1 data MPC graphic2 MPC graphic2 data MPC parameter MPC parameter data Speed control circuit MSC graphic1 MSC graphic1 data MSC graphic2 MSC graphic2 data MSC parameter MSC parameter data Servotrace SVT graphic1 SVT graphic1(ST1) SVT graphic2 SVT graphic2(ST2) SVT parameter SVT parameter(SVT) Graphic data Bitmap for interactive programming tools(BMP) D/A converter D/A conversion configuration data Function generator Function generator configuration data Initialize MMC Initialization programm(INI) MMC configuration Interpolator trace Comment file(COM) Circularity test Diagram from circularity test Setup diagram from circularity test(SUD) Circularity test parameter Setup parameter(SUP) Configuration list displays Configuration list display Logfiles Comment file(COM) Current control loop MCC graphic1 MCC graphic1 data MCC graphic2 MCC graphic2 data MCC parameter MCC parameter data Machine data/axis Machine data(TEA) Machine data/operator panell

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-523

Reference 11.9 Directory structure of the Data Management

03.03

||||--*.TEA |||--MDCH.DIR ||||--*.TEA |||--MDCOMP.DIR ||||--*.COM |||--MDDRV.DIR ||||--*.TEA |||--MDHSA.DIR ||||--*.TEA |||--MDNC.DIR ||||--*.TEA |||--MDVSA.DIR ||||--*.TEA |||--MPC.DIR ||||--MPCGR1.DIR |||||--*.MP1 ||||--MPCGR2.DIR |||||--*.MP2 ||||--MPCPAR.DIR |||||--*.MPC |||--MSC.DIR ||||--MSCGR1.DIR |||||--*.MS1 ||||--MSCGR2.DIR |||||--*.MS2 ||||--MSCPAR.DIR |||||--*.MSC |||--PLC.DIR ||||--*.COM |||--PLCUD.DIR ||||--*.PLC |||--SPL.DIR ||||--*.SPL |||--SVTRC.DIR ||||--SVTGR1.DIR |||||--*.ST1 ||||--SVTGR2.DIR |||||--*.ST2 ||||--SVTPAR.DIR |||||--*.SVT ||--DH.DIR |||--DCF.COM |||--LOG.COM |||--TYP.COM ||--DP.DIR |||--AWB.DIR ||||--*.AWB ||||--*.COM ||||--*.LST

Machine data(TEA) Machine data/channel Machine data(TEA) Machine data comparison Comment file(COM) All machine data/drive Machine data(TEA) Machine data/MSD Machine data(TEA) Machine data/NC Machine dataMaschinendaten(TEA) Machine data/FDD Machine data(TEA) Position control circuit MPC graphic1 MPC graphic1 data MPC graphic2 MPC graphic2 data MPC parameter MPC parameter data Speed control loop MSC graphic1 MSC graphic1 data MSC graphic2 MSC graphic2 data MSC parameter MSC parameter data PLC data Comment file(COM) PLC operand screenforms Operand screenform(PLC) Safe programmable logic Safe logic Servotrace SVT graphic1 SVT graphic1(ST1) SVT graphic2 SVT graphic2(ST2) SVT parameter SVT parameter(SVT) Data management Configuration Logbook/DH Data type Interactive programming DP user screens Display description(AWB) Comment fileCOM) Display list(LST)

11-524

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

|||--DPT.DIR ||||--*.BMP |||--GPMAC.DIR ||||--MACM.DIR |||||--*.DSC |||||--*.MAC ||||--MACT.DIR |||||--*.DSC |||||--*.MAC |||--HLP.DIR ||||--*.BMP ||||--*.COM |||--INF.DIR ||||--*.BMP ||||--*.COM |||--SIM.DIR ||||--*.COM ||||--*.INI ||||--CMA.DIR |||||--*.SPF ||||--CST.DIR |||||--*.SPF ||||--CUS.DIR |||||--*.SPF ||||--GUD4.DEF ||||--GUD5.DEF ||||--GUD6.DEF ||||--GUD7.DEF ||||--GUD8.DEF ||||--GUD9.DEF ||||--MGUD.DEF ||||--MMAC.DEF ||||--SGUD.DEF ||||--SMAC.DEF ||||--UGUD.DEF ||||--UMAC.DEF |||--TS.DIR ||||--*.LDB ||||--*.MDB ||--HS.DIR |||--HS--TEA.ACC |||--HS1.BOT |||--HS10.BOT |||--HS11.BOT |||--HS12.BOT |||--HS13.BOT |||--HS14.BOT |||--HS15.BOT |||--HS16.BOT

DP tools Bitmap for interactive programming tool(BMP) GP macros GP macros milling GP macro description(DSC) GP macro code(MAC) GP macros turning GP macro description(DSC) GP macro code(MAC) DP help Bitmap for interactive programming tool(BMP) Comment file(COM) DP basic information Bitmap for interactive programming tool(BMP) Comment file(COM) Simulation directory Comment file(COM) Initialization programINI) Manufacturer cycles Subprogram fileSPF) Standard cycles Subprogram fileSPF) User cycles Subprogram fileSPF) NC user data 4 NC user data 5 NC user data 6 NC user data 7 NC user data 8 NC user data 9 Global user data/machine manufacturer Macros/machine manufacturer Global data/system Macros/system Global data/user Macros/user Technology storage TS list structure(LDB) TS data(MDB) MSD data Access/MSD TEA Boot data/MSD1 Boot data/MSD10 Boot data/MSD11 Boot data/MSD12 Boot data/MSD13 Boot data/MSD14 Boot data/MSD15 Boot data/MSD16

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-525

Reference 11.9 Directory structure of the Data Management

03.03

|||--HS17.BOT |||--HS18.BOT |||--HS19.BOT |||--HS2.BOT |||--HS20.BOT |||--HS21.BOT |||--HS22.BOT |||--HS23.BOT |||--HS24.BOT |||--HS25.BOT |||--HS26.BOT |||--HS27.BOT |||--HS28.BOT |||--HS29.BOT |||--HS3.BOT |||--HS30.BOT |||--HS31.BOT |||--HS4.BOT |||--HS5.BOT |||--HS6.BOT |||--HS7.BOT |||--HS8.BOT |||--HS9.BOT ||--IBN.DIR |||--*.TRC |||--DAC.BIN ||--MB.DIR |||--*.COM ||--MPF.DIR |||--*.CEC |||--*.EEC |||--*.MPF |||--*.QEC |||--*.TOP |||--DPWP.INI ||--NC_CARD.DIR |||--ARC.DIR ||||--*.ARC |||--CMA.DIR ||||--*.SPF |||--CST.DIR ||||--*.SPF ||--OEM.DIR |||--*.USD ||--PDA.DIR |||--*.WPP ||--SPF.DIR |||--*.SPF |||--DPWP.INI

Boot data/MSD17 Boot data/MSD18 Boot data/MSD19 Boot data/MSD2 Boot data/MSD20 Boot data/MSD21 Boot data/MSD22 Boot data/MSD23 Boot data/MSD24 Boot data/MSD25 Boot data/MSD26 Boot data/MSD27 Boot data/MSD28 Boot data/MSD29 Boot data/MSD3 Boot data/MSD30 Boot data/MSD31 Boot data/MSD4 Boot data/MSD5 Boot data/MSD6 Boot data/MSD7 Boot data/MSD8 Boot data/MSD9 Installation and startup Trace file(TRC) DAC parametrzation MBDDE alarms Comment file(COM) Main programs Sag/angularity compensation(CEC) Spindle pitch/encoder error compensation(EEC) Main program(MPF) Quadrant error compensation(QEC) Tool plan(TOP) DP Initialization NC card Archives Archiv file(ARC) Manufacturer cycles Subprogram file(SPF) Standard cycles Subprogram file(SPF) OEM data User data(USD) Working sequence Workpiece plan(WPP) Subprogram files Subprogram file(SPF) DP Initialization

11-526

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

||--SYF.DIR |||--*.SYF |||--LOGBOOK.SYF |||--VERSION.SYF ||--TEMPL.DIR |||--MANUF.DIR ||||--*.INI ||||--*.JOB ||||--*.MPF ||||--*.SPF |||--NEWFILES.DIR ||||--*.041 ||||--*.CEC ||||--*.COM ||||--*.DAT ||||--*.GUD ||||--*.IKA ||||--*.INI ||||--*.JOB ||||--*.MPF ||||--*.PRO ||||--*.RPA ||||--*.SEA ||||--*.SPF ||||--*.TCM ||||--*.TEA ||||--*.TMA ||||--*.TOA ||||--*.TOP ||||--*.UFR |||--Siemens.DIR ||||--*.JOB ||||--*.MPF ||||--*.SPF |||--USER.DIR ||||--*.JOB ||||--*.MPF ||||--*.SPF ||--V24.DIR |||--*.V24 ||--VS.DIR |||--HL1.BOT |||--HL10.BOT |||--HL11.BOT |||--HL12.BOT |||--HL13.BOT |||--HL14.BOT |||--HL15.BOT |||--HL16.BOT

System directories System files(SYF) Logbook Version Templates Manufacturer Initialize program(INI) Joblist Main program file(MPF) Subprogram file(SPF) New files AutoTurn program Sag/angularity compensation(CEC) Comment file(COM) Time evaluation(DAT) Channel user data(GUD) Compensation data(IKA) Initialize programm(INI) Joblist Main program file(MPF) Protection areas R parameter(RPA) Setting data(SEA) Sub program file(SPF) Tool plan, unformatted(TCM) Mchine data(TEA) Magazine data(TMA) Tool offset active(TOA) Tool plan(TOP) Zero offset/user frame(UFR) Siemens Joblist Main program file(MPF) Subprogram file(SPF) User Joblist Main program file(MPF) Subprogram file(SPF) V24 interface V24 parameter FDD data Boot data/HLA1 Boot data/HLA10 Boot data/HLA11 Boot data/HLA12 Boot data/HLA13 Boot data/HLA14 Boot data/HLA15 Boot data/HLA16

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-527

Reference 11.9 Directory structure of the Data Management

03.03

|||--HL17.BOT |||--HL18.BOT |||--HL19.BOT |||--HL2.BOT |||--HL20.BOT |||--HL21.BOT |||--HL22.BOT |||--HL23.BOT |||--HL24.BOT |||--HL25.BOT |||--HL26.BOT |||--HL27.BOT |||--HL28.BOT |||--HL29.BOT |||--HL3.BOT |||--HL30.BOT |||--HL31.BOT |||--HL4.BOT |||--HL5.BOT |||--HL6.BOT |||--HL7.BOT |||--HL8.BOT |||--HL9.BOT |||--SL1.BOT |||--SL10.BOT |||--SL11.BOT |||--SL12.BOT |||--SL13.BOT |||--SL14.BOT |||--SL15.BOT |||--SL16.BOT |||--SL17.BOT |||--SL18.BOT |||--SL19.BOT |||--SL2.BOT |||--SL20.BOT |||--SL21.BOT |||--SL22.BOT |||--SL23.BOT |||--SL24.BOT |||--SL25.BOT |||--SL26.BOT |||--SL27.BOT |||--SL28.BOT |||--SL29.BOT |||--SL3.BOT |||--SL30.BOT |||--SL31.BOT |||--SL4.BOT

Boot data/HLA17 Boot data/HLA18 Boot data/HLA19 Boot data/HLA2 Boot data/HLA20 Boot data/HLA21 Boot data/HLA22 Boot data/HLA23 Boot data/HLA24 Boot data/HLA25 Boot data/HLA26 Boot data/HLA27 Boot data/HLA28 Boot data/HLA29 Boot data/HLA3 Boot data/HLA30 Boot data/HLA31 Boot data/HLA4 Boot data/HLA5 Boot data/HLA6 Boot data/HLA7 Boot data/HLA8 Boot data/HLA9 Boot data/SLM1 Boot data/SLM10 Boot data/SLM11 Boot data/SLM12 Boot data/SLM13 Boot data/SLM14 Boot data/SLM15 Boot data/SLM16 Boot data/SLM17 Boot data/SLM18 Boot data/SLM19 Boot data/SLM2 Boot data/SLM20 Boot data/SLM21 Boot data/SLM22 Boot data/SLM23 Boot data/SLM24 Boot data/SLM25 Boot data/SLM26 Boot data/SLM27 Boot data/SLM28 Boot data/SLM29 Boot data/SLM3 Boot data/SLM30 Boot data/SLM31 Boot data/SLM4

11-528

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 11.9

Reference Directory structure of the Data Management

|||--SL5.BOT |||--SL6.BOT |||--SL7.BOT |||--SL8.BOT |||--SL9.BOT |||--VS--TEA.ACC |||--VS1.BOT |||--VS10.BOT |||--VS11.BOT |||--VS12.BOT |||--VS13.BOT |||--VS14.BOT |||--VS15.BOT |||--VS16.BOT |||--VS17.BOT |||--VS18.BOT |||--VS19.BOT |||--VS2.BOT |||--VS20.BOT |||--VS21.BOT |||--VS22.BOT |||--VS23.BOT |||--VS24.BOT |||--VS25.BOT |||--VS26.BOT |||--VS27.BOT |||--VS28.BOT |||--VS29.BOT |||--VS3.BOT |||--VS30.BOT |||--VS31.BOT |||--VS4.BOT |||--VS5.BOT |||--VS6.BOT |||--VS7.BOT |||--VS8.BOT |||--VS9.BOT ||--WKS.DIR |||--*.WPD ||||--*.041 ||||--*.CEC ||||--*.COM ||||--*.DAT ||||--*.GUD ||||--*.IKA ||||--*.INI ||||--*.JOB ||||--*.MPF ||||--*.PRO

Boot data/SLM5 Boot data/SLM6 Boot data/SLM7 Boot data/SLM8 Boot data/SLM9 Access/FDD TEA Boot data/FDD1 Boot data/FDD10 Boot data/FDD11 Boot data/FDD12 Boot data/FDD13 Boot data/FDD14 Boot data/FDD15 Boot data/FDD16 Boot data/FDD17 Boot data/FDD18 Boot data/FDD19 Boot data/FDD2 Boot data/FDD20 Boot data/FDD21 Boot data/FDD22 Boot data/FDD23 Boot data/FDD24 Boot data/FDD25 Boot data/FDD26 Boot data/FDD27 Boot data/FDD28 Boot data/FDD29 Boot data/FDD3 Boot data/FDD30 Boot data/FDD31 Boot data/FDD4 Boot data/FDD5 Boot data/FDD6 Boot data/FDD7 Boot data/FDD8 Boot data/FDD9 Works data file Workpiece(WPD) AutoTurn programm Sag/angularity compensation(CEC) Comment file(COM) Time evaluation(DAT) Channel user data(GUD) Compensation data(IKA) Initialize programm(INI) Joblist Main program file(MPF) Protection areas

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-529

Reference 11.9 Directory structure of the Data Management

03.03

||||--*.RPA ||||--*.SEA ||||--*.SPF ||||--*.TCM ||||--*.TEA ||||--*.TMA ||||--*.TOA ||||--*.TOP ||||--*.UFR ||||--DPWP.INI ||--WZV.DIR |||--MCFG.DIR ||||--*.INI |||--WCFG.DIR ||||--*.CTC ||||--*.WMF |||--WDAT.DIR ||||--*.LDB ||||--*.MDB ||--_NC_ACT.DIR

R parameter(RPA) Setting data(SEA) Subprogram fileSPF) Tool plan, unformatted(TCM) Machine data(TEA) Magazine data(TMA) Tool offset active(TOA) Tool plan(TOP) Zero offset/user frame(UFR) DP initialization Tool management Magazine configuration Initialization programm(INI) Tool management configuration Convert. regulations(CTC) Windows Metafile(WMF) Tool management data Technology storage list structure(LDB) Technology storage data(MDB) NC active data

11-530

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.10 Software Information

11.10

Software Information

11.10.1

File extensions

Table 11-24 Overview of the file extensions

extension .$$$ .000 .041 .ACC .ANN .APP .ARC .ARJ .ASM .ASP .BAK .BAT .BIN .BMK .BOT .BSP .C .CAT .CFG .CHK .COM .CPI .CYC .DAT .DAT .DBF .DIR .DLL .DOC

contents and meanings of the file temporary file installation and overlay files AUTOTURN program access descriptions for NCU data notes to WINDOWS help files application file of the user interface GEM file compressed with ARC file compressed with ARJ source code file in the programming language Assembler asynchronous sub program backup copy of a file batch file (stack file) binary file bookmark for WINDOWS help files boot data FDD/MSD--611D request being processed source code file in the programming language C dBase catalogue file configuration file file restored with CHKDSK executable program, comment file files with character tables cycles program *.DAT time calculation(DAT) = data for AUTOTURN data for AUTOTURN (time calculation) dBase data file directory files of the WINDOWS applications test file (word processing or ASCII)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-531

Reference 11.10 Software Information

03.03

Table 11-24

Overview of the file extensions

extension .EMN .EXE .FPU .FW? .GEM .GUD .HLP .ICO .IKA .INI .INX .LHA .LIB .LUD .LZH .MPF .NDX .OBJ .OPT .ORF .OVL .PAS .PIF .PRG .REC .REF .SEA .SIK .SPF .SWP .SYF .SYS .TEA .TMP

contents and meanings of the file request being processed executable program found in the catalogue MMC2 framework files file of the graphical user interface GEM global/channel--specific user data help file interpolated compensation configuration file (usually Windows applications) index files (e.g. for data bases) file compressed with LHARC library file ( for programming languages) local/program--specific user data file compressed with LHA part program index files (e.g. for data bases) object files (programming languages) options file restored with ProFilAct II overlay files source code file of the programming language PASCAL configuration file (Windows) application programming files (e.g. dBase) file restored with RECOVER cross reference file NC setting data backup copy of a file (like .BAK) subprogram swap files, for example for a virtual working memory system file program (driver; call from CONFIG.SYS) NC machine data temporary file

11-532

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.10 Software Information

Table 11-24

Overview of the file extensions

extension .TOA .TXT .UFR .WKS .WPD .ZIP tool data

contents and meanings of the file text file (word processing or ASCII) zero point shift/frames Works data file (same: .WDB and .WPS) workpiece directory file compressed with PKZIP

11.10.2

Alarm numbers

Table 11-25 List of the alarm number ranges

alarm numbers 000 000 to 009 999 010 000 to 019 999 020 000 to 029 999 030 000 to 039 999 040 000 to 059 999 060 000 to 062 999 063 000 to 064 999 065 000 to 067 999 068 000 to 069 999 070 000 to 079 999

alarm area NCK alarms general alarms channel alarms axis spindle alarms functional alarms reserved cycle alarms SIEMENS reserved cycle alarms user reserved Compile--Cycles developer and OEM reserved MMC alarms/messages

alarm text file ALN_xx.COM ALN_xx.COM ALN_xx.COM

ALZ_xx.COM

ALN_xx.COM, ALC_xx.COM

080 000 to 099 999

100 000 to 109 999 100 000 to 100 999 101 000 to 101 999 102 000 to 102 999 103 000 to 103 999 104 000 to 104 999

MMC 100 base system diagnosis services machine parameter

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-533

Reference 11.10 Software Information

03.03

Table 11-25

List of the alarm number ranges

alarm numbers 105 000 to 105 999 106 000 to 106 999 107 000 to 107 999 108 000 to 109 999 110 000 to 119 999 120 000 to 129 999 130 000 to 139 999 140 000 to 199 999 (200 000 to 299 999 300 000 to 399 999

alarm area programming reserved OEM reserved MMC 101 MMC 103 OEM reserved MCU alarms) drive alarms PLC alarms/messages

alarm text file

ALM_xx.COM

ALN_xx.COM

400 000 to 499 999 500 000 to 599 999 600 000 to 699 999 700 000 to 799 999 800 000 to 899 999 810 000 to 810 009 900 000 to 999 999

general alarms channel alarms axis spindle alarms user area sequences/ graphs system error messages in the PLC reserved

ALP_xx.COM

ALP_xx.COM ALP_xx.COM

11.10.3

Drivers

Table 11-26 List of drivers

name in directory L:\MMC2\DRIVERS KBD.DRV SCANTAB.EXE

function

resetting the END key to TAB called from AUTOEXEC.BAT

11-534

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.10 Software Information

Table 11-26

, FortsetzungList of drivers

name

function

VKD_MMC2.386 replacement for WINDOWS--driver VKD.386: to use the vertical SK bar, ETC-- and MACHINE--key, storing shift--key description in chapter 7 entry in SYSTEM.INI, section [386Enh] VMMC2D.386 area change--over for DOS applications for setting the contrast in the monochrome operator panel

Special keycodes of the vkd_mmc2.386 driver

When you exclusively use this driver note that it doesn't supply the keycode for shift+F1 to shift+F8, but rather encodes the vertical softkey bar and other keys according to the following table. This range of codes should not be used by WINDOWS.

Table 11-27 Special keycodes of the driver vkd_mmc2.386

key vertical Softkey 1 vertical Softkey 2 vertical Softkey 3 vertical Softkey 4 vertical Softkey 5 vertical Softkey 6 vertical Softkey 7 vertical Softkey 8 ETC MACHINE open parenthesis ( close parenthesis ) 5E 5F 62 63 64 65 66 67 69 6A

scan code 0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xE8 0xE9 0xEA 0xEB

code

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-535

Reference 11.10 Software Information

03.03

Note The scan codes for the vertical softkey 1 (5E) and for the vertical softkey 2 (5F) differ from the values 60 respectively 61 for pressing (make--code) the key as they are usually implemented under DOS. Since e.g. the code for letting go(break--code) the vertical softkey 1 corresponds to E0 and with the prefix code (e.g. twice ALT key) returns E1 when being pressed (make) , it has been substituted by the codes 5E and 5F.

Modifying the scancodes of the OP 031 with the keyboard driver

For some keys (VSK0--7, M--key, ETC--key, '(', ')', SingleQuote) the OP031 generates scancodes, which are reserved in the PC area. Since these are not standard key codes and since future OPs might not generate these key codes, it is necessary to eliminate these key codes as soon as possible. The keyboard driver contained in P5 is equipped with a scancode mapping feature, which allows to redefine the special scancodes generated by the OP031. The following incompatibilities will occur in P5: Up to P5.1 the OP031 created the following codes:

Table 11-28 Codes up to SW version 5.1 ScanCode 0x5E 0x5F 0x62 0x63 0x64 0x65 0x66 0x67 0x68 0x69 0x6A 0x6B 0x6C VirtKeycode 0xE0 0xE1 0xE2 0xE3 0xE4 0xE5 0xE6 0xE7 0xBF (like PC) 0xE8 0xE9 0xEA 0xEB

Key VSK0: VSK1: VSK2: VSK3: VSK4: VSK5: VSK6: VSK7: SingleQuote: ETC: MACHINE: ( )

11-536

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.10 Software Information

From P5.1UPD the KeyboardDriver will provide the following mappings:

Table 11-29 Key VSK0: VSK1: VSK2: VSK3: VSK4: VSK5: VSK6: VSK7: SingleQuote: ETC: MACHINE: ( ) Codes from SW version 5.1UPD ScanCode like Shift--F1 like Shift--F2 like Shift--F3 like Shift--F4 like Shift--F5 like Shift--F6 like Shift--F7 like Shift--F8 like SingleQuote like Shift--F9 like Shift--F10 like ( like ) VirtKeycode like Shift--F1 like Shift--F2 like Shift--F3 like Shift--F4 like Shift--F5 like Shift--F6 like Shift--F7 like Shift--F8 like SingleQuote like Shift--F9 like Shift--F10 like ( like )

The mapping uses a table contained in the file SYSTEM.INI. Any VirtKeycode may be substituted there by a sequence of VirtKeycodes (from P5.1UPD). The SYSTEM.INI for P5.1 will be supplied with a table that gives the mapping showed above. Thus the KeyboardDriver in P5.1UPD generates PC compatible scancodes only. If on a MMC103 an OEM application is installed which works with the 'old` OP031 codes only, the mapping feature may be disabled in the SYSTEM.INI. This does not touch the MMC103 applications. Problems will occur, if several OEM applications have been installed, which differ regarding their requirements on the keycodes (i.e. if e.g. one OEM application ONLY works with 'old' codes and another works with 'new' codes only. However, this case cannot occur yet, since up to now there are no OEM applications which react on 'new' keycodes only, since such applications could NOT be run on MMC103--SW--releases <P5.1UPD. Troublefree are all applications which react on both kinds ('old' and 'new') of keyboard codes, since they can be run on all SW releases. Problems might occur with applications which can be operated with the OP031 only and therefore can process the previous scancodes only.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-537

Reference 11.10 Software Information

03.03

Simulating the OP031 with a MF2-keyboard

Table 11-30 Function--keys for area applications with VB and AL

function key F1 to F8 F9 F10 F11 F12 Shift+F1 to Shift+F8 Shift+F9 Shift+F10 Shift+F11 Shift+F12 Escape--key Home--key RECALL--key

meaning activate the horizontal softkeys area--changeover key channel--changeover key Info--key activate the vertical softkeys ETC--key machine--area key presently not being used presently not being used alarm acknowledgment window--changeover key

11.10.4

Supported languages and Language shortcuts

Table 11-31 Languages and applied ANSI--table/Code--Page Abbreviation GR UK SP IT FR CH TW KO JA SW HU PO Code-Page (DOS) 850 850 850 850 850 936 950 949 932 850 852 850 ANSI-Table (Windows) 1252 1252 1252 1252 1252 ----1252 1250 1252

Language German English Spanish Italian French Chinese(simplified) Chinese (traditional) Korean Japanese Swedish Hungarian Portuguese

11-538

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.10 Software Information

Table 11-31

Languages and applied ANSI--table/Code--Page Abbreviation CZ TR RU PL NL FI Code-Page (DOS) 852 857 866 852 850 850 ANSI-Table (Windows) 1250 1254 1251 1250 1252 1252

Language Czech Turquoise Russian Polish Dutch Finnish

11.10.5

Assignment of ANSI tables and fonts

Table 11-32 Font Arial Arial bold Arial italic Arial bold italic Table 11-33 Font Arial Arial bold Arial italic Arial bold italic Table 11-34 Font Arial Arial bold Arial italic Arial bold italic ANSI-Table 1250 (Central Europe) File Cearial.ttf Ceariabd.ttf Ceariali.ttf Caeriabi.ttf Characters Arial CE (True Type) Arial CE Bold (True Type) Arial CE Italic (True Type) Arial CE Bold Italic (True Type)

ANSI-Table 1251 (Cyrillic) File Aricyr.ttf Aricyb.ttf Aricyri.ttf Aricyrbi.ttf Characters Arial Cyr (True Type ) Arial Cyr Bold (True Type ) Arial Cyr Italic (True Type ) Arial Cyr Bold Italic (True Type )

ANSI-Table 1252 (West Europe) File Windows--Standard Windows--Standard Windows--Standard Windows--Standard Arial (True Type ) Arial Bold (True Type ) Arial Italic (True Type ) Arial Bold Italic (True Type ) Characters

In order to use these languages, each of them must be installed under Windows.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-539

Reference 11.11 Hardware information

03.03

11.11

Hardware information

11.11.1

Memory addresses

Table 11-35 Overview of über memory address ranges

identification Boot vector System BIOS (after RESET) reserved DRAM DRAM Boot vector System BIOS PCMCIA window range/EMS Adapter RAM/ROM (PCMCIA/LAN/SCSI) Adapter RAM/ROM (PCMCIA/LAN/SCSI) MPI/AMPlus--L range Adapter RAM/ROM (PCMCIA/LAN/SCSI) VGA BIOS VGA DRAM DRAM BIOS variable Vector table

range (hex) FFFF000:FFF0 FFFF000:0000 200000:0000 40000:0000 10000:0000 F000:FFF0 F000:0000 E000:0000 D000:0000 CC00:0800 CC00:0000 C800:0000 C000:0000 A000:0000 0050:0000 0040:0000 0000:0000

11-540

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.11 Hardware information

11.11.2

Interrupt requests

The following table shows the Interrupt requests (IRQ) and the possible assignments for the ISA--adapter or the PC--card adapter. 0 is the highest priority. Each adapter with a request for IRQ 2 is forwarded to IRQ 9.

Table 11-36

Interrupt assignment for MMC

Prio

Interrupt controller Interrupt controller 1 2 timer keyboard controller interrupt controller 2 Ê real time clock free(Graphic) MPI (K--Bus) free free (COM 3/4) math. coprocessor hard disk free serial interface 2 (COM 2) serial interface 1 (COM 1) free(parallel interface 2, LAN) floppy drive parallel interface 1 (LPT 1)

IRQ

Option ISA-adapter no yes -no yes yes yes yes no yes yes yes yes yes yes yes

Option PC-card adapter no no -no yes yes yes yes no yes yes yes yes yes no yes

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14

0 1 2 8 9 10 11 12 13 14 15 3 4 5 6 7

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-541

Reference 11.11 Hardware information

03.03

11.11.3

Input/output addresses MMC

The I/O--addresses 000 to 0FF are reserved for the main board, the ports 100 to 3FF are available for extender cards.

Table 11-37 Overview of input/output addresses of the MMC

identification DMA controller #1 Interrupt controller Timer Keyboard controller Real--time clock, CMOS memory, NMI mask Manufacturers diagnostic checkpoint (POST--Codes) DMA page register Interrupt controller #2 DMA controller #2 arithmetic coprocessor Hard disk (secondary) Hard disk Game I/O (joystick A/D--port) Sound card Parallel printer #2 EGA #2 Asynchronous adapter port #2 Prototype card

address (hex) 000 to 01F 020 to 03F 040 to 05F 060 to 06F 070 to 07F 080 080 to 09F 0A0 to 0BF 0C0 to 0DF 0F0 to 0FF 170 to 177 1F0 to 1F7 200 to 207 220 to 257 278 to 27F 2C0 to 2DF 2F8 to 2FF 300 to 31F

e.g. Computer Link Board DF 15 (COM 338 to 33F 3) LAN card Parallel printer #1 Bisynchronous port #2 (SDLC) Bisynchronous port #1 Video Graphics Array (VGA) or alternatively Monochrome Display Adapter/Printer #1 or alternatively Enhanced Graphics Adapter (EGA) #1 or alternatively Color/Graphics Adapter (CGA) and EGA 360 to 36F 378 to 37F 380 to 38F 3A0 to 3AF 3B0 3B0 3C0 3D0 to to to to 3DF 3BF 3CF 3DF

11-542

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Reference 11.11 Hardware information

Table 11-37

Overview of input/output addresses of the MMC

identification PCMCIA controller Disk controller Asynchronous adapter Port #1

address (hex) 3E0 to 3E1 3F0 to 3F7 3F8 to 3FF

11.11.4

More details on the PCU50 hardware

Graphic chip

Chips of the type 65550 are used as SVGA--Graphic chip set.

Bus-specification

The ISA and the PCI--bus of the PCI/ISA--box follow the specifications below: PCI LOCAL BUS Specification Revision 2.1 (PCI Special Interest Group 1.6.95) (E)ISA Specification Version 3.2 BCPR Service, Inc. 1989--1992

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

11-543

Reference 11.11 Hardware information

03.03

Notes

11-544

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Applications

12

The delivery volume of the OEM package MMC contains some examples that allow you to quickly get familiar with the design of the operator's interface and to extend the functions of the SINUMERIK 840D's MMC component. This chapter contains short descriptions of the supplied examples.

Preliminary remarks

Working with the examples described in this chapter requires basic knowledge of Visual Basic. The following short descriptions are part of the program documentation that can be found in the file OEMBSPn.WRI in the directory SRC of the corresponding example OEMBSPn ( with n being the ordinal number of the example).

Pattern for an application

Example OEMBSP0 provides a pattern for an application. You can use this pattern as a frame for your own MMC--OEM projects. Before working with the files contained in this project using VISUAL BASIC you should copy and possibly rename them.

12.1

Goal

Sequence Control / Application change-over

Example OEMBSP1 is a basic example that introduces you to the topic MMC-OEM and demonstrates the use of the Sequence Control. It also explains, what is to be considered when creating an application with VISUAL BASIC, if it is to be embedded in the SINUMERIK development environment. It demonstrates how to realize your own Sequence Control and how to modify softkey texts. Finally the example explains how to embed your own applications in the Regie.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

12-545

Applications 12.2 NCDDE Server

03.03

12.2

Goal

NCDDE Server

Example OEMBSP2 is based on the first example and treats the basic functions of the NCDDE Server. The example's purpose is: S introducing the DDE basics S initializing the DDE Server S structuring/ handling the data description files S accessing NC data and displaying an own VISUAL BASIC application S sending a DDE LinkExecute job S copying a part program from MMC to NC S selecting a part program for execution

Requirements

You need to be familiar with the following S VISUAL BASIC S creating an application that fits the SINUMERIK environment using VISUAL BASIC S realizing your own Sequence Control S developing a language DLL S embedding your own application in the Regie

12.3

Goal

Alarm Server

The example OEMBSP3 shows how to work with the message module MBDDE. Via the DDE mechanism the Alarm Server provides services for the alarm handling. The Alarm Server can be used directly under Visual Basic or via the Sequence Control.

12-546

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 12.4

Applications Example Regie/OEMFRAME

Alarm Server directly under VB

In the directory "oembsp3\alar_dde" you can find an example program called "mbddetst" Using this program you can address the Alarm Server "mbdde.exe" directly under Visual Basic. Clicking the corresponding labels will send the commands to the Alarm Server or establish the according links.

Alarm Server via Sequence Control

The following example is to be realized: Using the softkeys and the dialog boxes of the Sequence Control the corresponding commands are to be sent to the Alarm Server and functions are to be called. The data are copied to the corresponding display boxes via the link mechanism.

Requirements

Basic knowledge of the use of VISUAL VASIC; VISUAL C++ (modifying a DLL) is required. Before the example OEMBSP3 is executed under Visual Basic you need to start "mbdde.exe" (Alarm Server or message module) "regie.dll".

12.4

Goal

Example Regie/OEMFRAME

The example OEMBSP4 shows how to use the Regie and how to embed standard WINDOWS applications. Any WINDOWS application can be embedded in the Regie using the 'OEM-Frame' functionality. Here the two WINDOWS programs CLOCK and WRITE (both are part of the standard WINDOWS delivery volume) will be embedded in the Regie using an area application (here: Sequence Control). The following steps must be taken: S copy the WINDOWS applications S expand the regie.ini file S expand the language DLL of the module Regie

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

12-547

Applications 12.5 Data Management Server

03.03

Requirements

Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL) and of the development of an OEM application.

12.5

Goal

Data Management Server

The example OEMBSP5 shows how to use the functions of the Data Management. In a simple Visual Basic application the following functions of the Data Management are used: S create files or directories S delete files or directories S list the files or directories that have been created this way

Requirements

Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL) and of the development of an OEM application. This knowledge can be acquired with the example OEMBSP1.

12.6

Goal

NCDDE Server for PLC data

The example OEMBSP6 shows how to use the NC--DDE Server for data exchange with the PLC: Accessing PLC data and displaying Visual Basic application. Starting a job DDE--LinkPoke for writing PLC data

Requirements

Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL) and of the development of an OEM application. This knowledge may be acquired from the examples OEMBSP1 and OEMBSP2.

12-548

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 12.7

Applications Positioning WINDOWS applications

12.7

Goal

Positioning WINDOWS applications

The example OEMBSP8 shows how to position standard applications within the SINUMERIK window. Standard WINDOWS applications as EXCEL, EDITOR, CLOCK can be positioned in the SINUMERIK display form using API functions.

Requirements

Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL) and of the development of an OEM application. This knowledge may be acquired from the example OEMBSP1.

12.8

Goal

Example Data exchange between Visual Basic and DLL

The example OEMBSP10 demonstrates two applications: S realizing DLL functions S simple data exchange between VB applications and the DDL function

Requirements

Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL) and of the development of an OEM application.

12.9

Goal

Functions of the Sequence Control

You may not use some components of Visual Basic like e.g. message boxes in your OEM applications. The Sequence Control provides substitute solutions. Example 11 shows how to use this and other functions of the Sequence Control to make work easier for the developer of OEM applications.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

12-549

Applications 12.10 Sequential processing of several asynchronous jobs

03.03

Requirements

Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how to create and integrate an OEM application.

12.10 Sequential processing of several asynchronous jobs

Goal

Some commands of the Data Management have not yet finished, when the VB command which issued the command is finished. How to guarantee that the correct sequence is kept even when several commands are issued is shown in example 12.

Requirements

Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how to create and integrate an OEM application. You should also be familiar with the features of the Data Management Server as shown in Example 5.

12.11

Starting an application with an OEM softkey and realizing a DCTL connection

Goal

This example shows how to start an application with an OEM--softkey, how to exit the application, how to use the Visual Basic control 'DCTL.VBX' and how to implement a language switch--over.

Requirements

Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how to create and integrate an OEM application. You should also be familiar with the features of the Data Management Server as shown in Example 5.

12-550

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Applications 12.12 Operating a 32-bit C++ application with softkeys

12.12 Operating a 32-bit C++ application with softkeys

Goal

This example shows how to adapt a C++ application (32--Bit) in order to operate it with the Sinumerik 840D MMC 103 ­ specific user panel. For development the Microsoft Developer Studio Visual C++ 4.1 was used. This is on the one hand a dialog--based application and on the other hand a single document application.

Requirements

Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how to create and integrate an OEM application.

12.13 Embedding SprintPlus in MMC-OEM applications

Goal

This example shows how to embed an application which has been developed with an parametrizing tool in an already existing MMC--OEM applikation (here: OemBsp0).

Requirements

Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how to create and integrate an OEM application.

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

12-551

Applications 12.13 Embedding SprintPlus in MMC-OEM applications

03.03

Platz für Notizen

12-552

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Appendix

A

This Chapter contains the abbreviations and technical terms used in the OEM pakkage HMI. For general abbreviations and technical terms refer to the corresponding literature (see chapter A.3).

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-553

Appendix A1 Abbreviations

03.03

A1

Abbreviations

ACC ASCII ASUP BIOS DDE DLL DRAM IPO ISA MCS MMC MPI NC NCDDE NCK NCU NSK OEM ACCESS module American Standard for Information Interchange Asynchronous NC subprogram Basic Input Output System Dynamic Data Exchange: method for data exchange between two WINDOWS applications Dynamic Link Library Dynamic random access memory Interpolator Industrial Standard Adapter: bus standard for PC extension adapter boards based on IBM--AT Machine Coordinate System Human Machine Interface: operating interface of the NC applying to the software running on the operator's panel Multiport interface Numerical control Dynamic data exchange with the NC kernel Numerical Control Kerne consists of block preparation, motion control etc. Numerical Control Unit: hardware component of SINUMERIK 840D, accommodating the NCK software. Numerical System Keyword: Keyword for addressing NC variables with the NCDDE server Original Equipment Manufacturer: manufacturer of devices and equipment, who adapts the standard components for his purposes using the open system feature of SINUMERIK 840D. user parametrizes MTB configures OEM programs. The expression 'OEM' does not apply to the PLC programming. Operator's Paneconsists of monitor screen, keypad, LEDs and buttons. For 840D/FM--NC variants of the OP031/032 are used (described in the documentation /BH/ Operator Components Manual)

OP

M-554

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 A1

Appendix Abbreviations

PC PCMCIA

Personal Computer Personal Computer Memory Card International Association Standard memory card used in the NCU 572/573 accommodating among others the NCK system, today simply named PC--card. Program nstance Programmable logic controller memory that allows random access for reading and writing data workpiece coordinate system Visual Basic Windows for Workgroups

PI PLC RAM WCS VB WfW

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-555

Appendix A2 Technical terms

03.03

A2

Technical terms

Active file system The active file system contains all variables of the NCK referred to by their names. These variables are used for configuring the NCK software and adapting it to a special machine as well as for describing tools or providing calculation variables in NC part programs. Alarm Server The Alarm Server provides the currently active alarms and messages of the system for the MMC. Axis key Axis keys are special type declarations (AxKey) that assign a bit to each axis or spindle. If the bit corresponding to an axis is set, this axis is in the state described by the respective AxKey. The first axis is always assigned to bit0. Domain Service Performs upload/download of interrelated data (files) from/to the NC--kernel. Dynamic memory Data stored in the dynamic memory of the NC have temporary life time and don't need to be battery--maintained. In this documentation the term 'dynamic memory' is used synonymously with 'DRAM' and 'unbuffered memory'. External communication The external communication realizes the external operating interface of the NC kernel. The communication is specified according to the BTSS definition and the variable definitions. Functional units The processing sequence from the interpretation of the ASCII part program to the block preparation and interpolation up to the position control of the axes is structured into several functional units. These functional units of the NCK contain the methods for processing the NC-data. Each functional unit uses the results of the proceeding one. Keyboard Server The Keyboard Server manages the operator's panel and the corresponding codes for the OEM user. ISA Bus Adapter Hardware extension of MMC 101/102: case with slots (ISA bus) for connecting standard PC and AT extension boards MMC-OEM base system The MMC--OEM base system is the software supplied with the OEM package MMC. It provides a base for OEM applications.

M-556

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03 A2

Appendix Technical terms

NC-DDE Server The NC--DDE Server is a component of the MMC--OEM base system. It performs three tasks of the data transfer: S Variable Service S Domain Service S PI Service Passive file system The passive file system is located in the battery--maintained memory (SRAM). It is used for storing files and NC part programs. The passive file system is structured hierarchically i.e. it consists of directories and subdirectories. PC card The PC card is a memory card following the PCMCIA norm. It contains the system firmware of the NCU. As an option an additional PC--card adapter can be connected to the HMI component of a control. It offers memory and communication functionality on a small space. PI Service The PI Service invokes the execution of special commands defined in the NC kernel. The functions are started on the NCU. Regie The Regie is a component of the MMC base system taking care of the system start--up. It also starts the OEM applications. It corresponds to the WINDOWS program manager. Sequence Control The Sequence Control provides a frame for SIEMENS standard applications and compatible OEM applications. It manages the structure of the menus including softkey functions and texts. Symbol A symbol contains the description of one element of the active file system characterized in particular by its ASCII name. Variable Service The Variable Service reads and writes data of the NC--kernel one item at a time. A data item is specified by its identifier, e.g. tool data. accesses NC, PLC and drive data copies files from MMC to NCK and back starts Program Invocation Services of the NC

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-557

Appendix A3 Reference

03.03

A3

Reference

General Documentation

/BU/

SINUMERIK 840D/840Di/810D/802S, C, D Ordering Information Catalog NC 60.1 Order No.: E86060-K4460-A101-A8-7600

/ST7/

SIMATIC SIMATIC S7 Programmable Logic Controllers Catalog ST 70 Order No.: E86 060-K4670-A111-A3

/Z/

SINUMERIK, SIROTEC, SIMODRIVE Accessories and Equipment for Special-Purpose Machines Catalog NC Z Order No.: E86060-K4490-A001-A7-7600

Electronic Documentation

/CD6/

The SINUMERIK System (09.01 Edition) DOC ON CD (includes all SINUMERIK 840D/840Di/810D/FM-NC and SIMODRIVE publications) Order No.: 6FC5 298-6CA00-0BG1

M-558

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

05.01 03.03

Appendix A3 Reference

User Documentation

/AUK/

SINUMERIK 840D/810D/FM-NC Short Guide AutoTurn Operation Order No.: 6FC5 298-4AA30-0BP3 SINUMERIK 840D/810D/FM-NC AutoTurn Graphic Programming System Operator's Guide Programming / Setting up Order No.: 6FC5 298-4AA50-0BP3 SINUMERIK 840D/810D/FM-NC Operator's Guide Order No.: 6FC5 298-6AA00-0BP0 SINUMERIK 840D/810Di/810D Operator's Guide HMI Advanced Order No.: 6FC5 298-6AF00-0BP1 SINUMERIK 840D/810D Operator's Guide HMI Embedded Order No.: 6FC5 298-6AC00-0BP1 SINUMERIK 840D/810D/FM-NC Operator's Guide Unit Operator Panel Order No.: 6FC5 298-3AA60-0BP1 SINUMERIK 840D/840Di/810D Operator's Guide HT 6 (HPU new) Order No.: 6FC5 298-0AD60-0BP2 SINUMERIK 840D/840Di/810D/FM-NC Short Operation Guide Order No.: 6FC5 298-6AA10-0BP0 SINUMERIK 840D/810D Operator's Guide ManualTurn Order No.: 6FC5 298-6AD00-0BP0 SINUMERIK 840D/810D Operator's Guide ShopMill Order No.: 6FC5 298-6AD10-0BP0 SINUMERIK 840D/810D Operator's Guide ShopTurn Order No.: 6FC5 298-6AD50-0BP0 (09.01 Edition)

/AUP/

(09.01 Edition)

/BA/

(10.00 Edition)

/BAD/

(09.01 Edition)

/BEM/

(09.01 Edition)

/BAE/

(04.96 Edition)

/BAH/

(09.01 Edition)

/BAK/

(02.01 Edition)

/BAM/

(10.01 Edition)

/BAS/

(10.01 Edition)

/BAT/

(03.01 Edition)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-559

Appendix A3 Reference

03.03 05.01

/BAP/

SINUMERIK 840D/840Di/810D Operator's Guide Handheld Programming Unit Order No.: 6FC5 298-5AD20-0BP1 SINUMERIK 840D/840Di/810D/FM-NC User's Guide Measuring Cycles Order No.: 6FC5 298-6AA70-0BP0 SINUMERIK 840D/840Di/810D/FM-NC Diagnostics Guide Order No.: 6FC5 298-6AA20-0BP1 SINUMERIK 840D/810D Short Guide ManualTurn Order No.: 6FC5 298-2AD40-0BP0 SINUMERIK 840D/810D Short Guide ShopMill Order No.: 6FC5 298-2AD30-0BP0 SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Fundamentals Order No.: 6FC5 298-6AB00-0BP1 SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Advanced Order No.: 6FC5 298-6AB10-0BP1 SINUMERIK 840D/840Di/810D/FM-NC Short Guide Programming Order No.: 6FC5 298-6AB30-0BP1 SINUMERIK 840D/840Di/810D Programming Guide ISO Milling Order No.: 6FC5 298-6AC20-0BP1 SINUMERIK 840D/840Di/810D Programming Guide ISO Turning Order No.: 6FC5 298-6AC10-0BP1 SINUMERIK 840D/840Di/810D/FM-NC Programming Guide Cycles Order No.: 6FC5 298-6AB40-0BP1

(04.00 Edition)

/BNM/

(10.00 Edition)

/DA/

(09.01 Edition)

/KAM/

(11.98 Edition)

/KAS/

(01.98 Edition)

/PG/

(09.01 Edition)

/PGA/

(09.01 Edition)

/PGK/

(09.01 Edition)

/PGM/

(10.01 Edition)

/PGT/

(10.01 Edition)

/PGZ/

(09.01 Edition)

/PI /

PCIN 4.4 Software for Data Transfer to/from MMC Module Order No.: 6FX2 060 4AA00-4XB0 (German, English, French) Order from: WK Fürth

M-560

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

05.01 03.03

Appendix A3 Reference

/SYI/

SINUMERIK 840Di System Overview Order No.: 6FC5 298-5AE40-0BP0

(01.00 Edition)

Manufacturer/Service Documentation

a) Lists /LIS/

SINUMERIK 840D/840Di/810D/FM-NC SIMODRIVE 611D Lists Order No.: 6FC5 297-6AB70-0BP1

(09.01 Edition)

b) Hardware /BH/

SINUMERIK 840D/840Di/810D/FM-NC Operator Components Manual (HW) Order No.: 6FC5 297-6AA50-0BP1 SIMODRIVE Sensor Absolute Encoder with PROFIBUS-DP User Guide (HW) Order No.: 6SN1197-0AB10-0YP1 SINUMERIK, SIROTEC, SIMODRIVE EMC Installation Guide Planning Guide (HW) Order No.: 6FC5 297-0AD30-0BP1 SINUMERIK 810D Configuring Manual (HW) Order No.: 6FC5 297-4AD10-0BP1 SINUMERIK 840D NCU 561.2-573.2 Configuring Manual (HW) Order No.: 6FC5 297-6AC10-0BP1 SINUMERIK FM-NC NCU 570 Configuring Manual (HW) Order No.: 6FC5 297-3AC00-0BP0 SIMODRIVE Sensor Measuring System for Main Spindle Drives Configuring/Installation Guide, SIMAG-H (HW) Order No.: 6SN1197-0AB30-0BP0

(09.01 Edition)

/BHA/

(02.99 Edition)

/EMV/

(06.99 Edition)

/PHC/

(12.00 Edition)

/PHD/

(09.01 Edition)

/PHF/

(04.96 Edition)

/PMH/

(05.99 Edition)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-561

Appendix A3 Reference

03.03 05.01

c) Software /FB1/

SINUMERIK 840D/840Di/810D/FM-NC Description of Functions, Basic Machine (Part 1) -- (09.01 Edition) -(the various sections are listed below) Order No.: 6FC5 297-6AC20-0BP1 A2 A3 B1 B2 D1 D2 F1 G2 H2 K1 K2 K4 N2 P1 P3 R1 S1 V1 W1 Various Interface Signals Axis Monitoring, Protection Zones Continuous Path Mode, Exact Stop and Look Ahead Acceleration Diagnostic Tools Interactive Programming Travel to Fixed Stop Velocities, Setpoint/Actual-Value Systems, Closed-Loop Control Output of Auxiliary Functions to PLC Mode Group, Channel, Program Operation Mode Axes, Coordinate Systems, Frames, Actual-Value System for Workpiece, External Zero Offset Communication EMERGENCY STOP Transverse Axes Basic PLC Program Reference Point Approach Spindles Feeds Tool Compensation

/FB2/

SINUMERIK 840D/840Di/810D(CCU2)/FM-NC Description of Functions, Extended Functions (Part 2) --(09.01 Edition)-including FM-NC: Turning, Stepper Motor (the various sections are listed below) Order No.: 6FC5 297-6AC30-0BP1 A4 B3 B4 F3 H1 K3 K5 L1 M1 M5 N3 N4 P2 P5 R2 S3 S5 S6 S7 T1 Digital and Analog NCK I/Os Several Operator Panels and NCUs Operation via PG/PC Remote Diagnostics Jog with/without Handwheel Compensations Mode Groups, Channels, Axis Replacement FM-NC Local Bus Kinematic Transformation Measurement Software Cams, Position Switching Signals Punching and Nibbling Positioning Axes Oscillation Rotary Axes Synchronous Spindles Synchronized Actions (up to and including SW 3) Stepper Motor Control Memory Configuration Indexing Axes

M-562

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

05.01 03.03

Appendix A3 Reference

W3 W4

Tool Change Grinding

/FB3/

SINUMERIK 840D/840Di/810D(CCU2)/FM-NC Description of Functions, Special Functions (Part 3) (the various sections are listed below) Order No.: 6FC5 297-6AC80-0BP1 F2 G1 G3 K6 M3 S8 T3 V2 W5 TE1 TE2 TE3 TE4 TE5 TE6 TE7 TE8 V2 W3

(09.01 Edition)

3-Axis to 5-Axis Transformation Gantry Axes Cycle Times Contour Tunnel Monitoring Coupled Axes and ESR (previously Coupled Motion and Master/Slave Couplings) Constant Workpiece Speed for Centerless Grinding Tangential Control Preprocessing 3D Tool Radius Compensation Distance Control Analog Axis Master-Slave for Drives Transformation Package for Handling Setpoint Exchange MCS Coupling Retrace Support Unclocked Path-Synchronous Switching Signal Output Preprocessing 3D Tool Radius Compensation

/FBA/

SIMODRIVE 611D/SINUMERIK 840D/810D Description of Functions, Drive Functions (the various sections are listed below) Order No.: 6SN1 197-0AA80-0BP7 DB1 DD1 DD2 DE1 DF1 DG1 DM1 DS1 DÜ1

(09.01 Edition)

Operational Messages/Alarm Reactions Diagnostic Functions Speed Control Loop Extended Drive Functions Enable Commands Encoder Parameterization Calculation of Motor/Power Section Parameters and Controller Data Current Loop Control Monitors/Limitations

/FBAN/

SINUMERIK 840D/SIMODRIVE 611 Digital Description of Functions ANA Module Order No.: 6SN1 197-0AB80-0BP0

(02.00 Edition)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-563

Appendix A3 Reference

03.03 05.01

/FBD/

SINUMERIK 840D Description of Functions Digitizing Order No.: 6FC5 297-4AC50-0BP0 DI1 DI2 DI3 DI4 Start-Up Scanning with Tactile Sensors (scancad scan) Scanning with Lasers (scancad laser) Milling Program Generation (scancad mill)

(07.99 Edition)

/FBDN/

CAM Integration DNC NT-2000 Description of Functions System for NC Data Management and Data Distribution Order No.: 6FC5 297-5AE50-0BP1 SINUMERIK 840D/840Di/810D Description of Functions ISO Dialects for SINUMERIK Order No.: 6FC5 297-6AE10-0BP1 SINUMERIK 840D/810D Description of Functions Remote Diagnosis Order No.: 6FC5 297-6AF00-0BP0 FE1 FE2 Remote Diagnosis Alarm-Triggered Messaging by E-Mail: @Event

(05.00 Edition)

/FBFA/

(09.01 Edition)

/FBFE/

(09.01 Edition)

/FBHLA/

SINUMERIK 840D/SIMODRIVE 611 Digital Description of Functions HLA Module Order No.: 6SN1 197-0AB60-0BP2 SINUMERIK 840D/810D Description of Functions ManualTurn Order No.: 6FC5 297-5AD50-0BP1 SINUMERIK 840D/810D Description of Functions Configuring of OP 030 Operator Interface (the various sections are listed below) Order No.: 6FC5 297-6AC40-0BP0 BA EU PS PSE PSE IK

(04.00 Edition)

/FBMA/

(10.01 Edition)

/FBO/

(09.01 Edition)

Operator's Guide Development Environment (Configuring Package) Online only: Configuring Syntax (Configuring Package) Introduction to Configuring of Operator Interface Introduction to Configuring of Operator Interface Screen Kit: Software Update and Configuration

/FBP/

SINUMERIK 840D Description of Functions C-PLC Programming Order No.: 6FC5 297-3AB60-0BP0

(03.96 Edition)

M-564

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

05.01 03.03

Appendix A3 Reference

/FBR/

SINUMERIK 840D/810D Description of Functions SINCOM Computer Link Order No.: 6FC5 297-5AD60-0BP0 NFL NPL Host Computer Interface PLC/NCK Interface

(02.00 Edition)

/FBSI/

SINUMERIK 840D/SIMODRIVE Description of Functions SINUMERIK Safety Integrated (03.01 Edition) Order No.: 6FC5 297-6AB80-0BP0 SINUMERIK 840D/810D Description of Functions ShopMill Order No.: 6FC5 297-5AD80-0BP0 SIMATIC FM STEPDRIVE/SIMOSTEP Description of Functions Order No.: 6SN1 197-0AA70-0YP3 SINUMERIK 840D/810D Description of Functions ShopTurn Order No.: 6FC5 297-6AD70-0BP0 SINUMERIK 840D/840Di/810D(CCU2) Description of Functions Synchronized Actions for Wood, Glass, Ceramics, Presses Order No.: 6FC5 297-6AD40-0BP1 SINUMERIK 840D/810D Description of Functions Tool Information SINTDI with Online Help Order No.: 6FC5 297-6AE00-0BP0

/FBSP/

(10.01 Edition)

/FBST/

(11.98 Edition)

/FBT/

(03.01 Edition)

/FBSY/

(09.01 Edition)

/FBTD/

(03.01 Edition)

/FBU/

SIMODRIVE 611 universal Description of Functions (05.00 Edition) Closed-Loop Control Component for Speed Control and Positioning Order No.: 6SN1 197-0AB20-0BP3 SINUMERIK 840D/840Di/810D Description of Functions Tool Management Order No.: 6FC5 297-5AC60-0BP1 SINUMERIK 840Di Manual Order No.: 6FC5 297-5AE60-0BP0 SIMODRIVE 611 universal Short Description Closed-Loop Control Component for Speed Control Order No.: 6SN1 197-0AB40-0BP3

/FBW/

(10.01 Edition)

/HBI/

(07.01 Edition)

/KBU/

(05.00 Edition)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-565

Appendix A3 Reference

03.03 05.01

/PJE/

SINUMERIK 840D/810D HMI Embedded Installation Package Description of Functions: Software Update, Configuration, Installation Order No.: 6FC5 297-6EA10-0BP0 (the CS Configuration Syntax is included with the software and available as a pdf) SIMODRIVE Planning Guide 1FE1 Synchronous Built-In Motors AC Motors for Main Spindle Drives Order No.: 6SN1 197-0AC00-0BP1 SIMODRIVE Planning Guide Linear Motors (on request) ALL General Information about Linear Motors 1FN1 1FN1 Three-Phase AC Linear Motor 1FN3 1FN3 Three-Phase AC Linear Motor CON Connections Order No.: 6SN1 197-0AB70-0BP2 SIMODRIVE Planning Guide Motors AC Motors for Feed and Main Spindle Drives Order No.: 6SN1 197-0AA20-0BP4 SIMODRIVE 611-A/611-D Planning Guide Converters Order No.: 6SN1 197-0AA00-0BP5 SIMODRIVE POSMO A Operator's Guide Distributed Positioning Motor on PROFIBUS DP Order No.: 6SN2197-0AA00-0BP2 SIMODRIVE POSMO A Installation Instructions (enclosed with POSMO A) Order No.: 462 008 0815 00 SIMODRIVE POSMO SI/CD/CA Distributed Servo Drive Technology, User Manual Order No.: 6SN2197-0AA20-0BP0 SIMATIC S7-300 -- Manual: Assembly, CPU Data (HW) -- Reference Manual: Module Data Order No.: 6ES7 398-8AA03-8AA0

(08.01 Edition)

/PJFE/

(08.01 Edition)

/PJLM/

(06.01 Edition)

/PJM/

(09.00 Edition)

/PJU/

(05.01 Edition)

/POS1/

(04.01 Edition)

/POS2/

(12.98 Edition)

/POS3/

(01.01 Edition)

/S7H/

(10.98 Edition)

M-566

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

05.01 03.03

Appendix A3 Reference

/S7HT/

SIMATIC S7-300 Manual: STEP 7, Basic Information, V. 3.1 Order No.: 6ES7 810-4CA02-8AA0 SIMATIC S7-300 Manual: STEP 7, Reference Manuals, V. 3.1 Order No.: 6ES7 810-4CA02-8AR0 SIMATIC S7-300 FM 353 Step Drive Positioning Module Order in conjunction with Configuring Package SIMATIC S7-300 FM 354 Servo Drive Positioning Module Order in conjunction with Configuring Package

(03.97 Edition)

/S7HR/

(03.97 Edition)

/S7S/

(04.97 Edition)

/S7L/

(04.97 Edition)

/S7M/

SIMATIC S7-300 (10.99 Edition) FM 357 Multi-Axis Module for Servo and Stepper Drives Order in conjunction with Configuring Package SIMODRIVE 611 Single-Axis Positioning Control for MCU 172A Order No.: 6SN 1197-4MA00-0BP0 SIMODRIVE 611-A/611-D, SimoPro 3.1 Program for Configuring Machine-Tool Drives Order No.: 6SC6 111-6PC00-0AAj Order from: WK Fürth (01.98 Edition)

/SHM/

/SP/

d) Installation and Start-up /IAA/

SIMODRIVE 611A Installation and Start-Up Guide Order No.: 6SN 1197-0AA60-0BP6 (10.00 Edition)

/IAC/

SINUMERIK 810D Installation and Start-Up Guide (12.01 Edition) (incl. description of SIMODRIVE 611D start-up software) Order No.: 6FC5 297-4AD20-0BP1 SINUMERIK 840D/SIMODRIVE 611D Installation and Start-Up Guide (09.01 Edition) (incl. description of SIMODRIVE 611D start-up software) Order No.: 6FC5 297-6AB10-0BP1 SINUMERIK FM-NC Installation and Start-Up Guide Order No.: 6FC5 297-3AB00-0BP1

/IAD/

/IAF/

(07.00 Edition)

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

M-567

Appendix A3 Reference

03.03 05.01

/IAM/

SINUMERIK 840D/840Di/810D MMC/HMI Installation and Start-Up Guide Order No.: 6FC5 297-6AE20-0BP1 AE1 BE1 HE1 IM2 IM4 TX1 Updates/Options Expand the operator interface Online Help Start-Up HMI Embedded Start-Up HMI Advanced (PCU50) Setting Foreign language Texts

(09.01 Edition)

M-568

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Index

A

access mask, 10-441 access permission, 10-440 AccessLevel, 6-186 Actions, softkey, 7-328 actions , 7-245 Activate, 10-470 Activate2, 10-471 Active file system, 11-482 adding ETC, 7-332 addressing domains in NCK , 8-363 Advise Links, error handling, 8-396 aeditor, 4-158 AL_GetSkTextByState, 7-307 AL_SetSkTextByIndex, 7-307 Alarm maximum number, 9-424 order, 9-424 Section DEFAULTPRIO, 9-427 Section Helpcontext, 9-426 Section KEYS, 9-429 Section PROTOCOL, 9-428 Section TextFiles, 9-424 --timeFormat, 9-424 alarm log files , 3-132 alarm number, 11-533 Alarm-- Filter, 9-427, 9-428 AlarmFree, 9-415 AlarmList, 9-417 AlarmMsg, 9-415 alarms/messages , 3-132, 9-411 ALDisableEtcSKAction, 7-333 ALEnableEtcSKAction, 7-334 ALGetDLLEntriesI, 7-304 ALGetDLLEntriesIRaw, 7-305 ALGetDLLEntriesIRaw, 1-96 ALGetDLLEntriesRaw, 1-96, 7-303 ALNewEtcReturnstring, 7-333 ALNewEtcSuccessor, 7-333 ANIMATE, 8-378 application area, 4-144 application modal windows, 7-275 application--specific windows, 4-146 area application , 6-171 area change--over, 3-126 CmdLine, 6-182 attribute timeout, 6-182

C

CALL, 8-378 Cancel, 10-460 cancel, 3-126 change of value for test , 3-129 Change_SkText, 7-309 Change_SkTextOnScr, 7-309 ChangeEtcAccesslevel, 7-333 CHILDS, 4-153 Client, 8-339 Client--Server , 9-412 client--server--model, 8-339 CommandToTask, 6-197 complete overview of data, 10-438 Configuring the network, 8-399 Connection break down with NCK, 8-396 contrast control, 6-172 Convert_Possible_Datatypes, 10-453 Create, 10-474 current access permission level, 10-441 Cycles, 6-197

D

data format (directory/ASCII), 10-439 data formats, 11-488 Data Management of the complete system , 3-134 Data Management, additional infos, 3-135 Data Management, advantages , 3-133 Data Management, features, 3-136 data management, functions , 10-435, 10-449 Data Management, overview , 3-133 data scheme , 3-133 Data Scheme, definition, 10-437 data type, Archive, 10-444 DDE share manager, use, 8-397 DDE--communikation with Standard VB--Controls, 8-380 DDE--features , 8-339 DDE--Link--Server, 8-339 DDE--Link--Topic, 8-339 DDETest, 11-505 Defining global variables in the MMC, 8-404 Defining global variables in the NCK, 8-404 definition of data for test, 3-129

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Index-569

Index

03.03

Demands on the software engineer, 1-28 DH . INI, 5-161 Directly accessing NCK data, 3-134 DisableKeys, 6-190 DiskCare, 9-429 Display unit, 3-121 displaying alarms , 3-132 Document Conventions, 1-30 Domain Service, 11-485 Domain Service , 3-128 Domain Service of the NC--DDE Server, 3-130 drivers, 11-534

nSwitchToTaskAfterTermination, 6-233 FlushTime, 1-71, 9-429 foreign languages, language--DLL, 7-259 frame, MDIframe, 7-243 FREE, 8-377 Fullscreen--applications in WINDOWS, 4-145 function GetMMCDir, 6-217 GetMMCLanguagePath, 6-218 InitComplete, 6-218 Functions as from software version 6.2, 7-333

E

elements of the header , 4-145 end of text areas, 7-261 Entry ExitButtonIndex, 6-193 Entry HelpTaskIndex, 6-194 entry identifier, 6-177, 6-180 error classes, 11-506 Error classes for general = 1, 4, 6, 11-507 Error classes for general = 2, 11-512 Error codes for general = 1, 4, 6, 11-508 Error codes for general = 2, 11-512 Error codes for general = 5, 11-513 Error codes forr general = 7, 11-514 error messages from NCK, 8-396 Error messages from the Data Management, 11-518 Error regions, 11-507 Exist, 10-461 ExitButtonAccessLevel, 6-193 ExitButtonQueryUser, 6-193 Experience with PCs, 1-28 Explanation of data type, 10-439 Extensions of NC--functions, 1-24

G

g_chAdd_OnPath, 1-54 g_chGlobalProfile, 7-335 g_chHelpContext, 7-336 g_chLocalProfile, 7-335 g_chMBDDEServiceName, 7-335 g_chMMCPATH, 1-54, 7-335 g_chNCDDEServiceName, 1-68, 7-335 g_chOemPath, 1-54 g_chUserPath, 1-54 g_nAccessLevel, 7-336 g_nHelpInfo, 7-336 General error classes, 11-506 GeneralTexts, 6-199 Get_Attributes, 10-454 Get_FormIndex, 7-292 Get_Propertynames, 10-456 GetCurrentTaskIndex, 6-217 GIMMEKEYS, 6-187 Graphic chip, 11-543 graphical user interface , 4-143

H

hardware interfaces , 1-25 Hardware--supplements, 1-23 header, 4-144 HeaderOnTop, 6-183 Hide_A_Child, 7-295 Hide_Childs, 7-295 hiding the header , 4-145 HMI as an open architecture, 1-24 HMI shut--down, 2-104 horizontal softkey bar, 4-144 hotline, 1-29 Hotlink from Excel, 8-352 HSoftkeyTexts, 6-198

F

file DH.INI, 3-135, 10-437 file extension, 10-439 file extensions, 11-531 file REGIE.DLL, 6-172 file REGIE.INI, 6-172 File systems MMC/NCK, 10-438 files without additional infos, 3-135 FirstAlarm, 9-418 fKeepPlacement, 6-237 fRestoreTaskWindow, 6-234 nSecondsToFindWindows, 6-232

Index-570

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Index

I

MDIchilds, 7-272 types, 7-272 info field, 4-144 MDIchilds,to be opened, 7-280 information applying to the menu bars, 4-148 memory address, 11-540 initial state, 7-244 menu tree , 3-127, 7-245 initial state , 7-244 PCU50 module , 3-121 initialization file OEMFRAME.INI, 6-174 MMC.INI, 5-162 initialization file REGIE.INI, initialization, 6-174 HMI--design, 1-24 input/output addresses, 11-542 ModalDialogEnd, 7-312 interactive field , 4-144 ModalDialogInfo, 7-313 interactive line , 4-148 Modifiying access permission, 10-442 interfaces for data transfer , 3-139 Module types for the active file system, 11-492 Interrupt requests, 11-541 modules for the Domain Service, 11-489 IsChanMenuLocked, 6-214 MPI interface , 3-137 IsCurrentNCULocked, 6-213 MZ1, 9-419 MZ2, 9-419

K

Key assignment, 3-125 Knowledge of the NC--subject, 1-28 Create, problems, 2-109 power cut, 1-54, 2-108

N

Name, 6-182 name, 10-439 name of language DLL, 7-260 NC-DDE Server, connection state , 8-395 NC-DDE Server, initialization, 8-340 NCDDE--variables, array, 8-355 NCDDE311.NSK, 8-343 NETNAMES.INI, 5-164 network boards, 3-140 Networking the MMC103, 8-397 Release version 3.4, 1-32 NEW, 8-376 new state, 4-153 NrOfAlarm, 9-420 number of windows , 4-146

L

Lack of resources in the NC--DDE Server, 8-396 Language abbreviations, 9-431 Languages, 11-538 LastError, 11-505 Link--Item, 10-449 Link--Server, 10-449 Link--Topic, 10-449 List, 10-477 LoadLibrary -- first call, 2-106 Loadmethod, processing, 7-262 Lock/UnlockCurrent NCU, 6-213 Lock_Softkey, 7-299 LockChanMenu, 6-214 LockSkByAction, 7-297 LockSkByState, 7-298 LockSkByStateAndAction, 7-298 log file, 9-427, 9-428 log set--up , 3-132

O

OEM user alarms, 4-145 OEM--Frame, 3-126 OEMFRAME.INI, 5-165 initialization, 6-228 open software , 1-25 Operating unit, 3-120

M

machine control panel, 3-121 MATRIX, 4-152 MBDDE.INI, 5-162 alarms, 9-424

P

parameter for the title bar , 4-146 parameters for the display section, 4-147 passive file system, 11-484 PI Service, 3-128, 11-485

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Index-571

Index

03.03

SW 6.0 Functional changes and extensions, 1-84 IMC COM server, 1-88 OPC server, 1-87 OPI variables, 1-88 PI services, 1-94 PI_RESUME, 8-374 PI_RESUME_BINARY, 8-374 PI_START, 8-374 PI_START_BINARY, 8-374 PI_STOP, 8-374 PI_STOP_BINARY, 8-374 PLC_MEMORYRESET, 8-379 positioning windows, 7-275 Possible_Datatypes, 10-458 PreLoad, 6-184 pressing softkeys, 7-282 Lock_Softkey, 7-299 procedure, Unlock_Softkey, 7-301

R

R parameter, 10-446 RC file, comments, 7-261 ReadCmdLine, 6-215 ReadCmdLineMe, 6-215 RECALLkey, 7-328 RecLen, 9-429 Records, 9-429 REGIE.INI, 5-167, 6-174 registry features for messages, 3-132, 9-411 REGISTRY, SYSTEM.INI, 2-103 Remote Help, 6-194, 6-239 Rename, 10-463 request job, 10-449 Request, realized in C/C++, 10-451 Return, ASCII--Text, 7-280 RHelp, call, 6-239 RHelp, initialization, 6-240 RHelp, notebook function, 6-241 RHelp, utilization, 6-240

sequence structure, 3-126, 7-243 Server, 8-339 Set_ChildType, 7-295 Set_Previous_State, 7-287 several MMCs in the network , 8-400 Show_A_Hidden_Child, 7-297 Show_Focus, 7-296 Show_Hidden_Childs, 7-297 ShowMessageBox, 6-196 ShowResources, 6-197 skip header , 4-145 softkey texts, 7-263 spelling of child names , 2-107 standard keyboard , 3-121 standard software tools, 1-27 Start--form and DLL, 7-262 starting sequence, 3-125, 6-171 Starting sequence of the server, 8-400 state, 7-277 state , 3-127, 7-244 state number, 7-278 State table, 7-277 state transition , 7-246 state/action, 7-278 State_Changed, 7-288 State_Reached, 7-289 Status of the transfer, 3-130 Stopsave, 10-468 storage location of data, 10-440 storage of language DLLs, 7-259 structure of the display screen, 4-144 subwindow, MDIchild, 7-243 SVGA--Graphic--chip, 11-543 SwitchToChild, 6-207 SwitchToChildEx, 6-207 SwitchToHelpTask, 6-205 SwitchToParent, 6-208 SwitchToParentAndKillMe, 6-208 SwitchToPreviousTask, 6-204 SwitchToTask, 6-204 SwitchToTask2, 6-204

S

S7DPMPI.INI, 5-168 scancodes, 11-536 screen on/off, 6-212 ScreenTwips, 2-108 Section Miscellaneous, 6-191 sections of the file DH.INI, 3-136 sections of REGIE.INI, 6-174 Select, 10-464

T

Table of configuration/OEM domains, 1-24 TerminateTasks, 6-184 Test tools, 1-27 text areas in language DLL, 7-260 text entry in language--DLL, 7-260 text indices for softkeys, 7-280 The Data Managements view on the data, 3-134

Index-572

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

03.03

Index

Training, 1-29 two line softkey texts, 7-328

U

Unlock_Softkey, 7-301 UnlockChanMenu, 6-214 UnlockSkByAction, 7-300 UnlockSkByState, 7-300 UnlockSkByStateAndAction, 7-301 update, 1-29 upgrade, 1-29 user interface, 4-143

Variable Service , 3-128 vertical softkey bar, 4-144 VGA resolution , 4-146 vkd_mmc2.386, 11-535 VSoftkeyTexts, 6-199

W

window, standard form, 7-275 Write_Dialog, 7-310 WriteCmdLine, 6-215

Z

z--flag , 3-127, 7-244 Z--flag/succeeding state, 7-281

V

Variable helpflag, 6-240 LastError, 8-396 NcState, 8-395 TransferState, 8-363

Siemens AG 2003 All Rights Reserved HMI Programming Package Part 1 (BN) - 03.2003 Edition -

Index-573

Suggestions

SIEMENS AG A&D MC IS Postfach 3180 D-91050 Erlangen

(Tel. +49 180 / 525 -- 8008 / 5009 [hotline] Fax +49 9131 / 98 -- 1145 Mailto: [email protected]) From Name Address of your company/department Steet Zip code: Telephone: Telefax: City:

Corrections

for Publication/Manual:

SINUMERIK 840D/840Di/ SINUMERIK 801D/FM--NC HMI Programming Package Part 1 Manufacturer Documentation User's Manual Edition: 03.2003

Should you come across any printing errors when reading this publication please notify us on this sheet. Suggestions for improvement are also welcome.

/ /

Suggestions and/or corrections

Information

574 pages

Find more like this

Report File (DMCA)

Our content is added by our users. We aim to remove reported files within 1 working day. Please use this link to notify us:

Report this file as copyright or inappropriate

130244


You might also be interested in

BETA