Sunteți pe pagina 1din 574

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 SINUMERIK SINUMERIK SINUMERIK SINUMERIK


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

User’s Guide Description Installation Guide Description of User’s Manual


ProTool/Pro of Functions HMI Programming Functions HMI Environment
SINUMERIK HMI Programming Package OSACA Program-
Optionion Kit Package ming Package
Introduction 1

General information 2

SINUMERIK 840D/840Di/ HMI Fundamentals 3


SINUMERIK 810D/FM--NC
HMIProgramming Package SINUMERIK User Interface 4
Part 1
SystemStructure 5
User’s Manual

Regie 6

Sequence Control 7

Interface between
HMI and NCK/PLC 8

Alarms (Alarm handling) 9

Valid for:
Data Management 10
Component Softwareversion
HMI 6.3
Reference 11

Sample Application 12

Appendix A

Edition 03.2003 Index I


SINUMERIK documentation
3ls

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 Ident--No. Remarks


Preliminary 570886.3805.2j A
08.95 570 886.3806.23 C
10.95 570 886.3809.31 Supplement
10.95 570 886.3806.31 C
12.96 570 886.3806.34 C
03.97 570 886.3809.36 Supplement
03.97 570 886.3806.36 C
08.97 570 886.3806.42 C
12.97 570 886.3809.42 Supplement
12.97 570 886.3806.43 C
08.98 570 886.3806.44 Supplemenz
12.98 570 886.3806.51 C
11.99 570 886.3806.52 C
02.2000 none 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.

Other functions not described in this documentation might be


executable in the control. This does not, however, represent an
Siemens quality for software and training to DIN ISO 9001, obligation to supply such functions with a new control or when
Reg.Nr.1258--03 servicing.
We have checked that the contents of this document correspond to
This publication was produced with Interleaf 7. the hardware and software described. Nonetheless, differences might
The reproduction, transmission or use of this document or its exist and therefore we cannot guarantee that they are completely
contents is not permitted without express written authority. Offenders identical. The information contained in this document is, however,
will be liable for damages. All rights, including rights created by patent reviewed regularly and any necessary changes will be included in the
grant or registration of a utility model or design, are reserved. next edition. We welcome suggestions for improvement..

 Siemens AG 2000. All rights reserved. Subject to change without proir notice.

Bestell--Nr. 6FC5 297--6AC60--0AP0 Siemens--Aktiengesellschaft


Printed in the Federal Republic of Germany
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 MMC103-software --> HMI Advanced

S MMC100-software --> HMI Embedded

S MMC103-hardware --> PCU 50

S MMC100-hardware --> PCU 20

S OP031/OP032/OP032S --> OP012/OP015

Alterations for the HMI programming package

The following alterations arise for the HMI programming package:


S runs under Windows NT Service Pack 6
S we recommend applications to be programmed in Visual Basic 6.0
S the additional DOS box function is no longer part of SINUMERIK
S DDECTL.VBX and MENUGEN are no longer part of the delivery
S DCTL.VBX is replaced by DCTL.OCX
S 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 (Ap-
plication Programmers Interface) does not function as it should. The first three months of hotline service
are free--of--charge as it is included in the OEM package.

 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 purcha-
sed 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 Sie-
mens 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 hot-
line.

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--of--charge?

Up 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, pro-
prietary 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.

 Siemens AG 2003 All Rights Reserved


ii 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 soft-
ware 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 con-
tact 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

 Siemens AG 2003 All Rights Reserved


iv 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 Chapter 1
Programming instructions Chapter 2 to 10
Reference Chapter 11
Applications Chapter 12
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 informa-
tion in the Chapters 5 to 10 enable the user to take advantage of all features.

 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 defini-
tions 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 Appendix
2. Bibliography Appendix
3. Index 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.

 Siemens AG 2003 All Rights Reserved


vi 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 installa-
tion, 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.

 Siemens AG 2003 All Rights Reserved


viii 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 al-
ways happen for pure practical and stylistic considerations; the information provi-
ded herein naturally also applies to femal users, female engineers, female pro-
grammers etc.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition ix
Preface 03.03

Notes

 Siemens AG 2003 All Rights Reserved


x HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Contents
1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23
1.1 SINUMERIK 840D as an open system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-23
1.2 Open system architecture of the Human Machine Interface (HMI) . . . . . . 1-24
1.3 Which parts of the documentation are of interest for me . . . . . . . . . . . . . . 1-25
1.4 Development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-27
1.5 Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-28
1.6 Typographic conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-30
1.7 What happened in the last versions? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-32
1.7.1 Release 3.4 August 1996 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-32
1.7.2 Release 4.2 August 1997 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-43
1.7.3 Release 4.3 Dezember 1997 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-52
1.7.4 Release 4.4 August 1998 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-55
1.7.5 Release 5.1 Dezember 1998 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-56
1.7.6 Release 5.2 November 1999 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-58
1.7.7 Release 6.0 April 2000 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1-83
2 General information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-103
2.1 Features of the component PCUxx . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-103
2.2 Optimizing the development environment . . . . . . . . . . . . . . . . . . . . . . . . . . . 2-106
2.3 Problems during operation and how to solve them . . . . . . . . . . . . . . . . . . . 2-106
2.4 Transfer of VB applications from 16Bit to 32Bit . . . . . . . . . . . . . . . . . . . . . . 2-109
2.5 Notes for the OEM user on ”Hard disk Backup/Restore with Ghost” . . . . 2-116
3 Basics of the HMI component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-119
3.1 HMI as a part of SINUMERIK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-120
3.1.1 Operator component . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-120
3.1.2 Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-122
3.2 Software architecture of the HMI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-123
3.2.1 The layer of the HMI software . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-123
3.2.2 Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-124
3.2.3 Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-126
3.2.4 NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-128
3.2.5 Alarm server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-131
3.2.6 Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-133
3.3 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-137
3.3.1 MPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-137
3.3.2 Transfer of OEM data to the control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-139
3.4 OEM applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3-141
4 Design of the graphical user interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-143
4.1 User interface of the standard NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-143
4.1.1 Info field (header) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-145
4.1.2 Application area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-146

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition xv
Contents 03.03

4.1.3 Interactive field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-148


