SINUMERIK 840D - 840di SINUMERIK 810D - FM - NC HMI PDF
SINUMERIK 840D - 840di SINUMERIK 810D - FM - NC HMI PDF
SINUMERIK 840D - 840di SINUMERIK 810D - FM - NC HMI PDF
SINUMERIK 810D/FM--NC
Manufacturer/Service Documentation
Document Structure
Manufacturer/Service Documentation
General information 2
Regie 6
Sequence Control 7
Interface between
HMI and NCK/PLC 8
Valid for:
Data Management 10
Component Softwareversion
HMI 6.3
Reference 11
Sample Application 12
Appendix A
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.
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
Marken
SIMATICr, SIMATIC HMIr, SIMATIC NETr, SIROTECr, SINUMERIKr und SIMODRIVEr sind
eingetragene Marken der Siemens AG. Die übrigen Bezeichnungen in dieser Druckschrift können Marken
sein, deren Benutzung durch Dritte für deren Zwecke die Rechte der Inhaber verletzen können.
Siemens AG 2000. All rights reserved. Subject to change without proir notice.
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.
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:
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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.
Notes
A3 Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . M-558
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . I-569
Notes
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.
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
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++
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.
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’.
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).
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.
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.
1.5 Support
The OEM user is provided several kinds of support:
-- training
-- software support service with hotline
-- hard-/software development service
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.
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
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
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.
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.
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.
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.
Note
This configuration tool is suitable for editing the initialization files REGIE.INI star-
ting with release 3.2.
Access levels and user classes may also be defined and managed with symbolic
names.
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.
Variable safeFctEnable
The variable safeFctEnable for SISITEC axes provides the contents of the ma-
chine data MD 36901_SAFE_FUNCTION_ENABLE.
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 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).
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.
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
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:
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.
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.
New PI Services
Now there is an online--help available for PI Services.
The following PI Services are available since software release 4.2.
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.
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.
Note
The configuration tool is suitable for editing initialization files starting from SW 4.2.
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.
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;
if (hAB16DLL<0 || hAB16DLL>HINSTANCE_ERROR) {
lpfnGetPrivateProfileString = (PFN_GETPRIVATEPROFILESTRING *
lpfnGetPrivateProfileInt = (PFN_GETPRIVATEPROFILEINT *)
}
if (!lpfnGetPrivateProfileString)
lpfnGetPrivateProfileString = GetPrivateProfileString;
if (!lpfnGetPrivateProfileInt)
lpfnGetPrivateProfileInt = GetPrivateProfileInt;
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);
Note
This function is described in chapter 7.
Overview
Software release 4.3 has not been added additional features compared to release
4.2.
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.
OEMFRAME
With OEMFRAME you can now incorporate 32--bit--applications in the Regie.
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.
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.
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).
Online help
The online help on topics BTSS variables (BTSS_GR.HLP) and PI Services
(PI_GR.HLP) have been adapted.
Update to SW 5.1
Please refer to the file: ”Releas_d.wri” ’Updating to SW 5.1’
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.
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)
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.
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.
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.
Note
These files will be overwritten when the software is updated.
Note
The softkey ”Exit” may be locked in the file REGIE.INI with the entry ”ExitBut-
ton=False”.
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
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
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.
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.
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.
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
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)
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.
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.
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.
More information you will find in the online help file (PI_UK.HLP).
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)
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)
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.
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.
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
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”.
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.
IRegieEvt/
IRegieEvt IRegieSvr IRegieSvr
OEMFrame
REG_CMD.EXE
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.
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.
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.
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)
CTRLOUT_MODULE_NR Ô MDCA_CTRLOUT_MODULE_NR
CTRLOUT_TYPE Ô MDCA_CTRLOUT_TYPE
ENC_MODULE_NR Ô MDCA_ENC_MODULE_NR
ENC_TYPE Ô MDCA-ENC_TYPE
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
PI services
The following PI service has been added:
_N_F_OPER
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.
Note
When several Hotlinks have the same Itemtext, they can be differentiated by
prefixing with blanks in Item.
Horizontal softkeys
The position and size of horizontal softkey text boxes have been changed only
slightly (multiple--line texts with increased resolution)
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
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.
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
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
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
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
Note
These files will be overwritten when the software is updated.
Note
The softkey ”Exit” may be locked in the file REGIE.INI with the entry
”ExitButton=False”.
Overview
In this section you can find some tricks and tips to make work easier for you.
Overview
The following section describes problems that might possibly occur during opera-
tion and shows how to solve them instead of calling the hotline.
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.
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 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.
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).
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
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”).
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.
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.
IRegieEvt/
IRegieEvt IRegieSvr IRegieSvr
OEMFrame
REG_CMD.EXE
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:
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”.
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”
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
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.
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.
Internal Communication
data acquisition
Drives velocity control
current control
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
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.
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.
3.1.2 Options
There are several interfaces and additional components provided for functionally
expanding the base system:
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
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
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.
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.
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
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 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.
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.
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.
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.
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
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.
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:
registry--DDEServer
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.
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.
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.
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.
application 1
NCK
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
Initialization file
The file DH.INI contains among others the following sections (table 3--5):
section meaning
DHSTART root directory of the MMC Data Management on the hard disk
SCEME name of the binary parts of the data scheme
3.3 Communication
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.
MSST
Roff
= MPI Adapter
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)
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.
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:
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.
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:
Configuration
An OEM application is configured with Visual Basic or Visual C++. How to do this
is shown in the following chapters.
Overview
The graphical user interface of the SINUMERIK 840D is structured in four fields for
NC--specific applications:
dialog line
horizontalsoftkeys
Arrangement
The elements of the header briefly described in table 4--1 are arranged according
to the following figure:
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’.
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.
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.
Title bar
Parameters recommended for the title bar are:
Display section
The parameters recommended for the display section are:
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:
symbol meaning
^ Recall is possible: This is a jump back to the higher menu level.
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’.
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.
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.
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:
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].
Section CHILDS
Specify here the symbolic names for the entries of the section [TaskConfiguration]
in the file regie.ini
Syntax:
[CHILDS]
symbol=number
where:
Example:
[CHILDS]
HINZ=8
KUNZ=17
HINZ addresses the area application 8, KUNZ the area application 17.
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.
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.
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
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
Const CHILD_INDEX_EDITOR = 35
Dim nRet As Integer
nRet = WriteCmdLineVB(CHILD_INDEX_EDITOR, sCmdLine)
Call SwitchToChild(CHILD_INDEX_EDITOR)
Notes
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.
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
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
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
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.
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.
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.
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.
Note
Only file ”S7DPMPI.INI” of the windows directory is taken into account.
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).
Regie
setting in to operation
NCDDE server
DDEML.DLL AL_UTIL.DLL
MMSYSTEM.DLL MMC.DLL
VBRUN300.DLL
Fig. 6-1 Regie links area applications to auxiliary programs and DLLs
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.
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.
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.
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.
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.
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.
section function
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.
You can modify the file REGIE.INI for your purposes by e.g. adding information for
version management in the section version:
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”).
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”).
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.
Attributes
Table 6--2 gives an overview over the attributes of the entries in the section Star-
tupConfiguration.
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.
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
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>
...
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.
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.
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
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.
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.
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/.
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)
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.
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.
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.
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,
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.
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.
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.
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
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 .
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
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
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.
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):
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:
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).
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).
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.
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
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
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.
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
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.
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.
This section contains the texts of the vertical softkey bar of the Regie. The softkey
labeling cannot be reconfigured.
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.
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.
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.
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 functions
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
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’
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
Use
The functions of the RegieServer are available from C/C++ as well as from Visual
Basic.
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.
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.
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”.
Table 6-12 Functions of the RegieServer (switching tasks to the hidden area)
”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.
Task 0 to 7
ETC êêêêêê SwitchToChild(Ex)
ê
Task 8 to 15
ETC SwitchToParent
êêêêêê
ê
Task 16 to 23
Task 24 to 31
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.
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].
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.
Overview
Table 6-13 gives an overview of the RegieServer functions for switching tasks im-
mediately:
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.
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.
SwitchTo
function +F8 running
Parent Im-
mediate
step 1: data area bar activa-
ÜÜÜ
F10 ted function +F8 running F10
ÜÜÜ
vated F10
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.
Table 6-14 gives an overview of the functions of the RegieServer concerning the
screen control.
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).
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.
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:
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.
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.
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:
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-
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
6.4.8 Miscellaneous
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.
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.
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.
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.
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 = ...
...
Note
The event Deactivate of the RegieServer shall not be mistaken by the deactivation
of an application.
Note
The Sequence Control got already implemented such an interface in the MDI-
Form1 (in Alstart.frm) and evaluates the RegieEvents.
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.
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!
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)
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.
Note
It is not possible to enter a WINDOWS application like EXCEL directly in the sec-
tion [TaskConfiguration] of the file REGIE.INI:
Note
The OEM frame monitors the application it has started. If the application is closed,
the OEM frame closes itself, too.
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-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.
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
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
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.
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
program
100,280 400,280
working area
softkeys
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!
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.
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
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.
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.
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.
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.
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.
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.
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).
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.
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
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.
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:
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
Fig. 6-7 Storage location of the additional info for help texts
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
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.
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
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
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
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).
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.
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.
AB Sequence Control
ADD ON additional Siemens products
. . 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)
REGIE.INI
OEM-spezific REGIE-INI (differences only)
USER.NSK OEM-spezific file
..
OEMBSP1
OEMBSP1.MDI MDI-Childs für OEM-example 1
..
..
RE
SAMPLERS.OEM OEM-directory
(in connection with the OEM package only)
LANGUAGE
language files for OEM projects
..
OEMBSPO OEM-example 0
OEMBSP12 OEM-example 12
OEMBSP12.INI
..
..
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.
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.
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
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.
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 )
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
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
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
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):
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
The files of the Sequence Control are located in the directory ..\AB. They are listed
in table 7--2.
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!
In addition to the application--specific forms, the application has to provide the fol-
lowing files (Table 7-3):
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.
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.
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.
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.
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.
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”
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):
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
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.
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.
Step 1
Start Visual C++ 6.0
Step 2
Create a new project using the menu File --> New …
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.
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.
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.
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).
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.
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”.
Note
For editing a Cyrillic text make sure to switch the keyboard layout to Cyrillic before
you start editing!
S Go on by clicking ”Yes”.
The ”File Conversion” dialog appears.
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
Preload (from SW 6)
Die Angabe Preload=True bewirkt, daß diese Form bereits beim Start der Applika-
tion geladen wird.
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.
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.
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.
State table
All states and all actions of an application are recorded as a state table in the file
PROGNAME.ZUS:
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 ( ” \ ” )
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.
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.
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.
Comment
(optionally): Comment giving an explanation; length max. 25 characters.
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
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.
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
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.
Overview
Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)
Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)
Table 7-8 Overview of the functions and procedures (F/P: F = function, P = procedure)
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
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
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.
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)
Arguments
Note
This function must be programmed by the user.
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).
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
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
Argument
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
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.
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
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 )
Arguments
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
Note
This procedure must be called in the event routine Form_Deactivate.
Hide_A_Child
Description
The procedure Hide_A_Child allows to hide individual MDIchilds.
Application
Syntax
Sub Hide_A_Child (FormName As Form)
Arguments
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
Arguments
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
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
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)
Arguments
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
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
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
Note
After a state change--over previously locked softkeys are unlocked.
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
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
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
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
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
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.
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
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
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.
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
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
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
Return value
The procedure returns the softkey text as string.
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
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
Arguments
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
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
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
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)
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
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.
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
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)
Arguments
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.
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
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.
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
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”)
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
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
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
Arguments
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.
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
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() )
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
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 )
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
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
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
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
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
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
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
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);
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
The horizontal softkeys range from 0 to 7, the vertical ones from 8 to 15, the RE-
CALL--key is located on 16.
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.
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.
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.
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:\\...)
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.
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.
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
g_nEtcLevel meaning
0 Softkey texts of the standard bar
1 Softkey texts of the extension ETC1
2 Softkey texts of the extension ETC2
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)
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)
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.
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.
Overview
The Menu Tree Generator is no longer part of the HMI environment package (from
ver. 6).
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
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
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.
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.
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.
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.
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.
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‘.
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).
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.
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 “#”.
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).
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”).
Note
For reading a value only once, set LinkMode equal 2. The first channel then
requests the value with the method ”Link Request”.
Note
If the channel identifier ”u1” is not specified, the first channel is accessed by
default.
Note
For hotlink ”LinkMode” must be set 1.
Note
For notifying when changed (Warmlink) ”LinkMode” must be set 3.
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.
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.
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.
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.
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
Overview
Under Excel you can build up Advise (Hotlink)--connections to the NCDDE Server’s
interface for variables using cell formulas.
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.
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.
Note
In chapter 11 Reference and in the variables online--help you will find a complete
description of the variables that can be accessed.
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.
Result: 10101010101010101
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 (”|”).
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
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.
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
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
Overview
The Domain Services can be used to transfer files between the areas (domains)
HMI and NCK/PLC.
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.
Description
Using these functions you can transfer data/data files between the HMI and the
NC/PLC.
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).
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
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”
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.
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.
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.
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.
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.
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
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).
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.
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.
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.
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):
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
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.
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 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
Overview
Further commands of the NCDDE Server are listed in Table 8-7:
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
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
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
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)
Argument
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
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.
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:
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:
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:
value property
VertCenter vertically centered (default)
TopJustify top justified
BottomJustify bottom justified
MultiLine multiline
WordBreak property
If the property VertAlignment/Multiline has been set Multiline, the property
WordBreak determines the 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.
Data property
The Data property is used as an argument for the following DDE transactions:
DataToCaption property
The DataToCaption property determines the destination of data received by DDE--
transactions.
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.
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.
LinkFilter property
The LinkFilter value may range from 0 to 65535. How to use it, was described in
the paragraph LinkNext.
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.
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
...
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:
These functions are mainly intended for debugging in the environment of the
NCDDE Server.
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:
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:
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:
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
8.10.3 Troubleshooting
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.
β 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
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”.
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
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.
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
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
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.
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.
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
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)
Note
Backup all programs, frames and machine data before you load the file
INITIAL.INI, since this reformats the static memory of the NCK.
Note
The NSK file is generated in both binary format (*.MAP) and ASCII format (*.NSK).
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/ .
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.
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.3 Form Load takes long because many Hotlinks are being
established
Reason
For some commands the NCDDE Server expects an existing connection to the
NC.
Solution
First establish a hotlink to a NC variable.
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
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)
HMI
COM
Alarm Server
(MBDDE.EXE)
MPI
MPI
SINUMERIK 840D
(NCK/PLC)
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” ).
Overview
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
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
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
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)
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
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.
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
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
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
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
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
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
argument description
alarmNo identification number of the alarm which corresponding alarm
text is to be returned
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
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
Files
The Alarm Server (registry module) uses the following files :
MBDDE.INI
NETNAMES.INI
alarm text files
Description
The file MBDDE.INI contains, among others, the following sections:
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
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.
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.
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.
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’.
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.
File
Path and name of the log file
Filter
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.
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.
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.
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
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:
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:
entry meaning
alarmNo alarm number
display 0 display in the alarm/message line of the header
1 display in the dialog box
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”
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
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
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)
MPI
SINUMERIK 840D
(NCK/PLC
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
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:
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.
Note
The consistency of the defined structure can be checked for files and directories
located on the PCU50 hard disk only.
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.
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
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.
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.
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
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.
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
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.
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.
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).
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).
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.
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
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.
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
Argument Description
name name of the file or directory
extension extension of the file or directory
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
Argument Description
name file name or ”*” as substitute
extension file extension
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
Argument Description
name directory name
extension file extension
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
Argument Description
name name of the Data Management path or file name
mode --m for MMC or --n for NCK
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
Note
During start--up of the Data Management server this list is initialized depending on
the selected language.
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
Argument Description
dhpath name of the Data Management path or file name
mode --m for MMC or --n for NCK
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
Argument Description
dhpath name of the Data Management path or file name
mode --m for MMC or --n for NCK
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.
Cancel
Description
Cancels all jobs ( complex Execute jobs ) with the indicated result variable.
Application
Cancels a complex job
Syntax
LinkExecute: cancel DHServer--Variable
Arguments
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
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
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
Note
From these error messages you cannot distinguish whether the job has not been
executed or the file has not been found.
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
Argument Description
dhpath name
channel specification of a channel number ( always two digits )
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
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
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
Argument Description
dhpath name in the Data Management path
channel two digit channel number
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]
Arguments
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.
Note
For directories the permission is set on MMC as well as on NCK in order to
guarantee a unified view on these directories.
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
Argument Description
VarName name of the variable
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
Argument Description
VarName name of the variable
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.
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.
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
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.
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]
Arguments
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
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
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.
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
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
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
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.
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
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
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
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:
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.
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
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#
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.
11.1 Overview
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
communication K00
module
passive file system P01
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.
workpieces _N_WKS_DIR
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.
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.
unsigned 16 2 0 to 65535
Byte (PLC) 8 1
Word (PLC) 16 2
Doubleword 32 4
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”.
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’.
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]
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.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:
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:
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.
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--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”]
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> .......
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.
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).
The variable ’lastError’ is a value of the type long int, that consists of 4 compo-
nents (bytes):
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:
00 00 00 00
Note
The meaning of the 3rd and 4th byte depends on the value of the first byte.
01,04,06 xx xx code
02 xx class xx
02 xx class code
Byte 3 and 4 of LastError are generated by the NCU if general=3. Therefore they
depend on the software version of the NCU.
05 xx xx code
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
07 xx xx code
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.
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.
|||--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
||||--*.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
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
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
name function
in directory L:\MMC2\DRIVERS
KBD.DRV
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
ETC 69 0xE8
MACHINE 6A 0xE9
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.
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.
In order to use these languages, each of them must be installed under Windows.
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.
The I/O--addresses 000 to 0FF are reserved for the main board, the ports 100 to
3FF are available for extender cards.
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
Notes
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).
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.
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
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.
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”.
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
Requirements
Basic knowledge of the use of VISUAL BASIC, VISUAL C++ (for modifying a DLL)
and of the development of an OEM application.
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.
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.
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.
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.
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.
Requirements
Basic knowledge of VISUAL BASIC, VISUAL C++ (for editing a DLL) and of how
to create and integrate an OEM application.
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.
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.
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.
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.
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)
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
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.
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.
A3 Reference
General Documentation
/ST7/ SIMATIC
SIMATIC S7 Programmable Logic Controllers
Catalog ST 70
Order No.: E86 060-K4670-A111-A3
Electronic Documentation
User Documentation
Manufacturer/Service Documentation
a) Lists
b) Hardware
c) Software
W3 Tool Change
W4 Grinding
DI1 Start-Up
DI2 Scanning with Tactile Sensors (scancad scan)
DI3 Scanning with Lasers (scancad laser)
DI4 Milling Program Generation (scancad mill)
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
/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
d) Installation and
Start-up
/IAA/ SIMODRIVE 611A
Installation and Start-Up Guide (10.00 Edition)
Order No.: 6SN 1197-0AA60-0BP6
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
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
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
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