4.1.4 Softkey bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-148
4.2 Embedding additional applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-149
4.3 How to create an application with the OEM--package . . . . . . . . . . . . . . . . . 4-150
4.4 Adapting the standard application to your needs . . . . . . . . . . . . . . . . . . . . . 4-152
4.4.1 Embedding an OEM softkey in the area MASCHINE . . . . . . . . . . . . . . . . . 4-155
4.5 Adapting the standard interface (regie.ini, mmc.ini) . . . . . . . . . . . . . . . . . . . 4-156
4.6 The application aeditor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4-158
5 System structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-161
5.1 DH.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-161
5.2 MBDDE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-162
5.3 MMC.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-162
5.4 NETNAMES.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-164
5.5 OEMFRAME.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-165
5.6 REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-167
5.7 S7DPMPI.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5-168
6 Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-169
6.1 Concept of the Regie . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-170
6.2 Integration of OEM applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-173
6.3 Application with sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-174
6.3.1 The initialization file REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-174
6.3.2 Section [Version] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-175
6.3.3 Section [SystemDllCoonfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-176
6.3.4 Section [MMCDllConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-177
6.3.5 Section [StartupConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-177
6.3.6 Section [TaskConfiguration] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-180
6.3.7 Section [Miscellaneous] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-191
6.3.8 Section [CommandToTask] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-197
6.3.9 The initialization file language.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-197
6.3.10 Section [HSoftkeyTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-198
6.3.11 Section [VSoftkeyTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-199
6.3.12 Section [GeneralTexts] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-199
6.3.13 Section [HSoftkeyIcons] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-199
6.3.14 Section [HSoftkeyTextsShort] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-199
6.3.15 Section [MsgBox] . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-200
6.4 Functions of the RegieServer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-201
6.4.1 Switching tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-203
6.4.2 Switching tasks in the hidden area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-205
6.4.3 Switching tasks (to hidden area) immediately . . . . . . . . . . . . . . . . . . . . . . . . 6-208
6.4.4 Screen control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-211
6.4.5 Locking tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-213
6.4.6 Functions for managing the command line . . . . . . . . . . . . . . . . . . . . . . . . . . 6-214
6.4.7 Subsystems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-215
6.4.8 Miscellaneous . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-216

 Siemens AG 2003 All Rights Reserved


xvi HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Contents

6.5 Events of the RegieServer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-220


6.6 Application without sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-226
6.6.1 Entry in the file REGIE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-226
6.6.2 Entry in the file OEMFRAME.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-228
6.7 Embedding an OEM application in the HMI . . . . . . . . . . . . . . . . . . . . . . . . . 6-238
6.8 Adding help support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-239
6.8.1 Creating an alarm help file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-242
6.8.2 Creating an own help mechanism . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6-242
7 Sequence control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-243
7.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-244
7.2 Your first OEM application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-246
7.2.1 Directory structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-247
7.2.2 Directory structure of SW 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-249
7.2.3 Building the framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-250
7.2.4 Adding an additional window / form . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-253
7.3 Files of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-255
7.3.1 Initialization file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-255
7.3.2 Modules and forms of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . 7-256
7.3.3 Modules of the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-257
7.3.4 Temporary files of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-257
7.4 Language support for your applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-259
7.4.1 User interface and language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-259
7.4.2 RC files for texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-260
7.4.3 Creating the language DLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-263
7.4.4 Asian languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-267
7.4.5 Language selection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-268
7.4.6 Editing Texts Using Codepages Different From the Codepage
Used by the Operating System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-268
7.5 Types of windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-272
7.5.1 Application--modal windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-275
7.5.2 Displaying messages/notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-276
7.6 Menu control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-277
7.6.1 State table . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-277
7.6.2 State transitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-281
7.7 Procedures and functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-284
7.7.1 State control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-287
7.7.2 Inquiry functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-290
7.7.3 MDIChild functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-293
7.7.4 Locking/unlocking softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-297
7.7.5 Softkey text functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-302
7.7.6 Displaying texts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-310
7.7.7 Modal window functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-311
7.7.8 Action functions (dynamic change of the state matrix) . . . . . . . . . . . . . . . . 7-316
7.7.9 Functions for dynamic graphic resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-320
7.7.10 Functions for reading/ writing INI file entries . . . . . . . . . . . . . . . . . . . . . . . . . 7-324
7.8 Horizontal and vertical softkeys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-327
7.8.1 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 Configuring the softkey bars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-330


7.8.3 Extending the Softkey bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-332
7.8.4 New functions as from software version 6.2 . . . . . . . . . . . . . . . . . . . . . . . . . 7-333
7.9 Global variables of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-335
7.10 The Menu Tree Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7-336
8 Interface HMI <=> NCK/PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-337
8.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-338
8.2 Basics of DDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-339
8.3 Configuring the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-340
8.3.1 The initialization file MMC.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-340
8.3.2 Command files of the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-343
8.3.3 Connecting several NCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-344
8.4 Establishing a DDE connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-347
8.4.1 Establishing a DDE connection with Visual Basic . . . . . . . . . . . . . . . . . . . . 8-347
8.4.2 Establishing a DDE connection with Visual C/C++ . . . . . . . . . . . . . . . . . . . 8-350
8.4.3 Establishing a DDE connection from MS Excel . . . . . . . . . . . . . . . . . . . . . . 8-352
8.5 Variable Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-352
8.5.1 Single variable access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-354
8.5.2 Array variable access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-355
8.6 File transfer Services (Domain Services) . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-359
8.6.1 Transferring data between the HMI and the NC/PLC . . . . . . . . . . . . . . . . . 8-359
8.6.2 Extended copy functions between the HMI and the NC/PLC . . . . . . . . . . . 8-368
8.6.3 MAP--functions between domains . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-370
8.7 PI Services . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-374
8.8 More NCDDE Server commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-376
8.9 OEM--Visual Basic Controls (OCX files) . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-380
8.9.1 File DDECTL.VBX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-380
8.9.2 Filei DCTL.VBX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-381
8.9.3 File DCTL.OCX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-381
8.9.4 Applying DCTL.OCX . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-387
8.10 Diagnosis features for NCDDE--access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-393
8.10.1 Testing functions of the NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-393
8.10.2 State of a connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-395
8.10.3 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-396
8.11 How to configure the NCDDE Server for access via network . . . . . . . . . . 8-397
8.12 Extensions of the NCDDE server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-401
8.12.1 Multi variable service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-401
8.12.2 Indirect item specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-402
8.12.3 New access modifications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-402
8.13 Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9 . . .
8-403
8.14 Online--help for variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-408
8.15 Troubleshooting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409
8.15.1 Connection break down with NCK/PLC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409

 Siemens AG 2003 All Rights Reserved


xviii HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Contents

8.15.2 ...didn’t respond to DDE-Initiate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-409


8.15.3 Form Load takes long because many Hotlinks are being established . . . 8-409
8.15.4 First Execute commando doesn’t work . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-410
8.16 Determining the active bus nodes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8-410
9 Alarms (Alarm Handling) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-411
9.1 Communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-412
9.2 Types of Services (DDE link mode) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-414
9.3 Services of the Alarm DDE Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-414
9.3.1 Alarm Server commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-414
9.3.2 Advise variables of the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-416
9.3.3 Request variables of the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-420
9.4 Initializing the Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-423
9.4.1 The file MBDDE.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-423
9.4.2 The file NETNAMES.INI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-430
9.4.3 Alarm text files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-431
9.5 Alarm areas of the Sinumerik 840D . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9-433
10 Data Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-435
10.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-436
10.2 Directory structure of the Data Management . . . . . . . . . . . . . . . . . . . . . . . 10-437
10.2.1 Properties of the elements in the directory tree . . . . . . . . . . . . . . . . . . . . . 10-438
10.3 Elements in the MMC Data Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-443
10.4 Functions of the Data Management Server . . . . . . . . . . . . . . . . . . . . . . . . 10-449
10.4.1 Establishing DDE connections with the Data Management Server . . . . . 10-449
10.4.2 Request Jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-451
10.4.3 Simple Execute jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-459
10.4.4 Complex Execute jobs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10-468
11 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-481
11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-481
11.1.1 Areas of the NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-481
11.1.2 File systems of the NC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-482
11.1.3 Domain Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-485
11.1.4 PI Service . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-485
11.1.5 Data formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-488
11.2 Variable definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-488
11.2.1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-488
11.2.2 Shared modules of active and passive NCU file system . . . . . . . . . . . . . . 11-489
11.3 Module types for the active file system . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-492
11.3.1 Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-494
11.4 Machine data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-495
11.5 PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-496
11.5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-496
11.5.2 Summary of the PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-498
11.6 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 NCDDE -- Error messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-505


11.7.1 Variable LastError . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-505
11.7.2 General error class definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-506
11.7.3 Definition of the Error Region . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-507
11.7.4 Details for general = 1, 4 and 6 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-507
11.7.5 Details for general = 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-512
11.7.6 Details for general = 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-513
11.7.7 Details for general = 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-513
11.7.8 Detailsfor general = 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-514
11.7.9 Details for general = 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-515
11.7.10 Details for general = 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-517
11.8 Error messages of the Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-518
11.9 Directory structure of the Data Management . . . . . . . . . . . . . . . . . . . . . . . 11-519
11.10 Software Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-531
11.10.1 File extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-531
11.10.2 Alarm numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-533
11.10.3 Drivers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-534
11.10.4 Supported languages and Language shortcuts . . . . . . . . . . . . . . . . . . . . . 11-538
11.10.5 Assignment of ANSI tables and fonts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-539
11.11 Hardware information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-540
11.11.1 Memory addresses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-540
11.11.2 Interrupt requests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-541
11.11.3 Input/output addresses MMC . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-542
11.11.4 More details on the PCU50 hardware . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11-543
12 Applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-545
12.1 Sequence Control / Application change--over . . . . . . . . . . . . . . . . . . . . . . . 12-545
12.2 NCDDE Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-546
12.3 Alarm Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-546
12.4 Example Regie/OEMFRAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-547
12.5 Data Management Server . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-548
12.6 NCDDE Server for PLC data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-548
12.7 Positioning WINDOWS applications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-549
12.8 Example Data exchange between Visual Basic and DLL . . . . . . . . . . . . . 12-549
12.9 Functions of the Sequence Control . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12-549
12.10 Sequential processing of several asynchronous jobs . . . . . . . . . . . . . . . . 12-550
12.11 Starting an application with an OEM softkey and realizing a DCTL connection .
12-550
12.12 Operating a 32--bit C++ application with softkeys . . . . . . . . . . . . . . . . . . . 12-551
12.13 Embedding SprintPlus in MMC--OEM applications . . . . . . . . . . . . . . . . . . 12-551
A Appendix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-553
A1 Abbreviations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-554
A2 Technical terms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-556

 Siemens AG 2003 All Rights Reserved


xx HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Contents

A3 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-558
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-569

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition xxi
Contents 03.03

Notes

 Siemens AG 2003 All Rights Reserved


xxii HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Introduction 1
The flexible numeric control SINUMERIK 840D / 810D/FM--NC provides the ma-
chine 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 inter-
face 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 pro-
gramming interface for each of the above aspects.

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

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-23
Introduction 03.03
1.2 Open system architecture of the Human Machine Interface (HMI)

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

Extension of NC-- functions


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

Table of configuration/OEM domains

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

Range HMI
application OEM application
development WINDOWS on industrial PCs
environment
connection Regie Sequence Control
access to data OPC/COM
storage medium harddisc
programminglanguage Visual Basic
VisualC++

1.2 Open system architecture of the Human Machine Inter-


face (HMI)

New feature
The open system architecture of the Human Machine Interface (HMI) is a new fea-
ture 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 ap-
plies to hardware as well as to software.

 Siemens AG 2003 All Rights Reserved


1-24 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.3 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 in-
terest 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 ap-
plications 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 03.03
1.3 Which parts of the documentation are of interest for me

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

Integrators Modifiers Interface Power users


designers
Regie Regie Regie
Sequence Sequence Control
Control
NCDDE-Server NCDDE-Server NCDDE-Server
Alarm Server Alarm-Server Alarm-Server
Data Management Data Management Data Management
Server Server Server

 Siemens AG 2003 All Rights Reserved


1-26 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.4 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 applica-
tions in the system environment
software engineers with sufficient know--how of NC systems and experience in mo-
dern 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 tar-
get 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 03.03
1.5 Support

Demands on the software engineer


Developers of HMI applications work at the boundary of general WINDOWS pro-
gramming and NC--specific requirements. They must therefore be familiar with
both fields and additionally they should be experienced in the organization of soft-
ware 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 interfa-
ces

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

 Siemens AG 2003 All Rights Reserved


1-28 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.5 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 acqui-
red 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
upgrade An upgrade is a software with a higher release
number. It offers new features.
Example: upgrade from release 3.6 to release 4.2
hotline The hotline for the OEM--package is part of the software update
service.
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 Erlan-
gen:
Phone: 0180 / 525--8008
Fax: 0180 / 525--8009
E--Mail: MotionControl.Hotline@erlf.siemens.de

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-29
Introduction 03.03
1.6 Typographic conventions

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, ex-
tracts from programs and instructions for the user for pressing certain keys or en-
tering 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


Sub, If, ChDir reserved keywords of the programming
language:
bold, initial letter capitalized
BackColor, Click, Debug names of properties, events, special objects:
initial letter capitalized
setup user keyboard entry:
bold
event-driven within texts: first appearance of a term,
put emphasis on a text passage italic

 Siemens AG 2003 All Rights Reserved


1-30 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.6 Typographic conventions

Table 1-3 Typography of text components in this user’s manual

example meaning and description


eventname within programs:
place--holder for information to be supplied by
the user:
italic
[expressionlist] within programs:
optional entry inside square brackets
{ While|Until } within programs:
selection from two or more items:
inside curved brackets
Syntax error user defined variable and error messages
type Courier
Sub HelloButton_Click () program code:
Readout.Text = ”Hallo!” type Courier
End Sub
Readout.Text = ”This program code should be typed all in one line
Äshould be typed all in of the code window:identifier icon for line
Äone line” continuation:
Ä
CONSTANT.TXT file name:
capital letters
ENTER, CTRL+R names of keys and combination of keys:
small capital letters
ALT+F1 combination of keys
+ -- sign between key

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-31
Introduction 03.03
1.7 What happened in the last versions?

1.7 What happened in the last versions?

1.7.1 Release 3.4 August 1996

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

 Siemens AG 2003 All Rights Reserved


1-32 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Documentation
The documentation has been revised and newly structured to achieve a clearer
organization.
All chapters The sections of the .INI--files have been sorted alphabeti-
cally
Chapter 5 structure of the system has been added
Chapters 6 and 7 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).
Chapter 11 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.
Chapter 11.12 The PI Services have been newly structured and
sorted according to the type of service.
Chapter 11.14 The NCDDE alarms have been significantly updated.
Chapter 11.18 New chapter containing information on software and
hardware

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

software volume number of


disks
MMC 102 MMC 102 base system as it can be run on 10
base system the NC or an external PC
OEM--package sources, examples, Sequence Control, 3
online--help for variables
WIN 32S 32 bit extender for WINDOWS 3.11 2
remote diagnosis host and target software for remote diagnosis 2

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 03.03
1.7 What happened in the last versions?

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 gene-
rally be used for programming the MMC 102, configuring the MMC 100 or pro-
gramming the PLC with the NC--var--selector. Information on variables can be ac-
cessed 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 pro-
ject. 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. WIN-
DOW’s editor NOTEPAD and merely replace the entry ”REGIECTL.VBX” by
”RECTLP32.VBX”.

 Siemens AG 2003 All Rights Reserved


1-34 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 [TaskConfigura-
tion].
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 assi-
gned access rights.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-35
Introduction 03.03
1.7 What happened in the last versions?

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 required user group


S0 system password SIEMENS
S1 MTB password machine tool builder
S2 service password set--up / service staff
(machine tool builder)
S3 user password privileged user
(in--house service)
S4 key switch position 3 programmer
S5 key switch position 2 trained operator
S6 key switch position 1 operator
S7 key switch position 0 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 pass-
word.

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.

 Siemens AG 2003 All Rights Reserved


1-36 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Tool for configuring the Regie


The section [TaskConfiguration] of the REGIE.INI can be configured using this con-
figuration tool.
You can find it in the service menu on the control and in the path ..\aconfig\acon-
fig.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\LAN-
GUAGE\RE_XX.INI).
S editing the parameters of the file REGIE.INI (name, CmdLine, DosBox, Pre-
Load, 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 star-
ting 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 informa-
tion.

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 03.03
1.7 What happened in the last versions?

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 PROGNA-
ME.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 mar-
ked with gray background color.

Table 1-7 The eight levels of access permission

access level required user group


0 System password SIEMENS
1 MTB password machine tool builder
2 service password set up / service staff
(machine tool builder)
3 user password privileged user
(in--house service)
4 key switch position 3 programmer
5 key switch position 2 trained operator
6 key switch position 1 operator
7 key switch position 0 semi--skilled operator
(NC start/NC stop, operating
panel)

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

 Siemens AG 2003 All Rights Reserved


1-38 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 improved graphical user interface
S marking of the Z--Flag by store/unload instead of store/drop
S entry field for locking softkeys
S entry field for softkey switch over
S 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 state control
S help feature
S MDIChild function
S release/lock softkeys
S softkey text feature
S text display
S modal window functions
S 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 hot-
link--activities they offer higher data throughput than single PI-- and transfer--com-
mands. 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 besi-
des an ACC file generates a NSK file that contains the corresponding LINK com-
mands.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-39
Introduction 03.03
1.7 What happened in the last versions?

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/un-
loading 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 direc-
tory.
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#

 Siemens AG 2003 All Rights Reserved


1-40 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ”wait for gear stage change”
26 ”wait for position control ”
27 ”wait for threat cutting”
28 ”wait”
29 ”wait for punch ”
30 ”wait for safe operation”.
The following values have been reserved:
31 ”wait 31”
to
50 ”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 variable stopCond variable stopCondPar
12 ”wait: axis enable missing” axis number
15 ”wait: for spindle” spindle number
22 ”wait: spindle enable missing” spindle number
23 ”wait: axis feed override 0” axis number.

Variable safeFctEnable
The variable safeFctEnable for SISITEC axes provides the contents of the ma-
chine 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 03.03
1.7 What happened in the last versions?

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 accessing four sequentially stored bytes to be inter--
preset as floating point number
/Directory /Hierarchy1 accessing the module list of all types of modules
/Directory /Hierarchy2 accessing the module list of one module type
/Directory /Hierarchy3 accessing the module list of modules of a special
module
no additional parameter: 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.

 Siemens AG 2003 All Rights Reserved


1-42 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 State data for machine axes in the machine coordinate system
SEMA Extended state data for machine axes in the machine coordinate
system
SGA State data for geometry axes and additional axes in the
workpiece coordinate system
SEGA 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 Ser-
vice _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 delivery volume
S installation
S operating system
S information on updating from release P3.6 to P4.1
S 32--bit server for NC data
S OEM examples
S ”simulation” on PC
S control Tabelle.VBX
S documentation
S 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 03.03
1.7 What happened in the last versions?

S new PI Services
S source code
S menu tree generator
S new directory structure
S new configuration tool
S OEM softkeys: customer interfaces
S modifications of the Sequence Control
S 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 features discs


MMC 102 standard--SW MMC 102 standard--SW 14
OEM discs examples, Sequence 2
Control
remote diagnosis host-- and target software 2
for remote diagnosis

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.

 Siemens AG 2003 All Rights Reserved


1-44 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 pak-
kage 3.6 should run without error on a control after software release 4 was instal-
led.
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 ope-
rating 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” in-
stead.

Documentation
The documentation has been completely revised and has been added the func-
tions 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 03.03
1.7 What happened in the last versions?

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 exam-
ples for all BTSS components which can be copied by the OEM programmer.
The following text uses the expression BTSS--components for the different pro-
gramming 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 espe-
cially 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 on-
line--help.
Here is a list of the standard functions of the online--help (like the OEM user is fa-
miliar 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

 Siemens AG 2003 All Rights Reserved


1-46 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 Creates a cutting edge by specifying an edge number


_N_DELECE Deletes a cutting edge
_N_TMCRTO Creates a tool with a specified name, tool number and
duplo number in the tool management
_N_TMFPBP 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.
_N_TMGETT Determines the T--number for a given tool--ID and
Duplo--number

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 applica-
tions 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 03.03
1.7 What happened in the last versions?

Up to now the files of the MMC were located in the directory \MMC2. This direc-
tory also contained the OEM applications and the .ini files (regie.ini,...) were modi-
fied 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 for SIEMENS applications like Autoturn, SINDNC, etc.
S OEM for OEM applications
S USER 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 cor-
responding 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 pro-
gramming 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, Ti-
meOut, 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.

 Siemens AG 2003 All Rights Reserved


1-48 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ALGetpriva-
teProfileInt 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 identi-
cal 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 03.03
1.7 What happened in the last versions?

If the directory ..\USER does not exist, it will be created. If an .INI file name is spe-
cified without a path specification, only standard directories will be searched
through or data are written to ..\USER only.
The WinApi--functions GetPrivateProfileString, GetprivateProfileInt and Write-
PrivateProfileString 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 Se-
quence 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;

 Siemens AG 2003 All Rights Reserved


1-50 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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,si-
zeof(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 Inte-
ger) 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 argu-
ments.
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 pos-
sible. 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 03.03
1.7 What happened in the last versions?

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 pak-
kage 3.6 should run without error on a control after software release 4 was instal-
led.
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.

 Siemens AG 2003 All Rights Reserved


1-52 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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” af-
ter 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 03.03
1.7 What happened in the last versions?

Global variables of the Sequence Control


Some other global variables, which supply the paths of the newly installed directo-
ries 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 oc-
cur:
The existing file is deleted and the new file is not created/copied, since the para-
meter --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.

 Siemens AG 2003 All Rights Reserved


1-54 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 direc-
tory ”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 in-
dex>]
/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--PRO-
GRAM -- 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 03.03
1.7 What happened in the last versions?

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 spe-
cification, 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 va-
riable had not yet existed.

 Siemens AG 2003 All Rights Reserved


1-56 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 03.03
1.7 What happened in the last versions?

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 upda-
ted.

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 gua-
rantee 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.

 Siemens AG 2003 All Rights Reserved


1-58 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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, SY-
STEM.INI). The irritating prompts during system start--up, asking the operator whe-
ther 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 automati-
cally 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 envi-
ronment 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 be-
comes 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 03.03
1.7 What happened in the last versions?

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. Du-
ring 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 RE-
CALL--key is used for acknowledging the alarm and the corresponding area is im-
plicitly 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 applica-
tion is active in the DOS box, the MMC shut--down is also stopped and the corres-
ponding 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.

 Siemens AG 2003 All Rights Reserved


1-60 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Note
The softkey ”Exit” may be locked in the file REGIE.INI with the entry ”ExitBut-
ton=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 keybo-
ard driver applies. In the service--mode the entry has no effect, i.e. all key com-
binations are enabled.
The following codes have been implemented:
Bit 0: CTRL--ALT--DEL
Bit 1: ALT--F4
Bit 2: ALT--TAB
Bit 3: LEFTSHIFT--ALT--TAB
Bit 4: RIGHTSHIFT--ALT--TAB
Bit 5: CTRL--ESC
Bit 6: ALT--ESC
Bit 7: ALT--SPACE

Customizing the keyboard driver (chapter 3)


Since software version 5.1 it is possible to process the MMC--keys from area ap-
plications. 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 ’Star-
tup24’ 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 num-
bers (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 03.03
1.7 What happened in the last versions?

Processing MMC keys from area applications (chapter 6)


With two new attributes of the TaskConfiguration of the Regie it is possible to pro-
cess “MMC keys” from area applications.

Attribute Meaning
GIMMEKEYS Enabling mask for keys of the regie, which are to be
handled by the area application
ShowAppMenuKey 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 chan-
geover--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 changeo-
ver.
The required settings are entered in the file REGIE.INI in the section [TaskConfigu-
ration] 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 attribu-
tes.

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 proces-
sed by the application on its own.
bit0 : area changeover
1=OEMApp wants to process F10, 0=OEMApp wants F10 to be handled as stan-
dard (area change--over)
bit1 : channel changeover
1=OEMApp wants to process F11, 0=OEMApp wants F11 to be handled as stan-
dard
bit2 : Cancel--key (BigMac)
1=OEMApp wants to process ESC, 0=OEMApp wants ESC to be handled as stan-
dard

 Siemens AG 2003 All Rights Reserved


1-62 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ’ShowAppMe-
nuKey’, 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 03.03
1.7 What happened in the last versions?

Tips for the OEMFRAME (chapter 6)


To handle a windows--application as area application the following steps are neces-
sary:
1. Copy the program file to the directory OEM
2. Make an entry in the section TaskConfiguration in the file REGIE.INI in the di-
rectory 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 inte-
grated:
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 corres-
ponding section of the file ’OEMFrame.ini’, where xx represents the time in micro-
seconds.

 Siemens AG 2003 All Rights Reserved


1-64 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 win-
dow. 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 corres-
ponding 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 sto-
red 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 03.03
1.7 What happened in the last versions?

Softkey pictograms (chapter 7)


If in the language--DLL (starting with \\) a file name has been specified for a soft-
key, this file name is interpreted as the name of a bitmap (type BMP). It is comple-
ted 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 bit-
map 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--func-
tions and support the dynamic graphic resolution of the screen.

name F/P meaning


Softkeytext--functions
SK_Highlight P Highlighting a softkey
SK_HighlightUn Immediate highlighting a softkey
Attribute--functions for dynamic graphic resolution
subSetTFrmAttr P Set attribute for forms
subSetTCtrlAttr P 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).

 Siemens AG 2003 All Rights Reserved


1-66 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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, list-
box: there are dependencies which are not known by the SC, as e.g. the line spa-
cing 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 pro-
gram 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 set-
ting); i.e. usually the entry does not have to be modified.
The INI entry ScreenTwips (in the application--specific INI file) is ignored if Reso-
lution=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 horizontal resolution
VSize As Integer vertical resolution (exc. Task bar)
HFact As Single X--factor referring to BaseScreen--X

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-67
Introduction 03.03
1.7 What happened in the last versions?

VFact As Single Y-- factor referring to (BaseScreen--Y-- Task bar)


End Type
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 parame-
ter, 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 FontAttri-
butes 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 speci-
fied 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 FontAttri-
butes 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.

 Siemens AG 2003 All Rights Reserved


1-68 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 connec-
ted 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 connec-
ted 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 instal-
led 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 MA-
CHINE. In this case the program creates local variables which overdefine the ’si-
mulation variables‘.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 1-69
Introduction 03.03
1.7 What happened in the last versions?

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 read-
me.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 ac-
cessing 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--acces-
ses may not be mixed in one job. Furthermore access to channel--specific va-
riables 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 ex-
ceeds 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


1-70 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ac-
cess. 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 com-
mands 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 con-
trols, 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 03.03
1.7 What happened in the last versions?

DiskCare = 0 The protocol file is saved immediately after a change (like earlier
behavior).
DiskCare = n 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 func-
tions.

Function meaning PI name


group
tool Initiate check of unique D numbers _N_CHEKDM
functions Activate tool in sister tool group _N_SETTST
Set active wear group in a magazine _N_TMAWCO
Create tool with defined number of cutting edge _N_TMCRTC
Reset the active state _N_TMRASS

More information you will find in the online help file (PI_UK.HLP).

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 Ü CTRLOUT_MODULE_NR
MDCA_CTRLOUT_TYPE Ü CTRLOUT_ TYPE
MDCA_ENC_MODULE_NR Ü ENC_MODULE_NR
MDCA_ENC_TYPE Ü ENC_TYPE

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


MDB_WORKAREA_MINUS_ENABLE Ü WORKAREA_MINUS_ENABLE
MDB_WORKAREA_PLUS_ENABLE Ü WORKAREA_PLUS_ENABLE
MDD_SPIND_MAX_VELO_G26 Ü SPIND_MAX_VELO_G26
MDD_SPIND_MAX_VELO_LIMS Ü SPIND_MAX_VELO_LIMS
MDD_SPIND_MIN_VELO_G25 Ü SPIND_MIN_VELO_G25
MDD_WORKAREA_LIMIT_MINUS Ü WORKAREA_LIMIT_MINUS
MDD_WORKAREA_LIMIT_PLUS Ü WORKAREA_LIMIT_PLUS

Data area C / data module ETP (event types)


asciiMode (newly added)

 Siemens AG 2003 All Rights Reserved


1-72 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 Ü DRY_RUN_FEED
MDD_THREAD_START_ANGLE Ü THREAD_START_ANGLE

Data area C / data module SEGA (state data: channel axes in the WKS (exten-
sions of SGA))
AaVactW (newly added)
ActProgPosBKS (newly added)
Data area C / data module SEMA (state data: channel axes in the MKS (exten-
sions 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 03.03
1.7 What happened in the last versions?

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 ad-
ded)
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 Ü DRIVE_IS_ACTIVE
MDCA_DRIVE_LOGIC_NR Ü DRIVE_LOGIC_NR
MDCA_DRIVE_MODULE_TYPE Ü DRIVE_MODULE_TYPE
MDCA_DRIVE_TYPE Ü DRIVE_TYPE

 Siemens AG 2003 All Rights Reserved


1-74 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

MDD_INT_INCR_PER_DEG Ü INT_INCR_PER_DEG
MDD_INT_INCR_PER_MM Ü INT_INCR_PER_MM
MDD_SYSCLOCK_CYCLE_TIME Ü SYSCLOCK_CYCLE_TIME
MDL_POSTCTRL_SYSCLOCK_TIME_RATIO Ü POSTCTRL_SYSLOCK_TIME_RATIO
MDLA_DRIVE_INVERTER_CODE Ü DRIVE_INVERTER_CODE
MDSA_AXCONF_MACHAX_NAME_TAB Ü AXCONF_MACHAX_NAME_TAB

Data area N / data module SEMA (state data: channel axes in the MKS (exten-
sions 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 03.03
1.7 What happened in the last versions?

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)

 Siemens AG 2003 All Rights Reserved


1-76 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ad-
ded)
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 03.03
1.7 What happened in the last versions?

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)

 Siemens AG 2003 All Rights Reserved


1-78 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 03.03
1.7 What happened in the last versions?

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 gene-
rates 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 neces-
sary to eliminate these key codes as soon as possible. The keyboard driver contai-
ned 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 ScanCode VirtKeyCode
VSK0: 0x5E 0xE0
VSK1: 0x5F 0xE1
VSK2: 0x62 0xE2
VSK3: 0x63 0xE3
VSK4: 0x64 0xE4
VSK5: 0x65 0xE5
VSK6: 0x66 0xE6
VSK7: 0x67 0xE7
SingleQuote: 0x67 0xBF (wie PC)
ETC: 0x67 0xE8
Machine: 0x6A 0xE9
( 0x6B 0xEA
) 0x6C 0xEB

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

 Siemens AG 2003 All Rights Reserved


1-80 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Codes from SW version 5.1UPD


Key ScanCode VirtKeyCode
VSK0: like Shift F1 like Shift F1
VSK1: like Shift F2 like Shift F2
VSK2: like Shift F3 like Shift F3
VSK3: like Shift F4 like Shift F4
VSK4: like Shift F5 like Shift F5
VSK5: like Shift F6 like Shift F6
VSK6: like Shift F7 like Shift F7
VSK7: like Shift F8 like Shift F8
SingleQuote: like SingleQuote like SingleQuote
ETC: like Shift F9 like Shift F9
Machine: like Shift F10 like Shift F10
( like ( like (
) 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 SY-
STEM.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 keybo-
ard 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 03.03
1.7 What happened in the last versions?

Supported languages (chapter 11)


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

Assignment of ANSI tables and fonts


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

 Siemens AG 2003 All Rights Reserved


1-82 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Ansi--Table 1251 (Cyrillic)


Font File Characters
Arial Aricyr.ttf Arial Cyr (True Type )
Arial bold Aricyb.ttf Arial Cyr Bold (True Type )
Arial italic Aricyri.ttf Arial Cyr Italic (True Type )
Arial bold italic Aricyrbi.ttf Arial Cyr Bold Italic (True Type )

Ansi--Table 1252 (West Europe)


Font File Characters
Arial Windows--Standard Arial (True Type )
Arial bold Windows--Standard Arial Bold (True Type )
Arial italic Windows--Standard Arial Italic (True Type )
Arial bold italic Windows--Standard 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 upda-
ted.

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 03.03
1.7 What happened in the last versions?

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 sy-
stemWindows 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 ver-
sion 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 installa-
tion/environment around the path ’hmi_adv’. In hmi_adv, the HMI Advanced stan-
dard 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 sec-
tion ”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.

 Siemens AG 2003 All Rights Reserved


1-84 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

The HMI environment can be installed on any PC/programming device (PG) or lap-
top. 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 ex-
change 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 provi-
ded by the IRegieEvt and IRegieSvr interfaces of the Regie ser-
ver.

VB Application OEM Application


(32Bit) (32Bit)

IRegieEvt/
IRegieEvt IRegieSvr IRegieSvr
OEMFrame

REG_CMD.EXE

RegieControl RegieDLL OEMFrame

VB Application OEM Application


(16Bit) (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 03.03
1.7 What happened in the last versions?

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 func-
tions 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: NEW
GetCommandString: NEW
InitSvr: NEW; MUST BE CALLED AS THE FIRST
FUNCTION !!
InitCompleteEx: NEW; SIMPLIFIES InitComplete
PLEASE NOTE: InitComplete should no longer
be used!
Functions no longer supported in IRegieSvr:
ScreenOn: does not apply; use MMCScreenOn
ScreenOff: does not apply; use MMCScreenOff
StopRegieEvents: does not apply; use TestAndStopRegieEvents
ReadCmdLineVB: does not apply: use ReadCmdLine
ReadCmdLineMeVB: does not apply: use ReadCmdLineMe
WriteCmdLineVB: does not apply: use WriteCmdLine
WriteCmdLineExVB: 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: to acknowledge an event
DoCommandParam: to read out a command string
These two functionalities are implemented in IRegieEvt using two functions:

 Siemens AG 2003 All Rights Reserved


1-86 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

AsyncCompleted(): Synonym for AsyncCompleted-


Property of RECTLP32.VBX
GetCommandString(): Synonym for DoCommandParam-
Property 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 im-
plemented 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 availa-
ble.
Where previously the Control DCTL.VBX has been used, now please use the Con-
trol 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 inter-
face 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 03.03
1.7 What happened in the last versions?

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)

 Siemens AG 2003 All Rights Reserved


1-88 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

CTRLOUT_MODULE_NR Ô MDCA_CTRLOUT_MODULE_NR
CTRLOUT_TYPE Ô MDCA_CTRLOUT_TYPE
ENC_MODULE_NR Ô MDCA_ENC_MODULE_NR
ENC_TYPE Ô MDCA-ENC_TYPE

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


SPIND_MAX_VELO_G26 Ô MDD_SPIND_MAX_VELO_G26
SPIND_MAX_VELO_LIMS Ô MDD_SPIND_MAX_VELO_LIMS
SPIND_MAX_VELO_G25 Ô MDD_SPIND_MIN_VELO_G25
WORKAREA_LIMIT_MINUS Ô MDB_WORKAREA_LIMIT_MINUS
WORKAREA_LIMIT_PLU Ô MDB_WORKAREA_LIMIT_PLUS
ORKAREA_MINUS_ENABLE Ô MDB_WORKAREA_MINUS_ENABLE
WORKAREA_PLUS_ENABLE Ô MDB_WORKAREA_PLUS_ENABLE

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 03.03
1.7 What happened in the last versions?

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

 Siemens AG 2003 All Rights Reserved


1-90 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 Ô MDSA_AXCONF_MACHAX_NAME_TAB
DRIVE_INVERTER_CODE Ô MDLA_DRIVE_INVERTER_CODE
DRIVE_IS_ACTIVE Ô MDBA_DRIVE_IS_ACTIVE
DRIVE_LOGIC_NR Ô MDCA_DRIVE_LOGIC_NR
DRIVE_MODULE_TYPE Ô MDCA_DRIVE_MODULE_TYPE
DRIVE_TYPE Ô MDCA_DRIVE_TYPE
INT_INCR_PER_DEG Ô MDD_INT_INCR_PER_DEC
INT_INCR_PER_MM Ô MDD_INT_INCR_PER_MM
POSCTRL_SYSCLOCK_TIME_RATIO Ô MDL_POSTCTRL_SYSLOCK_TIME_RATIO
SYSCLOCK_CYCLE_TIME Ô 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 03.03
1.7 What happened in the last versions?

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

 Siemens AG 2003 All Rights Reserved


1-92 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 03.03
1.7 What happened in the last versions?

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 co-
arse, 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:

 Siemens AG 2003 All Rights Reserved


1-94 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 ver-
sion 5 or higher before installing HMI--ProgrammingPackage. In other case Win-
dows 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 03.03
1.7 What happened in the last versions?

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 Inte-
ger
and
Function ALGetDLLEntriesIRaw(ByVal hdl As Long, ByVal t_start As Integer, By-
Val 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

 Siemens AG 2003 All Rights Reserved


1-96 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 03.03
1.7 What happened in the last versions?

-- 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 IOP-
CEventSubscriptionMgt must always be called over the parameter riid. IUnk-
nown 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.

 Siemens AG 2003 All Rights Reserved


1-98 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 What happened in the last versions?

Accessing alarms and events


This version does not contain the interfaces IMCEventList, IMCEventSubscrip-
tion 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 03.03
1.7 What happened in the last versions?

acMeasDNumber new
acMeasFrameSelect new
acMeasLatch new
acMeasPoint1 deleted
acMeasPoint2 deleted
acMeasPoint3 deleted
acMeasPoint4 deleted
acMeasSema new
acMeasSetpoint deleted
acMeasTNumber new
acMeasToolLength new
acMeasType changed
acMeasValid new
acMeasWpAngle new
acMeasWpSetangle new
actParts new
acTrafoParSet new
aTcAckC new
aTcCmdC new
cmdDwellTime new
cmdTrafoParSetS new
cmdTrafoS new
pTcSol new
pToolO new
remainDwellTime new
reqParts new
seruproMasterChanNo new
seruproMasterNcuNo new
specParts new
timeOrRevolDwell new
totalParts new
stopCond changed
vaEgSyncDiff 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

 Siemens AG 2003 All Rights Reserved


1-100 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Introduction
1.7 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 03.03
1.7 What happened in the last versions?

totalProtokolFiles new
totalMemDram2PassF new
totalMemDramPassF new
totalMemSramPassF new
traceProtocolActive new
usedMemDram2PassF new
usedMemDramPassF new
usedMemSramPassF new
Data area N / data block SD (Servo--DatenAcConstCutS) new
servoDataFl32 new
servoDataFl64 new
Data area N / data block SEMA (Zustandsdaten: Kanalachsen im MKS (Erweite-
rung 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

 Siemens AG 2003 All Rights Reserved


1-102 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 sy-
stem 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 ma-
naged 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 envi-
ronment 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 be-
comes 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 03.03
2.1 Features of the component PCUxx

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 se-
cond 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 RE-
CALL--key is used for acknowledging the alarm and the corresponding area is im-
plicitly 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 applica-
tion is active in the DOS box, the HMI shut--down is also stopped and the corres-
ponding 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.

 Siemens AG 2003 All Rights Reserved


2-104 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.1 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 keybo-
ard driver applies. In the service--mode the entry has no effect, i.e. all key com-
binations are enabled.
The following codes have been implemented:
Bit 0: CTRL--ALT--DEL
Bit 1: ALT--F4
Bit 2: ALT--TAB
Bit 3: LEFTSHIFT--ALT--TAB
Bit 4: RIGHTSHIFT--ALT--TAB
Bit 5: CTRL--ESC
Bit 6: ALT--ESC
Bit 7: ALT--SPACE

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 2-105
General information 03.03
2.2 Optimizing the development environment

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 envi-
ronment 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 neces-
sary-- 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 opera-
tion 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 RE-
GIE.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) LoadLi-
brary might not find the file REGIE.DLL.

 Siemens AG 2003 All Rights Reserved


2-106 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.3 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 ori-
ginal 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 --> Com-
mand 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 03.03
2.3 Problems during operation and how to solve them

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 ------> re-
boot 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 establis-
hed.

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 oc-
cur:
The existing file is deleted and the new file is not created/copied, since the para-
meter --f causes the destination file to be overwritten in any case, even when the
COPY or CREATE action has been aborted with an error.

 Siemens AG 2003 All Rights Reserved


2-108 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.4 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 suc-
cessful ( ”#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, Ser-
vice 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 03.03
2.4 Transfer of VB applications from 16Bit to 32Bit

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”).

 Siemens AG 2003 All Rights Reserved


2-110 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.4 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 accordin-
gly, 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 03.03
2.4 Transfer of VB applications from 16Bit to 32Bit

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.

 Siemens AG 2003 All Rights Reserved


2-112 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.4 Transfer of VB applications from 16Bit to 32Bit

VB application OEM application


(32Bit) (32Bit)

IRegieEvt/
IRegieEvt IRegieSvr IRegieSvr
OEMFrame

REG_CMD.EXE

RegieControl RegieDLL OEMFrame

VB application OEM application


(16Bit)
) (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 03.03
2.4 Transfer of VB applications from 16Bit to 32Bit

IRegieSvr interface
Functions which were not contained in Regie.dll:
AsyncCompleted: NEW
GetCommandString: NEW
InitSvr: NEW, MUST BE CARRIED OUT AS THE FIRST
FUNCTION!
InitCompleteEx: NEW, SIMPLIFIED InitComplete
NB: InitComplete should no longer be used
Functions which are no longer supported by IRegieSvr:
ScreenOn: discontinued, use MMCScreenOn
ScreenOff: discontinued, use MMCScreenOff
StopRegieEvents: discontinued, use TestAndStopRegieEvents
ReadCmdLineVB: discontinued, use ReadCmdLine
ReadCmdLineMeVB: discontinued, use ReadCmdLineMe
WriteCmdLineVB: discontinued, use WriteCmdLine
WriteCmdLineExVB: 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”.

 Siemens AG 2003 All Rights Reserved


2-114 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.4 Transfer of VB applications from 16Bit to 32Bit

IRegieServerEvents interface
RECTLP32 knew the following properties:
AsyncCompleted: to acknowledge an event
DoCommandParam: to export a command string
These two properties are realized in IregieEvt with the help of two functions:
AsyncCompleted(): synonymous to the AsyncCompleted property of the
RECTLP32
GetCommandString 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 (IRegieSer-
verEvents 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 03.03
2.5 Notes for the OEM user on ”Hard disk Backup/Restore with Ghost”

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 parti-
tioning.
While GHOST will import the image automatically if you have selected the stan-
dard partitioning, it will perform this interactively if you have selected the freely de-
terminable partitioning. This means that the operator is requested to enter e.g. par-
tition 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

 Siemens AG 2003 All Rights Reserved


2-116 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 General information
2.5 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 speci-
fied 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 03.03
2.5 Notes for the OEM user on ”Hard disk Backup/Restore with Ghost”

Platz für Notizen

 Siemens AG 2003 All Rights Reserved


2-118 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 custo-
mer 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 03.03
3.1 HMI as a part of SINUMERIK

3.1 HMI as a part of SINUMERIK

Functional components
The functions of the CNC control SINUMERIK 840D are split up in five compo-
nents:
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 PLC NCK


NC program execution
operating machine logic preparation
monitoring enable signals interpolation
programming machine operating servo control
setting--up PLC Data Management NC Data Management
diagnosis drive interface

Internal Communication

data acquisition
Drives 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

 Siemens AG 2003 All Rights Reserved


3-120 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.1 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, conti-
nue 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 03.03
3.1 HMI as a part of SINUMERIK

3.1.2 Options

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

 Siemens AG 2003 All Rights Reserved


3-122 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 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
HMI Customer applica-
for data manage-
applications with tions with se-
ment, alarms
sequence control quence control
and messages
Regie Com Server Regie Com Server

NCDDE server
for access to
Regie Com Server
data of NCK
Customer applica-
and PLC Regie
tions without se-
quence control
Keyboard filter

MPI drvier WINDOWS NT


Basic software
(cannot only be
used for SINUMERIK)

PCU50 Hardware level


MPI bus
NCK hardware PLC hardware 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 03.03
3.2 Software architecture of the HMI

S operating system and drivers


S applications
Besides the standard applications you can run further customer--specific applica-
tions on the control.
Off the shelf programs (e.g. CAD--systems) as well as own applications which inc-
lude the SINUMERIK Sequence Control are allowed. A VisualBasic interface is
provided. This gives you the advantage, that your program can access global va-
riables 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 develo-
per -- independent on the hardware layer.
Usually applications without Sequence Control are programs which were not pri-
marily 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

 Siemens AG 2003 All Rights Reserved


3-124 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 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 MF2 keyboard


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

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 3-125
Basics of the HMI component 03.03
3.2 Software architecture of the HMI

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 appli-
cation.
[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 Re-
gie, 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 soft-
keys (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 ap-
plications. 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

 Siemens AG 2003 All Rights Reserved


3-126 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 Software architecture of the HMI

States
Central element for describing the Sequence Control is the state . It is characteri-
zed 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 03.03
3.2 Software architecture of the HMI

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 re-
acts 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 stan-
dard 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 access NC--, PLC-- and drive data
S Domain Service copy files from MMC to NCK and vice versa.
S PI Service : 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.

 Siemens AG 2003 All Rights Reserved


3-128 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 Software architecture of the HMI

Table 3-2 Overview of data provided by the NCDDE Server

data group data type


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

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 defining data
S ANIMATE changing values for a screen demonstration

Data representation on the screen


Visual Basic standard controls are used for displaying data on the screen. For spe-
cial 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 inclu-
des 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 03.03
3.2 Software architecture of the HMI

Domain Service
Using the Domain Service of the NC--DDE Server, data contained in different do-
mains 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 description
COPY_TO_NC copy from MMC to NCK with additional
information
COPY_TO_NC_BINARY copy from MMC to NCK without additional
information
COPY_FROM_NC copy from NCK to MMC with additional
information
COPY_FROM_NC_BINARY copy from NCK to MMC without additional
information

 Siemens AG 2003 All Rights Reserved


3-130 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 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) start PI Service
S PI_STOP (argument) stop PI Service
S PI_RESUME (argument) 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 Example Meaning


NC function _N_DIGION Digitizing ON
NC program function _N_FINDBL Activate search
File function _N_F_DELE delete file
Protection level _N_F_PROT Assign protection level to a file
function
Tool function _N_CREATO Create tool
PLC function _INSE 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 03.03
3.2 Software architecture of the HMI

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/mes-
sages 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 name of log file
S Filter selection characteristic of the alarms to be logged

 Siemens AG 2003 All Rights Reserved


3-132 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 Software architecture of the HMI

S Records number of entries in the log file


S RecLen length of one entry (in bytes)
S FlushTime 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 requi-
rements 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 03.03
3.2 Software architecture of the HMI

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 Ser-
ver.

 Siemens AG 2003 All Rights Reserved


3-134 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Basics of the HMI component
3.2 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 con-
tains an entry with the following information for each directory and each file inclu-
ded in this directory:
S access permission read, write, show, execute, delete
S name name of the Data Management, up to 25 characters
S DOS name DOS file name, created by the Data Management
S extension file extension, 3 characters
S data type identifier 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 example
file name testmac
data type SMAC
extension SPF
full name standard macro
file system name --1testmac
storage location active (NCK) , passive (MMC)
size 12345
date 26.07.1999
access permission 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 03.03
3.2 Software architecture of the HMI

Table 3-5 Sections of the file DH.INI

section meaning
DHSTART root directory of the MMC Data Management on the hard disk
SCEME 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.

 Siemens AG 2003 All Rights Reserved


3-136 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 com-
ponents:
S MMC operator panel
S MSTT machine control panel
S NCK numeric control
S PLC programmable logic control
S PG 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 connec-
tor 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 03.03
3.3 Communication

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 order no. 6XV1 830 -- 0AH10
(specify length)
bus connector order no. 6ES5 762 -- 2AA12
(2 per cable)

 Siemens AG 2003 All Rights Reserved


3-138 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 ac-
tive.

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 cor-
rectly 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 in-
terface.

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 ta-
ble 3--6 are provided:

Table 3-6 Interfaces of the PCU50

interface identifier comment


parallel X8 with external net card or an external mass
memory (Streamer, JAZ drive, ZIP drive)
serial X6 and X7 with terminal simulation, PC IN 4 or
Interlnk--Intersrv
network with PCI/ISA box
floppy disk with optional disk drive

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 3-139
Basics of the HMI component 03.03
3.3 Communication

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 pro-
grams-->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 soft-
ware 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 net-
work refer to the according manuals respectively to the installation instructions.

 Siemens AG 2003 All Rights Reserved


3-140 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 connec-
tion with the dynamic link library of the Regie (REGIE.DLL).
If an OEM application is started by the Regie, it can use the initializations contai-
ned in the system’s initialization file (MMC.INI). It includes the elements of the Se-
quence 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 Meaning, contents Example


initialization file default values OTTO.INI
program file executable program OTTO.EXE
text file language dependent texts, e.g. OTTO_GR.DLL
softkey texts, display texts
diagram file managing the Regie diagrams OTTO.MDI
state management managing the Regie menus 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 03.03
3.4 OEM applications

Table 3-8 Entries of an OEM--application in the standard system

File Entry in the section Example


REGIE.INI TaskConfiguration Task7=name:=otto
OEM application is announced to
the system
REGIE.INI Version Version = 5.12 / Date = 26.07.99
version management by the
OEM--developer
language.INI HSoftkeyTexts HSK7=”OTTO”
of the Regie OEM application accessible via
softkey 7

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

 Siemens AG 2003 All Rights Reserved


3-142 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 verti--


--
cal
soft--
--
application keys
area

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 03.03
4.1 User interface of the standard NC

Table 4-1 Structure of the display screen

name of field contents example


info field operating section Machine
(header) channel state channel reset
program state program is active
name of channel and channel 1
mode group
alarm text channel 1 block N5
error at
circle end position
operation mode JOG
program name PROGRAM1
channel operation Stop:
messages EMERGENCY--STOP
display of channel state active
SKP skip block
application area five working windows and positions, auxiliary
NC--displays functions, feed
interactive field dialog line with notes for entered value exceeds
the operator, upper limit
information ^ recall is possible
corresponding to the
menu bar
horizontal softkey bar labels of 8 horizontal PARAMETER
softkeys
vertical softkey bar labels of 8 vertical REPOS
softkeys

 Siemens AG 2003 All Rights Reserved


4-144 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.1 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

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


program state channel operating messages
channel state state display

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 03.03
4.1 User interface of the standard NC

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 upper limit
BeArtleft left limit
BeArtwidth width
BeArtheight. 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 follo-
wing design:
A window consists of a title bar and a display section. The sizing controls (maxi-
mize, minimize, close button), usually available in WINDOWS applications, are not
supplied.

Title bar
Parameters recommended for the title bar are:

 Siemens AG 2003 All Rights Reserved


4-146 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.1 User interface of the standard NC

Table 4-2 Parameters for the title bar

element parameter VB identifier


background color gray &H00808080
window without focus
background color yellow &H0000FFFF
window with focus
text color white &H00000000
text font MS Sans Serif

Display section
The parameters recommended for the display section are:

Table 4-3 Parameters for the display section

element parameter VB identification


background color light gray &H00C0C0C0
fixed texts background gray VB Label
text black
text boxes background white VB Textbox
(for entry window) text black
text output left aligned VB Label
text black
toggle fields options to be selected VB SSOption
left aligned
text black
ON/OFF or YES/NO check box VB SSCheck
fields
line line style no 3--D !
focus window border yellow &H0000FFFF
(active window)

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 4-147
Design of the graphical user interface 03.03
4.1 User interface of the standard NC

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.

i Additional information concerning this menu is available via the


INFO key 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.

 Siemens AG 2003 All Rights Reserved


4-148 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.2 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 consi-
der the following restrictions:
S A control usually does not include a mouse and a MF2--keyboard. Can the ap-
plications still be operated? Here the function keys [F9] to [F12] with and wi-
thout [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 ne-
cessarily 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 03.03
4.3 How to create an application with the OEM--package

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 adap-
ted to the standard applications of HMI Advanced and which may therefore be in-
tuitively 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 initia-
lizations 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 re-
commend 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.

 Siemens AG 2003 All Rights Reserved


4-150 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.3 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 pak-
kage, e.g. subst l: d:\oempaket.
Set the variable NcddeMachineName in the file mmc.ini local , if this has not al-
ready 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 03.03
4.4 Adapting the standard application to your needs

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 supplemen-
ting user pictures without modifying the application itself.
For this you must add three new sections to the application--specific .INI file : [MA-
TRIX], [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 grea-
ter than 23.

Section MATRIX
Specify here, which given states of an application are to be modified. You can mo-
dify up to 16 states using the lines UPS0 to UPS15.
Syntax:
[MATRIX]
UPSx=state: Sektion{Softkeys}
where:

State Number of the state you want to modify


You can find it in the .ZUS file of the application
Sektion To describe the new state you have to add a new section to the
.INI file.
It contains the name of the new section.
Softkeys The softkey, which function you want to modify

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].

 Siemens AG 2003 All Rights Reserved


4-152 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.4 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 A symbolic name that is used in this .INI file only.


Number 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 Softkey identifier


text text in quotation The text is written directly to the softkey
marks
#<nr>h Text of the horizontal softkey texts with the
number nr
#<nr>v Text of the vertical softkey texts with the
number nr
#<nr>a 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 03.03
4.4 Adapting the standard application to your needs

function {Child} symbolic name of the application


(defined in the section CHILDS)
{Child}:’cmdline’ 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 applica-
tion 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 recor-
ded 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.

 Siemens AG 2003 All Rights Reserved


4-154 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.4 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 03.03
4.5 Adapting the standard interface (regie.ini, mmc.ini)

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 ”RE-
GIE.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 fol-
lowing 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:

 Siemens AG 2003 All Rights Reserved


4-156 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Design of the graphical user interface
4.5 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 embed-
ded. 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 03.03
4.6 The application aeditor

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
<access> ::= RW | RO
RW = read/write
RO = read only

 Siemens AG 2003 All Rights Reserved


4-158 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 03.03
4.6 The application aeditor

Notes

 Siemens AG 2003 All Rights Reserved


4-160 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 ap-
plications of the standard MMC. The Sequence Control provides some of the en-
tries as global variables.
You should have a look at this chapter if you want to evaluate entries in your ap-
plications 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 entry meaning


DHSTART mmchome ROOT directory of the MMC Data
Management
SCEME sceme 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 03.03
5.2 MBDDE.INI

5.2 MBDDE.INI
Use this file for parametrizing the alarm handling.

section meaning
Alarms general information concerning the alarm list.
example: time and date format of the registry entries
TextFiles 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).
Helpcontext names and paths of the help files
example: File0=hlp\alarm_
DEFAULTPRIO default definition of the priorities of the different alarm types
example: POWERON=100
PROTOCOL characteristics of the log file
example: file=.\proto.txt
name and path of the log file
KEYS information about the keys that may be used to clear an alarm
example: Cancel=+F10
clear alarm with the key combination Shift+F10

The entries are described in chapter 9.

5.3 MMC.INI
This file contains all user--specific settings. You can set colors and language--de-
pendent 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 meaning
BTSS settings machine data of the operating panel
example: precision of displayed data
example: change access level of R parameters
colors color set up of the VGA drivers
Control Screen resolution
DateTime time formats for different languages
Services additional information
example: name of floppy disk drive FloppyDisk=a:
DIRECTORIES definition of catalogues
example: temporary directory for Sequence Control:
AlDir=D:ALTMP

 Siemens AG 2003 All Rights Reserved


5-162 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 System structure
5.3 MMC.INI

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

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 5-163
System structure 03.03
5.4 NETNAMES.INI

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 entry value meaning notes


own owner MMC_1 own name
conn MMC_1 the section exists
once for each MMC
conn_1 NCU_1 defines which NCU one entry per NCU
the MMC may
access
param bus btss
network
param the section exists
MMC_1 once for each MMC
mmc_address own bus address must correspond to
S7DPMPI.INI
param the section exists
NCU_1 once per NCU
nck_address NCU bus address
called NCU_1
plc_address bus address of the
PLC on NCU_1
name name for NCU_1

 Siemens AG 2003 All Rights Reserved


5-164 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 System structure
5.5 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 sepa-
rate 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 user-- identifies the properties which are to be
dependent assigned to the window
[Taskname] WindowStyle_Off user-- identifies the properties which the window is
dependent not to possess
[Taskname] Width user-- Width of the window (attribute X in pixels)
dependent Remark:
If x=0 and y=0, the application header will be
hidden.
[Taskname] Height user-- Height of the window (attribute X in pixels)
dependent Remark:
If x=0 and y=0, the application header will be
hidden.
[Taskname] nDelayInitComplete user-- delays the ramp--up time after which the
dependent application can be selected via Regie
[Taskname] nSecondsTo user-- Setting of the teim after which the OEMFrame
FindWindows dependent aborts the search for the window of the
application.
[Taskname] fSearchOnlyFor user-- specifies whether the window specified in
TaskWindow dependent Regie.ini also belongs to the task specified
there
[Taskname] nSwitchToTask user-- delays the behavior when quitting the
AfterTermination dependent OEMFrame application
[Taskname] fRestoreTask user-- determines the behavior of the OEMFrame
Window dependent when quitting an application which has been
started from the OEMFrame application (2nd
task level)
Remark:
If possible this situation should be avoided.
[Taskname] fKeepPlacement user-- deactivates the size adaptation carried out by
dependent OEMFrame for the main window of the OEM
application

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 5-165
System structure 03.03
5.5 OEMFRAME.INI

Section Entry Value Meaning


[Taskname] fForceTaskFocus user-- When switching to the application, the main
dependent window is activated instead of the last active
window.
[Taskname] fSearchForPopUps 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).

 Siemens AG 2003 All Rights Reserved


5-166 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--applica-
tions here. The configuration tool supports this.

section entry meaning


Miscellaneous RemoveIcons development support: During start--up
the task icons are displayed
ShowMessageBox development support: Warnings
occurring during start--up are displayed
as message boxes
HelpTaskIndex number of the task, the info--button
branches to
ShowResources development support: shows the
system load
PoweronTaskIndex number of the task displayed after
start--up
MMCSignOfLife for testing only: MMC modifies DB19,
DBW16 each second
SystemDllConfiguration DllNamex list of WINDOWS--modules being
started
MMCDllConfiguration DllNamex list of SINUMERIK--modules being
started
StartupConfiguration Startupx list of servers running in the
background
TaskConfiguration Taskx list of foreground tasks

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 5-167
System structure 03.03
5.7 S7DPMPI.INI

5.7 S7DPMPI.INI
Entries in S7DPMPI.INI should be modified by the user interface in the area ’instal-
lation’ 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 entry meaning note


S7ONLINE
DRIVER driver used
PROFILE interface description used
HW_DEVICE interface used

S7MPISPC2 interface description


BAUDRATE baudrate 3 = 187,5 kBit
7 = 1,5 MBit
HWINT_VECTOR hardware interrupt must match the preset
hardware interrupt of the
MPI interface
TS_ADR bus address must match the mmc.ini
respectively the
netnames.ini
other parameters of the S7 protocol

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

 Siemens AG 2003 All Rights Reserved


5-168 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 03.03
6.1 Concept of the Regie

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 area applications


Regie display Machine

Header Dialog programming

Regie
setting in to operation
NCDDE server

Alarm server OEM-Application 1

Data management server OEM-Application 2

additional base functions WINDOWS Standard


application

dynamic link libraries dynamic link libraries


(DLL and VBX) (DLL and VBX)
of the system of the MMC

DDEML.DLL AL_UTIL.DLL

MMSYSTEM.DLL MMC.DLL

VBRUN300.DLL

Fig. 6-1 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

 Siemens AG 2003 All Rights Reserved


6-170 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.1 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 03.03
6.1 Concept of the Regie

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 de-
tail 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 lin-
ked during run--time.

 Siemens AG 2003 All Rights Reserved


6-172 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.2 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 em-
bedding WINDOWS applications, if needed. It is described in more detail in chap-
ter 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 de-
pends on the type of OEM application and is described in the sections 6.3 “Appli-
cation 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 opera-
tion. 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 con-
figuration 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 applica-
tions 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 03.03
6.3 Application with sequence control

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 appli-
cation OEMFRAME that can be provided for embedding standard WINDOWS pro-
grams 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 edi-
tors (e.g. EDIT).
It consists of the sections listed in table 6--1.

Table 6-1 Sections of the file REGIE.INI

section function

Version Date and software release number of the Regie.


Facilitating a separate release management by the
OEM software engineer

 Siemens AG 2003 All Rights Reserved


6-174 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 Application with sequence control

Table 6-1 Sections of the file REGIE.INI

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

Starting sequence
First the Regie starts the auxiliary programs (DLL, VBX) of the sections SystemDll-
Configuration 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 03.03
6.3 Application with sequence control

Examplel 6-1 Section Version


[Version]
Version = 5.21 ; specifies the version, set by the OEM developer
Date = 26.07.99 ; 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 Exten-
sions (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”).

 Siemens AG 2003 All Rights Reserved


6-176 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 Exten-
sions (VBX). They must be located in a MMC2 system directory. Path specifica-
tions 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 applica-
tion 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 Entry--
identifier (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 03.03
6.3 Application with sequence control

Entries for OEM in the section StartupConfiguration


The OEM--applications have to be entered in the area from ’Startup12’ to ’Star-
tup24’ 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 Star-
tupConfiguration.

Table 6-2 Attributes of the entries in the section StartupConfiguration

attribute meaning
Name Name of the application as listed in the file manager, without
extension ”.EXE”
Timeout Maximum period of time for initialization in milliseconds. Default
value is 10000 (10 sec.)
CmdLine Parameter for the client application: ASCII string
ShowTask Parameter for visibility of the icons: TRUE or FALSE
<empty> 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
[StartupConfiguration]
Startup5 = Name := MBDDE ; correct
Startup6 = Name := MBDDE.EXE ; W R O N G

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 sy-
stem start up cannot be guaranteed to run correctly.

 Siemens AG 2003 All Rights Reserved


6-178 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 Application with sequence control

Note
This time--out value should not be set too small! If the MMC is very busy, the wai-
ting time might become inadequately long.

This attribute is optional. If it is omitted, the Regie uses a default value of 10 se-
conds. 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 auxi-
liary 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 para-
meters.

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 (exam-
ple 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 re-
mains on the screen

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 6-179
Regie 03.03
6.3 Application with sequence control

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 confi-
gured in the file regie.ini in the OEM or AddOn directory for the relevant task. Typi-
cally, 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 stan-
dard 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 applica-
tions 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.

 Siemens AG 2003 All Rights Reserved


6-180 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 num-
bers (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 lan-
guage.INI (e.g. RE_GR.INI for German) in the subdirectory LANGUAGE. An appli-
cation can be started by a softkey only if there is a softkey text entered in the lan-
guage.INI.

Attributes
Table 6--3 lists the entries of the task configuration.

Table 6-3 Attributes of the task configuration

attribute meaning
name name of the application as used in the file manager but
without the extension ”.EXE”
Timeout maximum time to be used for start--up in milliseconds
default is 10000 (10 sec.)
CmdLine parameters for the client application: name of an application in
the OEM frame
HeaderOnTop display of HEADER active or not active
PreLoad load an application during start--up
TerminateTask remove other applications from the memory when starting an
application
AccessLevel level of access permission
ClassName class name of an application
WindowName window name of an application
ShowTask show icons or hide them, default value TRUE
GIMMEKEYS Enabling mask for keys of the Regie, which are to be handled
by the area application
ShowAppMenu-- Enabling mask for the area changeover key, which is to be
key used by the area application

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 6-181
Regie 03.03
6.3 Application with sequence control

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 appli-
cation: 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 Re-
adCmdLine. 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 attri-
butes 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.

 Siemens AG 2003 All Rights Reserved


6-182 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 parame-
ter 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 applica-
tion 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 (dis-
playing the operating area, the operation mode etc.) for this area application is in-
active (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 03.03
6.3 Application with sequence control

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 sa-
fety 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.

 Siemens AG 2003 All Rights Reserved


6-184 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 num-
ber 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 03.03
6.3 Application with sequence control

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 ad-
ded 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 permission required user group

S0 system password SIEMENS


S1 MTB password machine tool builder
S2 system password set up / service staff
(machine tool builder)
S3 user password privileged user
(in--house service)
S4 key switch position 3 programmer
S5 key switch position 2 trained operator
S6 key switch position 1 operator
S7 key switch position 0 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 ap-
plication to be started in iconized form, use the attribute ShowTask := FALSE. In
this case you cannot start the application by softkey action.

 Siemens AG 2003 All Rights Reserved


6-186 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 Application with sequence control

Customizing the keyboard filter


Use the extension described below to customize the ’MMC keys’ like area chan-
geover--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 changeo-
ver.
The required settings are entered in the file REGIE.INI in the section [TaskConfigu-
ration] 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 attribu-
tes.

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 proces-
sed by the application on its own.
bit0 : area changeover
1=OEMApp wants to process F10, 0=OEMApp wants F10 to be handled as stan-
dard (area change--over)
bit1 : channel changeover
1=OEMApp wants to process F11, 0=OEMApp wants F11 to be handled as stan-
dard
bit2 : Cancel--key (BigMac)
1=OEMApp wants to process ESC, 0=OEMApp wants ESC to be handled as stan-
dard
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 03.03
6.3 Application with sequence control

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 Virtual key code Key code (hex)


1st horizontal softkey bar VK_F1 -- VK_F8 70 --77
2nd horizontal softkey bar (VK_CONTROL, VK_F1) -- (11,70) -- (11,77)
(VK_CONTROL, VK_F8)
Right vertical softkey bar (VK_SHIFT, VK_F1) -- (10,70) -- (10,77)
(VK_SHIFT, VK_F8)
Left vertical softkey bar (VK_SHIFT, VK_CONTROL, (10,11,70) -- (10,11,77)
VK_F1) -- (VK_SHIFT,
VK_CONTROL, VK_F8)
Recall key VK_F9 78
ETC key (VK_SHIFT, VK_F9) (10,78)
Area switchover key VK_F10 79
Machine area key (VK_SHIFT, VK_F10) (10,79)
(Alarm) Cancel key VK_ESCAPE 1B
Channel switchover key VK_F11 7A
End key VK_END 23
Tab key VK_TAB 09

 Siemens AG 2003 All Rights Reserved


6-188 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 ’ShowAppMe-
nuKey’, 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 03.03
6.3 Application with sequence control

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 configu-
red 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 sec-
tion [Keyboard].
Keyboard sequences
The keyboard sequences are enabled/disabled via the entry DisableKeys. The fol-
lowing keyboard sequences are defined:
Bit0 CTRL--ALT
Bit1 ALT--F4
Bit2 ALT--TAB
Bit3 LEFTSHIFT--ALT--TAB
Bit4 RIGHTSHIFT--ALT--TAB
Bit5 CTRL--ESC
Bit6 ALT--ESC
Bit7 ALT--SPACE
Bit8 (SHIFT)--CTRL--F1 3rd and 4th softkey bar (PCU50)
Bit9 (SHIFT)--CTRL--F2 3rd and 4th softkey bar (PCU50)
Bit10 (SHIFT)--CTRL--F3 3rd and 4th softkey bar (PCU50)
Bit11 (SHIFT)--CTRL--F4 3rd and 4th softkey bar (PCU50)
Bit12 (SHIFT)--CTRL--F5 3rd and 4th softkey bar (PCU50)
Bit13 (SHIFT)--CTRL--F6 3rd and 4th softkey bar (PCU50)
Bit14 (SHIFT)--CTRL--F7 3rd and 4th softkey bar (PCU50)
Bit15 (SHIFT)--CTRL--F8 3rd and 4th softkey bar (PCU50)
Bit16 Left Windows Key (popup Taskmenue) VK_LWIN
Bit17 Right Windows Key (popup Taskmenue) VK_RWIN
A keyboard sequence is suppressed by setting the appropriate bit in the Disable-
Keys 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.

 Siemens AG 2003 All Rights Reserved


6-190 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 se-
quences 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 Disable-
KeysHigh:
Bit0--Bit28 Reserved
Bit29=1: 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 inter-
nal use only .

Table 6-7 Entries in the section [Miscellaneous]

entry meaning
ExitButton activates the ExitButtons
ExitButtonAccessLevel Zugriffsstufe des ExitButtons
ExitButtonIndex defines a softkey as ExitButton
ExitButtonQueryUser 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 03.03
6.3 Application with sequence control

Table 6-7 Entries in the section [Miscellaneous]

entry meaning
HelpTaskIndex assignes the substitute task Rhelp
MMCSignOfLife sign of life monitoring of the MMC
PoweronTaskIndex index of the first task following Power On
RemoveIcons removes icons from the screen
ShowMessageBox displays warnings during start--up
ShowResources 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 auxi-
liary 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 Softkeys for operating the Regie with the function Exit

Machine 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 Re-
gie.

 Siemens AG 2003 All Rights Reserved


6-192 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 positi-
on 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 can-
cel 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 03.03
6.3 Application with sequence control

Entry HelpTaskIndex:
Additional information: The standard WINDOWS application WinHelp can be inte-
grated 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 repre-
sents 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).

 Siemens AG 2003 All Rights Reserved


6-194 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 re-
leased 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 ap-
plication 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 03.03
6.3 Application with sequence control

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 unloa-
ded 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 develo-
ped.

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.

 Siemens AG 2003 All Rights Reserved


6-196 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 resour-
ces 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 meaning
HSoftkeyTexts texts of the horizontal softkey bar
VSoftkeyTexts texts of the vertical softkey bar
GeneralTexts miscellaneous texts, e.g. messages
DISP
Keyboard_State
HSoftkeyIcons icons of the horizontal softkey bar

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 6-197
Regie 03.03
6.3 Application with sequence control

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 edi-
ted 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 exam-
ple task 6 has been configured in the REGIE.INI and there is no entry in the lan-
guage.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

 Siemens AG 2003 All Rights Reserved


6-198 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.3 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 dis-
played, you must state the name of the file containing the relevant icon resp. bit-
map. Acc. to the resolution, the files (bmp files) must be stored in one of the direc-
tories \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 con-
figuration 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 auto-
matically 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 maxi-
mum 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 con-
taining 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 03.03
6.3 Application with sequence control

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.

 Siemens AG 2003 All Rights Reserved


6-200 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 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 re-
compiled. They can access, however, Regie.dll and the Regie Control without re-
compliation.

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 short description

switching task
SwitchToHelpTask switch to help task
SwitchToPreviousTask switch to previous task
SwitchToTask change with TaskIndex (without taking into
account ChildTasks)
SwitchToTask2 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 03.03
6.4 Functions of the RegieServer

Table 6-10 Functions of the RegieServer

name short description


SwitchToChildEx activate task in hidden area using the task
name
SwitchToParent return to activating program
SwitchToParentAndKillMe return to activating program and remove
task from memory

switching task (to hidden area) immediately


SwitchToHelpTaskImmediate switch to Help (immediately)
SwitchToPreviousTaskImmediate switch back (immediately)
SwitchToTaskImmediate switch with task index (immediately)
SwitchToChildImmediate activate task in hidden area using the task
number (immediately)
SwitchToChild activate task in hidden area using the task
ImmediateEx name (immediately)
SwitchToParentImmediate return to activating program (immediately)
SwitchToParentAndKillMeImmediate return to activating program and remove
task from memory (immediately)

screen control
MMCScreenOn turn on screen + interface bit
MMCScreenOff turn off screen + interface bit
ContrastDown decrease contrast of the flat screen
monitor
ContrastUp increase contrast of the flat screen monitor

locking
LockCurrentNCU lock NCU for current task
UnlockCurrentNCU unlock NCU for current task
IsCurrentNCULocked check to see who locked the current NCU
IsChanMenuLocked determine the disabled status of the
channel menu
LockChanMenu disable channel switchover
UnlockChanMenu enable channel switchover

command line
ReadCmdLine read area command line
ReadCmdLineMe read command line of current area
WriteCmdLine creating command line for a ‘son’

 Siemens AG 2003 All Rights Reserved


6-202 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

Table 6-10 Functions of the RegieServer

name short description


WriteCmdLineEx creating command line for a ‘son’ (Call
using the task name)

miscellaneous
AsyncCompleted quit event asynchronously
GetCurrentTaskIndex determine Taskindex of the task to be
called
GetMMCDir determine MMC directory
GetMMCLanguagePath access current task DLL
InitCompleteEx indicate successful initialization

InitSvr initialize RegieServer, MUST be called first


thing
ResumeRegieEvents release block for new events
SetMode lock or activate channel switch key
ChannelSwitchKey
Terminate quit HMI and initiate shutdown
TestAndStopRegieEvents 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 short description


switching tasks
SwitchToTask 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 03.03
6.4 Functions of the RegieServer

Table 6-11 Functions of the RegieServer (task changeover)

name short description


SwitchToTask2 change with Taskindex or switch to
ChildTask
SwitchToPreviousTask switch to previous task
SwitchToHelpTask 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.

 Siemens AG 2003 All Rights Reserved


6-204 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

SwitchToHelpTask
Description
The function SwitchToHelpTask changes to the area ’help’, i.e. to the task spe-
cified 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 inde-
pendent 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 short description


switching tasks to the hidden area
SwitchToChild activate task in hidden area using the task number
SwitchToChildEx activate task in hidden area using the task name
SwitchToParent return to activating program
SwitchToParentAndKillMe 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 03.03
6.4 Functions of the RegieServer

”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 AE-
DITOR.
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 re-
sources 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 Hidden tasks


can be accessed via data area bar can be accessed via function

Task 0 to 7
ETC êêêêêê SwitchToChild(Ex)
ê

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_Chan-
ged is not set equal 0, because this may interrupt in the Sequence Control further
actions like area changeovers or building up displays.

 Siemens AG 2003 All Rights Reserved


6-206 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 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 detou-
red 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 in-
dex 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 do-
ing 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 applica-
tion’s initialization file. In this section the task index of an area of the section [Task-
Configuration] configured in the REGIE.INI can be assigned a name. The only dif-
ference 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 03.03
6.4 Functions of the RegieServer

SwitchToParent
Description
Returning from the selected ‘son’ area to the calling ‘father’ and undoing the super-
posing.

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 re-
sources 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 im-
mediately:

Table 6-13 Functions of the RegieServer (switching tasks immediately)

name short description


Switching tasks (to hidden area) immediately
SwitchToHelpTaskImmediate switch to Help (immediately)
SwitchToPreviousTaskImmediate switch back (immediately)
SwitchToTaskImmediate switch with task index (immediately)
SwitchToChildImmediate activate task in hidden area (immediately)
using the task number

 Siemens AG 2003 All Rights Reserved


6-208 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

Table 6-13 Functions of the RegieServer (switching tasks immediately)

name short description


SwitchToChildImmediateEx activate task in hidden area (immediately)
using the task name
SwitchToParentImmediate return to activating program (immediately)
SwitchToParentAndKillMe return to activating program and remove
Immediate task from memory (immediately)

Regie--Queue
Additional information:
The Regie responds to pressed keys (e.g. F10--F10: return to previous applica-
tion) 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 inter-
ruptions of the command sequence.
Example:
In an application a child application ( e.g. an editor ) is closed by the vertical soft-
key 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 03.03
6.4 Functions of the RegieServer

key desired action function Regie queue

+ F8 closing an application function +F8 running + F8

step 1: data area function +F8 running


F10 bar activated F10

F10 step 2: predecessor activated function +F8 running


F10

executing actions with function +F8 running


F4 F4
softkey 4

function +F8 finished


calling of SwitchTo
SwitchToParent Parent

Fig. 6-3 How SwitchToParent works when keys are pressed quickly: Event SwitchTo-
Parent 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 ba-
sic 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.

 Siemens AG 2003 All Rights Reserved


6-210 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

Fig. 6--4 shows the function of SwitchToParentImmediate.

desired action function Regie queue


Key

+ F8 closing in application function +F8 running + F8

SwitchTo
function +F8 running
Parent Im-
mediate
step 1: data area bar activa-

ÜÜÜ
F10 ted function +F8 running F10

step 2: predecessor acti- function +F8 running


F10

ÜÜÜ
vated F10

F4 executing action with function finished Ü F4


softkey 4

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 short description


screen control
MMCScreenOn turn on screen + interface bit
MMCScreenOff turn off screen + interface bit
ContrastDown decrease contrast of the flat screen monitor
ContrastUp 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 03.03
6.4 Functions of the RegieServer

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 opera-
ting 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 ap-
plications (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.

 Siemens AG 2003 All Rights Reserved


6-212 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 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 ’Machi-
neSwitch’.
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 sparin-
gly.
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 short description


locking
LockCurrentNCU lock NCU for the current task
LockNCU lock NCU for the specified task
IsCurrentNCULocked check to see if who locked the current NCU
IsChanMenuLocked Sperrzustand des Kanalmenüs bestimmen
LockChanMenu Kanal Umschaltung sperren
UnlockChanMenu 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 03.03
6.4 Functions of the RegieServer

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 short description


Command line
ReadCmdLine read area command line
ReadCmdLineMe read command line of current area

 Siemens AG 2003 All Rights Reserved


6-214 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

Table 6-16 Command line functions of the RegieServer

name short description


WriteCmdLine installing a command line for a ‘son’
WriteCmdLineEx 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 applica-
tions 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 03.03
6.4 Functions of the RegieServer

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 shut-
down.

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 configu-
ration is stored. The entries in this section use the syntax in the file Regie.ini.
Example:
[StartupConfiguration]
Startup0 = name := ncdde, Timeout := 20000
Startup1 = name := mbdde, Timeout := 20000
Startup2 = name := dhserver, 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 short description


miscellaneous
AsyncCompleted quitting events asynchronously
GetCurrentTaskIndex Taskindex der aufrufenden Task bestimmen
GetMMCDir determining MMC directory
GetMMCLanguagePath accessing current task DLL

 Siemens AG 2003 All Rights Reserved


6-216 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 Functions of the RegieServer

Table 6-17 Functios of the RegieServer (Miscellaneous)

name short description


InitCompleteEx indicating successful initialization
InitSvr initialize RegieServer, MUST be called first thing
TestAndStopRegieEvents check if Regie is stopped and block new events to
be initiated
ResumeRegieEvents release block for new events
SetModeChannelSwitchKey locking or activating channel switch key
Terminate 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 03.03
6.4 Functions of the RegieServer

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 MDI-
FORM1.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 pres-
sed quickly until the current event is finished without interruption, prevent new
events from being activated with TestAndStopRegieEvents. The function Resu-
meRegieEvents cancels TestAndStopRegieEvent.

 Siemens AG 2003 All Rights Reserved


6-218 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.4 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 acti-
vated.

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 inad-
missible 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 03.03
6.5 Events of the RegieServer

6.5 Events of the RegieServer

Note
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 re-
compiled. They can access, however, Regie.dll and the Regie Control without re-
compliation.

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 Se-
quence Control in the events (State_Changed in PRIVATE.BAS) are called syn-
chronously and the user may hook on to it.
Regie-Server: Sequence Control:
Activate AL_ACTIVATE
Deactivate AL_DEACTIVATE, AL_NODEACTIVATE
FormLoad AL_FORMLOAD
FormUnload AL_FORMUNLOAD, AL_NOFORMUNLOAD
QueryForShutdown
The data file ALDEFINE.BAS is extended by the appropriate entries:
Global Const AL_ACTIVATE = ...
Global Const AL_DEACTIVATE = ...
...

 Siemens AG 2003 All Rights Reserved


6-220 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.5 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 decla-
red 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 MDI-
Form1 (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 me-
thod 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 03.03
6.5 Events of the RegieServer

Events of the RegieServer


In the following text you will find a description of all events of the RegieServer. Ge-
nerally, 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 meaning
Activate operator has selected an area
Deactivate Operator has deselected an area
FormLoad An iconized area has been selected
FormUnload Area has been deselected
QueryForShutdown Closing applications

Activate
Description
Is triggered after activating an area by the user. It is not allowed to modify the fo-
cus 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.

 Siemens AG 2003 All Rights Reserved


6-222 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.5 Events of the RegieServer

Deactivate
Description
Is triggered after activating the area bar with Softkey F10 and deactivating the ap-
plication (the focus switches over to the data area bar of the Regie). The applica-
tion gets no longer the function keys. If a new area is selected an event FormUn-
load 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 NoDeacti-
vate 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 deac-
tivation 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 Con-
trol performs a load command for all MDI--Childs which are unloaded in the prece-
ding 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, ikonisier-
ter 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 03.03
6.5 Events of the RegieServer

FormUnload
Description
Is triggered during deactivation of an area. The Sequence Control performs an un-
load 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 pro-
gram 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 acknowled-
ges 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 Que-
ryForShutdown is sent to the Dialog programming.
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).

 Siemens AG 2003 All Rights Reserved


6-224 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.5 Events of the RegieServer

In this case (Dialog programming is loaded, changeover from Machine to Diagno-


sis) 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 QueryForS-
hutdown 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 is-
sues 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 03.03
6.6 Application without sequence control

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 di-
rectory 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 sec-
tion [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”
.

 Siemens AG 2003 All Rights Reserved


6-226 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 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

attribute meaning default


Timeout* Maximum duration provided for running up the OEMFRAME appli- 10000 (10 s)
cation, in milliseconds.
CmdLine Defines the name of the OEMFRAME application including the com- “”
mand line parameters.
HeaderOnTop* Defines whether the standard header is displayed or not. 1
PreLoad* Defines whether the OEMFRAME application is started upon star- True
ting the HMI Advanced software or when this is selected for the first
time.
AccessLevel* Defines the access level required to select the OEMFRAME appli- 4
cation.
ClassName ClasseName of the main window of the OEMFRAME application. “”
WindowName WindowName of the main window of the OEMFRAME application. “”
GimmeKeys* Defines which keys processed by the Regie as standard are trans- inactive
ferred to the OEMFRAME application.
ShowAppMenu- Defines which key is used with active/selected OEMFRAME appli- inactive
Key* cation to activate the area changeover bar.
* optional

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 6-227
Regie 03.03
6.6 Application without sequence control

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 meaning
notepad 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 SetWindow-
Long 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 xxxx 0000 0000 0000 0000


1010 caption
1000 border)
0100 lgframe
0010 scrollbar vertical
0001 scrollbar horizontal
1000 system menu
0100 Thickframe

 Siemens AG 2003 All Rights Reserved


6-228 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 Application without sequence control

Table 6-21 Ways of configuring the display using WindowsStyle attributes

0000 0000 xxxx xxxx 0000 0000 0000 0000


0010 minimize-box
0001 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 dis-
played 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 03.03
6.6 Application without sequence control

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 horizon-
tal and Y is the vertical coordinate increasing downward. The measuring unit is
pixel. The available working area is 560 x 325 pixels.

X
x,y = 0,0 560,0 640,0
header
Y
0,100 560,100 soft-
keys
working area

0,425 560,425

softkeys
0,480 640,480

Fig. 6-5 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 pre-
vent 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, refer-
ring to the origin according the attribute Y in pixels.

 Siemens AG 2003 All Rights Reserved


6-230 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 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 va-
lues 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

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 03.03
6.6 Application without sequence control

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 para-
meter nDelayInitComplete. Such a delay becomes necessary if the application
must still carry out actions demanding more time after the window has been crea-
ted 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 ave-
rage.
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 InitCom-
plete”.
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!

 Siemens AG 2003 All Rights Reserved


6-232 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 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, fSear-
chOnlyForTaskWindow 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 speci-
fied 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 conse-
quently not be found if only this window is searched among the windows of star-
tup.exe.
2nd example
The application is started from a batch file. In this case, too, the window of the ap-
plication 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 appli-
cation. 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 pos-
sible to initiate a switchover to a certain task (e.g. machine) or to a previously ac-
tive 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 03.03
6.6 Application without sequence control

Note
Do not parameterize the task that has currently been closed or quitted! In the ex-
ample 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 applica-
tion that has been started from the OEMFRAME application (so--called second
task level).
This situation cannot be controlled completely by OEMFRAME and should there-
fore 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 star-
ted 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, OEM-
FRAME 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 pa-
rameter fRestoreTaskWindow. If this parameter contains the value 1, OEMFRAME
will always activate two windows when the OEMFRAME application or the applica-
tion started from the OEMFRAME application is selected. First, the basic window
of the OEMFRAME application is always brought to the foreground, and the ”Fore-
groundWindow” 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.

 Siemens AG 2003 All Rights Reserved


6-234 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 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 Fore-
groundWindow.

OEMFRAME --> OEM application --> ForegroundWindow

fForceTaskFocus=0
basic window fSecondForPopUps: irrelevant

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 OEM-
FRAME application is selected again. If no pop--up window exists, the basic win-
dow 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 03.03
6.6 Application without sequence control

OEMFRAME --> OEM application --> PopUpWindow

fForceTaskFocus=1
basic window fSearchForPopUps=1

The search for an active pop--up window is be carried out if the parameter fSearch-
ForPopUps is set to the value ”0”. In this case, only the basic window of the OEM-
Frame application is taken into account when the application is selected/deselec-
ted. The basic window is specified in the file Regie.ini using ClassName and/or
WindowName.

OEMFRAME --> OEM application


fForceTaskFocus=1
fSearchForPopUps=0
basic window

 Siemens AG 2003 All Rights Reserved


6-236 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.6 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 hid-
den/unhidden.
The parameter nShowMode refers to unhiding (task is activated), and the parame-
ter nUnShowMode to hiding. The following range of values exists for the two para-
meters:
1. The application window is hidden (SW_HIDE).
2. The application window is displayed in its original form (position, size) and re-
ceives 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_MINI-
MIZE).
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_RE-
STORE).
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 03.03
6.7 Embedding an OEM application in the HMI

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 re-
medy.

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.

 Siemens AG 2003 All Rights Reserved


6-238 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.8 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 follo-
wing).
The standard WINDOWS application WinHelp can be integrated in the MMC sy-
stem 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 repre-
sents 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 stan-
dard 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 03.03
6.8 Adding help support

In the second case the application must make sure, that the two variables (hel-
pflag 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 va-
riables 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 (sepa-
rated 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:

 Siemens AG 2003 All Rights Reserved


6-240 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Regie
6.8 Adding help support

Table 6-22 Softkeys for using Rh

softkey meaning/action
page down The help text is scrolled down one page
page up The help text is scrolled up one page
previous The selection is moved up one item
selection
next The selection is moved down one item
selection
follow cross RHelp instructs WinHelp to take the current selection as a
reference new index item and to display it.
back 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.
content RHelp causes WinHelp to display the table of contents
OK quit RHelp
notebook adding additional information to the help entry

Notebook
The notebook feature allows the user to add own texts to an existing help file.
entry Rh opens a text field, where
the user can type in additional information concerning the subject specified
in the variable [helpcontext].
record with the key OK
cancel with the key cancel
show 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. Ihelpcon-
text.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 03.03
6.8 Adding help support

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 ge-
nerating the help file.
You may not utilize all existing foot notes. The following foot notes are supported:
# context string, name of the help topic
$ title, defines the Topic Title, that appears in a List Box during a search
K 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.

 Siemens AG 2003 All Rights Reserved


6-242 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Sequence control 7
Overview
The configuration of the user interface is carried out in Visual Basic Professional.
Each application component (window) is opened as a subwindow (MDIchild or ap-
plication--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 03.03
7.1 Introduction

7.1 Introduction

Summary
This chapter should give you a good idea of the terms and functions of the Se-
quence Control.

States
The central element for describing the Sequence Control is the state. It is charac-
terized 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 exten-
sion ZUS).
In the structure diagrams a state is represented by the symbol according to fig.
7-1.

8
9

State 1
10
11
12 vertical
13 softkeys
14
15
0 1 2 3 4 5 6 7
horizontal softkeys
Fig. 7-1 Symbol representing a state

 Siemens AG 2003 All Rights Reserved


7-244 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

state 1
10
11
12
13
14
15
0 1 2 3 4 5 6 7

8 8 8
9 9 9

state 2 state 3
10 10 10
11
12
11
12 state 4 11
12
13 13 13
14 14 14
15 15 15
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

8 8 8
9 9 9
10 10 10

state 5 11
12 state 6 11
12 state 7 11
12
13 13 13
14 14 14
15 15 15
0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7

8
9
10

state 8 11
12
13
14
15
0 1 2 3 4 5 6 7

Fig. 7-2 Example of a menu tree

Actions
Actions result in state transitions. The actions at the operator interface are trigge-
red 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 ex-
tension ZUS).

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-245
Sequence control 03.03
7.2 Your first OEM application

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 (initial state)
S PROGNAME.MDI (components of an application, e.g. windows)
S PROGNAME.ZUS (descriptions of states and actions)
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--speci-
fic information. The file name is stored in the module PRIVATE.BAS as a constant.

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.

 Siemens AG 2003 All Rights Reserved


7-246 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.2 Your first OEM application

7.2.1 Directory structure

C:\MMC_OEM.V52 Installation drive (corresponds to drive L:\)

AB Sequence Control
ADD ON additional Siemens products

directory for the language DLLs of additional products


LANGUAGE

. . HMI_ADV
. ALTMP temporary files
DH Datea Management
DI_TMP temporary files

HD header files
standard user interface MMC102/MMC103
MMC2
(may not be modified)

LANGUAGE lanuage files of the standard system

RE_xx.INI hor. und vert. SK texts, highest level


lanuage DLLs, text files
..
..

OEM directory for OEM applications (.EXE and .INI)

REGIE.INI
OEM-spezific REGIE-INI (differences only)
USER.NSK OEM-spezific file
..

LANGUAGE directory for the language DLLs


O0_GR.DLL
German DLL für OEM-example0,
.. language-DLLs, text files
RE_xx.INI difference from \MMC2\LANGUAGE\RE_xx.INI
..
OEMBSPO
OEMBSPO.MDI MDI-Childs for OEM-example 0
OEMBSPO.ZUS state matrix für OEM-examplel 0

OEMBSP1
OEMBSP1.MDI 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 03.03
7.2 Your first OEM application

RE

SAMPLERS.OEM OEM-directory
(in connection with the OEM package only)
LANGUAGE
language files for OEM projects
..
OEMBSPO OEM-example 0

OEMBSPO.WRI description of the example in German

description of the example in Englisch


OEMEXPO.WRI
OEMBSPO.WRI reference to the MDI- and ZUS-file, must
be copied to \OEM
SRC the example’s source code

Array containing the FormNames


OEM.FRM forms in VisualBasic
OEMBSP0.MAK the project’s Makefile
OEMBSPO.MDI the applicatio’s MDI-Childs
OEMBSP0.ZUS states and actions
PRIVATE.BAS see Chap. 7.3.3
PVERSION.BAS see Chap. 7.3.3
.. SHUTDOWN.BAS see Chap. 7.3.3

OEMBSP12 OEM-example 12

OEMBSP12.INI

USER directory for the user’s modifications

REGIE.INI user--spezific REGIE.INI


USER.NSK user--spezific NSK files
..

LANGUAGE directory for the Sequence Control’s language DLLs

RE_xx.INI Difference from \MMC2\LANGUAGE\RE_xx.INI

..
..

 Siemens AG 2003 All Rights Reserved


7-248 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.2 Your first OEM application

The Siemens user interface automatically enters settings which differ from the de-
fault settings in the directory USER and its subdirectories as soon as the user ac-
cordingly 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 cor-
responding 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 03.03
7.2 Your first OEM application

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 con-
tents 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 BSP_1.vbp
OEMBSP0.MDI BSP_1.MDI
OEMBSP0.ZUS BSP_1.ZUS
OEM0.FRM OEMFRM1.FRM

Step 3
Copy the following language files: (DLLs)
L:\OEM\LANGUAGE\
O0_GR.DLL BSP_1_GR.DLL
O0_UK.DLL BSP_1_GR.DLL

 Siemens AG 2003 All Rights Reserved


7-250 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.2 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 03.03
7.2 Your first OEM application

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 )

 Siemens AG 2003 All Rights Reserved


7-252 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.2 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 proper-
ties 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 03.03
7.2 Your first OEM application

Step 4
Insert the following lines in the file ”L:\OEM\BSP_1\BSP_1.ZUS”
[1] 0 0 ” OEMFRM2” ”” ”0” 0
0 --1 --1 ”” ”0” 0
1 --1 --1 ”” ”1” --1
...
15 --1 --1 ”” ”15” --1

Step 5
Insert the following line in the file ”L:\OEM\BSP_1\BSP_1.MDI
” OEMFRM2” 1

 Siemens AG 2003 All Rights Reserved


7-254 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.3 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--speci-
fic 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 meaning
CONTROL directories for softkey pictogram control files, help files and user
pictures.
example: state matrix PROGNAME.ZUS
DEBUG setting the DEBUG support for the development system.
example: full screen

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, 1 = visible
i_Button=1
Stop_Button=1

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-255
Sequence control 03.03
7.3 Files of the Sequence Control

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 contents
ALCOMMON.BAS collection of functions and procedures for general use
ALDECL.BAS contains global variables and data structures
ALDEFINE.BAS contains general constants as for example the screen
positions of MDIchilds
ALDIALOG.FRM form for the dialog line: this line is currently being used by
the Sequence Control for test output
ALENVIR.BAS contains functions and procedures, that determine search
paths and environment variables
ALHELP.FRM form for display of help texts
ALHSOFT.FRM program code for processing of horizontal softkeys
ALLAFCT.BAS program for language switch--over: Manages loading and
unloading of forms.
ALMODAL.FRM standard form for application--modal output
ALPRINFO.BAS test program, e.g. to output the window types
ALSTART.FRM 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.
ALVSOFT.FRM program code for processing of vertical softkeys
ALWTRACE.BAS contains procedures for the trace feature (internal function
only)
AB16.DLL Bibliothek interner Funktionen und Prozeduren der Ab-
laufsteuerung (16-Bit-Version)
AB32.DLL Bibliothek interner Funktionen und Prozeduren der Ab-
laufsteuerung (32-Bit-Version)

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!

 Siemens AG 2003 All Rights Reserved


7-256 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.3 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 fol-
lowing files (Table 7-3):

Table 7-3 Files added by the application

file contents
PRIVATE.BAS contains among others the procedures Private_Init_Def,
Private_Init and State_Reached, the function
State_Changed and application--specific declarations,
procedures and functions.
SHUTDOWN.BAS 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.

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 fi-
les, 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 03.03
7.3 Files of the Sequence Control

Global constants
The module ALPRDECL.BAS is supplied for defining global constants in an appli-
cation: 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.

 Siemens AG 2003 All Rights Reserved


7-258 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 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 lan-
guage independent, some configuration requirements must be fulfilled:
S For each foreign language the minimum legible size of the fonts is of great im-
portance. ( 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 pro-
gram 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 03.03
7.4 Language support for your applications

Where to store language--DLLs


Example 7-2 Where to store language--DLLs

C:\ Installation driveI

OEM OEM directory

LANGUAGE language dependent files


O1_GR.DLL language DLL for OEM example 1 in German
O1_UK.DLL 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 conver-
ted 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):

 Siemens AG 2003 All Rights Reserved


7-260 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 Language support for your applications

Table 7-4 List of text identification

text--Id meaning
0 start position for the texts of the horizontal softkey -- bar
1 start position for the texts of the vertical softkey -- bar
2 start position for the application--specific texts of dialog boxes and
forms
3 ff. 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 03.03
7.4 Language support for your applications

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.

 Siemens AG 2003 All Rights Reserved


7-262 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 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 cor-
responding 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\Sinume-
rik\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 03.03
7.4 Language support for your applications

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.

 Siemens AG 2003 All Rights Reserved


7-264 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 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 gene-
rated 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 03.03
7.4 Language support for your applications

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.

 Siemens AG 2003 All Rights Reserved


7-266 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 Language support for your applications

7.4.4 Asian languages

The following fonts are used to display language--dependent texts in Asian langua-
ges:
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 lan-
guage--dependent texts. To do this, call up the function SubSetTCtrlAttr (see chap-
ter 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. McJap-
FrameHookl 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 03.03
7.4 Language support for your applications

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.

 Siemens AG 2003 All Rights Reserved


7-268 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 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 03.03
7.4 Language support for your applications

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.

 Siemens AG 2003 All Rights Reserved


7-270 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.4 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 03.03
7.5 Types of windows

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 names of the MDIchild as an ASCII -- text put in quotation marks (”) .
S Types of MDIchilds (0 to 5)
S Preload
S Comment (optional)

Organization of a MDI file


Excerpt from the MDI--file in the application ’machine’.
Example 7-4 Organization of a MDI file
”Preset” 1 // This is part of the basic screen machine.
”spin” 2
”vorschub” 1
”Werkzeug” 1, Preload=TRUE

Table 7-5 shows the different types of MDIchilds (pictures).

Table 7-5 Typs of MDIchilds

type action
0 NOUNLOAD MDIchild is always displayed
1 UNLOAD MDIchild is deleted when being overlaid
2 RESIZE MDIchild is reduced in size when being overlaid (size 0)
3 MODAL MDIchild is an application--modal window
4 OVERLAYED MDIchild is not overlaid, might be partially overlaid
5 MAYBE_1OR2 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.

 Siemens AG 2003 All Rights Reserved


7-272 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.5 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. Pic-
tures of e.g. type 1 would be unloaded when touched or overlaid by another win-
dow.
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 Applika-
tion geladen wird.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-273
Sequence control 03.03
7.5 Types of windows

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 remo-
ved 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. interrup-
ting DDE--connections), the above line might have to be inserted there also.

 Siemens AG 2003 All Rights Reserved


7-274 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.5 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 cor-
responding softkey bar.
S Applications open these windows by calling the procedure ModalDialog or Usr-
ModalDialog.
S Calling the procedure ModalDlgEnd --1 interrupts application--modal windows.
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 MDI-
childs ( property MDIchild = False ), but are handled by the Sequence Control like
MDIchilds ( The property Always on Top does not apply to MDIchilds in Win-
dows 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 MDIf-
rame 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 ALMO-
DAL.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 03.03
7.5 Types of windows

7.5.2 Displaying messages/notes

The Sequence Control provides the procedure Write_Dialog for displaying mes-
sages. 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.

 Siemens AG 2003 All Rights Reserved


7-276 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/ access Htext Vtext Childs Return Z -- Flag / comment


action level succeedi
ng state
999 ”Description of state 10”
10 ht0 vt0 ”x1” ”x2” ”abc” 1 ”state 10”
... ””
0 John --1 --1 ”a1” ”” ”SK0” 17 ”Softkey0”
14 3 --1 --1 ”” ”SK14” --1 ”abort”
15 Mary --1 --1 ”” ”OK” 3 ”OK”
16 3 ”RECALL--
key”
999 ”Description of state 17”
17 ht0 vt0 ”a” ”b” ”0017” 0 ”state17”
””
0 4 --1 --1 ”” ”SK0” 0 ”Softkey0”

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 03.03
7.6 Menu control

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 neces-
sary). The actions of a state are numbered from 0 to 15, according to the hori-
zontal ( 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 pres-
sed. 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 neces-
sary for operating this softkey.
When loading a softkey bar the current key switch position is compared to the va-
lues 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 permission required: user group


level:
--1 always everyone
0 system password SIEMENS
1 MTB password machine tool builder
2 service password set up / service staff
(machine tool builder)
3 user password privileged user (in--house service)
4 key switch position 3 programmer
5 key switch position 2 trained operator

 Siemens AG 2003 All Rights Reserved


7-278 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 permission required: user group


level:
6 key switch position 1 operator
7 key switch position 0 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 [ACCESSLE-
VEL] must be created containing the corresponding entries.

Example for symbolic user classes


The application PROGNAME contains the following entries in the section [AC-
CESSLEVEL] 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 03.03
7.6 Menu control

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 des-
cription 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 corres-
ponds 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 applica-
tion with the following characteristics:
S The maximum number of MDIchilds is determined by the constant Max-
FormNbr (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 ope-
ned 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 ac-
tion has been triggered including
S name of a procedure
S state number
S name of the form.

 Siemens AG 2003 All Rights Reserved


7-280 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 ope-
ned 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 03.03
7.6 Menu control

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_Chan-
ged 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 ( --1, --1, --1 ) informs the
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

 Siemens AG 2003 All Rights Reserved


7-282 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 ex-
cerpt 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 applica-
tion 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 Pri-
vate_Init is called.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-283
Sequence control 03.03
7.7 Procedures and functions

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 state control
S inquiry function
S MDIchild function
S unlocking/locking softkeys
S softkey text function
S text display
S modal window function
S action function (dynamic change of the state matrix)
S attributes for forms and controls

Overview

Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)

name F/P meaning


state control
Set_Previous_State P return to previous state
Set_State P state change over
State_Changed F return application state following an
action
State_Reached P user procedure like State_Changed
inquiry function
AlGetAccessLevel F read current access level
AlGetSkByAction F read softkey number of the current state
returning a specific value
Get_FormIdx2 F provides an index for form names
Get_FormIndex F provides an index for ASCII form names
MDIchild function
ChildActivate P declare a MDIchild to the Sequence
Control
ChildDeactivate P disconnect a MDIchild from the Sequence
Control
Hide_Childs P hide all open MDIchilds
Set_ChildType F set type of MDIchild
Show_Focus a specific MDIchild gets the entry focus
AlSkipFocus P exclude MDIchild from getting the focus
Hide_A_Child P hide specified Childs

 Siemens AG 2003 All Rights Reserved


7-284 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)

name F/P meaning


Show_Hidden_Childs P show all hidden Childs
unlocking/locking softkeys
Lock_Softkey P lock softkeys or softkey bars
Unlock_Softkey P unlock softkeys or softkey bars

LockSkByState P lock all state softkeys resulting in a


specific state
UnlockSkByState P unlock all state softkeys resulting in a
specific state
LockSkByAction P lock all state softkeys returning a specific
return value
UnlockSkByAction P unlock all state softkeys returning a
specific return value
LockSkByState P lock all state softkeys resulting in a
AndAction specific state and returning a specific
return value
UnlockSkByState P unlock all state softkeys resulting in a
AndAction specific state and returning a specific
return value
softkey text functions
AlGetDllEntries F read several texts from the language DLL
with end index
AlGetDllEntriesI F read several texts from the language DLL
without end index
Change_SkTextOnScr P change softkey text on the screen
Al_GetSkTextByIndex F read softkey text
Al_SetSkTextByIndex P change softkey text
Al_GetSkTextByState F read softkey text for a specific state
Al_SetSkTextByState P change softkey text for a specific state
Change_SKtext P change softkey text
SK_Highlight P highlight a softkey
SK_HighlightUn P highlight a softkey immediate
text display
Write_Dialog P write text to dialog line
modal window functions
ModalDialog F open application modal window
ModalDialogEnd F close a modal dialog

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-285
Sequence control 03.03
7.7 Procedures and functions

Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)

name F/P meaning


ModalDialogInfo F is a modal dialog active
UsrModalDialog F wait loop for modal dialog
SysModalDialog F system modal dialog
action functions (dynamic change of the state matrix)
AlDisableSkAction P disable softkey actions
AlEnableSkAction P enable softkey actions
AlNewActionEntry F change a softkey action
AlNewActionEntries F change several softkey actions
AlNewSoftkeyAction F change subsequent state
action functions (dynamic change of the state matrix)
subSetTFrmAttr P set attribute for forms
subSetTCtrlAttr P set attribute for controls
attributive functions for dynamic graphic resolution
subSetTFrmAttr P set attributes for form
subSetTCtrlAttr P set attributes for control
functions for reading/ writing INI file entries
AlGetPrivateProfileString F read entries from INI files
AlGetPrivateProfileInt F read numeric entries from INI files
AlWriteProfileString F write entries to INI files

 Siemens AG 2003 All Rights Reserved


7-286 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 projek-
tierten 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 Data type description


state integer state to be changed to

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-287
Sequence control 03.03
7.7 Procedures and functions

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_Chan-
ged 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 Data type description


action string a function called by this is e.g. configured in the
application’s .zus file
newstate integer state to be changed to
oldstate integer 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 pres-
sed.

 Siemens AG 2003 All Rights Reserved


7-288 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 glo-
bal constants listed below have been changed:
S Global Const AL_ACTIVATE = ”--990”
S Global Const AL_DEACTIVATE = ”--991”
S Global Const AL_FORMLOAD = ”--992”
S Global Const AL_FORMUNLOAD = ”--993”
S Global Const AL_NODEACTIVATE = ”--994”
S Global Const AL_NOFORMUNLOAD = ”--995”
S Global Const AL_ETCINFO = ”--996”
S Global Const AL_EXITINFO = ”--998”
S 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 03.03
7.7 Procedures and functions

Arguments

Table 7-11 Arguments of State_Reached

Argument Data type description


action String An action called by this function is configured
e.g. in the file .zus.
newstate Integer state the application changed to
oldstate Integer 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).

 Siemens AG 2003 All Rights Reserved


7-290 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 ac-
tion.
Syntax
Function AlGetSkByAction(ByVal action As String) as Integer
Arguments

Table 7-12 Arguments of AIGetSkByAction

Argument Data type description


action string searched action text of the softkey

Return value
The return value is the softkey number. In case of error, a value less than 0 is re-
turned.

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 03.03
7.7 Procedures and functions

Argument

Table 7-13 Arguments of Get_FormIdx2

Argument Data type description


FormName Form name of the form

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 Data type description


name String name of the form

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.

 Siemens AG 2003 All Rights Reserved


7-292 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

7.7.3 MDIChild functions

AlSkipFocus
Description
The procedure AlSkipFocus allows exclude certain MDIchilds from the focus distri-
bution.
Application
Erlaubt es dem OEM-Anwender, die Softkeynummer abzufragen, mit der eine be-
stimmte Aktion ausgelöst wird.
Syntax
Sub ALSkipFocus (ByVal ChildIndex As Integer, OnOff As Integer)
Arguments

Table 7-15 Arguments of AISkipFocus

Argument Data type Description


ChildIndex integer specifies the index of the MDIchild to be
excluded from focus distribution
OnOff integer 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_Acti-
vate.
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 03.03
7.7 Procedures and functions

Arguments

Table 7-16 Arguments of ChildActivate

Argument Data type Description


FormName Form 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_Deacti-
vate.
Syntax
Sub ChildDeactivate (FormName As Form)
Arguments

Table 7-17 Arguments of ChildDeactivate

Argument Data type Description


FormName Form form to be deactivated

Note
This procedure must be called in the event routine Form_Deactivate.

 Siemens AG 2003 All Rights Reserved


7-294 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Data type Description


FormName Form 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 du-
ring 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 03.03
7.7 Procedures and functions

Arguments

Table 7-19 Arguments of Set_ChildType

Argument Data type Description


ChildIndex Integer MDIchild/Form to be hidden
newType Integer Child type to be set
TYPE_NOUNLOAD 0
TYPE_UNLOAD 1
TYPE_RESIZE 2
TYPE_MODAL 3
TYPE_OVERLAYED 4
TYPE_MAYBE_1OR2 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 Data type Description


mdiChild Form MDIChild/Form to get the focus

 Siemens AG 2003 All Rights Reserved


7-296 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 pre-
sently 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 pre-
sently 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 03.03
7.7 Procedures and functions

Arguments

Table 7-21 Arguments of LockSkByAction

Argument Data type Description


action String 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 Data type Description


state Integer 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 Return-
String (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 Data type Description


state Integer state to be locked for softkey operation
action String action to be locked

 Siemens AG 2003 All Rights Reserved


7-298 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

Lock_Softkey
Description
The procedure Lock_Softkey allows the explicit lock individual softkeys respecti-
vely 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 WIN-
DOWS) 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 Data type Description


skIndex integer H_Lock lock horizontal softkey bar
V_Lock lock vertical softkey bar
HV_Lock 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 03.03
7.7 Procedures and functions

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 argu-
ment 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 Data type Description


action String 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 Data type Description


state Integer state which is to be released for softkeys

 Siemens AG 2003 All Rights Reserved


7-300 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Re-
turnString (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 Data type Description


state Integer state which is to be released for softkeys
action String action to be released

Unlock_Softkey
Description
The procedure Unlock_Softkey cancels the lock of a individual softkey or the com-
plete 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 Data type Description


skIndex integer H_Lock unlock horizontal softkey bar
V_Lock unlock vertical softkey bar
HV_Lock 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 03.03
7.7 Procedures and functions

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--specifi-
cally (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 Data type Description


hLang integer hLanguageLibHandle
specifies the language--DLL, is returned when
loading the DLL
t_beg integer marks the beginning of a text area
t_end integer marks the end of the text area
t_max integer maximum number of texts
dllt DLLEntry specifies the structure that the texts are to be
written to; this structure is provided as a type
declaration in the Sequence Control:

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.

 Siemens AG 2003 All Rights Reserved


7-302 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 in-
stead 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, By-
Val t_end As Integer, ByVal t_maxRead As Integer, Sktext As Variant) As Integer
Arguments

Table 7-30 Arguments of ALGetDLLEntries

Argument Data type Description


hLang Integer hLanguageLibHandle specifies the language
DLL; is returned when loading the DLL
t_beg Integer specifies the start of the text area
t_end Integer specifies the end of the text area
t_max Integer maximum number of texts
dllt Variant 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 03.03
7.7 Procedures and functions

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 In-
dex--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, By-
Val t_max As Integer, dllt As variant) As Integer
Arguments

Table 7-31 Arguments of ALGetDLLEntriesI

Argument Data type Description


hLang integer hLanguageLibHandle
specifies the language--DLL, is returned when
loading the DLL
t_beg integer marks the beginning of a text area
t_max integer maximum number of texts
dllt variant specifies the structure that the texts are to be
written to; this structure is provided as a type
declaration in the Sequence Control

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.

 Siemens AG 2003 All Rights Reserved


7-304 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Data Type Description


hLang Integer hLanguageLibHandle specifies the language
DLL, is returned when loading the DLL
t_beg Integer marks the beginning of a text area
t_max Integer maximum number of texts
dllt Variant 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 03.03
7.7 Procedures and functions

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 Data type Description


sk integer softkey number

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 Data type Description


hv integer True horizontal softkey
False vertical softkey

Return value
The procedure returns the softkey text as string.

 Siemens AG 2003 All Rights Reserved


7-306 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Data type Description


hv integer True horizontal softkey
False vertical softkey
Index integer position number in the language DLL
sktext string text to be assigned to the softkey

AL_GetSKTextByState
Description
The function AL_GetSkTextByState supplies a softkey text specified by the argu-
ments 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 03.03
7.7 Procedures and functions

Arguments

Table 7-36 Arguments of ALGetSKTextByState

Argument Data type Description


state integer state
action integer position number in the language--DLL
sk integer 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 Data type Description


state integer state
action integer position number in the language--DLL
sk integer softkey number
sktext string text to be assigned to the softkey

 Siemens AG 2003 All Rights Reserved


7-308 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Data type Description


SoftkeyId integer number of the softkey
SkText string text to be assigned to the softkey

Change_SkTextOnScr
Description
The routine Change_SkTextOnScr changes the softkey text specified by the argu-
ment index directly on the screen, however not in the internal data structure (Se-
quence Control).
Application
This routine is useful for modifying a program’s softkey texts until the state chan-
ges.
Syntax
Sub Change_SkTextOnScr (SoftkeyId As Integer, SkText As String)
Arguments

Table 7-39 Arguments of Change_SkTextOnScr

Argument Data type Description


SoftkeyId integer softkey number
SkText string 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 03.03
7.7 Procedures and functions

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 Data type Description


DText string text for the dialog line

 Siemens AG 2003 All Rights Reserved


7-310 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 reali-
zed 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 dia-
log. The application remains in the wait loop until the dialog is terminated, or inter-
rupted 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 soft-
key is labeled in the corresponding softkey bar; at least one value of hsk re-
spectively 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 softkey bars and the focus.
S Return value = 15 assuming the vertical softkey 15 is used.
S User evaluates the return value.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-311
Sequence control 03.03
7.7 Procedures and functions

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 Data type Description


Title string title bar of the modal dialog
midx integer index of the modal window in g_frmFormName
hsk integer horizontal softkey bar
--1 no softkeys
vsk integer vertical softkey bar
--1 no softkeys
mtext string 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)

 Siemens AG 2003 All Rights Reserved


7-312 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

Arguments

Table 7-42 Arguments of ModalDialogEnd

Argument Data type Description


Index integer 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 03.03
7.7 Procedures and functions

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 applica-
tion--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 Data type Description


Title string title line of the modal dialog
midx integer index of the modal window in g_frmFormName
hsk integer horizontal softkey bar
--1 no softkeys labeled
vsk integer vertical softkey bar
--1 no softkeys labeled
mtext string 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 Appl-
Modal) 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 respecti-
vely 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 mo-
dal dialog.

 Siemens AG 2003 All Rights Reserved


7-314 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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 Data type Description


Title string title line of the modal dialog
hsk integer 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 03.03
7.7 Procedures and functions

Table 7-44 Arguments of SysModalDialog

Argument Data type Description


vsk integer vertical softkey bar
--1 no softkey labeled
mtext string text for system modal windows

Return value
The application remains in a wait loop of this function until the dialog has been ack-
nowledged 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 ac-
tion (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 Data type Description


state integer number of the state
SkIndex index number of the softkey

 Siemens AG 2003 All Rights Reserved


7-316 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

ALEnableSKAction
Description
The procedure ALEnableSKAction allows you to dynamically enable a softkey ac-
tion specified by the arguments state and SKIndex and disabled by ALDisableS-
KAction. 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 Data type Description


state integer state number
SkIndex index softkey number

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 reconfi-
gure the application’s reactions during run time. If the modification refers to the cur-
rent state, the horizontal respectively the vertical softkey bar is redrawn if neces-
sary.

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, By-
Val AccessLevel As Integer, ByVal HskTextId As Integer, ByVal VskTextId As Inte-
ger, 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 03.03
7.7 Procedures and functions

Arguments

Table 7-47 Arguments of ALNewActionEntry

Argument Data type Description


state integer state number
SkIndex index softkey number
AccessLevel integer access level
HskTextId integer horizontal softkey text bar
VskTextId integer vertical softkey text bar
ReturnString string return string
Successor integer 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 ‘action
AccessLevel As Integer ‘access level
HskTextId As Integer ‘horizontal SK text bar
VskTextId As Integer ‘vertical SK text bar
ReturnString As String ‘return text
Successor As Integer ‘subsequent state
End Type
The type definition Sk_MatEntry can be found in the module ALDECL.BAS.

 Siemens AG 2003 All Rights Reserved


7-318 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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_MatEn-
try) As Integer
Arguments

Table 7-48 Arguments of ALNewActionEntries

Argument Data type Description


state integer state number
SkMatEntry() Sk_MatEntry softkey number

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 = -1
xxSkMatEntry(0). HskTextId = 0
xxSkMatEntry(0). HskTextId = 32
xxSkMatEntry(0).ReturnString = ”abc”
xxSkMatEntry(0). Successor = 7
xxSkMatEntry(1).SkIndex = 10
xxSkMatEntry(1). AccessLevel = -1
xxSkMatEntry(1). HskTextId = 40
xxSkMatEntry(1). HskTextId = 48
xxSkMatEntry(1).ReturnString = ”xyz”
xxSkMatEntry(1). Successor = 13
usw.
nRet = ALNewActionEntries (3, xxSkMatEntry() )

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-319
Sequence control 03.03
7.7 Procedures and functions

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 retur-
ned 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, By-
Val ReturnString As String, ByVal Successor As Integer) As Integer
Arguments

Table 7-49 Arguments of ALNewActionEntries

Argument Data type Description


state Integer state number
SkIndex Index softkey number
ReturnString String return string
Successor Integer 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-

 Siemens AG 2003 All Rights Reserved


7-320 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

box: there are dependencies which are not known by the SC, as e.g. the line spa-
cing 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 pro-
gram 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 set-
ting); i.e. usually the entry does not have to be modified.
The INI entry ScreenTwips (in the application--specific INI file) is ignored if Reso-
lution=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 horizontal resolution
VSize As Integer vertical resolution (exc. Task bar)
HFact As Single X--factor referring to BaseScreen--X
VFact As Single Y-- factor referring to (BaseScreen--Y-- Task bar)
End Type
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 parame-
ter, 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 03.03
7.7 Procedures and functions

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 dis-
play 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 mean-
time.
Syntax
subSetTCtrlAttr (Ctrl As Control, wType As Integer, Optional ByVal size As Variant)
Parameter

Table 7-50 Parameter of subSetTCtrlAttr

Parameter Datentyp Description


Ctrl Control Control the font properties of which are to be set.
wType Integer 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
size Variant 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.

 Siemens AG 2003 All Rights Reserved


7-322 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 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. Typi-
cally, the procedure subSetTFrmAttr is called up when the form concerned is dis-
played 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 Datentyp Beschreibung


Frm Control Control the font properties of which are to be set.
wType Integer 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
size Variant This parameter is optional. If it is set and has the va-
lue True, the font size is converted in addition to the
currently set resolution.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-323
Sequence control 03.03
7.7 Procedures and functions

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 Data type Description


IpApplication String section name
Name
IpKeyName String key name
IpDefault String default return value
IpReturnedStr String returned entry
ing

 Siemens AG 2003 All Rights Reserved


7-324 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.7 Procedures and functions

Table 7-52 Arguments of ALGetPrivateProfileString

Argument Data type Description


nSize Long size of IpReturnedString
IpFileName String INI file name

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 en-
tries. If ‘IpFileName’ is followed only by the file name, the function takes into consi-
deration 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 Data type Description


IpApplication String section name
Name
IpKeyName String key name

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-325
Sequence control 03.03
7.7 Procedures and functions

Table 7-53 Arguments of ALGetPrivateProfileInt

Argument Data type Description


nDefault Integer default return value
IpFileName String INI file name

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 consi-
deration 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 Data type Description


IpApplication String section name
Name
IpKeyName String key name

 Siemens AG 2003 All Rights Reserved


7-326 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.8 Horizontal and vertical softkeys

Table 7-54 Argument of ALGetPrivateProfileString

Argument Data type Description


IpString String value the key has to get
IpFileName String INI file name

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 la-
bels respectively for indicating the softkey currently pressed.

8
9
10
11
12
13
14
15
0 1 2 3 4 5 6 7

Fig. 7-3 Softkey numbering

The horizontal softkeys range from 0 to 7, the vertical ones from 8 to 15, the RE-
CALL--key is located on 16.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-327
Sequence control 03.03
7.8 Horizontal and vertical softkeys

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 applica-
tions.

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.

 Siemens AG 2003 All Rights Reserved


7-328 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.8 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 WIN-
DOWS 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 soft-
key, this file name is interpreted as the name of a bitmap (type BMP). It is comple-
ted 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 bit-
map 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 03.03
7.8 Horizontal and vertical softkeys

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 PROGNA-
ME.INI:
Example 7-18 Number of softkeys
[CONTROL]
NbrHorSoftkeys = 4 ;number of horizontal softkeys = 4
NbrVerSoftkeys = 0 ;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.

 Siemens AG 2003 All Rights Reserved


7-330 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.8 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 03.03
7.8 Horizontal and vertical softkeys

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/ access Htext Vtext Childs Return Z -- Flag / Commen


action level succeedin t
g state
999 ”description of state 10 with softkey bar extended by ETC”
10 0\8\16 vt0 ”Figure ”abc” 1 ” state10
1” with
softkey
bar
extended
by ETC ”
0 --1 --1 ”a1” ”” ”SK0” 17 ”Softkey0

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 meaning
0 Softkey texts of the standard bar
1 Softkey texts of the extension ETC1
2 Softkey texts of the extension ETC2

 Siemens AG 2003 All Rights Reserved


7-332 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.8 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, By-
Val EtcLevel As Integer)

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 7-333
Sequence control 03.03
7.8 Horizontal and vertical softkeys

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, By-
Val EtcLevel As Integer)

 Siemens AG 2003 All Rights Reserved


7-334 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Sequence control
7.9 Global variables of the Sequence Control

7.9 Global variables of the Sequence Control

General
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 03.03
7.10 The Menu Tree Generator

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).

 Siemens AG 2003 All Rights Reserved


7-336 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Interface HMI <=> NCK/PLC 8
Overview
The NCDDE Server provides the following three services for the developers of ap-
plications:
Variable Service accessing NC, PLC and drive data

OPC-DataAccess
via

DCTL-Control
or
Domain Service copying files from HMI to NCK and vice versa
file access via data management
IMC-File
with

IADS
and
FileViewer-Control
or
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 03.03
8.1 General

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
OPC/
FileViewer Sinumerik
Control server
NCDDE M M SINUMERIK
Application
server P P 840D/PLC
I I
DCTL
Control

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.

 Siemens AG 2003 All Rights Reserved


8-338 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 DDE is communication between WINDOWS applications
S DDE is executed with two processes following the client--server model
S One process acts as client : it requests data from the server.
S The other process acts as server: it provides the data for the client.
S The connection is established by the client
S A program may act as server as well as client.
S 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 name of the DDE Server
S Link Topic subject
S Link Item the data item to be accessed
S Link Mode type of the connection

DDE Link--Mode
S Request The client inquires data only once.
S Warmlink The Server informs the client of data having been changed.
Then the client can access this data item.
S Hotlink If the data has been changed, the Server automatically
supplies the current data value to the client.
S Poke The client instructs the Server to write a data item.
S Execute 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 03.03
8.3 Configuring the NCDDE Server

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 Ser-
ver and the Link Topic are defined with which the local NCDDE Server must esta-
blish the connection.
By editing four lines in the section [GLOBAL] of the file MMC.INI the NCDDE Ser-
ver 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 connec-
ted 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.

 Siemens AG 2003 All Rights Reserved


8-340 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.3 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 instal-
led 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 03.03
8.3 Configuring the NCDDE Server

Example 8-1 Excerpt of the file MMC.INI


[GLOBAL]
; for using M:N function set NcddeMachineName=MachineSwitch
; for working without NC set NcddeMachineName=local
; for working with SIMNC set NcddeMachineName=SIM1
; for connecting to a NC set NcddeMachineName=NCU840D
NcddeMachineName=local
; 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 set NcddeMachineNames=net,NCU840D
; for working without NC set NcddeMachineNames=
; for working with SIMNC set NcddeMachineNames=SIM1
; for connecting to a NC set NcddeMachineNames=NCU840D
NcddeMachineNames=
; 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 MA-
CHINE. In this case the program creates local variables which overdefine the ’si-
mulation variables‘.

 Siemens AG 2003 All Rights Reserved


8-342 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.3 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 des-
cribed 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. Ex-
ample 8--2 shows a Link--Item (LastError) and the structuring of the global varia-
bles 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 03.03
8.3 Configuring the NCDDE Server

8.3.3 Connecting several NCs

M:N -- feature
This feature allows to connect several MMCs to several NCUs. You can e.g. ac-
cess 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--confi-
guration:
BTSS 1,5 Mbit
MPI 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.

 Siemens AG 2003 All Rights Reserved


8-344 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.3 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 be-
havior 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 03.03
8.3 Configuring the NCDDE Server

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 procedu-
res resp. enabled again after their termination. To do this, the functions Lock-
CurrentNCU/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 “machines-
witch” (KinkItem).

 Siemens AG 2003 All Rights Reserved


8-346 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.4 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 ac-
cess 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 con-
nections 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|llo-
cal”).

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 8-347
Interface HMI <=> NCK/PLC 03.03
8.4 Establishing a DDE connection

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 NcddeServi-
ceName 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/actToolBase-
Pos[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

 Siemens AG 2003 All Rights Reserved


8-348 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.4 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 au-
tomatically. 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


Sub Form_Load ( )
Label1.LinkTopic = ”ncdde|ncu840D”
Label1.LinkItem = ”/PLC/Input/Byte[1]” Label1.LinkMode = 3
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 03.03
8.4 Establishing a DDE connection

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.

 Siemens AG 2003 All Rights Reserved


8-350 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.4 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 acknow-
ledgment) 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 idInst; // created with DdeInitialize
HSZ hszService, hszTopic, hszItem; // String Handles
HCONV hConv; // Conversation Handle

hszService = DdeCreateStringHandle ( idInst , ”ncdde” , NULL );


hszTopic = DdeCreateStringHandle ( idInst , ”local” , NULL );
hszItem = 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 03.03
8.5 Variable Service

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 A
1 =ncdde|ncu840D!’/Plc/DataBlock/Bit[c100,9.3]’ 1 1

Left you see the cell formula, right the resulting, continuously updated display.

8.5 Variable Service

Overview

OPC Data
Access to variables of the NC is carried out either via
DCTL Control
or via the .
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.

 Siemens AG 2003 All Rights Reserved


8-352 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, floa-
ting number and text.
The format is specified as an extended ‘printf’--format of the high level program-
ming language C. The syntax of a NCDDE format instruction is:
format: ”” <arguments> <‘printf’ format>
arguments: ‘!’ ‘b’ <arguments> // converting to a bit--string
‘!’ ‘d’ <arguments> // d for double as 64bit float
‘!’ ‘l’ <arguments> // l for long as 32bit integer
‘!’ ‘t’ <arguments> // t for text as a string
‘!’ ‘#’ <arguments> // # , 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 format-
ting 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 03.03
8.5 Variable Service

Converting to hexadecimal format


In this example the flag byte 5 is read from the PLC and then displayed with lea-
ding 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 con-
tains the NCDDEServiceName and the NcddeMachineName as they have been
entered in the file MMC.INI. They are separated by the pipe symbol (”|”).

 Siemens AG 2003 All Rights Reserved


8-354 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 compa-
red 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 03.03
8.5 Variable Service

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 description
variable name name of the NCK/PLC variable (see chapter 11)
c 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.
u unit index only for NCK variables (e.g. channel):
u stands for unit
StartIndex index of the variable to be read
when accessing arrays this gives the first value to be read
EndIndex for array access only
(optional) specifies the number of values to be read

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 extrac-
ted from this result string.

 Siemens AG 2003 All Rights Reserved


8-356 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 03.03
8.5 Variable Service

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

 Siemens AG 2003 All Rights Reserved


8-358 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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.

IMC File IADSl


For transfer between HMI and NCK/PLC, ,
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 description
COPY_TO_NC copy from MMC to NCK with additional information
COPY_TO_NC_BINARY copy from MMC to NCK without additional
information
COPY_FROM_NC copy from NCK to MMC with additional information
COPY_FROM_NC_BINA copy from NCK to MMC without additional
RY information
MAP_ACC_NC 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 03.03
8.6 File transfer Services (Domain Services)

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).

 Siemens AG 2003 All Rights Reserved


8-360 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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 description
WinFile source or destination of the information in the MMC
area
NcFile file name for the NCK/PLC environment
TransferState 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 inc-
lude 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 indi-
cates 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 03.03
8.6 File transfer Services (Domain Services)

Shared Memory access with the argument WinFile


If the first character of WinFile is a #--character followed by a number in hexadeci-
mal 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; // buffer handle (HGLOBAL) (is preset by
// the client)
unsigned short header_size; // header length (is preset by the client)

unsigned long shared_size; // usable length of the data area


// (is preset by the client)

unsigned long fill_count; // number of valid bytes in the data area


// (is preset by the client during download
// and set by the Server during upload)

unsigned long state; // 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 file_mod_time; // file modification time


// (is preset by the client during download
// and set by the server during upload)

unsigned long server_private; // server-specific data (is set by the server)

unsigned long client_private; // client-specific data (is set by the client)

unsigned long magic; // signature for an additional type check


// the value is always NCDDE_MAGIC = 0xF6F7F8F9
// (preset by the client)
};

 Siemens AG 2003 All Rights Reserved


8-362 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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 which area: PLC or NC
/_N_MPF_DIR path specification for the NC
/_N_WS03_MPF 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 number meaning


transfer is started 0 The opening protocol to the CNC is
being handled.
transfer is running 1 to 98 Transfer is running. The number
approximately reports the
percentage of the file, that already
has been transferred (see note).
transfer is terminated 99 The closing protocol to the CNC is
being handled.
transfer successful 100 The job has been executed without
error
transfer stopped with error > 100 Transfer is stopped. TransferState
code contains the reported error code
(chapter 11.7).

The range of value has been chosen, so that values <=100 indicate normal condi-
tions, 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 03.03
8.6 File transfer Services (Domain Services)

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 varia-
ble FILE$ of the type “String”. From VB you can access these Data with the func-
tions Memoryread and -write only. You can utilize this feature much better with
C++.

 Siemens AG 2003 All Rights Reserved


8-364 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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 Function MemoryWrite Lib ”toolhelp.dll” (ByVal wSel%, ByVal dwOffset&, lpvBuf
As Any, ByVal dwcb&) As Long
Declare Function MemoryRead Lib ”toolhelp.dll” (ByVal wSel%, ByVal dwOffset&, lpvBuf
As Any, 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 03.03
8.6 File transfer Services (Domain Services)

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

 Siemens AG 2003 All Rights Reserved


8-366 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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 03.03
8.6 File transfer Services (Domain Services)

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.

 Siemens AG 2003 All Rights Reserved


8-368 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 File transfer Services (Domain Services)

Table 8-5 Arguments of the commands COPY_TO/FROM_NC

name description
WinFile source or destination of the information in the MMC area
NcFile file name in the NC/PLC environment
seekPos seek pointer: Starting point of the copy procedure
identifier B for block or C for character
seekLen window size: area to be transferred
identifier B for block or C for character
compareString search string, maximum length is 32 characters
skipCount 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 03.03
8.6 File transfer Services (Domain Services)

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 pre-
pare 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.

 Siemens AG 2003 All Rights Reserved


8-370 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 File transfer Services (Domain Services)

Table 8-6 Arguments of the command MAP_ACC_NC

name description
WinFile source or destination of the information in the MMC area
NcFile file name in the NC/PLC environment
TransferState variable characterizing the state of the transfer
Area 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
DataBlock Module type for Variable Service: Numerical hexadecimal
value ranging from 00 to FF, described in chapter 11.3.1, for
example (excerpt):

module identification module number


system state data (Y) 10
global user data (GUD) 17
OEM tool data (TU) 24
magazine directory (TMV) 2B
Timeout Monitoring the execution time of a NC--MMC transaction in
seconds
Prefix 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 ; global NCK user variable MGUD
/NC/_N_CH02_GUD_ACC ; global user variable in the 2nd channel
/NC/_N_AX_SEA_ACC ; axis specific setting data
/NC/_N_CH_TEA_ACC ; 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 03.03
8.6 File transfer Services (Domain Services)

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/)

 Siemens AG 2003 All Rights Reserved


8-372 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.6 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 03.03
8.7 PI Services

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
PI.hlp
found in .
The PI Services of the NCDDE Server are:
PI_START instructs the NCK to execute a command
PI_START_BINARY instructs the PLC to execute a command
PI_STOP instructs the NCK to stop the execution of a command
PI_STOP_BINARY instructs the PLC to stop the execution of a command
PI_RESUME instructs the NCK to resume a stopped execution
PI_RESUME_BINARY 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 diffe-
rent 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.

 Siemens AG 2003 All Rights Reserved


8-374 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 ex-
ecution 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, ””@1d1@1d0@@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,
””@1d1@1d0@@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 03.03
8.8 More NCDDE Server commands

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 meaning
NEW create local variables
FREE delete variables
ANIMATE continuously change a local variable
CALL execute NCDDE--commands in files
PLC_ reset the PLC memory
MEMORYRESET

NEW
Description
Creates a local/internal variable in the NCDDE Server which can then be acces-
sed.
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 (VarName , value)
Arguments

Table 8-8 Arguments of NEW

argument syntax description


VarName <string> name of the variable to be created
value <number> 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.

 Siemens AG 2003 All Rights Reserved


8-376 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.8 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 (Hot-
links) to the variables, these links are removed. Other transactions with the NCK
and PLC are aborted.
Syntax
FREE (VarName)
Argument

Table 8-9 Arguments of FREE

argument syntax description


VarName < String > 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 03.03
8.8 More NCDDE Server commands

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 approxi-
mately 1 second.
Application
Used for testing your application.
Syntax
ANIMATE (VarName)
Argument

Table 8-10 Arguments of Animate

argument syntax description


VarName < String> 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)

 Siemens AG 2003 All Rights Reserved


8-378 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.8 More NCDDE Server commands

Argument

Table 8-11 Arguments of CALL

argument syntax description


FileName < string > 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 me-
mory. Specify /PLC as area address.
Application
Resets the PLC memory
Syntax
PLC_MEMORYRESET(AreaAddr)
Argument

Table 8-12 Argument of PLC_MEMORYRESET

argument syntax descriptions


AreaAddr < String > area address

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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

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 communica-
tion. 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 resour-
ces.
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 applica-


tions from 16Bit versions to 32Bit versions. (See also Chapter ”Transfer of VB ap-
plications from 16Bit to 32Bit.)

 Siemens AG 2003 All Rights Reserved


8-380 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 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 capabili-
ties. 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 tem-
porarily. 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. Additio-
nally it makes the BASIC programming easier.
S Avoiding side effects:
Typical side effects of Visual Basic Controls like aborting programmed connec-
tions 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 applica-
tion of the DCTL.OCX.

Properties
Most properties of the DCTL.OCX--Control correspond to the properties of Visual
Basic standard controls. These include:
S Style properties
S Color properties
S Base properties
S Drag properties
S 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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

S DDE properties
S HorAlignment property
S VertAlignment property
S WordBreak property
S TabSize property
S LastError property
S Data property
S DataToCaption property
S LinkCmd property
S LinkNext property
S 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 property
LeftJustify left justified (default)
RightJustify right justified
HorCenter centered

VertAlignment/Multiline property
This property controls the vertical text justification of the caption display; alternati-
vely 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 property
VertCenter vertically centered (default)
TopJustify top justified
BottomJustify bottom justified
MultiLine multiline

 Siemens AG 2003 All Rights Reserved


8-382 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 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 property
False word wrap by CR/LF (carriage--return line--feed sequence)
True 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 argument


Request requested variable value, if the ”DataToCaption” property is
set FALSE
Advise Link updated values, if the ”DataToCaption” property is set
FALSE
Poke value to be transferred
Execute 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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

DataToCaption property
The DataToCaption property determines the destination of data received by DDE--
transactions.

Table 8-17 Data destination

value meaning
True data destination is the Caption property
False 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. change to DDE activity terminated


by
1 Advise Link Establishes an AdviseLink. Returns Stop
after the Advise Link has been
established. The AdviseLink can be
deleted by the Stop command.
2 Advise Link_ Like ”1 -- AdviseLink”, additionally action Stop
NotifyData (1) when DDE Data have been
received.
3 Advise Link_ Like ”1 -- AdviseLink”, additionally action Stop
NotifyDataWhenVi (2) when DDE Data have been
sible received.
4 Advise LinkAsync Establishes an AdviseLink. Returns Stop
before the Advise Link has been
established. The AdviseLink can be
deleted by a Stop Command.
5 Advise LinkAsync_ Like ”4 -- AdviseLinkAsync”, additionally Stop
NotifyData action (1) when DDE Data have been
received.
6 Advise LinkAsync_ Like ”4 -- AdviseLinkAsync”, additionally Stop
NotifyDataWhenVi action (2) when DDE Data have been
sible received.
7 Stop Deletes an AdviseLink. Returns after itself
the AdviseLink has been deleted.
8 StopAsync Deletes an AdviseLink. Returns before Sync
the AdviseLink has been deleted.
9 StopAsync_ Like ”8 -- StopAsync”, additionally action Sync
Notify (1) when the deletion has been
completed

 Siemens AG 2003 All Rights Reserved


8-384 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 OEM--Visual Basic Controls (OCX files)

Table 8-18 LinkCmd property

no. change to DDE activity terminated


by
10 StopAsync_ Like ”8 -- StopAsync”, additionally action Sync
NotifyWhenVisible (2) when the deletion has been
completed
11 Request Reads a DDE variable. Returns after itself
the reading has been completed.
12 RequestAsync Reads a DDE variable. Returns before Sync
the reading has been completed.
13 RequestAsync_ Like ”12 -- RequestAsync”, additionally Sync
Notify action (1) when reading has been
completed
14 RequestAsync_ Like ”12 -- RequestAsync”, additionally Sync
NotifyWhenVisible action (2) when reading has been
completed
15 Execute Sends a command to the server. itself
Returns after the execution of the
command is completed.
16 ExecuteAsync Sending a command to the server. Sync
Returns before the execution of the
command is completed.
17 ExecuteAsync_ Like ”16 -- ExecuteAsync”, additionally Sync
Notify action (1) when the execution of the
command has been completed.
18 ExecuteAsync_ Like ”16 -- ExecuteAsync”, additionally Sync
NotifyWhenVisible action (2) when the execution of the
command has been completed.
19 Poke Writes a DDE variable. Returns after itself
the writing has been completed
20 PokeAsync Writing a DDE variable. Returns before Sync
the writing has been completed.
21 PokeAsync_Notify Like ”20 -- PokeAsync”, additionally Sync
action (1) when writing has been
completed.
22 PokeAsync_ Like ”20 -- PokeAsync”, additionally Sync
NotifyWhenVisible action (2) when writing has been
completed.
23 Sync Terminates asynchronous commands itself
like synchronous commands. No
operation if there is no asynchronous
command working.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 8-385
Interface HMI <=> NCK/PLC 03.03
8.9 OEM--Visual Basic Controls (OCX files)

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 crea-
ted by WINDOWS, the pixel in the upper left corner of the control is held invalida-
ted 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 connec-
tions of the other activities (excluding hotlink ) are dynamically created and dele-
ted. Because of that and since a DCTL Control does not own a window, the de-
mand 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 se-
parates 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.

 Siemens AG 2003 All Rights Reserved


8-386 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 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 stan-
dard controls as:
S Click
S DblClick
S MouseDown
S MouseMove
S MouseUp
S DragDrop
S DragOver
S KeyDown
S KeyPress
S 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 para-
graph 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 proce-
dure. 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 un-
necessarily 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 im-
mediately 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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

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 imme-
diately 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

 Siemens AG 2003 All Rights Reserved


8-388 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 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 con-
trol. 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 perfor-
med. 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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

Example 8-48 Speeding up doing things in parallel


Sub Form_Load ( )
’ start reading variable 1
Dctl1.LinkItem = ”/Channel/Parameter/R[1]” ’the variable name
Dctl1.LinkCmd = 12 ’ initiates the reading
’ start reading variable 2
Dctl2.LinkItem = ”/Channel/Parameter/R[2]” ’ the variable name
Dctl2.LinkCmd = 12 ’ initiates the reading
’ start reading variable 3
Dctl3.LinkItem = ”/Channel/Parameter/R[3]” ’ the variable name
Dctl3.LinkCmd = 12 ’ initiates the reading
’ start a hotlink into display
Dctl4.LinkItem = ”/Channel/Parameter/R[4]” ’ the variable name
Dctl4.DataToCaption = TRUE ’ that’s default, can be omitted
Dctl4.LinkCmd = 4 ’ creates the hotlink
’ start a command execution
Dctl5.Data = ”Pi_start(/NC,001,_N_SET_OF)” ’ the command
Dctl5.LinkCmd = 16 ’ 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.
Dctl1.LinkCmd = 23 ’ wait until variable 1 read
Dctl2.LinkCmd = 23 ’ wait until variable 2 read
Dctl3.LinkCmd = 23 ’ wait until variable 3 read
Dctl5.LinkCmd = 23 ’ 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.
End Sub

Speeding up DDE: text arrangement


Assume you need to display many data items at high frequency. Then your pro-
gram 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 requi-
rement. Fitting to these features the DCTL control provides multiline display and
index filtering.

 Siemens AG 2003 All Rights Reserved


8-390 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.9 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 chan-
ges. 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 03.03
8.9 OEM--Visual Basic Controls (OCX files)

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
...

 Siemens AG 2003 All Rights Reserved


8-392 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.10 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 03.03
8.10 Diagnosis features for NCDDE--access

Hotlinks
Here a list is created which contains all existing Advise Links (Hotlinks and Warm-
links). It is organized as a 5--column--table with the following meanings:

Table 8-19 Hotlinks

column info remarks


1 PDU reference internal value: possible PDU reference for
communicating with the NCU and the PLC
2 Advise Link LOCAL link to a local variable
REMOTE link to an external variable
PILED external Advise Link was added to
another job
3 Update time time of the last refresh PDU in an internal time unit
of the NCDDE Server
4 LastError LastError specification following chapter 11.14 of
variable 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.
5 Variable name variable name following chapter 11.

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 sta-
tus, the Hotlinks and the variables of the NCDDE Server.

DDE Test
Pressing this button starts a testing program ”DDETEST.EXE” featuring the follo-
wing:

Table 8-20 DDE testing commands

command action meaning


Passive none reset state, no function active
Hotlink start establish Advise Link
Request DoIt read variable

 Siemens AG 2003 All Rights Reserved


8-394 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.10 Diagnosis features for NCDDE--access

Table 8-20 DDE testing commands

command action meaning


Poke DoIt write variable
Execute DoIt execute a service

Specify the installed NC under Service|Topic e.g.: NCDDE|NCU840D. ”DE-


FAULT_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 dif-
fers 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

value meaning
0 normal operation
1 some connections with CNC broke down
2 all connections with CNC broke down
3 interpreting the startup file
4 server initialization

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 8-395
Interface HMI <=> NCK/PLC 03.03
8.10 Diagnosis features for NCDDE--access

8.10.3 Troubleshooting

Error--messages from NCK


Error conditions as for example lack of resources, access violations, wrong opera-
ting mode etc. are communicated from NCK via acknowledgments of transactions.
If the NCDDE Server cannot handle these error conditions, the according transac-
tions 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 para-
graph 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 ser-
ver tries to resume the broken connection with the CNC. The state of the connec-
tion 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 connec-
tion 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.

 Siemens AG 2003 All Rights Reserved


8-396 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.11 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 ma-
kes 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 net-
work 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 MMC 102

OEM-- OEM-- DDE M M


NCDDE-- P P SINUMERIK
application application Server I 840D/PLC
I

Windows e.g. Ethernet Wondows


network link 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 03.03
8.11 How to configure the NCDDE Server for access via network

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 ”Net-
work 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 entry meaning


Share Name NCU840D$ identifier of the HMI, under which it is known
in the network
Application ncdde name of the application that shall become
Name available for the system via network access
Topic Name NCU840D 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
Access Type Full write/read access without password lock

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

 Siemens AG 2003 All Rights Reserved


8-398 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.11 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 star-
ted, 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 03.03
8.11 How to configure the NCDDE Server for access via network

Starting sequence of the servers


Before the NCDDE communication is started via network, the NCDDE Server loca-
ted on the client system (in this case MMC 103) must be started. Then the WIN-
DOWS PC is started again, so the changes made in the files MMC.INI and RE-
GIE.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 ex-
ternal 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 dif-
ferent Share Names with DDESHARE.EXE.

 Siemens AG 2003 All Rights Reserved


8-400 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.12 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 ac-
cessing 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 inter-
preted 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--acces-
ses may not be mixed in one job. Furthermore access to channel--specific va-
riables 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 ex-
ceeds 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 03.03
8.12 Extensions of the NCDDE server

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 ac-
cess. 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.

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).

 Siemens AG 2003 All Rights Reserved


8-402 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.13 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 run-
ning in one channel.
The same applies to local user data.
First of all you have to define and activate user variables, before the NCDDE--Ser-
ver can access them. For clustering the variables you then have to create and em-
bed the corresponding NSK files. This is done in five steps:
1. create a definition file
2. copy this definition file to the directory /_N_DEF_DIR of the NCK
3. activate the user data as *.ACC--file by loading an INITIAL.INI file.
4. create the *.NSK--file with the MAP command
5. 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 _N_GUD_DEF for GUD
S _N_SGUD_DEF for GD1 = SGUD global data Siemens
S _N_MGUD_DEF for GD2 = MGUD global data machine tool builder
S _N_UGUD_DEF for GD3 = UGUD global data user
S _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 ac-
cording 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 03.03
8.13 Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

Defining global data


Global data are defined by:
S definition header DEF
S area NCK or CHAN
S type e.g. REAL or INT
S variable name e.g. LIFTOFF_DIST
S dimension in square brackets
S comment 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 le-
vel in the NCK must be located in the directory /_N_DEF_DIR. It includes:
S program identifier in the first line
S comment line with path specification (will be evaluated )
S definitions
S terminating instruction M02, M17 or M30.
Example 8-55 Defining global variables in the NCK
%_N_MGUD_DEF
; $PATH=/_N_DEF_DIR
DEF NCK REAL RUECKZUG ; defining a global variable
DEF CHAN INT TABELLE[100] ; defining a channel-specific array
DEF CHAN REAL BLF_OFFS_X ; defining a channel-specific variable
M17 ; 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 ; defining a global variable
DEF CHAN INT TABLE[100] ; defining a channel-specific array
DEF CHAN REAL BLF_OFFS_X ; defining a channel-specific variable
M17 ; terminate this line with RETURN

 Siemens AG 2003 All Rights Reserved


8-404 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.13 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 for the global user variables
_N_CH_GD2_ACC 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 03.03
8.13 Accessing global user variables GUD, SGUD, MGUD, UGUD, GD3 to GD9

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 : file name in the WINDOWS environment
/NC/_N_CH_GD2_ACC : NC domain
trans : variable TransferState
2 : area channel
2D : module type MGUD
10 : time limit of the transaction 10s
/ACC/CH/MGUD : 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

 Siemens AG 2003 All Rights Reserved


8-406 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Interface HMI <=> NCK/PLC
8.13 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 03.03
8.14 Online--help for variables

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 WIN-
DOWS 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 e.g. spindle type
name of the variable e.g. variable spindleType
short description of the module 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.

 Siemens AG 2003 All Rights Reserved


8-408 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 check connection cable


S check installation of MPI drivers
S check MMC.INI
S WINSTART.BAT
S 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 03.03
8.16 Determining the active bus nodes

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 deter-
mine 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 va-
riable /Nck/Nck/BusState. The system outputs a 32-bit value in which set bits dis-
play 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.

 Siemens AG 2003 All Rights Reserved


8-410 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Alarms (Alarm Handling) 9
Overview
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
... is intended to trace alarms and events

IMC-EventList
... provides a list of all existing alarms and events

IMC-EventCreation
... is intended to create HMI alarm

System alarms/messages
The following alarms/messages may occur in the system:
S NCK alarms
S drive alarms
S cycle program alarms
S PLC alarms
S Compile--Cycles alarms
S PLC messages
S 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) 03.03
9.1 Communication

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 featu-
res of the Alarm Server.
The following must be specified for each communication job:
S Service name of the DDE--Server to be addressed
S Topic topic of the connection
S Item data to be accessed
S Mode 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)

 Siemens AG 2003 All Rights Reserved


9-412 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&Event- DDE communication


Server

Alarm Server
(MBDDE.EXE)

NCDDEServer Protocol files

MPI

MPI
SINUMERIK 840D
(NCK/PLC)

Fig. 9-1 Communication with the registry module

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) 03.03
9.2 Types of Services (DDE link mode)

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 meaning


Execute requests a service from the Server
example: generating an alarm message
Advise instructs the Server to monitor certain data.
( Hotlink ) If these data are changed the client will be informed or the
data will be updated automatically.
Request 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 contents
9.3.1 Commands of the Alarm Server
9.3.2 Advise variables of the Alarm Server
9.3.3 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.

 Siemens AG 2003 All Rights Reserved


9-414 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.3 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 syntax description


Quitvar <string> name of the acknowledgment variable

Example 9-1 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 description
No the identification number of the alarm to be set
Prio 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.
Var1 ... the contents of the variables to be inserted in the alarm string
Var4 to be displayed. Up to four variables (%1 to %4) may be
specified (optional)

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 9-415
Alarms (Alarm Handling) 03.03
9.3 Services of the Alarm DDE Interface

Table 9-4 Arguments of AlarmMsg

arguments description
TimeData 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 type of the alarm 1 PowerOn
2 Reset
3 Cancel
4 NC--Start
NCU name of the NCU
Quitvar the acknowledgment variable

Example 9-2 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 Re-
quest.
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.

 Siemens AG 2003 All Rights Reserved


9-416 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.3 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) 03.03
9.3 Services of the Alarm DDE Interface

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 alarm number
100 priority of the alarm
NCU_1: channel ... name of the NCU and the alarm text
03.01.97 ... date and time
0 display area ”message line”
12 acknowledgment variable ”12”
NEW internal value of the acknowledgment variable
5 alarm type ”NC--Start”
NCU sender of the alarm: ”NCU_1”
hlp\alarm_GR.hlp path and name of the help file
12080 again the alarm number

 Siemens AG 2003 All Rights Reserved


9-418 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.3 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) 03.03
9.3 Services of the Alarm DDE Interface

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

 Siemens AG 2003 All Rights Reserved


9-420 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.3 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 description
alarmNo 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) 03.03
9.3 Services of the Alarm DDE Interface

Example 9-9 Inquiring the alarm text corresponding to alarm no. ”12080”
(AlarmTextForID)
Sub Form_Load ( )
Label1.LinkTopic = ”mbdde|alarme”
Label1.LinkItem = ”AlarmTextForID(12080)”
Label1.LinkMode = 2
Label1.LinkRequest
End Sub

Result:
012080 0 0 ”channel %1 block %2 syntax error in text %3 ”
012080 alarm number
0 display area (here: message line)
0 helpfileId (here: File0)
”channel ...” 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 num-
ber.
Syntax
HelpForID(alarmNo)
Argument

Table 9-6 Arguments of HelpForID

argument description
alarmNo 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

 Siemens AG 2003 All Rights Reserved


9-422 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.4 Initializing the Alarm Server

9.4 Initializing the Alarm Server

Files
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 meaning
Alarms general information concerning the alarm list.
example: time and date format of the registry entries
TextFiles 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).
Helpcontext names and paths of the help files
example: File0=hlp\alarm_
DEFAULTPRIO default definition of the priorities of the different alarm types
example: POWERON=100
PROTOCOL characteristics of the log file
example: file=.\proto.txt
name and path of the log file
KEYS information about the keys that may be used to clear an alarm
example: Cancel=+F10
clear alarm with the key combination Shift+F10

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 9-423
Alarms (Alarm Handling) 03.03
9.4 Initializing the Alarm Server

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 (descri-
bed 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 ope-
ned.

 Siemens AG 2003 All Rights Reserved


9-424 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.4 Initializing the Alarm Server

Example 9-12 Section [TextFiles] in the file MBDDE.INI (Voreinstellung)


[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_ ;cycles alarms
CZYK=\dh\mb.dir\alc_ ;Compile--Cycles alarms
UserMMC= ;user defined MMC alarms
UserNCK= ;user defined NCK alarms
UserPLC= ;user defined PLC alarms
UserZYK= ;user defined cycles alarms
UserCZYK= ;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” af-
ter 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) 03.03
9.4 Initializing the Alarm Server

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’.

 Siemens AG 2003 All Rights Reserved


9-426 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.4 Initializing the Alarm Server

The alarm text file contains the data in the following format:
100001 0 0 ‘Function has not yet been implemented!’
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 ).

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) 03.03
9.4 Initializing the Alarm Server

Sektion [PROTOCOL]
Description
This section defines different characteristics of the protocol that specifies how par-
ticular 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 Nr alarm number
S Prio priority
S Mode message/alarm line or dialog box
S Type alarm type ( PowerOn, Cancel, ... )
S From sender of the alarm
S Quitvar acknowledgment variable
RELATION:
S ’:’ equal
S ’<’ less than
S ’>’ greater than
S ’!’ not
CHARACTERISTICS:
S numbers
S strings
OPERATORS
S ’,’ comma stands for a logical or, only inside a filter
S ’’ space stands for a logical and between different filters
S ’##’ pipe stands for a logical or between different filters
S ’##’ Pipe bedeutet log. oder zwischen einzelnen Filtern.

 Siemens AG 2003 All Rights Reserved


9-428 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.4 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 con-
tents 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 con-
trols, 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 The protocol file is saved immediately after a change (like earlier
behavior).
DiskCare = n 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) 03.03
9.4 Initializing the Alarm Server

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 sy-


stem, too.

Section [MmcAlarmDisable]
Description
The sender identifications which are entered here are disabled and will not be ac-
cepted in the AlarmMsg--job. In MBDDE.INI ”PLC”, ”NCU” and ”MBDDE” are disa-
bled by default.
Example 9-18 Section [MmcAlarmDisable] in the file MBDDE.INI
[MmcAlarmDisable]
DisableSenderOfMmcAlarm0 = PLC
DisableSenderOfMmcAlarm1 = NCU
DisableSenderOfMmcAlarm2 = MBDDE
DisableSenderOfMmcAlarm3 = .....

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

 Siemens AG 2003 All Rights Reserved


9-430 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.4 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. Ex-
ample:
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 Shortcut
Chinese (peoples CH
republic)
Chinese (Taiwan) TW
English GB
French FR
German GR
Italian IT
Korean KO
Spanish SP

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 meaning
alarmNo alarm number
display 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) 03.03
9.4 Initializing the Alarm Server

Table 9-9 Contents of the alarm text file

entry meaning
help--Id assigning a help file to the alarm
text 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”

 Siemens AG 2003 All Rights Reserved


9-432 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Alarms (Alarm Handling)
9.5 Alarm areas of the Sinumerik 840D

9.5 Alarm areas of the Sinumerik 840D

Table 9-10 Areas of alarm numbers

alarm number alarm area alarm text file


NCK alarms
000 000 to 009 999 general alarms ALN_xx.COM
010 000 to 019 999 channel alarms ALN_xx.COM
020 000 to 029 999 axis/spindle alarms ALN_xx.COM
030 000 to 039 999 functional alarms
040 000 to 059 999 reserved
060 000 to 062 999 cycle alarms SIEMENS ALZ_xx.COM
063 000 to 064 999 reserved
065 000 to 067 999 cycle alarms user
068 000 to 069 999 reserved
070 000 to 079 999 Compile--Cycles and OEM ALN_xx.COM,
alarms ALC_xx.COM
080 000 to 099 999 reserved

MMC alarms/messages
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 MMC 101
120 000 to 129 999 MMC 103 ALM_xx.COM
130 000 to 139 999 OEM
140 000 to 199 999 reserved

(200 000 to 299 999 MCU alarms

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 9-433
Alarms (Alarm Handling) 03.03
9.5 Alarm areas of the Sinumerik 840D

Table 9-10 Areas of alarm numbers

alarm number alarm area alarm text file


300 000 to 399 999 drive alarms ALN_xx.COM

PLC alarms/messages
400 000 to 499 999 general alarms ALP_xx.COM
500 000 to 599 999 channel alarms
600 000 to 699 999 axis/spindle alarms
700 000 to 799 999 user area
800 000 to 899 999 execution chains / graphs ALP_xx.COM
810 000 to 810 009 system error messages of ALP_xx.COM
the PLC
900 000 to 999 999 reserved

xx = Language shortcut

 Siemens AG 2003 All Rights Reserved


9-434 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Data Management 10
Overview
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 creating
S deleting
S copying
S listing
S downloading (copy from MMC to NCK, source is deleted)
S uploading (copy from NCK to MMC, source is deleted)
S setting access permission
S perform auxiliary functions.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 10-435
Data Management 03.03
10.1 General

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 Manage-
ment--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 NCDDE server


file system
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: simple requests returning data
S simple Execute jobs: simple requests not returning data
S complex Execute jobs: complex requests returning data. These jobs might
run for a long period of time

 Siemens AG 2003 All Rights Reserved


10-436 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.2 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 meaning
DHSTART root directory of the MMC Data Management on the hard disk
example: mmchome=l:\dh
access permission
example: access level=4
SCEME name of the binary parts of the data scheme
example: sceme=schema.bin

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 03.03
10.2 Directory structure of the Data Management

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 specifica-
tions given in the Data Scheme in order to keep the structures for files and directo-
ries 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 ele-
ments 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 meaning
name name of the file or the directory
extension extension of name in the DOS file system
explanation identifier for displaying the element in readable form
data format directory or file

 Siemens AG 2003 All Rights Reserved


10-438 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.2 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 sy-
stem.
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 ex-
tension.
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: possible display:
explanation name extension
workpieces WPD DIR workpieces
workpiece * WPD shaft1
oder:
parts WPD DIR parts
part * WPD shaft1

Data format
The data format specifies an object of the directory tree to be of type file or direc-
tory.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 10-439
Data Management 03.03
10.2 Directory structure of the Data Management

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 file MMC
DM directory MMC
FN file NCK
DN 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 required: user group


level:
S0 system password SIEMENS
S1 password of the machine tool machine tool builder
builder
S2 password of the service set up staff, service (machine tool
builder)
S3 user password privileged user
(in--house service)
S4 key switch position 3 programmer
S5 key switch position 2 trained operator

 Siemens AG 2003 All Rights Reserved


10-440 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.2 Directory structure of the Data Management

Table 10-3 The 8 level of access permission

access required: user group


level:
S6 key switch position 1 operator
S7 key switch position 0 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 posi-
tion 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 permis-
sion level.
These access masks are described by a 5 digit number.

1st digit 2nd digit 3rd digit 4th digit 5th digit

READ WRITE EXECUTE SHOW 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 03.03
10.2 Directory structure of the Data Management

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 Manage-
ment is provided.
The predefined access mask from the Data Scheme with global validity can not be
modified using this function.

 Siemens AG 2003 All Rights Reserved


10-442 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 exten- name format contents/meaning /use


sion
access ACC * file describes the access to certain
description NCK variables dependent on the
access permission actually set
archive ARC * file data stored on the MMC hard
disk for archiving purposes
boot data BOT * file machine data in binary format
needed for setting NCK and the
611D drives into operation
clipboard CLP CLIP direc--tory directory for temporary stored
files of the Data Management
comment COM * file file containing arbitrary ASCII
text
compensation IKA * file data for interpolated
data compensations
definitions DEF * file data needed by the system
functions as definitions
directory DIR * direc--tory any directory in the directory tree
global user data GUD * file machine--specific user data
(GUD Global User Data)
initialization INI * file machine--specific settings of
program various types of NCK or MMC
data, without specification of a
specific type
machine data TEA * file NCK machine data (TEA Testing
Data Active).
NC data MDN * direc--tory directory of NC machine data.
OEM--specific USR * file any data defined by the OEM
data user
part program MPF * file NC part program of the type
’main program’ or ’subprogram’
part program -- LUD * file local variables defined in the part
specific/local program (LUD Local User Data).
user data
settable zero UFR * file settable zero point offsets and
point offset and frames (UFR User Frame).
frames (UFR
User Frame).

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 10-443
Data Management 03.03
10.3 Elements in the MMC Data Scheme

Table 10-4 Elements of the data scheme

element exten- name format contents/meaning /use


sion
setting data SEA * file setting data (SEA Setting Data
Active).
subprogram SPF * file NC subprogram: Cycles
Programs and all programs to be
called by others
system data SYF * file data needed for the execution of
system functions
tool TOA * file tool compensation (TOA Tool
compensation Offset Active)
workpiece WPD * direc--tory all files needed to completely
directory describe a workpiece for
machining

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.

 Siemens AG 2003 All Rights Reserved


10-444 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: workpieces
extension: DIR
name: WKS
format: directory
attribute: --
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 03.03
10.3 Elements in the MMC Data Scheme

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--speci-
fic 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 di-
rectory (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 resto-
ring 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.

 Siemens AG 2003 All Rights Reserved


10-446 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 pro-
gram only. They may however be stored as a file to give access via the Data Ma-
nagement.

Setting Data
Setting data (SEA Setting Data Active).

Sub program
NC subprogram: Cycles Programs and all programs that are called by other pro-
grams.
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 03.03
10.3 Elements in the MMC Data Scheme

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 pro-
gram 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).

 Siemens AG 2003 All Rights Reserved


10-448 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 creating
S deleting
S copying
S listing
S downloading (copy from MMC to NCK, source is deleted)
S uploading (copy from NCK to MMC, source is deleted)
S setting access permission
S 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: simple requests returning data
S simple Execute jobs: simple requests not returning data
S complex Execute jobs: 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 Link--Server name of the DDE server
S Link--Topic topic
S Link--Item data to be accessed
S Link--Mode link mode

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 10-449
Data Management 03.03
10.4 Functions of the Data Management Server

Table 10-5 Functions of the Data Management (Overview)

function type item meaning


Activate execute: ------ copy a file or directory to the NCK file
complex system, in the same directory
Activate2 execute: ------ like Activate, the source file is not deleted
complex
Best_Datatype request name looks for the data type that matches best
extension the given name and extension
Cancel execute: ------ abort all jobs with the result variable
simple passed
Convert_Possibl request data type List the data types which can be copied to
e_Datatypes extension a data file
Copy execute:co ------ copy a file source to the file destination
mplex
Create execute:co ------ create a file or a directory
mplex
Del execute: ------ delete a file or a directory
complex
Exist execute: ------ check, whether a file exists in NCK or
simple MMC
Extern execute: ------ select a file for execution from external
simple
Get_Attributes request dhpath returns the attributes of a file or a
directory.
Get_Properties request dhpath returns the properties of a file or a
-- mode directory according to the data scheme
Get_ request dhpath supplies the language--dependent shortcut
Propertynames -- mode for the specific bits of the property list
Get_Realpath request dhpath returns the path of a DOS or a NCK file or
-- mode directory
List execute:co ------ read the contents of a directory of the
mplex Data Management.
Passivate execute: ------ transfer a file or a directory from NCK to
complex the MMC file system, in the same
directory.
Possible_ request dhpath lists those data types that can be stored in
Datatypes -- mode a directory of the Data Management
Rename execute:si ------ Rename a data file in NewName
mple
Select execute: ------ select a file for execution in NCK
simple
Set Access execute: ------ set permission of a file or directory
simple

 Siemens AG 2003 All Rights Reserved


10-450 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 Functions of the Data Management Server

Table 10-5 Functions of the Data Management (Overview)

function type item meaning


Startsave execute: ------ Establishing a memory range in the server
simple named
VarName
Stopsave execute: ------ The memory range VarName is released
simple

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 syn-
chronously. 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 re-
quest. 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 con-
tents of the control is updated at the end of the REQUEST--call and may be inqui-
red.
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 03.03
10.4 Functions of the Data Management Server

Best_Datatype
Description
Looks for the data type that matches best the given arguments name and exten-
sion. 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 exten-
sion.
Application
Allows to determine a suitable data type for a certain directory of the Data Mana-
gement.
Syntax
LinkTopic: DHServer|best_data type
LinkItem : name extension
Arguments

Table 10-6 Arguments of Best_Datatype

Argument Description
name name of the file or directory
extension 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

 Siemens AG 2003 All Rights Reserved


10-452 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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: DHServer|convert_possible_datatypes
LinkItem : name extension
Arguments

Table 10-7 Arguments of Convert_Possible_Datatypes

Argument Description
name file name or ”*” as substitute
extension file extension

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 03.03
10.4 Functions of the Data Management Server

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: DHServer|get_attributes
LinkItem : name extension
Arguments

Table 10-8 Argumenzts of Get_Attributes

Argument Description
name directory name
extension file extension

Reading the attributes of the Data Management


Determine possible data types which can be copied to a part program:

 Siemens AG 2003 All Rights Reserved


10-454 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 exten-
sion.
Application
Determines for example, whether a part program may be edited.
Syntax
LinkTopic: DHServer|get_properties
LinkItem : name mode
Arguments

Table 10-9 Arguments of Get_Properties

Argument Description
name name of the Data Management path or file name
mode --m for MMC or --n for NCK

Work piece editable


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 03.03
10.4 Functions of the Data Management Server

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: DHServer|get_propertynames
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

Result: e.g. for german


#editable#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#--#

Note
During start--up of the Data Management server this list is initialized depending on
the selected language.

 Siemens AG 2003 All Rights Reserved


10-456 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 cal-
ling 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: DHServer|get_realpath
LinkItem : dhpath mode
Arguments

Table 10-10 Arguments of Get_Realpath

Argument Description
dhpath name of the Data Management path or file name
mode --m for MMC or --n for NCK

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 03.03
10.4 Functions of the Data Management Server

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: DHServer|possible_datatypes
LinkItem : dhpath [mode}
Arguments

Table 10-11 Arguments of Possible_Datatypes

Argument Description
dhpath name of the Data Management path or file name
mode --m for MMC or --n for NCK

Possible data types


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

 Siemens AG 2003 All Rights Reserved


10-458 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 syn-
tax 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 03.03
10.4 Functions of the Data Management Server

Cancel
Description
Cancels all jobs ( complex Execute jobs ) with the indicated result variable.
Application
Cancels a complex job
Syntax
LinkExecute: cancel DHServer--Variable
Arguments

Table 10-12 Arguments of von Cancel

Argument Description
DHServer-- Variable specified as result variable when a complex
Variable execute job is started

Canceling a job
Cancel a jobs with the result variable ”StatVar”
Example 10-11 Cancel a job
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: all jobs were canceled


Err <>0: command was not executed correctly

 Siemens AG 2003 All Rights Reserved


10-460 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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: exist dhpath mode
Arguments

Table 10-13 Arguments of Exist

Argument Description
dhpath name in the Data Management path
mode --m for MMC or --n for NCK

File exists
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: file exists


Err<>0: 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 03.03
10.4 Functions of the Data Management Server

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: extern dhpath channel
Arguments

Table 10-14 Arguments of Extern

Argument Description
dhpath name
channel 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: selection worked


Err<>0: selection did not work

 Siemens AG 2003 All Rights Reserved


10-462 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 chek-
ked, if the data types are consistent (see the function Convert_Possible_Dataty-
pes)
Application
Renames e.g. work pieces and part programs.
Syntax
LinkExecute: rename dhpath --mode NeuName [datatype] extension
Arguments

Table 10-15 Arguments of Rename

Argument Description
dhpath path of Data Management
mode --n=NCK, --m=MMC
directories are renamed on the NCK and the MMC
NeuName new name of data file
datatype new data type, * or name--scheme, for example WKS
extension 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 03.03
10.4 Functions of the Data Management Server

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: renamed


Err<>0: 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: select dhpath channel
Arguments

Table 10-16 Arguments of Select

Argument Description
dhpath name in the Data Management path
channel two digit channel number

Selecting a part program


Selects the part program ”MPF1.mpf” in the first channel.

 Siemens AG 2003 All Rights Reserved


10-464 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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: part program selected


Err<>0: 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 chek-
ked.
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 03.03
10.4 Functions of the Data Management Server

Arguments

Table 10-17 Arguments of Setaccess

Argument Description
dhpath name in the Data Management
access requested access permission
mode --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: 47774
current user class: 4 access permission is changed
current user class: 5 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: access permission has been changed


Err<>0: 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.

 Siemens AG 2003 All Rights Reserved


10-466 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 varia-
ble 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 se-
quence.
Application
This call can be used by applications which inquire the result of a job using repea-
ted request jobs rather than hotlink connections.
Syntax
LinkExecute: startsave VarName
Argument

Table 10-18 Arguments of Startsave

Argument Description
VarName name of the variable

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: variable created


Err<>0: variable not created

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 10-467
Data Management 03.03
10.4 Functions of the Data Management Server

Stopsave
Description
Complementary function to startsave: The memory range VarName is released.
Application
Removes a result variable from the Data Management Server.
Syntax
LinkExecute: stopsave VarName
Arguments

Table 10-19 Arguments of Stopsave

Argument Description
VarName name of the variable

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 Linkexe-
cute.

 Siemens AG 2003 All Rights Reserved


10-468 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 nega-
tive 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_ADV-
DATA.
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 job execution is n percent, with n from 0 to 99
100 job has been executed correctly
>100 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 com-
pleted 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 03.03
10.4 Functions of the Data Management Server

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 al-
low 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: activate ergvar source [--f]
Arguments

Table 10-20 Arguments of Activate

Argument Description
ergvar result variable: contains the present state of the job
source Data Management path of the source file
--f --f (force= overwrite) (if destination file exists)

Access permission
Required access permission:
read source
write destination directory, destination
delete source.

 Siemens AG 2003 All Rights Reserved


10-470 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 03.03
10.4 Functions of the Data Management Server

Arguments

Table 10-21 Arguments of Activate2

Argument Description
ergvar result variable: contains the present state of the job
source Data Management file of the source file
--f (force= overwrite) (if destination file with same name exists)

Access permission
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 desti-
nation 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: copy ergvar source --mode target --mode[f] [datatype]
Arguments

Table 10-22 Arguments of Copy

Argument Description
ergvar result variable: contains the present state of the job
source Data Management path of the source file
mode --m for MMC; --n for NCK
target Data Management path of the destination file

 Siemens AG 2003 All Rights Reserved


10-472 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 Functions of the Data Management Server

Table 10-22 , FortsetzungArguments of Copy

Argument Description
mode --m for MMC; --n for NCK
--f (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 03.03
10.4 Functions of the Data Management Server

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: create ergvar dirpath name ext data type --mode [file]
Arguments

Table 10-23 Arguments of Create

Argument Description
ergvar result variable: contains the present state of the job
dirpath Data Management path of the directory in which the file or
the directory is being created
name name of the file or the directory
ext extension of the file or the directory
datatype * or fixed NCK name according to the pattern
For DOS file ”DOSFILE”,
for DOS directories ”DOSDIR”
mode --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.
file 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”.

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

 Siemens AG 2003 All Rights Reserved


10-474 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 * -nf”
End Sub

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: del ergvar dhpath [mode]
Arguments

Table 10-24 Arguments of Del

Argument Description
ergvar result variable: contains the present state of the job
dhpath Data Management file of the source file
mode --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 03.03
10.4 Functions of the Data Management Server

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# delete successful
#102#file does not exist# delete not successful

 Siemens AG 2003 All Rights Reserved


10-476 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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: list ergvar dirpath [mode]
Arguments

Table 10-25 Arguments of List

Argument Description
ergvar result variable: contains the present state of the job
dirpath Data Management path
mode --m for MMC; --n for NCK
--f 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 03.03
10.4 Functions of the Data Management Server

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 Meaning
lname name of the file in the Data Management (NC files without _N_)
datatype name of the file type according to the Data Scheme:
files that are not contained in the scheme are represented by the
place holder ”--------”
text explanation of the file type (see table in chapter 10.2)
extension file extension
realname ”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 length of file. For directories 0 is entered.
date date of the last write access. The time of day is given in seconds
since 01.01.1970.
attribute 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 access permission: read, write , execute, show, delete

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.

 Siemens AG 2003 All Rights Reserved


10-478 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Data Management
10.4 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 para-
meter 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: passivate ergvar source [mode] [--f]
Arguments

Table 10-27 Arguments of List

Argument Description
ergvar result variable: contains the present state of the job
source Data Management path for the source file
mode --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 03.03
10.4 Functions of the Data Management Server

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.

 Siemens AG 2003 All Rights Reserved


10-480 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
mode group tool/
magazine
channel channel

PLC
main feed
spindle drive
drive

Fig. 11-1 Areas of the NC

Table 11-1 List of the areas

area identifier for area address identifier for PI identifier for


link item Service area
NCK Nck 0 001 N
mode group Bag 1 1xx B
channel Channel 2 2xx C
axis Axis 3 3xx A

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-481
Reference 03.03
11.1 Overview

Table 11-1 List of the areas

area identifier for area address identifier for PI identifier for


link item Service area
tool offsets, tool Tools 4 4xx T
magazine data
PLC Plc ?
feed drive DriveVSA 5 5xx V
main spindle drive DriveHSA 6 6xx H

communication K00
module
passive file system P01

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 (down-
load 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 file name

all NC data _N_INITIAL_INI

all machine data _N_COMPLETE_TEA

all global NC machine data _N_NC_TEA

all channel specific machine data _N_CH_TEA

machine data of channel n _N_CHn_TEA

all axis specific machine data _N_AX_TEA

machine data of axis n _N_AXn_TEA

all setting data _N_COMPLETE_SEA

all global NC setting data _N_NC_SEA

 Siemens AG 2003 All Rights Reserved


11-482 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.1 Overview

Table 11-2 Files of the active file system (excerpt)

data type file name

all channel specific setting data _N_CH_SEA

setting data of channel n _N_CHn_SEA

all axis specific setting data _N_AX_SEA

setting data of axis n _N_AXn_SEA

all option data (MMC 103 only) _N_COMPLETE_OPT

all global NC option data _N_NC_OPT

all channel specific option data (MMC 103 only) _N_CH_OPT

all axis specific option data (MMC 103 only) _N_AX_OPT

all global user data _N_COMPLETE_GUD

all global NC user data _N_NC_GUD

all channel specific user data _N_CH_GUD

user data of channel n _N_CHn_GUD

all tool/magazine data _N_COMPLETE_TOA

all tool data _N_TO_TOA

tool data of area t _N_TOt_TOA

all magazine data _N_TO_TMA

magazine data of area t _N_TOt_TMA

all protection areas _N_COMPLETE_PRO

all global NC protection areas _N_NC_PRO

all channel specific protection areas _N_CH_PRO

channel protection areas of channel n _N_CHn_PRO

all R parameters _N_COMPLETE_RPA

all channel specific R parameters _N_CH_RPA

channel R parameters of channel n _N_CHn_RPA

all zero point offsets _N_COMPLETE_UFR

all global NC zero point offsets _N_NC_UFR

all channel specific zero point offsets _N_CH_UFR

channel zero point offsets of channel n _N_CHn_UFR

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-483
Reference 03.03
11.1 Overview

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 _N_AX_QEC

quadrant error compensation data of axis n _N_AXn_QEC

all lead screw error compensation data _N_AX_EEC

lead screw error compensation data of axis n _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 struc-
tures.
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 directory name


MMC display machine data _N_BD_DIR

workpieces _N_WKS_DIR

global part programs _N_MPF_DIR

global subprograms _N_SPF_DIR

user cycles _N_CUS_DIR

Siemens standard cycles _N_CST_DIR

comment data files _N_COM_DIR

definition files for macros and global user data _N_DEF_DIR

main spindle drive machine data in binary format _N_HS_DIR

feed drive machine data in binary format _N_VS_DIR

user data (OEM) _N_OEM_DIR

system data _N_SYF_DIR

 Siemens AG 2003 All Rights Reserved


11-484 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.1 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 description
COPY_FROM_NC copy from NCK to MMC with additional
information
COPY_FROM_NC_BINARY copy from NCK (PLC) to MMC without
additional information
COPY_TO_NC copy from MMC to NCK with additional
information
COPY_TO_NC_BINARY copy from MMC to NCK (PLC) without
additional information
MAP_ACC_NC 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 meaning PI name


NC-- Set--up _N_IBN_SS
functions Reconfiguraton _N_CONFIG
Domain option argument _N_DOMOPT
MMC semaphore _N_MMCSEM
PI Service addressed to _N_CMPCYC
Compile--Cycles
Work piece counter _N_TMPCIT
Select file for upload _N_F_XFER
DeleteMDA memory _N_F_DMDA

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-485
Reference 03.03
11.1 Overview

Table 11-5 Overview of the PI Service

function group meaning PI name


Cancel NC alarms _N_CANCEL
Digitizing on _N_DIGION
Digitizing off _N_DIGIOF
Setting of measurement _N_SCALE
system: inch--metric
NC- Select program for execution _N_SELECT
in a channel
program- Select program for external _N_EXTMOD
execution from external
functions Select program for external _N_EXTERN
execution from external
Activate search _N_FINDBL
Set User Frame _N_SETUFR
Overstore on _N_OST_ON
Overstore off _N_OST_OF
Assign interrupt _N_ASUP__
file Open file _N_F_OPEN
functions Close file _N_F_CLOS
Rename file _N_F_RENA
Copy file within NCK _N_F_COPY
Delete file _N_F_DELE
Position the file search poin- _N_F_SEEK
ter
Activate actual user data _N_SETUDT
Delete variable--aera _N_DELVAR
access level New password _N_NEWPWD
functions Login _N_LOGIN_
Logout _N_LOGOUT
Add file protection to a file _N_F_PROT
tool Create tool _N_CREATO
functions Create tool for tool manage- _N_TMCRTO
ment
Create new cutting edge _N_CREACE
Delete existing tool _N_DELETO
Lock--up for empty place for _N_TMFDPL
loading

 Siemens AG 2003 All Rights Reserved


11-486 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.1 Overview

Table 11-5 Overview of the PI Service

function group meaning PI name


Provide magazine place for _N_TMMVTL
loading, unload tool
Positioning a magazine place _N_TMPOSM
or tool
Create cutting edge for exi- _N_CRCEDN
sting tool
Delete cutting edge for exi- _N_DELECE
sting tool
Create tool: Given are name, _N_TMCRTO
tool number and duplo num-
ber
Lock--up for empty place: _N_TMFPBP
type, magazine and space for
tool
Lock--up for T number: Given _N_TMGETT
are tool name and duplo no.
Initiate check of unique D _N_CHEKDM
numbers
Activate tool in sister tool _N_SETTST
group
Set active wear group in a _N_TMAWCO
magazine
Create tool with defined num- _N_TMCRTC
ber of cutting edges
Reset the active state _N_TMRASS

PLC Activate a module _INSE


functions Delete a passive module _DELE
Start/Stop the PLC _PROGRAM
Reset the PLC memory s. PLC_
MEMORYRESET

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-487
Reference 03.03
11.2 Variable definition

11.1.5 Data formats

This description uses the following data formats:

Table 11-6 Overview of the data formats

data type length (bit) length range


(byte)
char 8 1 0 to 255

unsigned 16 2 0 to 65535

long 32 4 --2.147.483.648 to +2.147.483.647

double 64 8 ±10 --307 to ±10308


string nx8 n set of ASCII characters, terminated with ”\0”

Byte (PLC) 8 1

Word (PLC) 16 2

Doubleword 32 4

Float 32 4 4 succeeding bytes are interpreted as


floating point--number
Double 64 8 8 succeeding bytes are interpreted as
floating point--number

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”.

 Siemens AG 2003 All Rights Reserved


11-488 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.2 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 ser-
vice. 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 module type file system area meaning


ACC access N,C,A,V,H, describes the properties of NCK variables
description for Passive needed to access NCU variables (ACCess).
NCU variables
ASP asynchronous Passive
sub programs
BIN binary file Passive 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 Passive COM (COMment File). Arbitrary ASCII--Text
CEC beam sag / N,Passive
angular errors
CYC cycle programs Passive
DIR directory 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).
EDI editor window N In order to edit files, a section of the files is
loaded up from the NCU--memory and then
edited in the editor window
EEC error A,Passive
compensation of
the encoder
GUD global/channel--s N,C,Passive The user (machine tool builder, OEM) has the
pecific user data 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 03.03
11.2 Variable definition

Table 11-7 Overview: common modules for the Domain Service

EXT module type file system area meaning


INI initialization Passive Initialization modules (INItial File) are not
module 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.
LUD local/program--sp C,Passive The user has the possibility to define local
ecific user data data within a program.
MPF main programs Passive MPF (Main Program File) are NC part
programs of the type ’main program’.
OPT option data N,Passive option data (OPTion File)
PRO protection area N,C,Passive
QEC quadrant error A,Passive
compensation
RPA calculation C,Passive
parameters
SEA setting data N,C,A, Setting Data (SEtting data Active)
Passive
SPF sub program Passive SPF (Sub Program File) are NC part
programs of the type ’sub program’.
SYF system data Passive A system file (SYFile) contains information
concerning the complete system.
TEA machine data N,C,A,V,H, machine data
Passive

 Siemens AG 2003 All Rights Reserved


11-490 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.2 Variable definition

Table 11-7 Overview: common modules for the Domain Service

EXT module type file system area meaning


TMA magazine T,Passive contains:
description • 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)
TOA tool T,Passive tool compensations(Tool Offset Active) with:
compen--sations • 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).
UFR User FRAMES C,Passive contains FRAMES (User input Frames)
(settable zero point offset extended)
WPD workpiece Passive The module of the type WPD (Work Piece
directory 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).

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-491
Reference 03.03
11.3 Module types for the active file system

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 type no.


active file (hex)
system
system state data N, C Y 10
NC instruction group list N YNCFL 11
user frame C FU 12
current frame C FA 13
tool compensation T TO 14
arithmetic parameter C RP 15
Setting data N,C,A SE 16
Global user data GUD (=GD1=SGUD) N,C GUD 17
local part program data C LUD 18
interpolated compensation C IK 19
machine data N,C,A,V*,H* M 1A
Compile--Cycles N CC 1F
external frames C FE 20
general tool data T TD 21
tool supervision data T TS 22
tool data for grinding T TG 23
OEM tool data T TU 24
tool user cutting edge data T TUE 25
tool data directory T TV 26
magazine description T TM 27
magazine place data T TP 28
multi--assignment to magazine place T TPM 29
data
types of magazine places T TT 2A
magazine directory T TMV 2B
magazine control block T TMC 2C
Global user data 2 (=MGUD) N,C GD2 2D
Global user data 3 (=UGUD) N,C GD3 2E
Global user data 4 N,C GD4 2F

 Siemens AG 2003 All Rights Reserved


11-492 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.3 Module types for the active file system

Table 11-8 Module types for the active file system

data type areas in type no.


active file (hex)
system
Global user data 5 N,C GD5 30
Global user data 6 N,C GD6 31
Global user data 7 N,C GD7 32
Global user data 8 N,C GD8 33
Global user data 9 N,C GD9 34
protected area N,C PA 35
Nibble data NIB 37
state data messages (drive, servo) SDME 6E
program pointer interrupted C SPARPI 6F
extended state data geometry axes C SEGA 70
extended state data machine axes C SEMA 71
state data spindles C SSP 72
state data geometry axes C SGA 73
state data machine axes C SMA 74
state data latest alarm N SALAL 75
state data oldest alarm N SALAP 76
state data alarms N SALA 77
state data synchronous actions C SSYNAC 78
state data block search pointer C SPARPF 79
state data program pointer C SPARPP 7A
state data NC functions C SNCF 7B
state data Interrupt_Status C SINT 7C
state data part program infos C SPARP 7D

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-493
Reference 03.03
11.3 Module types for the active file system

Table 11-8 Module types for the active file system

data type areas in type no.


active file (hex)
system
state data channel effecting C SINF 7E
state data N,B,C,V*,H* S 7F

*Data with Syntax--ID 611D

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 NC--DDE|local
LinkItem /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 mo-
dule SSYNAC and specifically the variables Hval supplies a description of the indi-
ces 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 so-
mewhat more complex. Tool correction data of a TO--area are required.
The organization of the tool correction data you will find in the programming ma-
nual and the function description W1. See the online-- help for more information.

 Siemens AG 2003 All Rights Reserved


11-494 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.4 Machine data

The general format of the link item for tool corrections is:
Link Item general /Tool/Compensation/Edgedata [ux, cy, n (--m)]
with x TO--area
y Tool number
n Tool parameter
m 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 Param-
Number 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 TO--area 1
c2 means second tool
3 means 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 TO--area 1
c2 means second tool
3 means geometric length offset (parameter 3)
4 means 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 $--varia-
bles, 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 03.03
11.5 PLC data

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 inter-
face:

Table 11-9 Variablenames for PLC data

1. part /PLC constant part of the name


2. part /Input for accessing inputs (internal image)
/Output for accessing outputs (internal image)
/Memory for accessing flags
/DataBlock for accessing data blocks
/Directory for accessing directories of the PLC
3. part /Bit access width: 1 bit
/Byte access width: 1 byte ( 8 bit )
/Word access width: 1 word ( 2 byte, 16 bit )
/DoubleWord access width: 1 double word ( 4 byte, 32 bit )
/Float for accessing 4 consecutive bytes to be interpreted as a
float--number
/Double for accessing 8 consecutive bytes to be interpreted as a
float--number
/Hierarchy1 for accessing the list of all module types
/Hierarchy2 for accessing the list of one module type
/Hierarchy3 for accessing the list of one specific module type
/S7Timer for accessing timer--contents, unit: milliseconds
/S7Counter for accessing counters, format: integer
/TimeAndDate for accessing the clock, format is explained below
/Statelist/Complete for accessing the complete system state list of the PLC
/Messages for accessing PLC messages/alarms
4. part no parameter For cyclic services to PLC variables the scan/cycle interval
is 500 ms.
parameter: --FAST For these and all other variables of the same cluster the
scan/cycle interval is 100 ms.

 Siemens AG 2003 All Rights Reserved


11-496 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.5 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 in-
dex 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 PLC program in S7 NCDDE Server accesses:


accesses:
DWORD 5 WORD 5 + 6 WORD 10 + 11
BYTE 5+6+7+8 BYTE 20 + 21 + 22 + 23

Example:
Valid PLC variable identifiers are:
/Plc/Input/Word[9] accessing input bytes 18 and 19
/Plc/Memory/Bit[9.3] accessing bit 3 in the flag data byte 9
/Plc/Output/Doubleword[7] accessing the output bytes from 28 to 31
/Plc/DataBlock/Bit[c100,9.3] 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 des-
cription 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 03.03
11.5 PLC data

11.5.2 Summary of the PLC data

Table 11-11 Variable names in the MMC for PLC data

data type parameter identifier, parameter


range
PLC--input
input bit 0 to 7 /Plc/Input/Bit[input byte bit]
input byte 0 to 63 /Plc/Input/Byte[input byte]
input word 0 to 31 /Plc/Input/Word[input word]
input 0 to 15 /Plc/Input/DoubleWord[input double word]
double word

PLC--output
output bit 0 to 7 /Plc/Output/Bit[output byte.bit]
output byte 0 to 63 /Plc/Output/Byte[output byte]
output word 0 to 31 /Plc/Output/Word[output word]
output 0 to 15 /Plc/Output/DoubleWord[output double word]
double word

PLC flag data


flag data bit 0 to 7 /Plc/Memory/Bit[flag data byte.bit]
flag data byte 0 to 255 /Plc/Memory/Byte[flag data byte]
flag data word 0 to 127 /Plc/Memory/Word[flag data word]
flag data double word 0 to 63 /Plc/Memory/DoubleWord[flag data double
word]

PLC data block


data bit 0 to 7 /Plc/DataBlock/Bit[cdata block, data byte.bit]
data byte 0 to 1023 /Plc/DataBlock/Byte[cdata block, data byte]
data word 0 to 511 /Plc/DataBlock/Word[cdata block, data word
data double word 0 to 255 /Plc/DataBlock/DoubleWord[cdatablock,data
double word]
floating point /Plc/DataBlock /Float[cdata block, data byte]

PLC timer 0 to 127 /Plc/S7timer[timerNumber]

PLC counter 0 to 63 /Plc/S7Counter[counterNumber]

 Siemens AG 2003 All Rights Reserved


11-498 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.5 PLC data

Table 11-11 Variable names in the MMC for PLC data

data type parameter identifier, parameter


range
PLC clock 1 /Plc/TimeAndDate[month.day.year
hour:minute:second:millisecond day of week
status]

PLC--Hierarchy
list of all modules 1 /Plc/Directory/Hierarchy1
list of one module type 1 /Plc/Directory/Hierarchy2[”data Block Type”]
list of one module 1 /Plc/Directory/Hierarchy3[”data Block name”]

PLC system state 1 /Plc/Statelist/Complete

PLC alarms 1 /Plc/Messages

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-499
Reference 03.03
11.5 PLC data

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 bit 4 resolution


0 0 1 ms
0 1 10 ms
1 0 100 ms
1 1 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

 Siemens AG 2003 All Rights Reserved


11-500 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.5 PLC data

PLC: messages and alarms


The variable ”/Plc/Messages” provides an interface to the message and alarm sy-
stem 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 messa-
ges 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 retur-
ned. The access must be executed binarily.

PLC: System state


The variable ”/Plc/Statelist/Complete” allows to read (no Hot/Warmlink) the com-
plete 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 accessing the module list of all module types
/Hierarchy2 accessing the module list of one module type
/Hierarchy3 accessing the module list of a specific module
allow a reading access ( however no Hot/Warmlink ) to the PLC directory informa-
tion.
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: The PLC contains 3 OBs (Type 08), 8 FBs (Type 0E) 1 FC
(Type 0C) and 4 DBs (Type 0A)
variable: /Plc/Directory/Hierarchy1
result: 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 03.03
11.5 PLC data

module number
module status (coded in hexadecimal format)
storage location ( values: ”RAM”, ”EPROM”, ”???” )
state ( values: ”ACTIVE”, ”PASSIVE”, ”???” )
Example: The PLC contains 8 function modules of the type 0E, located in the
RAM and active:
Variable: /Plc/Directory/Hierarchy2[”0E”]
Result: 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 attri-
bute1 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: In the PLC an organization module OB1 is active:
Variable: /Plc/Directory/Hierarchy3[”0800001A”]
Result:
0800001A <TAB> 1230 <TAB> RAM <TAB> ACTIVE <TAB>
07070001 01080001 000000f2 00000000 01edce06 110c01ed <CR>
ce06110c .... <CR><LF> .......

 Siemens AG 2003 All Rights Reserved


11-502 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.6 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 symbolic identifier PI numeric identifier


1st argument (name) argument description
2nd argument(name) argument description
: :
nth argument(name) argument description
PI symbolic identifier

The first parameter specifies the area or the unit.


The following identifiers are used (xx stands for two digits):
001 NCK--specific service
1xx BAG--specific service
2xx channel--specific service
3xx axis--specific service
4xx tool--specific service
5xx VSA--specific service
6xx HSA--specific service
K00 service concerning the COM module
P01 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 = DIR or WPD (i.e. directory)
yyyyy = any string (max. 25 characters) for names of files or directories
zzz = 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 03.03
11.6 PI Services

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).

 Siemens AG 2003 All Rights Reserved


11-504 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 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 compo-
nents (bytes):

1st byte 2nd byte 3rd byte 4th byte


general error error region error class error code
class number number number 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 03.03
11.7 NCDDE -- Error messages

11.7.2 General error class definitions

general region class code

Table 11-14 General error classes

No. identifier meaning


00 UNKNOWN_GENERAL_CLASS general class not (yet) set
01 NCDDE_ERROR ncdde server generated errors
02 MPI_ERROR layer 4 transport error at profibus inter-
face, refer to profibus-interface-errors sec-
tion of this file for a more detailed error in-
terpretation
03 L7_ERROR layer 7 error told from NC
errorclass and errorcode have been taken
from the corresponding S7-protocol entries
(ERRCLS/ERRCOD) in this case
04 L7_ADDITIONAL_ERROR layer 7 error detected within the server
protocol--handler
05 L7_ACCESS_ERROR layer 7 error told from NC
the errorcode has been taken from the
’Zugriffsergebnis’ S7-protocol entry
06 L4_ERROR other layer 4 errors
errorclass and errorcode have been taken
from the Layer 4 errortable in this case
07 DCTL_ERROR Errors detected by the DCTL-control itself
08 DOSERRNO_ERROR error was delivered by a dos call
errorcode/errclass hold the ”errno” value
09 DDEML_ERROR unexpected error at ddeml interface
errorcode/errclass hold a ddeml error va-
lue

Note
The meaning of the 3rd and 4th byte depends on the value of the first byte.

 Siemens AG 2003 All Rights Reserved


11-506 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 NCDDE -- Error messages

11.7.3 Definition of the Error Region

XX region class code

Table 11-15 Error regions

No. identifier meaning


00 UNKNOWN_REGION region not yet set
01 FT_ERROR filetransfer errors
04 REQUEST_ERROR error reading a single variable
05 POKE_ERROR error writing a single variable
06 DIAGNOSE_ERROR error when announcing or disannouncing
for diagnose
08 PI_ERROR pi-command error
09 EXECUTE_ERROR error executing a dde-exec-cmd
0A ADVISE_ERROR advise error
0B CLIENT_ERROR error during an XACT_COMPLETE trans-
action
0E COMIC_ERROR error executing a comic command
F3 NO_ACCESS no access to reagion information
F4 NO_ERROR internal only
FF NO_REGION 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 identifier meaning


00 UNKNOWN_CLASS errorclass not (yet) set
01 TIMEOUT_ERROR timed out wait for communication quit, the
error code shows the timeout used [sec]
02 TRANSPORT_ERROR error delivered by layer 4

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-507
Reference 03.03
11.7 NCDDE -- Error messages

Table 11-16 Error classes for general = 1, 4, 6

class identifier meaning


03 DDE_ERROR error at dde--interface
04 GENERAL_ERROR other error classes
05 FILEIO_ERROR error delivered by ferror call
06 SYNTAX_ ERROR syntax error was detected
07 ARGUMENT_ERROR one of the user arguments not acceptable
08 PDU_ACCESS_ERROR set when ’Zugriffsergebnis’ entry means
the whole pdu
09 VAR_ACCESS_ERROR set when ’Zugriffsergebnis’ entry means a
single variable
0A PROTOCOL_ERROR error caused by NC-Communication
0B CONVERSION_ERROR error occured when converting data
0C DOM_STATUS error ISO--layer 7: domain transfer status
follows as error code
0D CFILE_ERROR error delivered by CFileException, is an
I/O-error
0E COMIC_ERROR error occured within a comic

01,04,06 xx xx code

Table 11-17 Error codes for general = 1, 4, 6

code identifier meaning


00 UNKNOWN_CODE errorcode not (yet) set
01 LOCATION_ERROR used when a layer 4 addres not accepta-
ble
02 UNKNOWN_TOPIC_ try to communicate with unknown topic
ERROR spec
03 UNKNOWN_ITEM_ERROR try to communicate with unknown item
spec
04 UNKNOWN_ try to communicate with unknown clipbo-
CLIPFORMAT_ERROR ard format
05 ADRMAP_ERROR address map missing
06 ARGCNT_ERROR number of arguments not accepted
07 ARG_ERROR argument not acceptable
08 UNKNOWN_CMD_ERROR command not known

 Siemens AG 2003 All Rights Reserved


11-508 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 NCDDE -- Error messages

Table 11-17 Error codes for general = 1, 4, 6

code identifier meaning


09 TOKENIZE_ERROR command not known
0A VARIABLE_IN_USE_ variable currently in use
ERROR
0B VARIABLE_TYPE_ERROR variable type not acceptable
0C VARIABLE_CREATION_ error creating a variable (low memory)
ERROR
0D NODATA_ERROR no data accessible or delivered
0E FRAMING_ERROR wrong pdu construction detected
0F PDU_TOO_LARGE_ cluster too large
ERROR
10 TOO_MANY_ARGS_ number of arguments too large
ERROR
11 CAN_NOT_CONVERT no data conversion possible
12 DATA_CORRUPTED data inconstency detected
13 UNDEF_FORMAT format provided in LINK Command is un-
known
14 DATA_TOO_LARGE data too large for handling
15 SLICE_NOT_ALLOWED an index range is not allowed
16 SAME_ITEM_ADVISED this item is already advised on this con-
nection
17 REMOTE_DOWN no communication to this remote unit pos-
sible
18 CONNECTING communication may be poss. soon
19 BROKEN_LINE communication not possible
1A NO_LINE communication not possible
1B UNSUPPORTED_INDEX a variable index is not accepted
1C FORMATTING_ERROR wrong format for textconversion
1D UNEXPECTED_PDU this kind of pdu was not expected, pdu
syntax error
1E FTSTOP_ERROR both lower errorcode Bytes must be set,
when interrupting a filetransfer
1F EXIT_ABORT canceled on ncdde exit
20 UNKNOWN_TRANSPORT_ the requested transport class is not availa-
TYPE ble
21 OUT_OF_RESOURCES some resources are exhausted
22 CAN_NOT_OPEN_DEV the transport device can not be opened
23 CAN_NOT_INIT_DDEML DdeInitialize call failed
24 NO_SERVER DDE--Connecting to NC failed

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-509
Reference 03.03
11.7 NCDDE -- Error messages

Table 11-17 Error codes for general = 1, 4, 6

code identifier meaning


25 NC_NOT_RESPONDING NC lifesign stopped
26 BOOT_REJECTED NC rejected bootrequest/bootdata
27 SYNC_ERROR NC does not synchronize
28 OUT_OF_MEMORY memory is low
29 BUFOVERFLOW_ERROR an internal fixedlen buffer is too small
2A PROTOCOL_UNKNOWN no L7 protocolhandler available
2B OUT_OF_RESOURCES windows resources exhausted
2C ADRMAP_SELF ADDRESS: /SELF undefined or syntax
error
2D HEADER_CORRUPTED a filtransfer failed, because the header
was not decodable
2E ARITH_ERROR error evaluating an arithmetic expression
e.g. unknown variable or wrong variable
type
2F INDEX_ERROR unexpected index type
30 ITEM_SYNTAX syntax error decoding an item
31 VALUE_SYNTAX value not decodeable
32 LINK_SYNTAX the textparameter of a linkstatement is not
decodable
33 STRING_SYNTAX string syntactically wrong
34 ATOM_TUNING ncdde-atomtable overflow
35 INDEX_NOTAVAIL missing data for an index

36 EXIT_REJECT rejected during ncdde exit

37 SHARED_MEMORY_ shared memory selector not not decodable


SYNTAX
38 SHARED_MEMORY_ delivered shared memory selector not usa-
ACCESS ble
39 INVALID_TIME timecode corrupted
3A SHARED_MEMORY_ shm too small
EXHAUSTED
3B SHARED_MEMORY_ shm not acceptable
CORRUPTED
3C MAP_ERROR a acc--file entry was not mappable
3D PIPE_IN_USE_ERROR datasink for pipe variable already exists
3E EOF_ERROR poke to pipe variable after eof-poke
3F NO_TRANSFER no filetransfer for this access

 Siemens AG 2003 All Rights Reserved


11-510 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 NCDDE -- Error messages

Table 11-17 Error codes for general = 1, 4, 6

code identifier meaning


40 DDEINIT_ERROR error initializing DDE-NC-Interface
41 UNKNOWN_COMIC addressed comic does not exist
42 COMIC_ALREADY_EXISTS addressed comic does already exist
43 NO_CONV_ESTABLISHED DdeConnect failed
44 TRANSIENT_STATE refused action ( retry later )
45 NO_LASTERROR_ no lasterror info from extern ncdde
PROVIDED
46 OUT_OF_ too many synonymous stringhandles
STRINGHANDLES
47 WRITE_PROTECT poke not allowed
48 OUT_OF_AMAPS topic count too high, retune ncdde.exe
??? Was kann der Anwender da tun ???
49 ADVISE_NOT_ hot/warmlink not possible
SUPPORTED
4A REQUEST_NOT_ request transactions not supported
SUPPORTED
4B POKE_NOT_SUPPORTED poke transactions not supported
4C EXECUTE_NOT_ execute transactions not supported
SUPPORTED
4D DEVICE_NOT_PRESENT ncdde did not find the requested device
4E DATA_COUNT index range not equal to datafields
FC INTERNAL_ERROR ncdde internal problem
FD UNEXPECTED_ unexpected exception
EXCEPTION
FE CAN_NOT_OPEN_ERROR fopen failed
FF NO_ERRCODE no errcode available

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-511
Reference 03.03
11.7 NCDDE -- Error messages

11.7.5 Details for general = 2

02 xx class xx

Table 11-18 Error classes for general = 2

class identifier meaning


01 WRITE error detected during a non fatal return of
ihi_write:
the errorcode corresponds to the profibus op-
code (see below)
02 TIMEOUT the interface did unexpectedly not response to a
command:
the errorcode corresponds to the profibus op-
code (see below)
03 RESPONSE_ at this point unexpected response from profibus
ERROR interface:
the errorcode corresponds to the profibus inter-
face response code
04 READ_FATAL fatal error received on call to ihi_read:
hard-/software configuration must be checked
05 WRITE_FATAL fatal error received on call to ihi_write:
hard-/software configuration must be checked

02 xx class code

Table 11-19 Error codes for general = 2

class code identifier meaning


01, 02 00 OPEN_REQ open error
01, 02 01 SEND_CONN_REQ initialisation layer 4 connection
01, 02 06 SEND_EOM_DATA write data error
01, 02 07 RECEIVE_DATA read data error
01, 02 0C CLOSE_REQ close error
03 02 INVALID_REQ internal problem
03 04 NO_RESOURCES low memory below 1 Mbyte
03 06 UNKNOWN_REFERENCE internal problem

 Siemens AG 2003 All Rights Reserved


11-512 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 NCDDE -- Error messages

Table 11-19 Error codes for general = 2

class code identifier meaning


03 0C ILLEGAL_REQ internal problem
03 0E REM_ABORT remote station rejection
03 10 LOC_TIMEOUT remote station not responding
03 12 UNKNOWN_CONN_CLASS internal problem
03 14 DUP_REQ internal problem
03 16 CONN_REJECT remote station connection rejection
03 18 NEGOT_FAILED incompatible stations
03 1A ILLEGAL_ADDRESS wrong address parameter
03 1C NETWORK_ERROR 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 description
01 hardware error
03 accessing the object not allowed
05 invalid address
06 data type not supported
07 data type inconsistent
0A object does not exist

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-513
Reference 03.03
11.7 NCDDE -- Error messages

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 description
01 overload of the task list: more than 20 tasks are presently using the DCTL control
02 wrong syntax detected in the property LinkTopic
03 WINDOWS’ Atomtable exceeded
04 no connection can be established to a server
05 maximum length of the characterstring in the property LinkTopic exceeded
(max. 512 characters)
06 too many identical items: The DCTL Control limits identical items in one process to
100
07 time limit exceeded
08 invalid value of the property LinkCmd
09 server refused transaction but did not return an error code LastError
0A initialization of DDEML library failed
0C invalid value of the property LinkTopic
0D call of DDEClient transaction unexpectedly failed
0F overflow of link list: this task has Hotlinks with more than 20 different LinkTopics
10 connection interrupted by the server
11 last error not set
12 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.

 Siemens AG 2003 All Rights Reserved


11-514 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 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 identifier description


02 ENOENT 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.
07 E2BIG Arg list too long. Under DOS: The argument list exceeds
128 bytes, or the space required for the environment
information exceeds 32K.
08 ENOEXEC Exec format error. An attempt was made to execute a
file that is not executable or that has an invalid
executable--file format.
09 EBADF 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).
0A ECHILD No child processes
0B EAGAIN 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.
0C ENOMEM 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.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-515
Reference 03.03
11.7 NCDDE -- Error messages

Table 11-22 Error messages from MS-DOS

number identifier description


0D EACCES 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.
11 EEXIST 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.
12 EXDEV Cross--device link. An attempt was made to move a file
to a different device (using the rename function).
16 EINVAL 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.
18 EMFILE Too many open files. No more file handles are available,
so no more files can be opened.
1C ENOSPC No space left on device. No more space for writing is
available on the device (for example, when the disk is
full).
21 EDOM Math argument.
22 ERANGE 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).
24 EDEADLOCK Resource deadlock would occur. The argument to a
math function is not in the domain of the function.

 Siemens AG 2003 All Rights Reserved


11-516 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.7 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 03.03
11.8 Error messages of the Data

11.8 Error messages of the Data

Table 11-23 Error messages from the Data Management

error text of error message meaning


code
101 error at create or open of a do not create a file in a read--only directory
DOSfile
102 file does not exist do not open an existing file
103 file is read--only do not overwrite a write--protected file, do not delete
a directory that is not empty
104 no matching knot found path does not match the Data Scheme
105 no matching data type found do not use this data type here, e.g. MPF in SPF
directory
106 file/directory already exists do not overwrite existing file
107 no valid path of the Data do not use an invalid path
Management
108 argument error do not call an incomplete or erroneous set of
arguments
109 error during block copy read/write error on harddisk detected
110 invalid source path of Data Management invalid
111 data type of destination do not copy e.g. a SPF to a MPF
invalid
112 transfer error sum error message of the connection to NCU
113 no read permission do not access data without sufficient read
permission
114 no write permission do not access data without sufficient write
permission
115 no execute permission do not access data without sufficient execute
permission
116 no show permission do not access data without sufficient show
permission
117 no delete permission do not access data without sufficient delete
permission
118 no general access permission sum message for access violation on the NCU
119 resource error resource error on the NCU
120 memory (malloc) error error during allocation of memory in MMC
remedy: close application
121 infofile error error in the file containing additional information (25
character file name, access permission, etc.)
remedy: delete info file and restore from DOS files.
122 list buffer overflow error fixed buffer length of 64 kbyte exceeded

 Siemens AG 2003 All Rights Reserved


11-518 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

Table 11-23 Error messages from the Data Management

error text of error message meaning


code
123 Hardisk is full the remaining capacity of the hardisk is not
sufficient to finish the running job
124 Command canceled command canceled by CANCEL
125 Disk is open disk drive open during access to floppy disk
126 No further type of file possible
200 DDE error error during DDE communication in the MMC area

11.9 Directory structure of the Data Management


|--ROOT.DIR MMC data
||--*.CLP Clipboard
||--*.MDN NC data backup
|||--*.INI Initialization program(INI)
|||--EEC.DIR Spindle pitch/encoder error compensation
||||--AX%a_EEC.INI Axis spindle pitch/encoder error compensation
||||--AX_EEC.INI All spindle pitch/encoder error compensation
|||--GUD.DIR User data (global)
||||--CH_GUD.DIR Channel user data
|||||--CH%c_GUD.DIR User data channel
||||||--CH%c_GD1.INI User data 1 channel
||||||--CH%c_GD2.INI User data 2 channel
||||||--CH%c_GD3.INI User data 3 channel
||||||--CH%c_GD4.INI User data 4 channel
||||||--CH%c_GD5.INI User data 5 channel
||||||--CH%c_GD6.INI User data 6 channel
||||||--CH%c_GD7.INI User data 7 channel
||||||--CH%c_GD8.INI User data 8 channel
||||||--CH%c_GD9.INI User data 9 channel
||||||--CH%c_GUD.INI User data all channel
|||||--CH_GUD.INI All channel user data
||||--COMPLETE_GUD.INI All user data
||||--NC_GUD.DIR Global user data
|||||--NC_GD1.INI Global user data 1
|||||--NC_GD2.INI Global user data 2
|||||--NC_GD3.INI Global user data 3
|||||--NC_GD4.INI Global user data 4
|||||--NC_GD5.INI Global user data 5
|||||--NC_GD6.INI Global user data 6
|||||--NC_GD7.INI Global user data 7
|||||--NC_GD8.INI Global user data 8
|||||--NC_GD9.INI Global user data 9

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-519
Reference 03.03
11.9 Directory structure of the Data Management

|||||--NC_GUD.INI Global user data all


|||--NC_CEC.INI All sag/angularity compensation
|||--OPT.DIR Option data
||||--AX_OPT.INI Axis option data
||||--CH_OPT.INI Channel option data
||||--COMPLETE_OPT.INI All option data
||||--NC_OPT.INI NC option data
|||--PRO.DIR Protection areas
||||--CH_PRO.DIR Channel protection areas
|||||--CH%c_PRO.INI Protection areas channel
||||--COMPLETE_PRO.INI All protection areas
||||--NC_PRO.INI NC protection areas
|||--QEC.DIR Quadrant error compensation
||||--AX%a_QEC.INI Quadrant error compensation axis
||||--AX_QEC.INI All quadrant error compensation
|||--RPA.DIR R parameter
||||--CH%c_RPA.INI R parameter channel
||||--CH_RPA.INI All R parameter
|||--SEA.DIR Setting data
||||--AX_SEA.DIR Achs--Settingdaten
|||||--AX%a_SEA.INI Setting data axis
|||||--AX_SEA.INI All axis setting data
||||--CH_SEA.DIR Channel setting data
|||||--CH%c_SEA.INI Setting data channel
|||||--CH_SEA.INI All channel setting data
||||--COMPLETE_SEA.INI All setting data
||||--NC_SEA.INI General setting data
|||--TEA.DIR Machine data
||||--AX_TEA.DIR Axis machine data
|||||--AX%a_TEA.INI Machine data axis
|||||--AX_TEA.INI All axis machine data
||||--CH_TEA.DIR Channel machine data
|||||--CH%c_TEA.INI Machine data channel
|||||--CH_TEA.INI All channel machine data
||||--COMPLETE_TEA.INI All machine data
||||--NC_TEA.INI NC machine data
|||--TO.DIR Tool/magazine data
||||--TO_INI.INI All tool/magazine data
||||--TO_TMA.DIR Magazine data
|||||--TO%t_TMA.INI Magazine data unit
|||||--TO_TMA.INI All magazine data
||||--TO_TOA.DIR Tool offset active
|||||--TO%t_TOA.INI Tool offset active TO
|||||--TO_TOA.INI All tool offsets active
|||--UFR.DIR Zero offsets (user frame)
||||--CH_UFR.DIR Channel zero offsets
|||||--CH%c_UFR.INI Zero offsets channel
|||||--CH_UFR.INI All channel zero offsets
||||--COMPLETE_UFR.INI All zero offsets

 Siemens AG 2003 All Rights Reserved


11-520 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

||||--NC_UFR.INI General zero offset


||--ARC.DIR Archives
|||--*.ARC Archive file(ARC)
||--BD.DIR Display machine data
|||--*.TEA Machine data(TEA)
||--CMA.DIR Manufacturer cycles
|||--*.AWB Display description(AWB)
|||--*.COM Comment files(COM)
|||--*.CYC Preprocessed cycle
|||--*.LST Display list(LST)
|||--*.SPF Subprogram fileSPF)
|||--DPWP.INI DP initialization
|||--HLP.DIR DP help
||||--*.BMP Bitmap for interactive programming tools(BMP)
||||--*.PDF Help file(PDF)
||||--*.TXT Help index(TXT)
||--COM.DIR Comments
|||--*.COM Comment file(COM)
|||--HLP.DIR DP help
||||--*.BMP Bitmap for interactive programming tools(BMP)
||||--*.PDF Help file(PDF)
||||--*.TXT Help index(TXT)
||--CST.DIR Standard cycles
|||--*.AWB Display description(AWB)
|||--*.COM Comment file(COM)
|||--*.CYC Preprocessed cycle
|||--*.LST Display list(LST)
|||--*.SPF Subprogram fileSPF)
|||--DPWP.INI DP initialization
|||--HLP.DIR DP help
||||--*.BMP Bitmap for interactive programming tools(BMP)
||||--*.PDF Help file(PDF)
||||--*.TXT Help index(TXT)
|||--SC.COM Call description/system
||--CUS.DIR User cycles
|||--*.AWB Display description(AWB)
|||--*.COM Comment file(COM)
|||--*.CYC Preprocessed cycle
|||--*.LST Display list(LST)
|||--*.SPF Subprogram file(SPF)
|||--COV.COM Overview of cycles
|||--DPWP.INI DP initialization
|||--HLP.DIR DP help
||||--*.BMP Bitmap for interactive programming tools(BMP)
||||--*.PDF Help file(PDF)
||||--*.TXT Help index(TXT)
|||--UC.COM Call description/user
||--DEF.DIR Definitions
|||--GUD4.DEF NC user data 4

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-521
Reference 03.03
11.9 Directory structure of the Data Management

|||--GUD5.DEF NC user dataNC 5


|||--GUD6.DEF NC user dataNC 6
|||--GUD7.DEF NC user dataNC 7
|||--GUD8.DEF NC user dataNC 8
|||--GUD9.DEF NC user dataNC 9
|||--MGUD.DEF Global data/global data machine tool manufacturer
|||--MMAC.DEF Macros/global data machine tool manufacturer
|||--SGUD.DEF Global user data/system
|||--SMAC.DEF Macros/system
|||--UGUD.DEF Global data/user
|||--UMAC.DEF Macros/user
||--DG.DIR Diagnosis
|||--*.UMA Machine
||||--BITMAP.DIR Graphic data
|||||--*.BMP Bitmap for interactive programming tools(BMP)
||||--DAU.DIR D/A converter
|||||--*.DAC D/A conversion configuration data
||||--FG.DIR Function generator
|||||--*.FGC Function generator configuration data
||||--IPOTRC.DIR Interpolator trace
|||||--*.COM Comment file(COM)
||||--KFT.DIR Circularity test
|||||--KFTDIA.DIR Diagram from circularity test
||||||--*.SUD Setup diagram from circularity test(SUD)
|||||--KFTPAR.DIR Circularity test parameter
||||||--*.SUP Setup parameter(SUP)
||||--MCC.DIR Current control loop
|||||--MCCGR1.DIR MCC graphic1
||||||--*.MC1 MCC graphic1 data
|||||--MCCGR2.DIR MCC graphic2
||||||--*.MC2 MCC graphic2 data
|||||--MCCPAR.DIR MCC parameter
||||||--*.MCC MCC parameter data
||||--MDAX.DIR Machine data/axis
|||||--*.TEA Machine data(TEA)
||||--MDBT.DIR Machine data/panel
|||||--*.TEA Machine data(TEA)
||||--MDCH.DIR Machine data/channel
|||||--*.TEA Machine data(TEA)
||||--MDCOMP.DIR Machine data comparison
|||||--*.COM Comment fileCOM)
||||--MDHSA.DIR Machine data/MSD
|||||--*.TEA Machine data(TEA)
||||--MDNC.DIR Machine data/NC
|||||--*.TEA Machine data(TEA)
||||--MDVSA.DIR Machine data/FDD
|||||--*.TEA Machine data(TEA)
||||--MPC.DIR Position control circuit
|||||--MPCGR1.DIR MPC graphic1

 Siemens AG 2003 All Rights Reserved


11-522 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

||||||--*.MP1 MPC graphic1 data


|||||--MPCGR2.DIR MPC graphic2
||||||--*.MP2 MPC graphic2 data
|||||--MPCPAR.DIR MPC parameter
||||||--*.MPC MPC parameter data
||||--MSC.DIR Speed control circuit
|||||--MSCGR1.DIR MSC graphic1
||||||--*.MS1 MSC graphic1 data
|||||--MSCGR2.DIR MSC graphic2
||||||--*.MS2 MSC graphic2 data
|||||--MSCPAR.DIR MSC parameter
||||||--*.MSC MSC parameter data
||||--SVTRC.DIR Servotrace
|||||--SVTGR1.DIR SVT graphic1
||||||--*.ST1 SVT graphic1(ST1)
|||||--SVTGR2.DIR SVT graphic2
||||||--*.ST2 SVT graphic2(ST2)
|||||--SVTPAR.DIR SVT parameter
||||||--*.SVT SVT parameter(SVT)
|||--BITMAP.DIR Graphic data
||||--*.BMP Bitmap for interactive programming tools(BMP)
|||--DAU.DIR D/A converter
||||--*.DAC D/A conversion configuration data
|||--FG.DIR Function generator
||||--*.FGC Function generator configuration data
|||--INIT.DIR Initialize MMC
||||--*.INI Initialization programm(INI)
||||--*.ZIP MMC configuration
|||--IPOTRC.DIR Interpolator trace
||||--*.COM Comment file(COM)
|||--KFT.DIR Circularity test
||||--KFTDIA.DIR Diagram from circularity test
|||||--*.SUD Setup diagram from circularity test(SUD)
||||--KFTPAR.DIR Circularity test parameter
|||||--*.SUP Setup parameter(SUP)
|||--KLB.DIR Configuration list displays
||||--*.KLB Configuration list display
|||--LOGFILES.DIR Logfiles
||||--*.COM Comment file(COM)
|||--MCC.DIR Current control loop
||||--MCCGR1.DIR MCC graphic1
|||||--*.MC1 MCC graphic1 data
||||--MCCGR2.DIR MCC graphic2
|||||--*.MC2 MCC graphic2 data
||||--MCCPAR.DIR MCC parameter
|||||--*.MCC MCC parameter data
|||--MDAX.DIR Machine data/axis
||||--*.TEA Machine data(TEA)
|||--MDBT.DIR Machine data/operator panell

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-523
Reference 03.03
11.9 Directory structure of the Data Management

||||--*.TEA Machine data(TEA)


|||--MDCH.DIR Machine data/channel
||||--*.TEA Machine data(TEA)
|||--MDCOMP.DIR Machine data comparison
||||--*.COM Comment file(COM)
|||--MDDRV.DIR All machine data/drive
||||--*.TEA Machine data(TEA)
|||--MDHSA.DIR Machine data/MSD
||||--*.TEA Machine data(TEA)
|||--MDNC.DIR Machine data/NC
||||--*.TEA Machine dataMaschinendaten(TEA)
|||--MDVSA.DIR Machine data/FDD
||||--*.TEA Machine data(TEA)
|||--MPC.DIR Position control circuit
||||--MPCGR1.DIR MPC graphic1
|||||--*.MP1 MPC graphic1 data
||||--MPCGR2.DIR MPC graphic2
|||||--*.MP2 MPC graphic2 data
||||--MPCPAR.DIR MPC parameter
|||||--*.MPC MPC parameter data
|||--MSC.DIR Speed control loop
||||--MSCGR1.DIR MSC graphic1
|||||--*.MS1 MSC graphic1 data
||||--MSCGR2.DIR MSC graphic2
|||||--*.MS2 MSC graphic2 data
||||--MSCPAR.DIR MSC parameter
|||||--*.MSC MSC parameter data
|||--PLC.DIR PLC data
||||--*.COM Comment file(COM)
|||--PLCUD.DIR PLC operand screenforms
||||--*.PLC Operand screenform(PLC)
|||--SPL.DIR Safe programmable logic
||||--*.SPL Safe logic
|||--SVTRC.DIR Servotrace
||||--SVTGR1.DIR SVT graphic1
|||||--*.ST1 SVT graphic1(ST1)
||||--SVTGR2.DIR SVT graphic2
|||||--*.ST2 SVT graphic2(ST2)
||||--SVTPAR.DIR SVT parameter
|||||--*.SVT SVT parameter(SVT)
||--DH.DIR Data management
|||--DCF.COM Configuration
|||--LOG.COM Logbook/DH
|||--TYP.COM Data type
||--DP.DIR Interactive programming
|||--AWB.DIR DP user screens
||||--*.AWB Display description(AWB)
||||--*.COM Comment fileCOM)
||||--*.LST Display list(LST)

 Siemens AG 2003 All Rights Reserved


11-524 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

|||--DPT.DIR DP tools
||||--*.BMP Bitmap for interactive programming tool(BMP)
|||--GPMAC.DIR GP macros
||||--MACM.DIR GP macros milling
|||||--*.DSC GP macro description(DSC)
|||||--*.MAC GP macro code(MAC)
||||--MACT.DIR GP macros turning
|||||--*.DSC GP macro description(DSC)
|||||--*.MAC GP macro code(MAC)
|||--HLP.DIR DP help
||||--*.BMP Bitmap for interactive programming tool(BMP)
||||--*.COM Comment file(COM)
|||--INF.DIR DP basic information
||||--*.BMP Bitmap for interactive programming tool(BMP)
||||--*.COM Comment file(COM)
|||--SIM.DIR Simulation directory
||||--*.COM Comment file(COM)
||||--*.INI Initialization programINI)
||||--CMA.DIR Manufacturer cycles
|||||--*.SPF Subprogram fileSPF)
||||--CST.DIR Standard cycles
|||||--*.SPF Subprogram fileSPF)
||||--CUS.DIR User cycles
|||||--*.SPF Subprogram fileSPF)
||||--GUD4.DEF NC user data 4
||||--GUD5.DEF NC user data 5
||||--GUD6.DEF NC user data 6
||||--GUD7.DEF NC user data 7
||||--GUD8.DEF NC user data 8
||||--GUD9.DEF NC user data 9
||||--MGUD.DEF Global user data/machine manufacturer
||||--MMAC.DEF Macros/machine manufacturer
||||--SGUD.DEF Global data/system
||||--SMAC.DEF Macros/system
||||--UGUD.DEF Global data/user
||||--UMAC.DEF Macros/user
|||--TS.DIR Technology storage
||||--*.LDB TS list structure(LDB)
||||--*.MDB TS data(MDB)
||--HS.DIR MSD data
|||--HS--TEA.ACC Access/MSD TEA
|||--HS1.BOT Boot data/MSD1
|||--HS10.BOT Boot data/MSD10
|||--HS11.BOT Boot data/MSD11
|||--HS12.BOT Boot data/MSD12
|||--HS13.BOT Boot data/MSD13
|||--HS14.BOT Boot data/MSD14
|||--HS15.BOT Boot data/MSD15
|||--HS16.BOT Boot data/MSD16

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-525
Reference 03.03
11.9 Directory structure of the Data Management

|||--HS17.BOT Boot data/MSD17


|||--HS18.BOT Boot data/MSD18
|||--HS19.BOT Boot data/MSD19
|||--HS2.BOT Boot data/MSD2
|||--HS20.BOT Boot data/MSD20
|||--HS21.BOT Boot data/MSD21
|||--HS22.BOT Boot data/MSD22
|||--HS23.BOT Boot data/MSD23
|||--HS24.BOT Boot data/MSD24
|||--HS25.BOT Boot data/MSD25
|||--HS26.BOT Boot data/MSD26
|||--HS27.BOT Boot data/MSD27
|||--HS28.BOT Boot data/MSD28
|||--HS29.BOT Boot data/MSD29
|||--HS3.BOT Boot data/MSD3
|||--HS30.BOT Boot data/MSD30
|||--HS31.BOT Boot data/MSD31
|||--HS4.BOT Boot data/MSD4
|||--HS5.BOT Boot data/MSD5
|||--HS6.BOT Boot data/MSD6
|||--HS7.BOT Boot data/MSD7
|||--HS8.BOT Boot data/MSD8
|||--HS9.BOT Boot data/MSD9
||--IBN.DIR Installation and startup
|||--*.TRC Trace file(TRC)
|||--DAC.BIN DAC parametrzation
||--MB.DIR MBDDE alarms
|||--*.COM Comment file(COM)
||--MPF.DIR Main programs
|||--*.CEC Sag/angularity compensation(CEC)
|||--*.EEC Spindle pitch/encoder error compensation(EEC)
|||--*.MPF Main program(MPF)
|||--*.QEC Quadrant error compensation(QEC)
|||--*.TOP Tool plan(TOP)
|||--DPWP.INI DP Initialization
||--NC_CARD.DIR NC card
|||--ARC.DIR Archives
||||--*.ARC Archiv file(ARC)
|||--CMA.DIR Manufacturer cycles
||||--*.SPF Subprogram file(SPF)
|||--CST.DIR Standard cycles
||||--*.SPF Subprogram file(SPF)
||--OEM.DIR OEM data
|||--*.USD User data(USD)
||--PDA.DIR Working sequence
|||--*.WPP Workpiece plan(WPP)
||--SPF.DIR Subprogram files
|||--*.SPF Subprogram file(SPF)
|||--DPWP.INI DP Initialization

 Siemens AG 2003 All Rights Reserved


11-526 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

||--SYF.DIR System directories


|||--*.SYF System files(SYF)
|||--LOGBOOK.SYF Logbook
|||--VERSION.SYF Version
||--TEMPL.DIR Templates
|||--MANUF.DIR Manufacturer
||||--*.INI Initialize program(INI)
||||--*.JOB Joblist
||||--*.MPF Main program file(MPF)
||||--*.SPF Subprogram file(SPF)
|||--NEWFILES.DIR New files
||||--*.041 AutoTurn program
||||--*.CEC Sag/angularity compensation(CEC)
||||--*.COM Comment file(COM)
||||--*.DAT Time evaluation(DAT)
||||--*.GUD Channel user data(GUD)
||||--*.IKA Compensation data(IKA)
||||--*.INI Initialize programm(INI)
||||--*.JOB Joblist
||||--*.MPF Main program file(MPF)
||||--*.PRO Protection areas
||||--*.RPA R parameter(RPA)
||||--*.SEA Setting data(SEA)
||||--*.SPF Sub program file(SPF)
||||--*.TCM Tool plan, unformatted(TCM)
||||--*.TEA Mchine data(TEA)
||||--*.TMA Magazine data(TMA)
||||--*.TOA Tool offset active(TOA)
||||--*.TOP Tool plan(TOP)
||||--*.UFR Zero offset/user frame(UFR)
|||--Siemens.DIR Siemens
||||--*.JOB Joblist
||||--*.MPF Main program file(MPF)
||||--*.SPF Subprogram file(SPF)
|||--USER.DIR User
||||--*.JOB Joblist
||||--*.MPF Main program file(MPF)
||||--*.SPF Subprogram file(SPF)
||--V24.DIR V24 interface
|||--*.V24 V24 parameter
||--VS.DIR FDD data
|||--HL1.BOT Boot data/HLA1
|||--HL10.BOT Boot data/HLA10
|||--HL11.BOT Boot data/HLA11
|||--HL12.BOT Boot data/HLA12
|||--HL13.BOT Boot data/HLA13
|||--HL14.BOT Boot data/HLA14
|||--HL15.BOT Boot data/HLA15
|||--HL16.BOT Boot data/HLA16

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-527
Reference 03.03
11.9 Directory structure of the Data Management

|||--HL17.BOT Boot data/HLA17


|||--HL18.BOT Boot data/HLA18
|||--HL19.BOT Boot data/HLA19
|||--HL2.BOT Boot data/HLA2
|||--HL20.BOT Boot data/HLA20
|||--HL21.BOT Boot data/HLA21
|||--HL22.BOT Boot data/HLA22
|||--HL23.BOT Boot data/HLA23
|||--HL24.BOT Boot data/HLA24
|||--HL25.BOT Boot data/HLA25
|||--HL26.BOT Boot data/HLA26
|||--HL27.BOT Boot data/HLA27
|||--HL28.BOT Boot data/HLA28
|||--HL29.BOT Boot data/HLA29
|||--HL3.BOT Boot data/HLA3
|||--HL30.BOT Boot data/HLA30
|||--HL31.BOT Boot data/HLA31
|||--HL4.BOT Boot data/HLA4
|||--HL5.BOT Boot data/HLA5
|||--HL6.BOT Boot data/HLA6
|||--HL7.BOT Boot data/HLA7
|||--HL8.BOT Boot data/HLA8
|||--HL9.BOT Boot data/HLA9
|||--SL1.BOT Boot data/SLM1
|||--SL10.BOT Boot data/SLM10
|||--SL11.BOT Boot data/SLM11
|||--SL12.BOT Boot data/SLM12
|||--SL13.BOT Boot data/SLM13
|||--SL14.BOT Boot data/SLM14
|||--SL15.BOT Boot data/SLM15
|||--SL16.BOT Boot data/SLM16
|||--SL17.BOT Boot data/SLM17
|||--SL18.BOT Boot data/SLM18
|||--SL19.BOT Boot data/SLM19
|||--SL2.BOT Boot data/SLM2
|||--SL20.BOT Boot data/SLM20
|||--SL21.BOT Boot data/SLM21
|||--SL22.BOT Boot data/SLM22
|||--SL23.BOT Boot data/SLM23
|||--SL24.BOT Boot data/SLM24
|||--SL25.BOT Boot data/SLM25
|||--SL26.BOT Boot data/SLM26
|||--SL27.BOT Boot data/SLM27
|||--SL28.BOT Boot data/SLM28
|||--SL29.BOT Boot data/SLM29
|||--SL3.BOT Boot data/SLM3
|||--SL30.BOT Boot data/SLM30
|||--SL31.BOT Boot data/SLM31
|||--SL4.BOT Boot data/SLM4

 Siemens AG 2003 All Rights Reserved


11-528 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Reference
11.9 Directory structure of the Data Management

|||--SL5.BOT Boot data/SLM5


|||--SL6.BOT Boot data/SLM6
|||--SL7.BOT Boot data/SLM7
|||--SL8.BOT Boot data/SLM8
|||--SL9.BOT Boot data/SLM9
|||--VS--TEA.ACC Access/FDD TEA
|||--VS1.BOT Boot data/FDD1
|||--VS10.BOT Boot data/FDD10
|||--VS11.BOT Boot data/FDD11
|||--VS12.BOT Boot data/FDD12
|||--VS13.BOT Boot data/FDD13
|||--VS14.BOT Boot data/FDD14
|||--VS15.BOT Boot data/FDD15
|||--VS16.BOT Boot data/FDD16
|||--VS17.BOT Boot data/FDD17
|||--VS18.BOT Boot data/FDD18
|||--VS19.BOT Boot data/FDD19
|||--VS2.BOT Boot data/FDD2
|||--VS20.BOT Boot data/FDD20
|||--VS21.BOT Boot data/FDD21
|||--VS22.BOT Boot data/FDD22
|||--VS23.BOT Boot data/FDD23
|||--VS24.BOT Boot data/FDD24
|||--VS25.BOT Boot data/FDD25
|||--VS26.BOT Boot data/FDD26
|||--VS27.BOT Boot data/FDD27
|||--VS28.BOT Boot data/FDD28
|||--VS29.BOT Boot data/FDD29
|||--VS3.BOT Boot data/FDD3
|||--VS30.BOT Boot data/FDD30
|||--VS31.BOT Boot data/FDD31
|||--VS4.BOT Boot data/FDD4
|||--VS5.BOT Boot data/FDD5
|||--VS6.BOT Boot data/FDD6
|||--VS7.BOT Boot data/FDD7
|||--VS8.BOT Boot data/FDD8
|||--VS9.BOT Boot data/FDD9
||--WKS.DIR Works data file
|||--*.WPD Workpiece(WPD)
||||--*.041 AutoTurn programm
||||--*.CEC Sag/angularity compensation(CEC)
||||--*.COM Comment file(COM)
||||--*.DAT Time evaluation(DAT)
||||--*.GUD Channel user data(GUD)
||||--*.IKA Compensation data(IKA)
||||--*.INI Initialize programm(INI)
||||--*.JOB Joblist
||||--*.MPF Main program file(MPF)
||||--*.PRO Protection areas

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-529
Reference 03.03
11.9 Directory structure of the Data Management

||||--*.RPA R parameter(RPA)
||||--*.SEA Setting data(SEA)
||||--*.SPF Subprogram fileSPF)
||||--*.TCM Tool plan, unformatted(TCM)
||||--*.TEA Machine data(TEA)
||||--*.TMA Magazine data(TMA)
||||--*.TOA Tool offset active(TOA)
||||--*.TOP Tool plan(TOP)
||||--*.UFR Zero offset/user frame(UFR)
||||--DPWP.INI DP initialization
||--WZV.DIR Tool management
|||--MCFG.DIR Magazine configuration
||||--*.INI Initialization programm(INI)
|||--WCFG.DIR Tool management configuration
||||--*.CTC Convert. regulations(CTC)
||||--*.WMF Windows Metafile(WMF)
|||--WDAT.DIR Tool management data
||||--*.LDB Technology storage list structure(LDB)
||||--*.MDB Technology storage data(MDB)
||--_NC_ACT.DIR NC active data

 Siemens AG 2003 All Rights Reserved


11-530 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 contents and meanings of the file


.$$$ temporary file
.000 installation and overlay files
.041 AUTOTURN program
.ACC access descriptions for NCU data
.ANN notes to WINDOWS help files
.APP application file of the user interface GEM
.ARC file compressed with ARC
.ARJ file compressed with ARJ
.ASM source code file in the programming language Assembler
.ASP asynchronous sub program
.BAK backup copy of a file
.BAT batch file (stack file)
.BIN binary file
.BMK bookmark for WINDOWS help files
.BOT boot data FDD/MSD--611D
.BSP request being processed
.C source code file in the programming language C
.CAT dBase catalogue file
.CFG configuration file
.CHK file restored with CHKDSK
.COM executable program, comment file
.CPI files with character tables
.CYC cycles program
.DAT *.DAT time calculation(DAT) = data for AUTOTURN
.DAT data for AUTOTURN (time calculation)
.DBF dBase data file
.DIR directory
.DLL files of the WINDOWS applications
.DOC test file (word processing or ASCII)

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-531
Reference 03.03
11.10 Software Information

Table 11-24 Overview of the file extensions

extension contents and meanings of the file


.EMN request being processed
.EXE executable program
.FPU found in the catalogue MMC2
.FW? framework files
.GEM file of the graphical user interface GEM
.GUD global/channel--specific user data
.HLP help file
.ICO
.IKA interpolated compensation
.INI configuration file (usually Windows applications)
.INX index files (e.g. for data bases)
.LHA file compressed with LHARC
.LIB library file ( for programming languages)
.LUD local/program--specific user data
.LZH file compressed with LHA
.MPF part program
.NDX index files (e.g. for data bases)
.OBJ object files (programming languages)
.OPT options
.ORF file restored with ProFilAct II
.OVL overlay files
.PAS source code file of the programming language PASCAL
.PIF configuration file (Windows)
.PRG application programming files (e.g. dBase)
.REC file restored with RECOVER
.REF cross reference file
.SEA NC setting data
.SIK backup copy of a file (like .BAK)
.SPF subprogram
.SWP swap files, for example for a virtual working memory
.SYF system file
.SYS program (driver; call from CONFIG.SYS)
.TEA NC machine data
.TMP temporary file

 Siemens AG 2003 All Rights Reserved


11-532 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 contents and meanings of the file


.TOA tool data
.TXT text file (word processing or ASCII)
.UFR zero point shift/frames
.WKS Works data file (same: .WDB and .WPS)
.WPD workpiece directory
.ZIP file compressed with PKZIP

11.10.2 Alarm numbers

Table 11-25 List of the alarm number ranges

alarm numbers alarm area alarm text file


NCK alarms
000 000 to 009 999 general alarms ALN_xx.COM
010 000 to 019 999 channel alarms ALN_xx.COM
020 000 to 029 999 axis spindle alarms ALN_xx.COM
030 000 to 039 999 functional alarms
040 000 to 059 999 reserved
060 000 to 062 999 cycle alarms SIEMENS ALZ_xx.COM
063 000 to 064 999 reserved
065 000 to 067 999 cycle alarms user
068 000 to 069 999 reserved
070 000 to 079 999 Compile--Cycles ALN_xx.COM,
developer ALC_xx.COM
and OEM
080 000 to 099 999 reserved

MMC alarms/messages
100 000 to 109 999 MMC 100
100 000 to 100 999 base system
101 000 to 101 999 diagnosis
102 000 to 102 999 services
103 000 to 103 999 machine
104 000 to 104 999 parameter

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-533
Reference 03.03
11.10 Software Information

Table 11-25 List of the alarm number ranges

alarm numbers alarm area alarm text file


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 MMC 101
120 000 to 129 999 MMC 103 ALM_xx.COM
130 000 to 139 999 OEM
140 000 to 199 999 reserved

(200 000 to 299 999 MCU alarms)

300 000 to 399 999 drive alarms ALN_xx.COM

PLC alarms/messages
400 000 to 499 999 general alarms ALP_xx.COM
500 000 to 599 999 channel alarms
600 000 to 699 999 axis spindle alarms
700 000 to 799 999 user area
800 000 to 899 999 sequences/ graphs ALP_xx.COM
810 000 to 810 009 system error messages ALP_xx.COM
in the PLC
900 000 to 999 999 reserved

11.10.3 Drivers

Table 11-26 List of drivers

name function
in directory L:\MMC2\DRIVERS
KBD.DRV

SCANTAB.EXE resetting the END key to TAB


called from AUTOEXEC.BAT

 Siemens AG 2003 All Rights Reserved


11-534 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 ac-
cording 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 scan code code


vertical Softkey 1 5E 0xE0
vertical Softkey 2 5F 0xE1
vertical Softkey 3 62 0xE2
vertical Softkey 4 63 0xE3
vertical Softkey 5 64 0xE4
vertical Softkey 6 65 0xE5
vertical Softkey 7 66 0xE6
vertical Softkey 8 67 0xE7

ETC 69 0xE8
MACHINE 6A 0xE9

open parenthesis ( 0xEA


close parenthesis ) 0xEB

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-535
Reference 03.03
11.10 Software Information

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 gene-
rates 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 neces-
sary to eliminate these key codes as soon as possible. The keyboard driver contai-
ned 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

Key ScanCode VirtKeycode


VSK0: 0x5E 0xE0
VSK1: 0x5F 0xE1
VSK2: 0x62 0xE2
VSK3: 0x63 0xE3
VSK4: 0x64 0xE4
VSK5: 0x65 0xE5
VSK6: 0x66 0xE6
VSK7: 0x67 0xE7
SingleQuote: 0x68 0xBF (like PC)
ETC: 0x69 0xE8
MACHINE: 0x6A 0xE9
( 0x6B 0xEA
) 0x6C 0xEB

 Siemens AG 2003 All Rights Reserved


11-536 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 Codes from SW version 5.1UPD

Key ScanCode VirtKeycode


VSK0: like Shift--F1 like Shift--F1
VSK1: like Shift--F2 like Shift--F2
VSK2: like Shift--F3 like Shift--F3
VSK3: like Shift--F4 like Shift--F4
VSK4: like Shift--F5 like Shift--F5
VSK5: like Shift--F6 like Shift--F6
VSK6: like Shift--F7 like Shift--F7
VSK7: like Shift--F8 like Shift--F8
SingleQuote: like SingleQuote like SingleQuote
ETC: like Shift--F9 like Shift--F9
MACHINE: like Shift--F10 like Shift--F10
( like ( like (
) 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 SY-
STEM.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 keybo-
ard 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 03.03
11.10 Software Information

Simulating the OP031 with a MF2--keyboard

Table 11-30 Function--keys for area applications with VB and AL

function key meaning


F1 to F8 activate the horizontal softkeys
F9 RECALL--key
F10 area--changeover key
F11 channel--changeover key
F12 Info--key

Shift+F1 to Shift+F8 activate the vertical softkeys


Shift+F9 ETC--key
Shift+F10 machine--area key
Shift+F11 presently not being used
Shift+F12 presently not being used

Escape--key alarm acknowledgment


Home--key window--changeover key

11.10.4 Supported languages and Language shortcuts

Table 11-31 Languages and applied ANSI--table/Code--Page

Language Abbreviation Code--Page (DOS) ANSI--Table


(Windows)
German GR 850 1252
English UK 850 1252
Spanish SP 850 1252
Italian IT 850 1252
French FR 850 1252
Chinese(simplified) CH 936 --
Chinese (traditional) TW 950 --
Korean KO 949 --
Japanese JA 932 --
Swedish SW 850 1252
Hungarian HU 852 1250
Portuguese PO 850 1252

 Siemens AG 2003 All Rights Reserved


11-538 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

Language Abbreviation Code--Page (DOS) ANSI--Table


(Windows)
Czech CZ 852 1250
Turquoise TR 857 1254
Russian RU 866 1251
Polish PL 852 1250
Dutch NL 850 1252
Finnish FI 850 1252

11.10.5 Assignment of ANSI tables and fonts

Table 11-32 ANSI-Table 1250 (Central Europe)

Font File Characters


Arial Cearial.ttf Arial CE (True Type)
Arial bold Ceariabd.ttf Arial CE Bold (True Type)
Arial italic Ceariali.ttf Arial CE Italic (True Type)
Arial bold italic Caeriabi.ttf Arial CE Bold Italic (True Type)

Table 11-33 ANSI-Table 1251 (Cyrillic)

Font File Characters


Arial Aricyr.ttf Arial Cyr (True Type )
Arial bold Aricyb.ttf Arial Cyr Bold (True Type )
Arial italic Aricyri.ttf Arial Cyr Italic (True Type )
Arial bold italic Aricyrbi.ttf Arial Cyr Bold Italic (True Type )

Table 11-34 ANSI-Table 1252 (West Europe)

Font File Characters


Arial Windows--Stan- Arial (True Type )
dard
Arial bold Windows--Stan- Arial Bold (True Type )
dard
Arial italic Windows--Stan- Arial Italic (True Type )
dard
Arial bold italic Windows--Stan- Arial Bold Italic (True Type )
dard

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 03.03
11.11 Hardware information

11.11 Hardware information

11.11.1 Memory addresses

Table 11-35 Overview of über memory address ranges

identification range (hex)


Boot vector FFFF000:FFF0
System BIOS (after RESET) FFFF000:0000
reserved 200000:0000
DRAM 40000:0000
DRAM 10000:0000
Boot vector F000:FFF0
System BIOS F000:0000
PCMCIA window range/EMS E000:0000
Adapter RAM/ROM (PCMCIA/LAN/SCSI) D000:0000
Adapter RAM/ROM (PCMCIA/LAN/SCSI) CC00:0800
MPI/AMPlus--L range CC00:0000
Adapter RAM/ROM (PCMCIA/LAN/SCSI) C800:0000
VGA BIOS C000:0000
VGA DRAM A000:0000
DRAM 0050:0000
BIOS variable 0040:0000
Vector table 0000:0000

 Siemens AG 2003 All Rights Reserved


11-540 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 assign-
ments 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 IRQ Option Option


1 2 ISA--adapter PC--card
adapter
0 timer 0 no no
1 keyboard controller 1 yes no
interrupt controller 2 Ê 2 -- --
2 real time clock 8 no no
3 free(Graphic) 9 yes yes
4 MPI (K--Bus) 10 yes yes
5 free 11 yes yes
6 free (COM 3/4) 12 yes yes
7 math. coprocessor 13 no no
8 hard disk 14 yes yes
9 free 15 yes yes
10 serial interface 2 3 yes yes
(COM 2)
11 serial interface 1 4 yes yes
(COM 1)
12 free(parallel 5 yes yes
interface 2, LAN)
13 floppy drive 6 yes no
14 parallel interface 1 7 yes yes
(LPT 1)

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition 11-541
Reference 03.03
11.11 Hardware information

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 address (hex)


DMA controller #1 000 to 01F
Interrupt controller 020 to 03F
Timer 040 to 05F
Keyboard controller 060 to 06F
Real--time clock, CMOS memory, NMI 070 to 07F
mask
Manufacturers diagnostic checkpoint 080
(POST--Codes)
DMA page register 080 to 09F
Interrupt controller #2 0A0 to 0BF
DMA controller #2 0C0 to 0DF
arithmetic coprocessor 0F0 to 0FF
Hard disk (secondary) 170 to 177
Hard disk 1F0 to 1F7
Game I/O (joystick A/D--port) 200 to 207
Sound card 220 to 257
Parallel printer #2 278 to 27F
EGA #2 2C0 to 2DF
Asynchronous adapter port #2 2F8 to 2FF
Prototype card 300 to 31F
e.g. Computer Link Board DF 15 (COM 338 to 33F
3)
LAN card 360 to 36F
Parallel printer #1 378 to 37F
Bisynchronous port #2 (SDLC) 380 to 38F
Bisynchronous port #1 3A0 to 3AF
Video Graphics Array (VGA) or 3B0 to 3DF
alternatively 3B0 to 3BF
Monochrome Display Adapter/Printer 3C0 to 3CF
#1 or alternatively 3D0 to 3DF
Enhanced Graphics Adapter (EGA) #1
or alternatively
Color/Graphics Adapter (CGA) and
EGA

 Siemens AG 2003 All Rights Reserved


11-542 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 address (hex)


PCMCIA controller 3E0 to 3E1
Disk controller 3F0 to 3F7
Asynchronous adapter Port #1 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 03.03
11.11 Hardware information

Notes

 Siemens AG 2003 All Rights Reserved


11-544 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Applications 12
The delivery volume of the OEM package MMC contains some examples that al-
low you to quickly get familiar with the design of the operator’s interface and to ex-
tend 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 exam-
ple 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 Sequence Control / Application change--over

Goal
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 environ-
ment.
It demonstrates how to realize your own Sequence Control and how to modify soft-
key 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 03.03
12.2 NCDDE Server

12.2 NCDDE Server

Goal
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 Alarm Server

Goal
The example OEMBSP3 shows how to work with the message module MBDDE.
Via the DDE mechanism the Alarm Server provides services for the alarm hand-
ling.
The Alarm Server can be used directly under Visual Basic or via the Sequence
Control.

 Siemens AG 2003 All Rights Reserved


12-546 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Applications
12.4 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 correspon-
ding 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 Example Regie/OEMFRAME

Goal
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 Re-
gie 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 03.03
12.5 Data Management Server

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 Data Management Server

Goal
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 Manage-
ment 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 NCDDE Server for PLC data

Goal
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.

 Siemens AG 2003 All Rights Reserved


12-548 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Applications
12.7 Positioning WINDOWS applications

12.7 Positioning WINDOWS applications

Goal
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 Example Data exchange between Visual Basic and DLL

Goal
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 Functions of the Sequence Control

Goal
You may not use some components of Visual Basic like e.g. message boxes in
your OEM applications. The Sequence Control provides substitute solutions. Ex-
ample 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 03.03
12.10 Sequential processing of several asynchronous jobs

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 cor-
rect sequence is kept even when several commands are issued is shown in exam-
ple 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 imple-
ment 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.

 Siemens AG 2003 All Rights Reserved


12-550 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 Mi-
crosoft Developer Studio Visual C++ 4.1 was used. This is on the one hand a dia-
log--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 03.03
12.13 Embedding SprintPlus in MMC--OEM applications

Platz für Notizen

 Siemens AG 2003 All Rights Reserved


12-552 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Appendix A
This Chapter contains the abbreviations and technical terms used in the OEM pak-
kage 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 03.03
A1 Abbreviations

A1 Abbreviations
ACC ACCESS module
ASCII American Standard for Information Interchange
ASUP Asynchronous NC subprogram
BIOS Basic Input Output System
DDE Dynamic Data Exchange: method for data exchange between two
WINDOWS applications
DLL Dynamic Link Library
DRAM Dynamic random access memory
IPO Interpolator
ISA Industrial Standard Adapter: bus standard for PC extension adap-
ter boards based on IBM--AT
MCS Machine Coordinate System
MMC Human Machine Interface: operating interface of the NC applying
to the software running on the operator’s panel
MPI Multiport interface
NC Numerical control
NCDDE Dynamic data exchange with the NC kernel
NCK Numerical Control Kerne consists of block preparation, motion
control etc.
NCU Numerical Control Unit: hardware component of SINUMERIK
840D, accommodating the NCK software.
NSK Numerical System Keyword: Keyword for addressing NC variables
with the NCDDE server
OEM 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.
OP 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)

 Siemens AG 2003 All Rights Reserved


M-554 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Appendix
A1 Abbreviations

PC Personal Computer
PCMCIA 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.
PI Program nstance
PLC Programmable logic controller
RAM memory that allows random access for reading and writing data
WCS workpiece coordinate system
VB Visual Basic
WfW Windows for Workgroups

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-555
Appendix 03.03
A2 Technical terms

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 sy-
stem 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 structu-
red 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.

 Siemens AG 2003 All Rights Reserved


M-556 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Appendix
A2 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 accesses NC, PLC and drive data
S Domain Service copies files from MMC to NCK and back
S PI Service starts Program Invocation Services of the NC
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 connec-
ted to the HMI component of a control. It offers memory and communication func-
tionality on a small space.
PI Service
The PI Service invokes the execution of special commands defined in the NC ker-
nel. 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 pro-
gram 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 charac-
terized 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.

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-557
Appendix 03.03
A3 Reference

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

 Siemens AG 2003 All Rights Reserved


M-558 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 (09.01 Edition)
Order No.: 6FC5 298-4AA30-0BP3

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


AutoTurn Graphic Programming System (09.01 Edition)
Operator’s Guide
Programming / Setting up
Order No.: 6FC5 298-4AA50-0BP3

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


Operator’s Guide (10.00 Edition)
Order No.: 6FC5 298-6AA00-0BP0

/BAD/ SINUMERIK 840D/810Di/810D


Operator’s Guide HMI Advanced (09.01 Edition)
Order No.: 6FC5 298-6AF00-0BP1

/BEM/ SINUMERIK 840D/810D


Operator’s Guide HMI Embedded (09.01 Edition)
Order No.: 6FC5 298-6AC00-0BP1

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


Operator’s Guide Unit Operator Panel (04.96 Edition)
Order No.: 6FC5 298-3AA60-0BP1

/BAH/ SINUMERIK 840D/840Di/810D


Operator’s Guide HT 6 (HPU new) (09.01 Edition)
Order No.: 6FC5 298-0AD60-0BP2

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


Short Operation Guide (02.01 Edition)
Order No.: 6FC5 298-6AA10-0BP0

/BAM/ SINUMERIK 840D/810D


Operator’s Guide ManualTurn (10.01 Edition)
Order No.: 6FC5 298-6AD00-0BP0

/BAS/ SINUMERIK 840D/810D


Operator’s Guide ShopMill (10.01 Edition)
Order No.: 6FC5 298-6AD10-0BP0

/BAT/ SINUMERIK 840D/810D


Operator’s Guide ShopTurn (03.01 Edition)
Order No.: 6FC5 298-6AD50-0BP0

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-559
Appendix 03.03
05.01
A3 Reference

/BAP/ SINUMERIK 840D/840Di/810D


Operator’s Guide Handheld Programming Unit (04.00 Edition)
Order No.: 6FC5 298-5AD20-0BP1

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


User’s Guide Measuring Cycles (10.00 Edition)
Order No.: 6FC5 298-6AA70-0BP0

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


Diagnostics Guide (09.01 Edition)
Order No.: 6FC5 298-6AA20-0BP1

/KAM/ SINUMERIK 840D/810D


Short Guide ManualTurn (11.98 Edition)
Order No.: 6FC5 298-2AD40-0BP0

/KAS/ SINUMERIK 840D/810D


Short Guide ShopMill (01.98 Edition)
Order No.: 6FC5 298-2AD30-0BP0

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


Programming Guide Fundamentals (09.01 Edition)
Order No.: 6FC5 298-6AB00-0BP1

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


Programming Guide Advanced (09.01 Edition)
Order No.: 6FC5 298-6AB10-0BP1

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


Short Guide Programming (09.01 Edition)
Order No.: 6FC5 298-6AB30-0BP1

/PGM/ SINUMERIK 840D/840Di/810D


Programming Guide ISO Milling (10.01 Edition)
Order No.: 6FC5 298-6AC20-0BP1

/PGT/ SINUMERIK 840D/840Di/810D


Programming Guide ISO Turning (10.01 Edition)
Order No.: 6FC5 298-6AC10-0BP1

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


Programming Guide Cycles (09.01 Edition)
Order No.: 6FC5 298-6AB40-0BP1

/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

 Siemens AG 2003 All Rights Reserved


M-560 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
05.01
03.03 Appendix
A3 Reference

/SYI/ SINUMERIK 840Di


System Overview (01.00 Edition)
Order No.: 6FC5 298-5AE40-0BP0

Manufacturer/Service Documentation

a) Lists

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


SIMODRIVE 611D
Lists (09.01 Edition)
Order No.: 6FC5 297-6AB70-0BP1

b) Hardware

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


Operator Components Manual (HW) (09.01 Edition)
Order No.: 6FC5 297-6AA50-0BP1

/BHA/ SIMODRIVE Sensor


Absolute Encoder with PROFIBUS-DP
User Guide (HW) (02.99 Edition)
Order No.: 6SN1197-0AB10-0YP1

/EMV/ SINUMERIK, SIROTEC, SIMODRIVE


EMC Installation Guide
Planning Guide (HW) (06.99 Edition)
Order No.: 6FC5 297-0AD30-0BP1

/PHC/ SINUMERIK 810D


Configuring Manual (HW) (12.00 Edition)
Order No.: 6FC5 297-4AD10-0BP1

/PHD/ SINUMERIK 840D


NCU 561.2-573.2 Configuring Manual (HW) (09.01 Edition)
Order No.: 6FC5 297-6AC10-0BP1

/PHF/ SINUMERIK FM-NC


NCU 570 Configuring Manual (HW) (04.96 Edition)
Order No.: 6FC5 297-3AC00-0BP0

/PMH/ SIMODRIVE Sensor


Measuring System for Main Spindle Drives
Configuring/Installation Guide, SIMAG-H (HW) (05.99 Edition)
Order No.: 6SN1197-0AB30-0BP0

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-561
Appendix 03.03
05.01
A3 Reference

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 Various Interface Signals
A3 Axis Monitoring, Protection Zones
B1 Continuous Path Mode, Exact Stop and Look Ahead
B2 Acceleration
D1 Diagnostic Tools
D2 Interactive Programming
F1 Travel to Fixed Stop
G2 Velocities, Setpoint/Actual-Value Systems, Closed-Loop Control
H2 Output of Auxiliary Functions to PLC
K1 Mode Group, Channel, Program Operation Mode
K2 Axes, Coordinate Systems, Frames,
Actual-Value System for Workpiece, External Zero Offset
K4 Communication
N2 EMERGENCY STOP
P1 Transverse Axes
P3 Basic PLC Program
R1 Reference Point Approach
S1 Spindles
V1 Feeds
W1 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 Digital and Analog NCK I/Os
B3 Several Operator Panels and NCUs
B4 Operation via PG/PC
F3 Remote Diagnostics
H1 Jog with/without Handwheel
K3 Compensations
K5 Mode Groups, Channels, Axis Replacement
L1 FM-NC Local Bus
M1 Kinematic Transformation
M5 Measurement
N3 Software Cams, Position Switching Signals
N4 Punching and Nibbling
P2 Positioning Axes
P5 Oscillation
R2 Rotary Axes
S3 Synchronous Spindles
S5 Synchronized Actions (up to and including SW 3)
S6 Stepper Motor Control
S7 Memory Configuration
T1 Indexing Axes

 Siemens AG 2003 All Rights Reserved


M-562 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
05.01
03.03 Appendix
A3 Reference

W3 Tool Change
W4 Grinding

/FB3/ SINUMERIK 840D/840Di/810D(CCU2)/FM-NC


Description of Functions, Special Functions (Part 3) (09.01 Edition)
(the various sections are listed below)
Order No.: 6FC5 297-6AC80-0BP1
F2 3-Axis to 5-Axis Transformation
G1 Gantry Axes
G3 Cycle Times
K6 Contour Tunnel Monitoring
M3 Coupled Axes and ESR (previously Coupled Motion and
Master/Slave Couplings)
S8 Constant Workpiece Speed for Centerless Grinding
T3 Tangential Control
V2 Preprocessing
W5 3D Tool Radius Compensation
TE1 Distance Control
TE2 Analog Axis
TE3 Master-Slave for Drives
TE4 Transformation Package for Handling
TE5 Setpoint Exchange
TE6 MCS Coupling
TE7 Retrace Support
TE8 Unclocked Path-Synchronous Switching Signal Output
V2 Preprocessing
W3 3D Tool Radius Compensation

/FBA/ SIMODRIVE 611D/SINUMERIK 840D/810D


Description of Functions, Drive Functions (09.01 Edition)
(the various sections are listed below)
Order No.: 6SN1 197-0AA80-0BP7
DB1 Operational Messages/Alarm Reactions
DD1 Diagnostic Functions
DD2 Speed Control Loop
DE1 Extended Drive Functions
DF1 Enable Commands
DG1 Encoder Parameterization
DM1 Calculation of Motor/Power Section Parameters and
Controller Data
DS1 Current Loop Control
DÜ1 Monitors/Limitations

/FBAN/ SINUMERIK 840D/SIMODRIVE 611 Digital


Description of Functions
ANA Module (02.00 Edition)
Order No.: 6SN1 197-0AB80-0BP0

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-563
Appendix 03.03
05.01
A3 Reference

/FBD/ SINUMERIK 840D


Description of Functions Digitizing (07.99 Edition)
Order No.: 6FC5 297-4AC50-0BP0

DI1 Start-Up
DI2 Scanning with Tactile Sensors (scancad scan)
DI3 Scanning with Lasers (scancad laser)
DI4 Milling Program Generation (scancad mill)

/FBDN/ CAM Integration DNC NT-2000


Description of Functions
System for NC Data Management and Data
Distribution (05.00 Edition)
Order No.: 6FC5 297-5AE50-0BP1

/FBFA/ SINUMERIK 840D/840Di/810D


Description of Functions
ISO Dialects for SINUMERIK (09.01 Edition)
Order No.: 6FC5 297-6AE10-0BP1

/FBFE/ SINUMERIK 840D/810D


Description of Functions Remote Diagnosis (09.01 Edition)
Order No.: 6FC5 297-6AF00-0BP0

FE1 Remote Diagnosis


FE2 Alarm-Triggered Messaging by E-Mail: @Event

/FBHLA/ SINUMERIK 840D/SIMODRIVE 611 Digital


Description of Functions
HLA Module (04.00 Edition)
Order No.: 6SN1 197-0AB60-0BP2

/FBMA/ SINUMERIK 840D/810D


Description of Functions ManualTurn (10.01 Edition)
Order No.: 6FC5 297-5AD50-0BP1

/FBO/ SINUMERIK 840D/810D


Description of Functions
Configuring of OP 030 Operator Interface (09.01 Edition)
(the various sections are listed below)
Order No.: 6FC5 297-6AC40-0BP0

BA Operator’s Guide
EU Development Environment (Configuring Package)
PS Online only: Configuring Syntax (Configuring Package)
PSE Introduction to Configuring of Operator Interface
PSE Introduction to Configuring of Operator Interface
IK Screen Kit: Software Update and Configuration

/FBP/ SINUMERIK 840D


Description of Functions C-PLC Programming (03.96 Edition)
Order No.: 6FC5 297-3AB60-0BP0

 Siemens AG 2003 All Rights Reserved


M-564 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 (02.00 Edition)
Order No.: 6FC5 297-5AD60-0BP0

NFL Host Computer Interface


NPL PLC/NCK Interface

/FBSI/ SINUMERIK 840D/SIMODRIVE


Description of Functions SINUMERIK Safety Integrated (03.01 Edition)
Order No.: 6FC5 297-6AB80-0BP0

/FBSP/ SINUMERIK 840D/810D


Description of Functions ShopMill (10.01 Edition)
Order No.: 6FC5 297-5AD80-0BP0

/FBST/ SIMATIC (11.98 Edition)


FM STEPDRIVE/SIMOSTEP
Description of Functions
Order No.: 6SN1 197-0AA70-0YP3

/FBT/ SINUMERIK 840D/810D


Description of Functions ShopTurn (03.01 Edition)
Order No.: 6FC5 297-6AD70-0BP0

/FBSY/ SINUMERIK 840D/840Di/810D(CCU2)


Description of Functions Synchronized Actions (09.01 Edition)
for Wood, Glass, Ceramics, Presses
Order No.: 6FC5 297-6AD40-0BP1

/FBTD/ SINUMERIK 840D/810D


Description of Functions
Tool Information SINTDI with Online Help (03.01 Edition)
Order No.: 6FC5 297-6AE00-0BP0

/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

/FBW/ SINUMERIK 840D/840Di/810D


Description of Functions Tool Management (10.01 Edition)
Order No.: 6FC5 297-5AC60-0BP1

/HBI/ SINUMERIK 840Di


Manual (07.01 Edition)
Order No.: 6FC5 297-5AE60-0BP0

/KBU/ SIMODRIVE 611 universal


Short Description (05.00 Edition)
Closed-Loop Control Component for Speed Control
Order No.: 6SN1 197-0AB40-0BP3

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-565
Appendix 03.03
05.01
A3 Reference

/PJE/ SINUMERIK 840D/810D


HMI Embedded Installation Package (08.01 Edition)
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)

/PJFE/ SIMODRIVE (08.01 Edition)


Planning Guide 1FE1 Synchronous Built-In Motors
AC Motors for Main Spindle Drives
Order No.: 6SN1 197-0AC00-0BP1

/PJLM/ SIMODRIVE
Planning Guide Linear Motors (06.01 Edition)
(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

/PJM/ SIMODRIVE
Planning Guide Motors
AC Motors for Feed and
Main Spindle Drives (09.00 Edition)
Order No.: 6SN1 197-0AA20-0BP4

/PJU/ SIMODRIVE 611-A/611-D


Planning Guide Converters (05.01 Edition)
Order No.: 6SN1 197-0AA00-0BP5

/POS1/ SIMODRIVE POSMO A (04.01 Edition)


Operator’s Guide
Distributed Positioning Motor on PROFIBUS DP
Order No.: 6SN2197-0AA00-0BP2

/POS2/ SIMODRIVE POSMO A (12.98 Edition)


Installation Instructions (enclosed with POSMO A)
Order No.: 462 008 0815 00

/POS3/ SIMODRIVE POSMO SI/CD/CA (01.01 Edition)


Distributed Servo Drive Technology, User Manual
Order No.: 6SN2197-0AA20-0BP0

/S7H/ SIMATIC S7-300 (10.98 Edition)


-- Manual: Assembly, CPU Data (HW)
-- Reference Manual: Module Data
Order No.: 6ES7 398-8AA03-8AA0

 Siemens AG 2003 All Rights Reserved


M-566 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
05.01
03.03 Appendix
A3 Reference

/S7HT/ SIMATIC S7-300 (03.97 Edition)


Manual: STEP 7, Basic Information, V. 3.1
Order No.: 6ES7 810-4CA02-8AA0

/S7HR/ SIMATIC S7-300 (03.97 Edition)


Manual: STEP 7, Reference Manuals, V. 3.1
Order No.: 6ES7 810-4CA02-8AR0

/S7S/ SIMATIC S7-300 (04.97 Edition)


FM 353 Step Drive Positioning Module
Order in conjunction with Configuring Package

/S7L/ SIMATIC S7-300 (04.97 Edition)


FM 354 Servo Drive Positioning Module
Order in conjunction with Configuring Package

/S7M/ SIMATIC S7-300 (10.99 Edition)


FM 357 Multi-Axis Module for Servo and Stepper Drives
Order in conjunction with Configuring Package

/SHM/ SIMODRIVE 611 (01.98 Edition)


Single-Axis Positioning Control for MCU 172A
Order No.: 6SN 1197-4MA00-0BP0

/SP/ 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

d) Installation and
Start-up
/IAA/ SIMODRIVE 611A
Installation and Start-Up Guide (10.00 Edition)
Order No.: 6SN 1197-0AA60-0BP6

/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

/IAD/ 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

/IAF/ SINUMERIK FM-NC


Installation and Start-Up Guide (07.00 Edition)
Order No.: 6FC5 297-3AB00-0BP1

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition M-567
Appendix 03.03
05.01
A3 Reference

/IAM/ SINUMERIK 840D/840Di/810D


MMC/HMI Installation and Start-Up Guide (09.01 Edition)
Order No.: 6FC5 297-6AE20-0BP1

AE1 Updates/Options
BE1 Expand the operator interface
HE1 Online Help
IM2 Start-Up HMI Embedded
IM4 Start-Up HMI Advanced (PCU50)
TX1 Setting Foreign language Texts

 Siemens AG 2003 All Rights Reserved


M-568 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
Index
A C
access mask, 10-441 CALL, 8-378
access permission, 10-440 Cancel, 10-460
AccessLevel, 6-186 cancel, 3-126
Actions, softkey, 7-328 change of value for test , 3-129
actions , 7-245 Change_SkText, 7-309
Activate, 10-470 Change_SkTextOnScr, 7-309
Activate2, 10-471 ChangeEtcAccesslevel, 7-333
Active file system, 11-482 CHILDS, 4-153
adding ETC, 7-332 Client, 8-339
addressing domains in NCK , 8-363 Client--Server , 9-412
Advise Links, error handling, 8-396 client--server--model, 8-339
aeditor, 4-158 CommandToTask, 6-197
AL_GetSkTextByState, 7-307 complete overview of data, 10-438
AL_SetSkTextByIndex, 7-307 Configuring the network, 8-399
Alarm Connection break down with NCK, 8-396
maximum number, 9-424 contrast control, 6-172
order, 9-424 Convert_Possible_Datatypes, 10-453
Section DEFAULTPRIO, 9-427 Create, 10-474
Section Helpcontext, 9-426 current access permission level, 10-441
Section KEYS, 9-429 Cycles, 6-197
Section PROTOCOL, 9-428
Section TextFiles, 9-424
--timeFormat, 9-424 D
alarm log files , 3-132
data format (directory/ASCII), 10-439
alarm number, 11-533
data formats, 11-488
Alarm-- Filter, 9-427, 9-428
Data Management of the complete system ,
AlarmFree, 9-415
3-134
AlarmList, 9-417
Data Management, additional infos, 3-135
AlarmMsg, 9-415
Data Management, advantages , 3-133
alarms/messages , 3-132, 9-411
Data Management, features, 3-136
ALDisableEtcSKAction, 7-333
data management, functions , 10-435, 10-449
ALEnableEtcSKAction, 7-334
Data Management, overview , 3-133
ALGetDLLEntriesI, 7-304
data scheme , 3-133
ALGetDLLEntriesIRaw, 7-305
Data Scheme, definition, 10-437
ALGetDLLEntriesIRaw, 1-96
data type, Archive, 10-444
ALGetDLLEntriesRaw, 1-96, 7-303
DDE share manager, use, 8-397
ALNewEtcReturnstring, 7-333
DDE--communikation with Standard VB--Con-
ALNewEtcSuccessor, 7-333
trols, 8-380
ANIMATE, 8-378
DDE--features , 8-339
application area, 4-144
DDE--Link--Server, 8-339
application modal windows, 7-275
DDE--Link--Topic, 8-339
application--specific windows, 4-146
DDETest, 11-505
area application , 6-171
Defining global variables in the MMC, 8-404
area change--over, 3-126
Defining global variables in the NCK, 8-404
CmdLine, 6-182
definition of data for test, 3-129
attribute timeout, 6-182

 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 nSwitchToTaskAfterTermination, 6-233


DH . INI, 5-161 FlushTime, 1-71, 9-429
Directly accessing NCK data, 3-134 foreign languages, language--DLL, 7-259
DisableKeys, 6-190 frame, MDIframe, 7-243
DiskCare, 9-429 FREE, 8-377
Display unit, 3-121 Fullscreen--applications in WINDOWS, 4-145
displaying alarms , 3-132 function
Document Conventions, 1-30 GetMMCDir, 6-217
Domain Service, 11-485 GetMMCLanguagePath, 6-218
Domain Service , 3-128 InitComplete, 6-218
Domain Service of the NC--DDE Server, 3-130 Functions as from software version 6.2, 7-333
drivers, 11-534

G
E g_chAdd_OnPath, 1-54
elements of the header , 4-145 g_chGlobalProfile, 7-335
end of text areas, 7-261 g_chHelpContext, 7-336
Entry ExitButtonIndex, 6-193 g_chLocalProfile, 7-335
Entry HelpTaskIndex, 6-194 g_chMBDDEServiceName, 7-335
entry identifier, 6-177, 6-180 g_chMMCPATH, 1-54, 7-335
error classes, 11-506 g_chNCDDEServiceName, 1-68, 7-335
Error classes for general = 1, 4, 6, 11-507 g_chOemPath, 1-54
Error classes for general = 2, 11-512 g_chUserPath, 1-54
Error codes for general = 1, 4, 6, 11-508 g_nAccessLevel, 7-336
Error codes for general = 2, 11-512 g_nHelpInfo, 7-336
Error codes for general = 5, 11-513 General error classes, 11-506
Error codes forr general = 7, 11-514 GeneralTexts, 6-199
error messages from NCK, 8-396 Get_Attributes, 10-454
Error messages from the Data Management, Get_FormIndex, 7-292
11-518 Get_Propertynames, 10-456
Error regions, 11-507 GetCurrentTaskIndex, 6-217
Exist, 10-461 GIMMEKEYS, 6-187
ExitButtonAccessLevel, 6-193 Graphic chip, 11-543
ExitButtonQueryUser, 6-193 graphical user interface , 4-143
Experience with PCs, 1-28
Explanation of data type, 10-439
Extensions of NC--functions, 1-24 H
hardware interfaces , 1-25
Hardware--supplements, 1-23
F header, 4-144
file DH.INI, 3-135, 10-437 HeaderOnTop, 6-183
file extension, 10-439 Hide_A_Child, 7-295
file extensions, 11-531 Hide_Childs, 7-295
file REGIE.DLL, 6-172 hiding the header , 4-145
file REGIE.INI, 6-172 HMI as an open architecture, 1-24
File systems MMC/NCK, 10-438 HMI shut--down, 2-104
files without additional infos, 3-135 horizontal softkey bar, 4-144
FirstAlarm, 9-418 hotline, 1-29
fKeepPlacement, 6-237 Hotlink from Excel, 8-352
fRestoreTaskWindow, 6-234 HSoftkeyTexts, 6-198
nSecondsToFindWindows, 6-232

 Siemens AG 2003 All Rights Reserved


Index-570 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 N
Knowledge of the NC--subject, 1-28
Name, 6-182
Create, problems, 2-109
name, 10-439
power cut, 1-54, 2-108
name of language DLL, 7-260
NC--DDE Server, connection state , 8-395
NC--DDE Server, initialization, 8-340
L NCDDE--variables, array, 8-355
Lack of resources in the NC--DDE Server, NCDDE311.NSK, 8-343
8-396 NETNAMES.INI, 5-164
Language abbreviations, 9-431 network boards, 3-140
Languages, 11-538 Networking the MMC103, 8-397
LastError, 11-505 Release version 3.4, 1-32
Link--Item, 10-449 NEW, 8-376
Link--Server, 10-449 new state, 4-153
Link--Topic, 10-449 NrOfAlarm, 9-420
List, 10-477 number of windows , 4-146
LoadLibrary -- first call, 2-106
Loadmethod, processing, 7-262
Lock/UnlockCurrent NCU, 6-213 O
Lock_Softkey, 7-299
OEM user alarms, 4-145
LockChanMenu, 6-214
OEM--Frame, 3-126
LockSkByAction, 7-297
OEMFRAME.INI, 5-165
LockSkByState, 7-298
initialization, 6-228
LockSkByStateAndAction, 7-298
open software , 1-25
log file, 9-427, 9-428
Operating unit, 3-120
log set--up , 3-132

P
M
parameter for the title bar , 4-146
machine control panel, 3-121
parameters for the display section, 4-147
MATRIX, 4-152
passive file system, 11-484
MBDDE.INI, 5-162
PI Service, 3-128, 11-485
alarms, 9-424

 Siemens AG 2003 All Rights Reserved


HMI Programming Package Part 1 (BN) -- 03.2003 Edition Index-571
Index 03.03

SW 6.0 sequence structure, 3-126, 7-243


Functional changes and extensions, 1-84 Server, 8-339
IMC COM server, 1-88 Set_ChildType, 7-295
OPC server, 1-87 Set_Previous_State, 7-287
OPI variables, 1-88 several MMCs in the network , 8-400
PI services, 1-94 Show_A_Hidden_Child, 7-297
PI_RESUME, 8-374 Show_Focus, 7-296
PI_RESUME_BINARY, 8-374 Show_Hidden_Childs, 7-297
PI_START, 8-374 ShowMessageBox, 6-196
PI_START_BINARY, 8-374 ShowResources, 6-197
PI_STOP, 8-374 skip header , 4-145
PI_STOP_BINARY, 8-374 softkey texts, 7-263
PLC_MEMORYRESET, 8-379 spelling of child names , 2-107
positioning windows, 7-275 standard keyboard , 3-121
Possible_Datatypes, 10-458 standard software tools, 1-27
PreLoad, 6-184 Start--form and DLL, 7-262
pressing softkeys, 7-282 starting sequence, 3-125, 6-171
Lock_Softkey, 7-299 Starting sequence of the server, 8-400
procedure, Unlock_Softkey, 7-301 state, 7-277
state , 3-127, 7-244
state number, 7-278
R State table, 7-277
state transition , 7-246
R parameter, 10-446
state/action, 7-278
RC file, comments, 7-261
State_Changed, 7-288
ReadCmdLine, 6-215
State_Reached, 7-289
ReadCmdLineMe, 6-215
Status of the transfer, 3-130
RECALLkey, 7-328
Stopsave, 10-468
RecLen, 9-429
storage location of data, 10-440
Records, 9-429
storage of language DLLs, 7-259
REGIE.INI, 5-167, 6-174
structure of the display screen, 4-144
registry features for messages, 3-132, 9-411
subwindow, MDIchild, 7-243
REGISTRY, SYSTEM.INI, 2-103
SVGA--Graphic--chip, 11-543
Remote Help, 6-194, 6-239
SwitchToChild, 6-207
Rename, 10-463
SwitchToChildEx, 6-207
request job, 10-449
SwitchToHelpTask, 6-205
Request, realized in C/C++, 10-451
SwitchToParent, 6-208
Return, ASCII--Text, 7-280
SwitchToParentAndKillMe, 6-208
RHelp, call, 6-239
SwitchToPreviousTask, 6-204
RHelp, initialization, 6-240
SwitchToTask, 6-204
RHelp, notebook function, 6-241
SwitchToTask2, 6-204
RHelp, utilization, 6-240

T
S
Table of configuration/OEM domains, 1-24
S7DPMPI.INI, 5-168
TerminateTasks, 6-184
scancodes, 11-536
Test tools, 1-27
screen on/off, 6-212
text areas in language DLL, 7-260
ScreenTwips, 2-108
text entry in language--DLL, 7-260
Section Miscellaneous, 6-191
text indices for softkeys, 7-280
sections of the file DH.INI, 3-136
The Data Managements view on the data,
sections of REGIE.INI, 6-174
3-134
Select, 10-464

 Siemens AG 2003 All Rights Reserved


Index-572 HMI Programming Package Part 1 (BN) -- 03.2003 Edition
03.03 Index

Training, 1-29 Variable Service , 3-128


two line softkey texts, 7-328 vertical softkey bar, 4-144
VGA resolution , 4-146
vkd_mmc2.386, 11-535
U VSoftkeyTexts, 6-199
Unlock_Softkey, 7-301
UnlockChanMenu, 6-214
UnlockSkByAction, 7-300 W
UnlockSkByState, 7-300 window, standard form, 7-275
UnlockSkByStateAndAction, 7-301 Write_Dialog, 7-310
update, 1-29 WriteCmdLine, 6-215
upgrade, 1-29
user interface, 4-143
Z
z--flag , 3-127, 7-244
V Z--flag/succeeding state, 7-281
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 Corrections
A&D MC IS for Publication/Manual:
Postfach 3180
SINUMERIK 840D/840Di/
D--91050 Erlangen SINUMERIK 801D/FM--NC
HMI Programming Package Part 1
(Tel. +49 180 / 525 -- 8008 / 5009 [hotline]
Fax +49 9131 / 98 -- 1145
Mailto: motioncontrol.docu@erlf.siemens.de) Manufacturer Documentation
User’s Manual
From
Edition: 03.2003
Name
Address of your company/department Should you come across any printing errors
when reading this publication please notify us on
Steet this sheet. Suggestions for improvement are al-
so welcome.
Zip code: City:
Telephone: /
Telefax: /

Suggestions and/or corrections

S-ar putea să vă placă și