SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning...

338
SINUMERIK 840C Software Version 6 OEM Version for Windows TM User's Guide Manufacturer Documentation 09.2001 Edition

Transcript of SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning...

Page 1: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

SINUMERIK 840CSoftware Version 6

OEM Version for WindowsTM

User's Guide

Manufacturer Documentation

09.2001 Edition

Page 2: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation
Page 3: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

SINUMERIK 840CSoftware Version 6

User's GuideOEM Version for Windows

Applies to

Control Software VersionSINUMERIK 840C/CE 6(Standard/Export version)

09.01 Edition

Introduction 1

Overview and Installation 2

System Structure of 840C 3

Alarms 4

DDE Interface 5

Sample Programs 6

Appendix

I Code Interface A1

Reference Guide A2

Function Identifiersfor Data Management A3

Abbreviations A4

Page 4: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

SINUMERIK Documentation

Order No. 6FC5198-6AA70-0BP2 Siemens-AktiengesellschaftPrinted in the Federal Republic of Germany

Printing history

Brief details of this edition and previous editions are listed below.

The status of each edition is shown by the code in the "Remarks" column.

Status code in the "Remarks" column:

A ...........................New documentation.B ...........................Unrevised reprint with new Order No.C ...........................Revised edition with new status.

Edition Order No. Remarks

06.94 6FC5198-3AA70-0BP0 A11.94 6FC5198-4AA70-0BP0 C12.95 6FC5198-5AA70-0BP0 C04.96 6FC5198-5AA70-0BP1 C07.97 6FC5198-6AA70-0BP0 C01.99 6FC5198-6AA70-0BP1 C09.01 6FC5198-6AA70-0BP2 C

This manual is included in the documentation on CD-ROM (DOCONCD)

Edition Order No. Remarks

10.01 6FC5 198-6CA00-0BG2 C

TrademarksSIMATIC , SIMATIC HMI , SIMATIC NET , SIROTEC , SINUMERIK and SIMODRIVE areregistered trademarks of Siemens AG. Other brands mentioned in this publication might be trademarkswhose use by a third party for his own purposes could violate the rights of the proprietors.

Further information is available on the Internet under:http:/www.ad.siemens.de/sinumerik

This publication was produced with Microsoft Word V 7.0and Designer V 4.0.The reproduction, transmission or use of this document or its contentsis not permitted without express written authority. Offenders will beliable for damages. All rights, including rights created by patent grantor registration of a utility model or design, are reserved.

Siemens AG 2001. All rights reserved

Other functions not described in this documentation might beexecutable in the control. This does not, however, represent anobligation to supply such functions with a new control or whenservicing.

We have checked that the contents of this document correspond to thehardware and software described. Nonetheless, differences might existand therefore we cannot guarantee that they are completely identical.The information contained in this document is, however, reviewedregularly and any necessary changes will be included in the nextedition. We welcome suggestions for improvement.

Subject to change without prior notice.

Page 5: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

09.01

Preliminary Remarks

Notes for the reader: The SINUMERIK documentation is organized in 4 parts:

• General Documentation

• User Documentation

• Manufacturer Documentation and

• Service Documentation

This manual is intended for OEM customers and manufacturers ofmachine tools who use the SINUMERIK 840C OEM Version forWindows.

The software of the integrated MMC of the SINUMERIK 840C OEMVersion for Windows includes the operating systems:

• MS-DOS 6.22

• MS-Windows for Workgroups 3.11 (WfW 3.11)

• FlexOS

The control can be started up both under Windows for Workgroups3.11 and FlexOS. If FlexOS is booted, the control is functionallyidentical with the SINUMERIK 840C/CE (basic version).

Booting under WfW 3.11 provides the OEM customer or machinemanufacturer with a way of integrating his own technological expertiseinto the control under a widely used operating system platform.Moreover, with MS Windows it is possible to make use of the widerange of inexpensive software for technical and industrial applicationson the control.

This manual describes the method of operation and parameter optionsof the internal software modules of the integrated MMC and providesthe user with the information required to develop and integrate his ownapplications into the software system.

This manual is intended to be introductory, so the reader does notneed any special knowledge except for experience of NC technologyand a basic knowledge of how to program the MS Windows operatingsystem.

For the acquisition or improvement of knowledge of these subjects, werecommend the training courses provided by SIEMENS. Pleaseconsult your local SIEMENS branch office or national company forfurther information.

Page 6: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

09.01

The Manufacturer Documentation for the 840C control is subdividedinto the following parts:

• Interface- Part 1: Signals- Part 2: Connection Conditions

• PLC 135 WB/WB2/WD Planning Guide

• Function Macros

• Planning Guides- Package 0: Basic Functions- Package 1: Tool Management- Package 4/5: Computer Link- Package 7: Code Carriers- Package 8: PLC Controlled Data Input/Output

There are also SINUMERIK publications that apply to all SINUMERIKcontrols (e.g. Measuring Cycles, CL 800 Cycle Language)

You can obtain more details from your local Siemens branch office ornational company.

When using SINUMERIK Safety Integrated (SI) in connection withOEM applications for 840 C Windows, please observe the notes

given in the Safety Integrated documentation.

This manual only applies to the controlSINUMERIK 840C, OEM Version for Windows,

Software Version 4, 5 and 6

For more detailed information on the MS DOS and MS Windowsoperating systems, please refer to the original documentation of the

Microsoft Corporation

MS-DOS is a registered trademark of the Microsoft Corporation

MS is a registered trademark of the Microsoft Corporation

Microsoft is a registered trademark of the Microsoft Corporation

Windows is a trade name of the Microsoft Corporation

Visual Basic is a trade name of the Microsoft Corporation

Visual C++ is a trade name of the Microsoft Corporation

ROBOHELP is a registered trademark of the Blue Sky Software Corporation

Page 7: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

09.01

Warning notes

The following warning notes with varying degrees of severity are used in the documentation:

Danger

Indicates an imminently hazardous situation which, if not avoided, willresult in death or serious injury or in substantial property damage.

Warning

Indicates a potentially hazardous situation which, if not avoided, couldresult in death or serious injury or in substantial property damage.

Caution

Used with the safety alert symbol indicates a potentially hazardoussituation which, if not avoided, may result in minor or moderate injury orin property damage.

Caution

Used without safety alert symbol indicates a potentially hazardoussituation which, if not avoided, may result in property damage.

Notice

Used without the safety alert symbol indicates a potential situationwhich, if not avoided, may result in an undesirable result or state.

Page 8: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

09.01

Page 9: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

Table of Contents

1 Introduction .................................................................................................................. 1-1

2 Overview and Installation............................................................................................ 2-1

2.1 System requirements ..................................................................................................... 2-2

2.2 Installation procedure ..................................................................................................... 2-2

2.3 Additional notes on the OEM test environment .............................................................. 2-3

2.4 Directory structure of the OEM test environment ........................................................... 2-4

3 System Structure of 840C ........................................................................................... 3-1

3.1 Overview ........................................................................................................................ 3-1

3.1.1 Hardware concept .................................................................................................... 3-1

3.1.2 Software structure of the integrated PC ................................................................... 3-2

3.1.3 Basic modules .......................................................................................................... 3-4

3.1.4 NCK / PLC / SIMODRIVE 611-D interface ............................................................... 3-6

3.2 Hardware configuration .................................................................................................. 3-7

3.2.1 Brief description of hardware.................................................................................... 3-7

3.2.2 Integrated PC ........................................................................................................... 3-93.2.2.1 Block diagram........................................................................................................... 3-103.2.2.2 Processor 80486....................................................................................................... 3-103.2.2.3 System memory........................................................................................................ 3-103.2.2.4 Mass storage medium .............................................................................................. 3-123.2.2.5 Watch Dog................................................................................................................ 3-123.2.2.6 VGA video graphic unit ............................................................................................. 3-123.2.2.7 Electrical and mechanical data ................................................................................. 3-123.2.2.8 PCMCIA software support ........................................................................................ 3-123.2.1.9 I/O address areas ..................................................................................................... 3-263.2.1.10 Interrupt assignments ............................................................................................... 3-273.2.3 Hardware interfaces on the MMC CPU .................................................................... 3-283.2.3.1 Serial interface RS232 (COM1)................................................................................ 3-283.2.3.2 Serial interface RS232/TTY (COM2) ........................................................................ 3-283.2.3.3 Parallel interface (LPT1) ........................................................................................... 3-293.2.3.4 Keyboard interface.................................................................................................... 3-303.2.3.5 RGB interface ........................................................................................................... 3-303.2.3.6 VGA analog interface (PC-compatible)..................................................................... 3-303.2.3.7 Hardware settings on the MMC CPU ....................................................................... 3-313.2.3.8 Operator controls and displays................................................................................. 3-313.2.3.9 SINUMERIK link bus................................................................................................. 3-313.2.3.10 AT96 local bus.......................................................................................................... 3-323.2.3.11 Use of interfaces COM3 and COM4......................................................................... 3-333.2.4 The AT box ............................................................................................................... 3-343.2.4.1 Overview................................................................................................................... 3-343.2.4.2 The ISA local bus in the AT rack .............................................................................. 3-353.2.4.3 AT bus power supply ................................................................................................ 3-363.2.4.4 Using PC/AT cards ................................................................................................... 3-36

3.3 New features in software version 6 ................................................................................ 3-38

3.3.1 Transmission of key code to PLC............................................................................. 3-38

Page 10: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3.3.2 Program frame for WINDOWS and DOS applications (SW 6 and higher)................ 3-393.3.2.1 Integrating Windows programs ................................................................................. 3-393.3.2.2 Integrating DOS programs........................................................................................ 3-403.3.3 Storing the alarm messages as a file for DOS applications (SW 6 and higher)........ 3-42

3.3.4 Mode switchover without displaying Siemens pictures (SW 6 and higher) ............... 3-43

3.4 Basic modules ................................................................................................................ 3-44

3.4.1 Application structure and operation .......................................................................... 3-443.4.1.1 Display applications .................................................................................................. 3-453.4.1.2 Background applications........................................................................................... 3-453.4.1.3 Operation via softkeys .............................................................................................. 3-453.4.2 Start-up of the control ............................................................................................... 3-463.4.2.1 Merging files with the "MIXER" program................................................................... 3-463.4.2.2 Merging initialization files (*.INI)................................................................................ 3-473.4.2.3 Merging batch files (*.BAT) ....................................................................................... 3-493.4.2.4 Merging (CONFIG.SYS) configuration files .............................................................. 3-513.4.2.5 Merging autostart files (REG_AUTO.CFG)............................................................... 3-533.4.3 Area switchover ........................................................................................................ 3-543.4.3.1 Configuration options in REGIE.INI .......................................................................... 3-543.4.3.2 Switching off the control............................................................................................ 3-593.4.3.3 Express shutdown..................................................................................................... 3-603.4.3.4 Autostart function via REG_AUTO.CFG ................................................................... 3-623.4.3.5 Starting applications via the job list ........................................................................... 3-653.4.4 NCK task................................................................................................................... 3-663.4.4.1 Output window .......................................................................................................... 3-663.4.4.2 Menus and softkey labeling ...................................................................................... 3-673.4.4.3 Language dependence ............................................................................................. 3-673.4.4.4 Available areas (menus) of the NCK......................................................................... 3-683.4.4.5 Storing the menus in the NCK area .......................................................................... 3-683.4.4.6 Changing the operating mode................................................................................... 3-683.4.4.7 PLC inserts ............................................................................................................... 3-683.4.4.8 Color settings for NCK task and alarm/message line ............................................... 3-693.4.5 Keyboard driver......................................................................................................... 3-733.4.5.1 Operator panel keyboard .......................................................................................... 3-743.4.5.2 Full keyboard on KYRU II ......................................................................................... 3-743.4.5.3 MF2 keyboard on SBC.............................................................................................. 3-743.4.5.4 Key codes ................................................................................................................. 3-753.4.5.5 Kyru expansions ....................................................................................................... 3-773.4.5.6 New features in Software version 5.1 ....................................................................... 3-793.4.6 Data manager ........................................................................................................... 3-923.4.6.1 Reading files in and out ............................................................................................ 3-933.4.6.2 Editor "WEdit" ........................................................................................................... 3-953.4.6.3 Expansion options..................................................................................................... 3-983.4.6.4 Access rights in data management........................................................................... 3-1003.4.6.5 The NCK data selector.............................................................................................. 3-1013.4.6.6 Data handling via DB 37 ........................................................................................... 3-1023.4.7 V24 parameterization................................................................................................ 3-105

3.4.8 Softkey manager....................................................................................................... 3-1063.4.8.1 Setting/deleting characters in the RECALL field ....................................................... 3-1093.4.8.2 NCK font ................................................................................................................... 3-1103.4.8.3 Operating the softkey menu with an external keyboard............................................ 3-1103.4.8.4 Operating the softkey menu with the mouse............................................................. 3-1103.4.9 Clock ......................................................................................................................... 3-111

3.4.10 Watchdog.................................................................................................................. 3-111

3.4.11 Access protection...................................................................................................... 3-111

Page 11: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3.4.11.1 Password management ............................................................................................ 3-1123.4.11.2 Setting up the password levels ................................................................................. 3-1143.4.12 FDD/MSD service display......................................................................................... 3-115

3.4.13 OEM information....................................................................................................... 3-115

3.4.14 840C language concept............................................................................................ 3-1163.4.14.1 Change language ..................................................................................................... 3-1163.4.14.2 Method of operation.................................................................................................. 3-1173.4.14.3 Special features of initial start-up.............................................................................. 3-1183.4.15 840C directory tree ................................................................................................... 3-119

3.5 SIN840C.INI ................................................................................................................... 3-120

4 Alarms ........................................................................................................................... 4-1

5 DDE Interface................................................................................................................ 5-1

5.1 Windows DDE ................................................................................................................ 5-1

5.1.1 Establishing a link ..................................................................................................... 5-1

5.1.2 Types of link.............................................................................................................. 5-25.1.2.1 Static data................................................................................................................. 5-25.1.2.2 Dynamic updating ..................................................................................................... 5-35.1.2.3 Notification of change ............................................................................................... 5-45.1.3 Terminating links....................................................................................................... 5-6

5.1.4 The DDEML library ................................................................................................... 5-6

5.2 DDE server of the SIN 840C OEM version for Windows................................................ 5-7

5.2.1 Activating the server ................................................................................................. 5-8

5.2.2 Link initiation with the server..................................................................................... 5-8

5.2.3 Time response.......................................................................................................... 5-9

5.3 Alarm handling via DDE ................................................................................................. 5-10

5.3.1 Setting alarms........................................................................................................... 5-10

5.3.2 Clear all alarms......................................................................................................... 5-11

5.3.3 Reading alarms......................................................................................................... 5-12

5.3.4 Changing the display mode of the alarm/message line ............................................ 5-13

5.4 Central status scan......................................................................................................... 5-14

5.5 MMC NCK interface ....................................................................................................... 5-16

5.5.1 Command interface (EXECUTE).............................................................................. 5-165.5.1.1 File transfer............................................................................................................... 5-165.5.1.2 DELETE_FILE .......................................................................................................... 5-195.5.1.3 RENAME_FILE......................................................................................................... 5-195.5.2 Read and write accesses.......................................................................................... 5-205.5.2.1 Data format............................................................................................................... 5-205.5.2.2 Variable names......................................................................................................... 5-205.5.2.3 List of the variable names......................................................................................... 5-205.5.2.4 Data fields................................................................................................................. 5-255.5.2.5 Error messages ........................................................................................................ 5-255.5.3 DDEML access to NC data....................................................................................... 5-295.5.3.1 Synchronous reading................................................................................................ 5-295.5.3.2 Asynchronous reading .............................................................................................. 5-305.5.3.3 Synchronous writing of NC data ............................................................................... 5-315.5.3.4 Asynchronous writing of NC data ............................................................................. 5-315.5.4 Transparent data transmission ................................................................................. 5-325.5.4.1 How transparent data transmission works................................................................ 5-325.5.4.2 Cyclic requests/change requests.............................................................................. 5-34

Page 12: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5.6 MMC PLC interface ........................................................................................................ 5-37

5.6.1 Overview................................................................................................................... 5-37

5.6.2 Data exchange on the PLC side ............................................................................... 5-375.6.2.1 Writing to the MMC ................................................................................................... 5-385.6.2.2 Reading from the MMC............................................................................................. 5-385.6.3 Data exchange on the MMC side.............................................................................. 5-39

5.6.4 Structure of data packets on the PLC side ............................................................... 5-405.6.4.1 Structure for receiving............................................................................................... 5-405.6.4.2 Structure for sending................................................................................................. 5-425.6.5 MMC-PLC data exchange (examples)...................................................................... 5-435.6.5.1 Reading PLC data (DDE_REQUEST) ...................................................................... 5-435.6.5.2 Writing PLC data (DDE_POKE)................................................................................ 5-445.6.5.3 Advise link for PLC data (DDE_ADVISE) ................................................................. 5-455.6.5.4 PLC user program (DDETESST.S5D)...................................................................... 5-485.6.6 Execution of MMC applications by the PLC side ...................................................... 5-515.6.6.1 Overview................................................................................................................... 5-515.6.6.2 Starting an MMC application from the PLC............................................................... 5-515.6.6.3 Terminating an MMC application from the PLC side ................................................ 5-525.6.6.4 I code description (42EH) ......................................................................................... 5-525.6.6.5 Terminating DOS programs...................................................................................... 5-555.6.6.6 PLC user program (WINOEMST.S5D) ..................................................................... 5-56

6 Sample Programs......................................................................................................... 6-1

6.1 Integration of customer applications............................................................................... 6-1

6.1.1 Development systems............................................................................................... 6-1

6.1.2 Integration into the OEM test environment ............................................................... 6-2

6.1.3 Testing DDE client applications ................................................................................ 6-2

6.1.4 Integration of applications into the control ................................................................ 6-3

6.2 Sample programs (MS Visual Basic) .............................................................................. 6-4

6.2.1 Project: Tacho........................................................................................................... 6-4

6.2.2 Project: DDETEST.................................................................................................... 6-7

6.3 Sample programs (MS Windows 3.1 SDK) .................................................................... 6-8

6.3.1 Project: VSASERV.................................................................................................... 6-8

6.3.2 Project: Message ...................................................................................................... 6-9

6.3.3 OEM client ................................................................................................................ 6-10

6.3.4 OEM client ADVTEST............................................................................................... 6-11

6.3.5 Gearbox interpolation................................................................................................ 6-13

6.4 Network DDE.................................................................................................................. 6-17

6.4.1 Link initiation for network DDE.................................................................................. 6-17

6.4.2 Creating a DDE SHARE ........................................................................................... 6-17

6.4.3 Network modules ...................................................................................................... 6-19

6.4.4 Summary................................................................................................................... 6-19

A1 I Code Interface............................................................................................................. A1-1

A1.1 ADS communication via mailboxes........................................................................... A1-1

A1.2 I code description...................................................................................................... A1-2

A1.2.1 Application areas ...................................................................................................... A1-2A1.2.1.1 Single data item and list transfer............................................................................... A1-2A1.2.1.2 Data transfer extensions ........................................................................................... A1-2A1.2.1.3 Executing functions................................................................................................... A1-2

Page 13: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1.2.1.4 Selective data transfer .............................................................................................. A1-3A1.2.1.5 File transfer............................................................................................................... A1-5A1.2.1.6 Reserved applications for OEM................................................................................ A1-5A1.2.2 Structure of the I code header .................................................................................. A1-6

A1.2.3 Protocol types........................................................................................................... A1-9A1.2.3.1 Protocol type 0.......................................................................................................... A1-10A1.2.3.2 Protocol type 1.......................................................................................................... A1-10A1.2.3.3 Protocol type 2.......................................................................................................... A1-11A1.2.3.4 Protocol type 3.......................................................................................................... A1-11A1.2.3.5 Protocol type 4.......................................................................................................... A1-13A1.2.3.6 Protocol type 5.......................................................................................................... A1-14

A1.3 Tabular overview of the I code command in SINUMERIK 840C OEMVersion for Windows................................................................................................. A1-15

A2 Reference Guide........................................................................................................... A2-1

A2.1 I code command description..................................................................................... A2-1

A2.1.1 Single data item and list transfer: 1xxH .................................................................... A2-1A2.1.1.1 Read value(s): 01xxH ............................................................................................... A2-1A2.1.1.2 Write value(s): 01xxH ............................................................................................... A2-3A2.1.1.3 Read/write GI buffer: 0117H..................................................................................... A2-6A2.1.2 Data transfer extensions: 2xxH................................................................................. A2-10A2.1.2.1 Read service values of axes: 020EH........................................................................ A2-10A2.1.2.2 Read service values of spindles: 020FH .................................................................. A2-12A2.1.2.3 Read/write PLC data via PLC DAD: 0210H.............................................................. A2-14A2.1.2.4 Read/write PLC data blocks: 0211H......................................................................... A2-16A2.1.2.5 Read PLC error ID: 0212H ....................................................................................... A2-19A2.1.2.6 Read control mode: 0213H....................................................................................... A2-20A2.1.2.7 Read/write program pointers: 0216H........................................................................ A2-21A2.1.3 Command execution: 4xxH....................................................................................... A2-23A2.1.3.1 Abort current I code request: 0400H ........................................................................ A2-23A2.1.3.2 Initiate drift compensation: 0419H ............................................................................ A2-24A2.1.3.3 Initiate file transfer: 0421H........................................................................................ A2-25A2.1.3.4 Initiating job list processing / workpiece transfer with Windows applications............ A2-31A2.1.3.5 Select workpiece name / machining program: 0422H .............................................. A2-32A2.1.3.6 Start / stop an MMC application from the PLC side: 042EH..................................... A2-34A2.1.3.7 Express shutdown: 042FH........................................................................................ A2-37A2.1.4 Selective data transfer: 5xxH.................................................................................... A2-38A2.1.4.1 Transfer data block description to the NCK: 0500H ................................................. A2-38A2.1.4.2 Delete DBB from NCK: 0501H ................................................................................. A2-40A2.1.4.3 DBB data transfer 0502H ......................................................................................... A2-41A2.1.4.4 Read DBB directory of NCK: 0503H......................................................................... A2-43A2.1.4.5 Issue cyclic request/change request: 0504H ............................................................ A2-44A2.1.4.6 Delete cyclic request/change request: 0505H .......................................................... A2-46A2.1.5 Process file: 6xxH ..................................................................................................... A2-47A2.1.5.1 Open file: 0601 H...................................................................................................... A2-47A2.1.5.2 Close file: 0602H ...................................................................................................... A2-50A2.1.5.3 Read file: 0603H....................................................................................................... A2-51A2.1.5.4 File transfer NCK → MMC (MMC: Services/NC/Save Start) .................................... A2-53A2.1.5.5 Write file: 0604H ....................................................................................................... A2-54A2.1.5.6 File transfer MMC → NCK (MMC: Services/NC/Load Start) .................................... A2-56A2.1.5.7 Delete file: 0605H ..................................................................................................... A2-57A2.1.5.8 Rename file: 0606H.................................................................................................. A2-59A2.1.5.9 Display directory: 0607H........................................................................................... A2-60A2.1.5.10 Read/write file attribute: 0608H ................................................................................ A2-62

A2.2 PLC function macros FX73/FX74 ............................................................................. A2-64

Page 14: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2.2.1 Function macro FX73, OEM-SEND .......................................................................... A2-64A2.2.1.1 Additional information ............................................................................................... A2-65A2.2.1.2 Block call (FX73: OEM-SEND) ................................................................................. A2-65A2.2.1.3 Signal description...................................................................................................... A2-66A2.2.1.4 FX73 behavior on restart .......................................................................................... A2-66A2.2.2 Function macro FX74, OEM-EMPF .......................................................................... A2-67A2.2.2.1 Additional information ............................................................................................... A2-68A2.2.2.2 Block call (FX 74: OEM-EMPF) ................................................................................ A2-68A2.2.2.3 Signal description...................................................................................................... A2-69A2.2.2.4 FX74 behavior on restart .......................................................................................... A2-69A2.2.3 OEM information bit .................................................................................................. A2-70

A2.2.4 Acknowledgements................................................................................................... A2-70A2.2.4.1 Error lists for FX73/FX74 .......................................................................................... A2-71A2.2.5 Transmission times ................................................................................................... A2-73

A3 Function Identifiers for Data Management ................................................................ A3-1

A3.1 Function group: delete .............................................................................................. A3-2

A3.2 Function group: edit .................................................................................................. A3-3

A3.3 Function group: copy/duplicate ................................................................................. A3-4

A3.4 Function group: create .............................................................................................. A3-8

A4 Abbreviations................................................................................................................A4-1

Page 15: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

1 Introduction09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 1-1SINUMERIK 840C OEM Version for Windows (BN)

1 Introduction

More and more often machine tool manufacturers are faced with the task not only of developingstandardized machine tools but also special solutions for manufacturing technology. In particular,higher and higher demands are being placed on the functionality of a CNC control. The demands areoften machine-specific and cannot be fully covered by standard products.

On the other hand, there is a desire to use the freedom afforded by the control to give it its ownappearance and/or include technological know-how. Previous man-machine interfaces (MMC) weremostly based on control-specific software systems and demanded special knowledge of the solution inquestion. A further disadvantage of such systems is their "closed" character which often means thatfunction expansions can only be included with great effort.

Today, there is a demand for "open-ended" control systems. This applies not only to the user interfacesand the operating system but also to the entire computer hardware. To meet this demand, SIEMENShas developed the SINUMERIK 840C OEM Version for Windows, an AT compatible MMC that is basedon the "open" operating systems MS-DOS 6.22 and MS Windows for Workgroups 3.11.

The MMC variation permits the use of numerous commercially available hardware modules inconjunction with the AT box and therefore the integration of existing hardware solutions directly into thecontrol. The applications of such solutions include:

• Remote diagnostics

• Measuring data acquisition for quality assurance and process control

• MDA/PDA systems (machine and production data acquisition)

• DNC systems (program management and transmission)

Moreover, it is possible to benefit directly from the advantages of the broad range of industrial andcommercial software available. This means that the same programming workstation software with thesame user-friendliness can be used both on an external PC during work preparation and directly on thecontrol.

For customer developments, Windows for Workgroups 3.11 provides a reliable and stable platform anda minimization of compatibility problems in the future. Moreover, this operating system ensures greatflexibility and cost-effective network-capability for the entire control system. With the programming toolsavailable on the market, the machine-tool manufacturer has the option of developing his ownapplications and integrating them into the control.

With Visual Basic for Windows, Microsoft has developed a programming tool that cleverly combines theadvantages of Windows with the programming language Basic. There is scarcely another programmingsystem with which it is so easy to write Windows programs. Using predefined "Custom Controls", evena beginner can develop professional Windows user interfaces in a simple way. Windows and menuscan be opened and closed with simple program commands and the input and output of the programuser can be managed and visualized.

However, anyone aiming at professional development cannot do without Visual C++. C++ is currentlythe first choice when it comes to solving complex programming problems in a simple way. With visual Cit is possible not only to write programs for Windows but also under Windows, and that faster and moreeasily then ever before. Integrated tools such as AppWizard and ClassWizard save the programmer alot of time-consuming and error-prone administration work, allowing him to concentrate on the actualproblem to be solved.

Page 16: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

1 Introduction09.01

1-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Windows applications can exchange data with the NCK, PLC and 611D via the DDE interface definedby Microsoft (Dynamic Data Exchange). Via the DDE server, which is also part of the OEM package,data are transferred from the applications and from and to the NCK, PLC and 611D. The methods"POKE" (write data), "REQUEST" (read data) and "EXECUTE" (commands for file transfer) areimplemented. Towards the PLC the "ADVISE" method is also implemented. The data that can beaccessed via the DDE server include machine data, setting data, PLC data blocks, part programs etc.

Simply by entering applications in an initialization file, they are integrated into the area switchover andcan be started either automatically when the control is booted or by the user by means of softkey orPLC command. Examples of such customer applications include:

• Tool management and visualization

• Pallet management

• Job management

• Machine diagnosis

With the OEM package, the machine-tool manufacturer obtains not only the DDE server and a fewlibrary routines but also a complete simulation and test environment for an external PC. With acommercially available programming tool (e.g. Visual Basic, Visual C++, etc.) the machine-toolmanufacturer can develop and test his own applications on an external PC.

The following section of this documentation deals with the requirements for and the installation of theOEM test environment and the OEMFORM alarm tool.

Chapter 3 provides a system description of SINUMERIK 840C OEM Version for Windows. Thisdescription includes both the hardware architecture of the control and the method of operation andparameterization of the Siemens basic modules.

The alarm concept described in previous editions in Chapter 4 has been taken out to form a separatedocumentation from the current software version on.

The next section contains a brief introduction to the method of operation of the Windows DDE and adetailed discussion of the various communications options of OEM applications with the NCK and PLC.

The DDE section is completed with a description of some sample programs that show the reader howto integrate his own applications and serve as a guide for the development of custom applications. ■

Page 17: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

2 Overview and Installation09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 2-1SINUMERIK 840C OEM Version for Windows (BN)

2 Overview and Installation

The OEM package comprises a PC test and simulation environment of the SINUMERIK 840C withwhich customer applications can be tested before they are loaded into the control. The package alsocontains several test utilities and sample programs including all the source files and resources tointroduce you to program development for SINUMERIK 840C OEM Version for Windows. You can alsoload the sample programs directly into the control, for example, to perform runtime measurements ofthe data transfer between the MMC and the NCK or the MMC and the PLC. You will find the simulationand test environment on the four diskettes labeled:

"SINUMERIK 840 C/CE OEM Package Windows DISK x V06.04.01"

The installation programs will expand each of the necessary files and copy them into the correctdirectory so that the programs function correctly.

If you have any questions regarding installation, please contact you local Siemens branch office orSiemens national company.

Page 18: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

2 Overview and Installation09.01

2-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

2.1 System requirements

Your PC must fulfil the minimum requirements listed below if the test environment is to functioncorrectly.

Hardware: 25 MHz 386 or larger

Memory: 4 MB RAM, approx. 21 MB free space on the hard disk

Monitor adapter: VGA resolution (640×480 pixels)

Operating system: MS Windows 3.1 or MS Windows for Workgroups 3.11, Windows 95,Windows NT

MS-DOS 6.22 or higher

You must also enter the Windows directory in the PATH of the AUTOEXEC.BAT. Please note that inaddition to the OEM package you will also need a programming tool for programming under Windows(e.g. MS Visual Basic, MS Visual C++, Borland Pascal, etc.) to create your own applications which youmust purchase on the open market. Please consult the documentation supplied with it for the systemresources required (processor, RAM and hard disk memory, operating system etc.).

2.2 Installation procedure

The OEM test environment is installed under menu guidance under the Windows operating system.

1. First start Windows if it is not yet active.

2. Place installation diskette 1 (labeled: OEM Package Windows V06.01.01) in your disk drive.

3. Read the README.TXT file and perform the installation according to the specifications.

Caution:

If a new database that has been created with OEMFORM is to be linked into the testenvironment, after copying the requested databases into directory c:\oem\<language>, theprogram DBTXTUPD.EXE must be called up in a DOS box (or directly under DOS) in thedirectory C:\MMCWIN\PE with the selected language as parameter, e.g. DBTXTUPD forGerman.

Page 19: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

2 Overview and Installation09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 2-3SINUMERIK 840C OEM Version for Windows (BN)

2.3 Additional notes on the OEM test environment

• When you copy the keyboard drivers you might find that Windows is currently using one ofthese drivers. You can acknowledge the message that appears on the screen with thebutton "IGNORE".

• The font in the editor "WEdit" might differ slightly from the font on the control. Anequivalent font is not loaded in the test environment.

• The OEM test environment has been developed for a VGA resolution of (640×480 pixels).If you use a higher resolution, the OEM test environment uses an equivalent portion of thefull screen. The OEM test environment is, however, still fully functional.

• The softkey bar that displays the menu list for the application currently active can behidden by calling the softkey manager SOFTMAN.EXE again in directory C:\MMCWIN\PC.

• The appearance of several applications can be altered in the installation file SIN840C.INI(see Section 3.5) in directory C:\MMCWIN\PC. The window size and foreground/background behavior of applications can be altered with the following options:

- Window always on top: topmost=on/off

- Window size: position[ ... ]

• In the MACHINE basic display of the test environment, the 1st softkey on the NC controlpanel corresponds to function key F2. In all other applications, the 1st softkey correspondsto function key F3.

Machine basic display:

Other applications:

• You can switch between test environment tasks using the standard MS Windows mecha-nism (<Alt> + <Tab> etc.).

SK1

F2

SK2

F3

SK3

F4

SK4

F5

SK5

F6

SK6

F7

SK7

F8

i

>F1 [M]

[∆]

SK1

F3

SK2

F4

SK3

F5

SK4

F6

SK5

F7

SK6

F8

SK7

F9 > F10

F1 (Help)

Page 20: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

2 Overview and Installation09.01

2-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

2.4 Directory structure of the OEM test environment

When you have installed the OEM test environment you will find the following directory structure ondrive C: of your hard disk:

The OEM test environment contains the following subdirectories:• Directory "local". This directory contains the workpieces that have been created

(subdirectories) together with all the files (mpf...,spf..., toa, etc.) required for machining aworkpiece. This directory is also part of the system software of the control. After installation,only the workpiece with the name "standard" exists.

• Directory "md" usually contains the machine data of the control. As no real NCK or PLC existin the OEM test environment, the associated subdirectories are "empty", i.e. they only containthe obligatory "dummy" files. Both the workpieces and the directory with the machine datacan be selected and edited under the data management of the OEM test environment.

• Directory "mmcsrc" contains a number of sample programs including all the source andresource files. These sample programs are intended to provide you with help in developingyour own applications.The sample programs have either been developed with Microsoft Windows 3.1 SDK orMFC 2.0 (C:\MMCSRC\MSC) or with Microsoft Visual Basic 3.0 (C:\MMCSRC\VB). They areavailable either as executable *.EXE files or as entire projects with resources, source code,libraries and header files.The sample programs VSASER.EXE, ADVTEST.EXE and TACHO.EXE are already linkedinto the OEM test environment and can be started directly from it. You will find adescription of the sample programs in Chapter 6.

• Directory C:\MMCWIN\PCMCIA contains 3 com driver floppy disks, XIRCOM driver floppiesand PC-CARD HD Patch.

• Directory C:\MMCWIN\PC contains all the basic modules of 840C OEM Version for Windows.This directory exists both in the OEM test environment as well as in the control. In addition tothe basic components such as area switchover, data management, the editor "WEdit" etc.,this directory contains the actual DDE server (DDESRV.EXE) for linking Windowsapplications to the NCK, PLC and 611D. This directory also contains a multiport RAMsimulator (MPRSIM.EXE) for PC use. You will find a description of the basic modules inSection 3.3.

• Directory \mmcwin\pc\bild contains the machine displays that are displayed in the OEM testenvironment when a machine area is called. ■

mmcwin— PCMCIA— PC

english

Page 21: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-1SINUMERIK 840C OEM Version for Windows (BN)

3 System Structure of 840C

3.1 Overview

The product SINUMERIK 840C OEM Version for Windows provides the machine-tool manufacturerwith a sophisticated and modern control which is used as a basis for integrating additional functionexpansions and customer-specific solutions.

3.1.1 Hardware concept

The following hardware configuration was chosen to meet the demands for "open architecture" andadaptability.

M M C

C om m un ication

N C K PLCAT-com patib le PC

Ex te rn a lp ro g ram m ing dev ic e o r

Fig. 3.1: Functional structure of SINUMERIK 840C OEM Version for Windows

The CNC 840C control can be divided into the following three components:

MMC=PC: With this integrated AT-compatible PC with the operating system Windows forWorkgroups 3.11, the machine-tool manufacturer can make individualadaptations and develop his own solutions on all levels of the user interface(MMC=Man Machine Communication) including communication with the NCKand the PLC. The AT box of central controller 3 also provides the user with openarchitecture hardware.

NCK: The actual NC kernel works with a 32-bit word size and an NC memory of 1 MB.Up to 6 spindles can be operated from its 15 servo loops. Several programs canbe executed simultaneously due to its channel structure. Data can be exchangedwith the MMC and the PLC via the DDE interface and the VDI interface. Usingprogram package WS800 A, machine displays can be configured in the NCKand customized machining cycles created and the control therefore adapted tothe individual tasks of the machine tool.

PLC: The PLC section of the SINUMERIK 840C is responsible for the entire machinecontrol and always contained the essential know-how of the machine-toolmanufacturer. 1024 inputs and outputs, a 256-KB user memory and aprocessing speed of less than 1 ms per 1000 instructions are the salient featuresof the freely programmable PLC.

Page 22: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.1.2 Software structure of the integrated PC

The system software of the CNC control 840C OEM Version for Windows comprises the 840C systemsoftware basic version (FlexOS) which has been expanded by a Windows MMC. The OEM testenvironment essentially consists of modified MMC Windows software installed on the hard disk whichenables simulation of the Windows SINUMERIK 840C interface on an external PC. The diagram belowshows the distribution of the entire control software on the hard disk.

Fig. 3.2: Main division of the software on the hard disk of the 840C OEM Version for Windows

1. The installation functions (MD dialog, drive/servo installation) in the Diagnosis area can only beexecuted under MMC FlexOS. The operating system FlexOS can be selected in thebackup/restore menu.

2. Common software includes DOS, Valitek and NCK, PLC and drive software. This software runswith the Windows MMC without any restrictions.

3. The Windows MMC consists of the operating system Windows for Workgroups 3.11 and aWindows basic system (basic modules) which, like the basic version (FlexOS), is responsible forthe basic functions of the Windows control panel and operation. The user can also install thesoftware in the five standard languages (English, German, French, Italian and Spanish) andswitch between the individual languages.

4. The DDE server (Dynamic Data Exchange) is the data interface to the NCK, PLC and 611D. TheDDE server is both part of the OEM package and the control software. However, it can only beexecuted with the library MEMBER.DLL supplied with the OEM package.

Page 23: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-3SINUMERIK 840C OEM Version for Windows (BN)

5. The user area can be used both by the machine-tool manufacturer and the end user. The OEMcan use the part of the hard disk that is not used by Siemens which is paid for when the MMCWindows licence is purchased. A memory size of at least 40 MB is guaranteed. As it is possibleto integrate OEM software under Windows, space on the hard disk is provided for customizedprograms that can be developed using commercially available tools.

6. The user area can also be used for end user data such as part programs, measurement data,order data, MDA/PDA data etc.

The individual operating system components, as well as the Siemens basic modules and the OEMapplications can interact as shown below and exchange information with the NCK/PLC and the 611-D.Fig. 3.3. clearly shows the interaction between the Windows system software and the basic modulesand OEM applications.

Basic system

DOS / WINDOWS

NCK / PLC / 611-D

OEM appl.< . . . . > . exe

DDEserver

Machine operation

Parameters

NCK programming

NCK/PLC service

1 4

Area switchover

Data management

V24 parameterization

WEdit

2 3 5

Fig. 3.3: Interaction between MMC Windows and OEM applications

1. The machine displays created in the NC kernel with WS800 A are passed directly to the userinterface via a graphics converter (NCK task), i.e. the operator receives the information directlyfrom the NCK/PLC and 611-D. Conversely, (nearly) all the entries made via the keyboard on thecontrol panel or the MF2 keyboard are passed onto the NCK.

2. In addition to the NCK task, other Siemens basic modules carry out numerous functions in theMMC area. The area switchover is therefore used to start additional applications and the datamanagement to manage the files on the hard disk and to transfer data between the MMC andthe NCK or peripheral device.

3. The OEM applications like the Siemens applications (e.g. machine operation, parameters, etc.)are initiated via the area switchover. Some of the basic modules also contain special functioncalls (e.g. workpiece transfer via serial interface) which can also be used by OEM applications.The OEM applications can be operated in the usual way via the operator panel or keyboard.

Page 24: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

4. Data on NCK, PLC, 611D is accessed using the DDE server via the DDE interface defined byMicrosoft. This interface is supported by nearly all Windows programs (EXCEL, WORD, etc.) anddevelopment tools (MS-Visual Basic, Visual C++, etc.) and guarantees a high degree ofdevelopment safety and stability due to its fixed definition and widespread use.

5. OEM applications can also directly access services in the DOS/Windows operating system. Filemanager, printer, Windows API (Windows Application Programmers Interface), etc. calls can beused in the usual way.

3.1.3 Basic modules

The MMC Windows basic system together with the operating system are responsible for operation ofthe integrated PC. The MMC Windows basic modules and the OEM test environment are largelyidentical. All the standard modules have a compatible structure and a uniform appearance which canbe modified by making entries in the initialization files. Basic modules that run in the background (e.g.multiport RAM driver, keyboard driver, DDE server etc.) are configured in such a way that they do notappear in the task list. This ensures that the user only accesses applications that he can see in the tasklist.

The following diagram provides an overview of the most important modules in the basic system

840C WINDOWS Basic system

Start up

Area switchover

Graphics converter (NCK task)

Alarm module

Data management ASCII editor

NCK/PLC communication

V24 parameterization

Backup/Restore

Keyboard driver

Softkey manager

Fig. 3.4: Basic system OEM Version for Windows

• The start-up module (AUTOEXEC.BAT, REG_AUTO.CFG) organizes the loading of the MPRserver, the booting of the PLC/NCK and 611-D software. The user can also define in theinitialization file C:\MMCWIN\LOAD840C.INI which user files are to be transferred to the NCKduring start-up.

Page 25: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-5SINUMERIK 840C OEM Version for Windows (BN)

• Individual applications can be started by the operator via softkey with the area switchover(REGIE.EXE) which replaces the Windows program manager. It is activated via the data areakey. As far as the area switchover is concerned, the Siemens areas, "Machine", "Parameter", ...,are ordinary applications.

The menu line and the entries in the associated pull-down menus including the application to beinitiated (*.EXE files) can be freely defined in the initialization file (REGIE.INI). Applications canalso be protected with a password, keyswitch position and cycle disable. The area switchover ispreconfigured by Siemens and can be changed as necessary (e.g. removing the Machine areaand adding OEM applications). It can be operated either via the control panel keys, softkeys ormouse.

• NCK task (NCKTASK.EXE) groups together the entire control of the NCK. This includes both thedisplay of graphic information that is processed in the NCK area as well as the transfer ofkeyboard entries to the NCK. NCK task is also responsible for managing the current menus ofthe various data areas of the NCK. In the OEM test environment where there is no link to anNCK, NCK task visualizes machine displays that are stored on the hard disk.

• The data manager (DATENMAN.EXE) contains a user interface for transferring files between theMMC, NCK, diskette drive and serial interface. A workpiece manager and an editor "WEdit"(WEDIT.EXE) with which part programs can be edited directly in the NCK memory are alsoprovided.

With the workpiece manager it is possible to integrate network drives, making transparentselection of workpieces that are stored on a remote computer possible. "Part program executionfrom the hard disk or network" is also implemented. Files can also be edited directly in the NCKmemory with the editor.

• With the Parameterization V24 module (PAR_V24.EXE), serial interfaces can be parameterizedfor the transmission of data in tape format. Up to 10 interface settings can also be managed.

• The alarm module (ALARM.EXE) accepts alarms and messages from the NCK/PLC/drive,visualizes them in the alarm or message line and lists the current alarms and messages in thealarm window. The position at which the alarm is displayed on the screen is defined in the alarmtext database. An OEM application can obtain the current active alarms and messages via theWindows DDE mechanism (Dynamic Data Exchange) and initiate its own.

• The NCK/PLC communication essentially consists of the DDE server (DDESRV.EXE) and theMPR server (SERVER.EXE) which allow the modules described above and the OEMapplications to exchange data with the NCK/PLC and the 611D. In the OEM test environment,the multiport RAM server is replaced by an MPR server simulator (MPRSSIM.EXE).

• The softkey manager (SOFTMAN.EXE) displays the menu line of Windows applications and thebuttons of non-system modal dialog boxes on the horizontal softkey bar. It is thus also possibleto operate any Windows application via softkey.

• The keyboard driver (KYRU.EXE) converts signals coming from the 840C operator panel intocodes which can be evaluated by Windows or DOS. This same thing happens when a full MF2keyboard is connected to the operator panel. A keyboard can only be connected to the centralcontroller for OEM servicing because of the lack of EMC of the keyboard connection.

The user can also freely assign various keys on the NC operator panel.

• Data can be saved and read back in via the Valitek streamer or via PC link as on the 840C BasicVersion. The streamer is connected to the parallel interface of the MMC CPU module. You mustclose Windows and return to the MS DOS level to operate the streamer.

Page 26: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.1.4 NCK / PLC / SIMODRIVE 611-D interface

Data/files of the NCK/PLC/611D are accessed via the DDE interface (Dynamic Data Exchange) definedby Microsoft for Windows applications. The DDE server collects the data and makes them available tothe applications. The functions "POKE" (write data), "REQUEST" (read data) and "EXECUTE"(commands for file transfer) are implemented. The function "ADVISE" is also implemented for the PLC.

Data exchange with standard Windows programs such as Excel, Visual Basic, etc. is possible via thisinterface. The DDE server can access, for example, machine data, setting data, PLC data blocks, partprograms and current values.

NCK/PLC/611-D

DDE server

Speedspindle

0

50

100

123

E X C E L

A B= NC DDE NCK PLC ! NC_0X125_1_1_2_2_0

VISUAL BASICVISUAL C++

BORLAND C++. . .

Read and writedata, programs

Fig. 3.5: Data exchange via DDE server

The DDE server converts the data request into an I code protocol and passes it on to the NCK. There,a software module sends the requested data to the DDE server.

Two function blocks exist in the PLC, FX74 (read data from DDE server and write to a data block) andFX73 (read data from a data block and write to the DDE server). The user can freely select the formatsand the protocols. For this, he must write a function block that reads out the data with the help of FX74,interprets them and writes back the requested data with FX73.

Service and drive data can be accessed for the SIMODRIVE 611-D. The DDE server is only used fordata exchange and is not a control interface.

You will find a detailed description of the DDE server and the I code interface with its various featuresin Chapter 5 and Appendix A1.

Page 27: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-7SINUMERIK 840C OEM Version for Windows (BN)

3.2 Hardware configuration

You will find additional information on this subject in the SINUMERIK 840C documentation:Interface Part 2, Connection Conditions.

The hardware of the 840C OEM Version for Windows is based on the 840C Basic Version.

3.2.1 Brief description of hardware

The SINUMERIK 840C OEM Version for Windows is a modular control with the following structure:

Link bus

NCK bus bus busPLC AT96

Servoloops

Computerlink

CSB INT. EU AT box

HandwheelSIMATIC EU

OP

2nd OP RGB

RS232

DMP mod.

DMP mod.PG

Handheld unit

NCK CPU PLC CPUDual Port

MMC CPU

Fig. 3.6: Block diagram of SINUMERIK 840C OEM Version for Windows

Page 28: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

The system uses the following hardware components:• NCK CPU

- NCK CPU 486 DX 33MHz or 486 DX2 66MHz with 4 and 8 MB RAM,486 DX4 66MHz with 8 MB RAM486 DX4 100 MHz with 8 MB RAM

- Servo loopsup to 30 servo loops (axes/spindles) analog and digital drive interfaces,max. 2 electronic handwheels.

- Computer linkcomputer link via RS 232C (V.24), SINEC H1 or MAP 3.0

- Central service board (CSB)central monitoring functions,handwheel inputs,NC inputs

- 230V AC / 24V DC power supply (occupies three slots)

• PLC

- PLC CPU 135 WD80186 / 16 MHzPLC coprocessorMPC interface for distributed machine I/OsRS 232C (V.24) interface to PGrapid interrupt inputs

- Interface EU, 16-bit16-bit link to SIMATIC EU (IM314)

- Distributed machine I/Osstandard DMPcompact DMPmachine control panel

- In 329L2-DP Profibus

•••• MMC

- MMC CPU (version B), 486 SX 33 MHz, 486 DX 33 MHz, 486 DX2 66 MHzwith 8 or 16 MB RAM2 serial interfaces (operator panel connection or freely assignable)Centronics interface to streamerMF/2 keyboard interface

- Interface MMCConnection for FD-E2 3.5" diskette drive2 serial interfacesPCMCIA slot

- Operator panel versions9.5/10 inch slimline operator panel monochrome incl. NC keyboard9.5/10 inch slimline operator panel color incl. NC keyboard14 inch monitor with separate NC keyboard

• AT box with 3 slots

Page 29: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-9SINUMERIK 840C OEM Version for Windows (BN)

3.2.2 Integrated PC

The PC is integrated into the system and is a system component that communicates via the internallink bus.

Visualization and communication tasks and database functions are chiefly performed on this industrialPC.

INTMMC

ATBox

MSTT

SINUMERIK 840 C

NCK local bus

Link bus

NCK CPU

Computerlink

MMCCPU(SBC)

PLC CPU

Operatorpanel

Multiport RAM

Servo loops CSB

Int. EU

PLC local bus AT 96

Fig. 3.7: MMC in the hardware of the 840C

The PC integrated in the 840C OEM Version for Windows provides all the functions of an ATmotherboard. The entire set of chips of an AT is integrated on one printed circuit board, which givesrise to the name SBC (single board computer). The SBC is an industry-standard and noise-free versionof an integrated industrial PC. It is linked to the internal SINUMERIK bus via a dual-port RAM and viathis link is able to exchange data with the NCK, PLC and SIMODRIVE 611-D.

An MMC interface module can be slotted into the central rack directly next to the MMC CPU module viathe AT96 bus. This module has two additional serial interfaces, two PCMCIA slots (type II) and a floppybus extension for connecting diskette drive FD-E2.

Central controller 3 also contains an AT box whose ISA bus is linked to the AT96 bus. A maximum of 3standard 16-bit PC cards can be slotted into this AT box, providing the user with many options forconnecting peripherals (networking via standard PC modules) or integrating existing external solutionsdirectly to the control (measuring computer for quality assurance).

In contrast to a standard PC, however, the integrated SBS of the SINUMERIK 840C does not have aloudspeaker.

Page 30: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-10 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.1 Block diagram

DRAMx36

bank 1DPRcon tr.

32K

Stat . cont.

+5V+15VUBATT

MC U

memory contr ol

BIOSE PROM64 Kx8

2 DPUs

data path

DRAM

x3 6

bank 0

: 2

TIMINGcontrol

PERIPHERALS

RTC

AT BUS I/F

ED BUS (32 bit)

XD BUS (8 bit)

VGAgraphic

un it

SD BUS (16 bit)

R G B

Combo

X 111 X 1 21 X 132

IDE interfaceWinchester

drive

NMI RESET

80486

CPU

CD BUS

66 MHz

66 MHz

32 bit

Status

16 bit

max . 32 MB

ATU

4 bit parity

66 MHz

14.3181 MHz

32.768 kHz

Video interface

Keyboard interfaceRS232/RS422**with adapter

18.432 MHz

RS232/TTY

32K

Dual portRAM

Link bus X11 AT96 Bus X21

Fig. 3.8: Block diagram of the MMC 486 CPU module

3.2.2.2 Processor 80486

- External 33MHz clock, internal 33 or 66 MHz clock- 100% software-compatible with 80386- 32-bit data bus- 4 GB linear address space- Real and protected mode- Integrated floating point unit- Integrated 8 KB cache

3.2.2.3 System memory

- Two slots with x36 organized SIM modules- Max. 16 MB dynamic memory, 8 MB in the basic version- Modifiable DRAM parameters in the set-up- 4 bit parity monitoring- EMS (version 4.0) support- Shadow RAM function for BIOS

Page 31: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-11SINUMERIK 840C OEM Version for Windows (BN)

The following diagram shows the distribution of the entire system memory of the MMC CPU:

64 KB BIOS

64 KB BIOS (after reset)

FFFF000:FFFF

XF000:FFFF

10000:0000

F000:0000

E000:0000D000:8000D000:0000C800:0000C000:0000

A000:0000

0000:0000

Video BIOS

Video memory

640 KB DRAM

ExtendedDRAM area

32 KB SRAM link memory32 KB SRAM link memory

Fig. 3.9: Memory distribution of the MMC CPU module

• Like AT-compatible PCs, the working memory area of the MMC CPU features the memorydistribution typical of an ISA system (Industry Standard Architecture)

• A 64 KB static RAM is used for physically linking the link bus to the NCK/PLC and theSIMODRIVE 611-D. This multiport RAM features the following:- Unbuffered

- 64 KB link memory to the SINUMERIK link bus (32k/32k)

- Memory area: D000:0000 - D000:7FFF (link area between NCK and PLC,

can only be read from the MMC)

D000:8000 - D000:FFFF (link to link bus)

- Interrupts 10 and 15 are assigned for the link to the NCK/PLC and the SIMO-DRIVE 611-D.

Page 32: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-12 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.4 Mass storage medium

The MMC CPU uses a hard disk drive as mass storage medium. The link is provided by the IDEinterface. The MMC CPU is currently supplied with a 540 MB/1 GB disk as standard.

• Replacement of the hard disk is automatically detected by the BIOS and entered in theset-up

• Integrated PC/AT controller

Note:Reducing disk accessing during the running operation of the control.

When booting the control, the basic system software is being loaded into the MMC user memory(RAM). If no further additional operations are carried out, the MMC module has the following remainingmemory:

Memory configuration of MMC CPU Reported free remaining memory

8 MB approx. 3 MB

16 MB approx. 11 MB

These values specifically apply to software version 6.1 and may vary with other software versions.

This means that MMC basic software requires no SWAP file so that the user may switch off relocatingof data to the hard disk (swapping) by setting the SWAP file size to 0 KB. OEM users setting up theirown applications and running them on the MMC have to ascertain how much memory capacity thewhole system (basic and application) requires and then decide if switching off of the SWAP file makessense.

3.2.2.5 Watch DogThis module is responsible for monitoring and has the following performance data:

• Not programmable, monitoring time of 1.6 s (fixed)

• Enable and trigger via status register 0

3.2.2.6 VGA video graphic unit

• AT bus interface

• Resolution and video timing programmable

3.2.2.7 Electrical and mechanical data

• Required voltage: +5V, +/-15V

• Format: Double-height Eurocard

• Module height: 40 mm (incl. hard disk drive)

3.2.2.8 PCMCIA software support

The two PCMCIA 2.0 slots on the interface MMC module are not directly supported in the standardversion by either the BIOS or the Windows operating system.

Manufacturers of PCMCIA cards usually include the drivers in the scope of supply of their product sothat these cards can also be used in the MMC interface module. Care should however be taken whenperforming installation with typical PCMCIA default settings (I/O address 300, interrupt 10) as interrupt10 (cf. 3.2.2.10) is already used by SINUMERIK 840C.

Page 33: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-13SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.8.1 Installation of a 3Com 10 MBps LAN PC Card, type 3CCE589EC

The two PCMCIA 2.0 slots on the interface MMC module are not directly supported in the standardversion by either the BIOS or the Windows operating system.

Software installation:

− Floppy disk drive, external keyboard,

− WfW 3.11 installation floppies (C:\WININST) see also:SINUMERIK 840CInstallation and Start-Up, Description of DifferencesOEM version for Windows™Installation and Start-Up GuideManufacturer Documentation1.2.3 Installation of Windows resources

− 3Com driver floppy 2 (C:\mmcwin\PCMCIA\3com2.exe of test environment)must be available. You do not yet need to insert the network adapter.

1. Set the password, open the File Manager and select File/Run and enter "progman" toopen the Program Manager. In this screen, open Windows Setup and selectOptions/Change Network Settings.

2. When the Network Setup dialog box opens, select the networks.. button and set InstallMicrosoft Windows Network in the box which opens next. Close this again by selectingthe Ok button.

3. By selecting button sharing.. in the Network Setup box, you can open a screen forsetting access rights which allow other computers to access the control.

4. Select the drivers.. button in the Network Setup box and then button Add-Adapter in thenext box. A list of available drivers will be displayed. Select option unlisted networkadapters to install the 3Com driver. The software is installed from the second (!) floppy(we are using Version 5.5, oemsetup.inf in A:\).

5. Select and set Setup:− Interrupt 11 (as this is automatically assigned: Call Setup a second time after installation and change to interrupt 11 or, after installation, set directly in protocol.ini, section [ELPC3] entry INTERRUPT=11)− Base I/O 300H− BaseMemory automatic or unused

6. Select the Close button to exit the Network Setup box.

7. Enter the user, group and computer name.

8. The MS Windows Network application is then installed by the Windows Setup routine(use the browser to set path C:\WININST for each of the requested WfW 3.11 installationfloppies to install files NDIS.386 and WFWNET.DRV).

9. When the Windows Setup routine asks for the manufacturer driver, select Elpc3.dos onthe second floppy, path A:\Mslanman.dos\Drivers\Ethernet\Elpc3, e.g. using the browser.

10. Before restarting your computer, make the following changes using the Notepad texteditor:

− Set PCMCIA_ENABLER=YES in section [ELPC3] of file \windows\protocol.iniso that the CardServices are not used.In the same file, insert a comment semicolon in front of the SLOT line.

Page 34: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-14 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

;SLOT = 1because 1 is not the number for slot A (slot A will be addressed if you insert a commentsemicolon)

− Change the following line in file c:\config.sys todevice=C:\DOS\EMM386.EXE NOEMS X=C000-DFFF

− Change the following line in section [386enh] of files c:\windows\system.ini andc:\mmcwin\pc\system.ini toEmmExclude=C000-DFFFNo other memory manager may have access to the memory array used by the PCMCIAnetwork card!

− Below are some of the settings which must be made in section [386Enh] of file system.inito avoid hardware conflicts:COM3Irq=5COM3Base=03E8COM4Irq=9COM4Base=02E8

11. Power down the control and switch off.

Hardware installation:

− Set DIP switches on the interface MMC to the standard 00010010 or deactivate COM3 and COM4with 1 000 0000.

− Insert card, e.g. in socket A of the interface MMC, with the front end of the card labeled Etherlink IIIon the right, i.e. you insert the card with this label upside down.

NoteIf a 3Com network card is installed on a SINUMERIK 840C OEM Version for Windows controlsystem, you may find that the computer stops booting at the "net start" command when yourestart it warm. If this happens, switch it off and then on again so that it can boot correctly.

NoteAfter you have installed the software successfully, you must make the change that was made in filec:\config.sys in file c:\config.emm as well. This will ensure that the network installation remainsoperable even when the computer is rebooted from Windows to FlexOS and vice versa!

To ensure the changes remain valid when the software is updated, they must be made in the filesmarked by an X in the following table:

Change � c:\windows\net start device=C:\DOS\EMM386.EXE NOEMS X=C000-DFFFAUTOEXEC.BAT CONFIG.

SYS EMM DRD FLXC:\ X X X

C:\TOOLS XC:\TOOLS\MSD X X X X XC:\TOOLS\DRD X

Make a new backup after you have installed the network for later restore purposes!

Page 35: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-15SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.8.2 Installation of an Xircom RealPort Ethernet 10/100+Modem 56, type REM56G-100

– Floppy disk drive, external keyboard,− WfW 3.11 installation floppies (C:\WININST) see also:

SINUMERIK 840CInstallation and Start-Up, Description of DifferencesOEM version for Windows™Installation and Start-Up GuideManufacturer Documentation1.2.3 Installation of Windows resources

− XIRCOM driver floppy (C:\mmcwin\PCMCIA\XIRCOM2.exe of test environment)must be available. You do not yet need to insert the network adapter.

− Set the password, open the File Manager and select File/Run and enter "progman" to open theProgram Manager. In this screen, open Windows Setup and select Options/Change NetworkSettings.

− When the Network Setup dialog box opens, select the networks.. button and set Install MicrosoftWindows Network in the box which opens next. Close this again by selecting the Ok button.

− By selecting button sharing.. in the Network Setup box, you can open a screen for setting accessrights which allow other computers to access the control.

− Select the drivers.. button in the Network Setup box and then button Add-Adapter in the next box.A list of available drivers will be displayed. Select option unlisted network adapters to install theXircom XCEM NDIS 2.01 RealMode driver. The software is installed from the driver floppy (we areusing Version 2.31).

− Select and set Setup: Interrupt 11, Base I/O 300H, Memory C8000− Load driver, insert floppies if requested or set path C:\WININST using the browser.− Add the following settings in section [XIRCMAC] of file \windows\protocol.ini:

− To deactivate the modem function: NOCOM

− To prevent various checks from being performed when the driver starts: NOCHECK

Important:It is essential that these checks are made during start-up. For this reason, do not use optionNOCHECK to begin with. We experienced the following problem: The card driver bootedproperly after a cold start but, when the computer was then warm started (e.g. after languageswitchover or Ctrl-Alt-Del), the message: "The selected memory segment is in use" appeared.The card then ceased to boot. When we set option NOCHECK, the driver booted properly aftera warm start and the network operated perfectly. Xircom thinks that this solution is acceptableand could not offer any alternative.

− You can add the line LINESPEED=100 or LINESPEED=10 as an option. This forces the cardto transmit at 100 Mbps or 10 Mbps. If the card cannot transmit this fast because, for example,the transmission partner is not capable of this speed, the network will crash. If you leave outthe line altogether, the fast possible transmission speed will be selected automatically.

Page 36: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-16 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

− Change the following line in file c:\config.sys todevice=C:\DOS\EMM386.EXE NOEMS X=C000-DFFFChange the following line in section [386enh] of files c:\windows\system.ini andc:\mmcwin\pc\system.ini toEmmExclude=C000-DFFF(No other memory manager may have access to the memory array used by the PCMCIA networkcard!)

Hardware installation:

− Set DIP switches on the interface MMC to the standard 00010010 or deactivate COM3 and COM4with 1 000 0000

− Insert card in socket A of the interface MMC, socket B cannot be used because of size of card

− Cabling, use of a hub:The partner computers can be directly connected (via a twisted-pair cable). They can also be linkedvia a hub (but then not using a twisted-pair cable). Xircom requires a hub to be connected betweenthe partners both with normal peer-to-peer connections and for transmissions at 100 Mbps.Judging by our own experience, we could have managed without a hub (an opinion shared by ourinternal company network hotline). Using a hub does not create any particular problems.

− To achieve the maximum transmission speed of 100 Mbps, you need - as mentioned above -suitable partners. We used, for example, a 3Com Fast Etherlink XL 10/100 Mb TX Ethernetadapter in the PCI slot of a Win95 PC. In its installation or configuration routine, you can select10 Mbps, 100 Mbps or Automatic (highest possible) as the media type. In a backup test on a2.98 MB file, the maximum configuration requires a good 5 seconds and approximately 55 secondsat 10 Mbps. The hub has no effect on the transmission speed.

NoteAfter you have installed the software successfully, you must make the change that was made in filec:\config.sys in file c:\config.emm as well. This will ensure that the network installation remainsoperable even when the computer is rebooted from Windows to FlexOS and vice versa!

To ensure the changes remain valid when the software is updated, they must be made in the filesmarked by an X in the following table:

Change � c:\windows\net start device=C:\DOS\EMM386.EXE NOEMS X=C000-DFFFAUTOEXEC.BAT CONFIG.

SYS EMM DRD FLXC:\ X X X

C:\TOOLS XC:\TOOLS\MSD X X X X XC:\TOOLS\DRD X

Make a new backup after you have installed the network for later restore purposes!

Page 37: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-17SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.8.3 Data backup using the PCMCIA card hard disk

The 840C OEM Version for Windows Package 6.4 contains a self-extracting file (c:\mmcwin\PCMCIA\PCCARDHD.exe). This file is a PC card patch which can be uploaded to a SINUMERIK 840C controlwith OEM Version for Windows via a PC link. The SW is installed by unpacking the file. The patch isthen integrated in the backup menus as the control system boots to enable access to a PC card HardDisk inserted in the PCMCIA slot. The patch is compatible with 840C OEM Version for Windows, SWversion 6. Controls with older SW installed must be upgraded beforehand with TOOLS > Version 6.7.4!

The PC card HD patch expands the backup menus (Installation and Start-Up Guide, Subsection 1.6.6Backup/FlexOS pages 1-53) as follows.

Menu option Data Area, Diagnosis, Backup/FlexOS causes the control to end MS-Windows and drop tothe MS-DOS level. The following menu is then displayed:

Main menuSIN840C-Windows

Copyright (c) Siemens AG 1997 - 1998. All rights reserved.Main menu SIN840C-Windows:.......=================================1. Restore/Backup/Install/Uninstall2. Boot MMC-Flexos3. Extended functions4. Calibrate display5. Check and reorganize hard disk (with system restart)6. Perform a surface scan of hard disk0. End ...reboot MMC-Windows================================Enter your Choice...:=[1,2,3,4,5,6,0]?

Fig. 1-25: Main menu of 840C Windows (SW 6.3)

1. Restore/Backup/Install/UninstallBy selecting 1, you can go to menu "Restore/Backup/Inst./Uninst." (Fig.1-26). If PC Card HD is set, you go to the menu for "Restore/Backup" for thePC card Hard Disk (Fig. 1-26.1).

NoteIf PC card HD is set as the device, but no PC card HD hard disk is inserted in thePCMCIA slot, you go to menu "Set device type" (Fig. 1-29.1).

Restore/Backup/Inst./Uninst.

Copyright (c) Siemens AG 1997. All rights reservedRestore/Backup/Inst./Uninst. - Device PST-160===================================================1. Backup system (all files on disk to tape)2. Restore system (all files on tape to disk)3. Backup user data...4. Restore user data5. Backup INI-files (all files *.ini on disk to tape)6. Restore INI-files... (all files *.ini on tape to disk)7. Set I/O device...8. Uninstall/Install/Unpack...9. Free data transfer via PC-Link...(Attention!!!)0. END...=================================================Enter your choice...:=[1,2,3,4,5,6,7,8,9,0]?

Fig. 1-26: Restore/Backup/Install/Uninstall menu

7. Set I/O device...By selecting 7, you go to the extended menu "Set device type" (Fig. 1-29.1).

8. Uninstall/Install/Unpack...If the PC card HD patch is installed, but PC-CARD HD is not set as thedevice, you go to the extended "Uninstall/Install/Unpack" (Fig. 1-30.1) menuwhen you select 8.

Page 38: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-18 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Restore/Backup forPC Card Hard Disk

Copyright (c) Siemens AG 2000. All rights reservedRestore/Backup - Device PC-Card HD===================================================1. Backup system (system on disk to PC-Card HD)2. Restore system (system on PC-Card HD to disk)3. Backup user data... (user data on disk to PC-Card HD)4. Restore user data (user data on PC-Card HD to disk)5. Backup INI-files (Ini files on disk to PC-Card HD)6. Restore INI-files...(Ini files on PC-Card HD to disk)7. Set I/O device...8. Pack/Unpack/Delete...9. Create a boot disk for PC-Card HD0. END...=================================================Enter your choice...:=[1,2,3,4,5,6,7,8,9,0]?

Fig. 1-26.1: Restore/Backup menu

1. Backup systemThe option Backup System dumps all data from the hard disk in the controlsystem to the PC card Hard Disk. All the system software and user data arebacked up.IMPORTANTWhen you back up data, any backup which already exists on the PC cardHD will be deleted.

NoteYou can pack (compress) backup data into archives, see option 8 Pack/Unpack/Delete for further details.

2. Restore systemThe system software copied to the PC card Hard Disk with Backup Systemcan be copied back to the control hard disk with this option.

IMPORTANTWhen you restore data, files of the same name on the control hard disk willbe overwritten without a prompt.

NoteThe following table shows how the Restore function behaves if the backupsystem if the backup system is not the same as the system on the control.Restore from BackupSystem

To Control System

MS-DOS/Windows-MMC

840C basic model (withboot floppy for PC cardHD)DR-DOS/FlexOS-MMC

MS-DOS/Windows-MMC OK IMPORTANT: Hard diskwill be formatted as MS-DOS!WARNING: All data onthe hard disk in drive C:will be deleted. Format(Y/N)?[Y][ENTER]!!!WARNING!!!Disk Boot Sector is to bemodified. Type "Y" toaccept, any key to abort.Award Software, Inc.[Y][ENTER]

DR-DOS/Flexos-MMC Not possible! OK

Page 39: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-19SINUMERIK 840C OEM Version for Windows (BN)

3. Backup user data...Select 3 to go to menu "Backup user data" (Fig. 1-26).

4. Restore user dataThis function enables you to restore previously created backups of user datafrom the PC card hard disk to the control system hard disk.

IMPORTANTWhen you restore data, files of the same name on the control hard disk willbe overwritten without a prompt.

5. Backup INI-filesThis function backs up all initialization files (*.INI) from the hard disk of thecontrol to the PC card hard disk.

IMPORTANTThis function will delete any previously existing backup of INI files on the PCcard HD.

NoteYou can pack (compress) backups of INI files into archives, see menuoption 8. Pack/Unpack/Delete for further details.Searching the hard disk for INI files make take several minutes without anychange to the screen display!

6. Restore INI-files...Select option 6 to go to menu "Restore INI files" (Fig. 1-28)

7. Set I/O device...Select option 7 to go to menu "Set device type" (Fig. 1-29.1)

8. Pack/Unpack/Delete...Select option 8 to go to menu "Pack/Unpack/Delete" (Fig. 1-37)

9. Create a boot disk for PC-Card HDYou can make a bootable PC card HD floppy with this function. This floppyenables you to use System Backup/Restore from/to controls on computerswithout a PC card HD patch if a floppy disk drive is connected and bootsequence A-C is set.

0. END ...Back to previous menu.

Backup user data Copyright (c) Siemens AG 1997. All rights reservedBackup user data - Device PC-Card HD===================================================1. Backup user data without 611D-drive data2. Backup user data with 611D-drive data0. END...=================================================Enter your choice...:=[1,2,0]?

Fig. 1-27: Backup user data menu

Page 40: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-20 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

1. Backup user data without 611D-drive dataThis function backs up the entire user branch in the FlexOS directorystructure and the following data in the MS-Windows directory:- User machine data- User cycles- Workpieces- OEM directory

2. Backup user data with 611D-drive dataThis function backs up the 611D drive boot data stored inc:\mmc.001\siem.069\servo.111\*.113 in addition to the data listed above:

0. END ...Return to previous menu.

IMPORTANTWhen you back up data, any previously existing backup on the PC card HDwill be deleted.

NoteYou can pack (compress) backup data into archives, see menu option 8.Pack/Unpack/Delete for more details.

Restore INI files Copyright (c) Siemens AG 1997. All rights reservedRestore INI files - Device PC-Card HD===================================================1. Restore without prompt2. Restore with prompt0. END...=================================================Enter your choice...:=[1,2,0]?

Fig. 1-28: Restore INI files menu

1. Restore without promptFiles are restored without an overwrite prompt.

IMPORTANTWhen you restore data, files of the same name on the control hard disk willbe overwritten without a prompt.

NoteThis function is useful for series start-ups.

2. Restore with promptFiles are restored after an overwrite prompt.

0. END...Return to previous menu.

Page 41: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-21SINUMERIK 840C OEM Version for Windows (BN)

Set device type(with PC card HDexpansion)

Copyright (c) Siemens AG 2000. All rights reservedSet device type - Device PC-Card HD=================================================1. PST - 1602. PST2 - M12003. PST2 - M1200 to read PST - 160 tapes4. PC-Link5. PC-Card HD0. END ...=================================================Enter your choice...:=[1,2,3,4,5,0]?

Fig. 1-29.1: Set device type menu

5. PC card HDChoose 5 to select the PC card Hard Disk. The type settings remains validafter RESET/POWER ON. The selected I/O medium is displayed in the 2nd

line of the menu.

0. END ...Return to previous menu.If you have set PC card HD and the previously selected menu was 1-26"Restore/Backup/Install/Uninstall", you will go to menu 1-26.1:"Restore/Backup" for the PC card Hard Disk.

NoteIf you have set PC card HD, but no PC card Hard Disk is inserted in thePCMCIA slot, a corresponding message is output and you will be promptedto selected another device!

IMPORTANTYou must switch off the control system power before inserting or removingthe PC card Hard Disk!

Uninstall/Install/Unpack(with PC card HDexpansion)

Copyright (c) Siemens AG 2000. All rights reservedUnistall/Install/Unpack - Device PST-160=================================================1. Uninstall windows software...

2. Install packed windows software...

3. Unpack packed windows software...

4. Delete packed windows software...

5. Set I/O device...

6. Uninstall PC-Card HD software

0. END ...=================================================Enter your choice...:=[1,2,0]?

Fig. 1-30.1: Uninstall/Install/Unpack menu

6. Uninstall PC-Card HD softwareRemoves the PC card HD patch from the control system.

IMPORTANTThe patch is deleted without any further prompt!

NoteYou can reach this menu option only if PC card HD is not selected as thedevice.

0. END ...Return to previous menu.

Page 42: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-22 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Pack/Unpack/Delete Copyright (c) Siemens AG 2000. All rights reservedPack/Unpack/Delete - Device PC-Card HD=================================================1. Pack system backup...2. Unpack packed system backup...3. Delete packed system backup...

4. Pack user data backup...5. Unpack packed user data backup...6. Delete packed user data backup...

7. Pack INI-files backup...8. Unpack packed INI-files backup...9. Delete packed INI-files backup...

0. END ...=================================================Enter your choice...:=[1,2,3,4,5,6,7,8,9,0]?

Fig. 1-37: Pack/Unpack/Delete menu

1. Pack system backup...Pack System Backup compresses a complete dump of all data from thecontrol system disk that was previously backed up on the PC card HardDisk. Fig. 1-38 is displayed. You can enter the archive name in this screenand start the compression. It may not always be possible to compresssystem backups of >150MB (main memory problem).

2. Unpack packed system backup...Unpack Packed System Backup extracts a complete dump of all data fromthe control system disk that has been compressed beforehand to the PCcard HD using the Pack System Backup function. Fig. 1-38 is displayed inwhich you can select the name of the archive and start the decompression.

IMPORTANTWhen you decompress an archive, the existing System Backup on the PCcard Hard Disk will be deleted.

3. Delete packed system backup...Delete Packed System Backup deletes a complete dump of all data from thecontrol system disk that has been compressed beforehand to the PC cardHD using the Pack System Backup function. Fig. 1-38 is displayed in whichyou can select the name of the archive and start the delete operation.

4. Pack user data backup...Pack User Data Backup compresses a complete dump of all user data fromthe control system disk that was previously backed up on the PC card HardDisk. Fig. 1-38 is displayed. You can enter the archive name in this screenand start the compression.

5. Unpack packed user data backup...Unpack Packed User Data Backup extracts a complete dump of all userdata from the control system disk that has been compressed beforehand tothe PC card HD using the Pack User Data Backup function. Fig. 1-38 isdisplayed in which you can select the name of the archive and start thedecompression.

IMPORTANTWhen you decompress an archive, the existing User Data Backup on the PCcard Hard Disk will be deleted.

Page 43: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-23SINUMERIK 840C OEM Version for Windows (BN)

6. Delete packed user data backup...Delete Packed User Data Backup deletes a complete dump of all user datafrom the control system disk that has been compressed beforehand to thePC card HD using the Pack User Data Backup function. Fig. 1-38 isdisplayed in which you can select the name of the archive and start thedelete operation.

7. Pack INI-files backup...Pack INI Files Backup compresses a complete dump of all initialization filesfrom the control system disk that was previously backed up on the PC cardHard Disk. Fig. 1-38 is displayed. You can enter the archive name in thisscreen and start the compression.

8. Unpack packed INI-files backup...Unpack Packed INI Files Backup extracts a complete dump of allinitialization files from the control system disk that has been compressedbeforehand to the PC card HD using the Pack INI Files Backup function.Fig. 1-38 is displayed in which you can select the name of the archive andstart the decompression.

IMPORTANTWhen you decompress an archive, the existing INI Files Backup on the PCcard Hard Disk will be deleted.

9. Delete packed INI-files backup...Delete Packed INI Files Backup deletes a complete dump of all INI files fromthe control system disk that has been compressed beforehand to the PCcard HD using the Pack INI Files Backup function. Fig. 1-38 is displayed inwhich you can select the name of the archive and start the delete operation.

0. END...Return to previous menu.

Fig. 1-38: Pack menu

Page 44: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-24 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Line Content (dependent on selection in 1-37)2 Pack, Unpack or Delete

Directory ArchiveD:\SYSTEM System BackupD:\USERDATA User Data Backup

5

D:\INIFILES INI Files Backup8-17 Archives available for selection22 Memory available on the PC card Hard Disk24 Selected archive or input field for entry of a new archive.

Page 45: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-25SINUMERIK 840C OEM Version for Windows (BN)

Line Content (menu bar)Key FunctionAlarm Reset1) (Esc) Abort (without execution)Input2) (Enter) Execute (see lines 2 and 5). A check

prompt is displayed which must beacknowledged with Y or N.Mode ReactionSelect Moves the Select

cursor accordingto cursor directionto the desiredarchive.

Cursor(up, down, left, right)

(left, right) Input Moves the Writecursor accordingto cursor directionto the desiredcharacter in theinput field.

Select Selects Inputmode (with Packonly)

Backspace3) or A .. Z

Backspace3)

A .. Z

Input Move cursor toleft, deleting thecharacter on leftof cursor.

Enter archivename (the DOSfile name con-vention withoutextensionapplies!).

Del (MF2 keyboard only) In Input mode only: Deletescharacter on which cursor ispositioned. The cursor position doesnot change.

25

Page (up, down) In Select mode only: For scrolling ifthere are more than 50 archives.

1) 2) 3)

If no archives are stored, you switch directly to Input mode. The input field is empty and ready to acceptan archive name. If archives are stored, the name of the archive on which the Select cursor ispositioned is displayed in the input field.

A check prompt is output prior to execution; if you acknowledge this with N, you return to Select orInput mode. If you acknowledge with Y, the archive name you have entered is checked. If you haveinput an illegal name (DOS file name convention applies), an error message appears. You then returnto Select or Input mode.

You can select Cancel to leave the screen without taking any action.

Page 46: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-26 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.9 I/O address areas

AT standard MMC 486 DX MMC 486 SX/DX(version B)

MMC interface

DMA controller 1 000 - 01F 000 - 00F 000 - 00FInterrupt controller 1 020 - 03F 020 - 021,

024,026,028020 - 021

Timer 040 - 05F 040 - 043 040 - 043Keyboard controller, port B 060 - 06F 060 - 06F 060 - 06FReal-time clock, CMOS memory, NMI 070 - 07F 070 - 071 070 - 071DMA page register, port A 080 - 09F 081 - 08F 081 - 08FManufacturer's diagnostic checkpoint 080 - 08F 080 080Interrupt controller 2 0A0 - 0BF 0A0 - 0A1 0A0 - 0A1DMA controller 2 0C0 - 0DF 0C0 - 0DF 0C0 - 0DFSoftware dummy output 0E0 0E0Config. Register 0EC - 0ED 0EC - 0EDEMS RegisterMath. Coprocessor 0F0 - 0FF 0F0 - 0FF 0F0 - 0FFConfig. Register/second hard disk 170 - 171 freeFree 100 - 1EF free except for

170 - 171free

Hard disk 1F0 - 1F7 1F0 - 1F7 1F0 - 1F7Reserved for game I/O port 200 - 207 free freeReserved for sound card 220 - 257 free freeConfig. Register free 26E- 26FParallel printer 2 278 - 27F free freeSerial communication COM 4 278 - 27F free free 2E8 - 2EFEnhanced graphics adapter EGA 2 2C0- 2DF 2C0- 2DF 2C0- 2DFSerial communication COM 2 2F8 - 2FF 2F8 - 2FF

settable in set-up

2F8 - 2FFsettable in set-up

Reserved for prototype card 300 - 31F free freeReserved for LAN card 360 - 36F free freeReserved for disk controller 2 370 - 377 free freeParallel printer 1 378 - 37F 378 - 37B

settable in set-up

3BC - 3BFsettable in set-up

Serial communication COM 3 378 - 37F free 3E8 - 3EFSynchronous data link control (SDLC) 380 - 38F free freeMMC interface, config. super I/O 398 - 399 free free 398 - 399Bisynchronous port 1 3A0 - 3AF free freeMonochrome display adapter/printer1 3B0 - 3BF 3B0 - 3BF 3B0 - 3BFEnhanced graphics adapter EGA 1 3C0 - 3CF 3C0 - 3CF 3C0 - 3CFVideo graphics array (VGA/CGA) 3D0 - 3DF 3D0 - 3DF 3D0 - 3DFPCMCIA controller 3E0 - 3E1 free free 3E0 - 3E1Diskette controller 3F0 - 3F7 free free 3F0 - 3F7Reserved for hard disk 3F6 - 3F7 3F6 - 3F7 3F6 - 3F7 com 3/4?Serial communication COM 1 3F8 - 3FF 3F8 - 3FB

settable in set-up

3F8 - 3FBsettable in set-up

Page 47: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-27SINUMERIK 840C OEM Version for Windows (BN)

3.2.2.10 Interrupt assignments

The following table shows the assignment of the available of interrupt requests (IRQs).

'Prio 0' indicates the highest priority.

Prio Interrupt controller 1 IRQ

0 Timer 0

1 Keyboard controller 1

2 Interrupt controller 2 IRQ

2 Real timer clock 8

3 VGA (not used) 9

4 SINUMERIK virt. interrupt 0 10

5 Free 11

6 Free, (COM3/4), MMC interfaceonly

12

7 Math. coprocessor 13

8 IDE hard disk interface 14

9 SINUMERIK virt. interrupt 1 15

10 Serial interface 2: COM2 3

11 Serial interface 1: COM1 4

12 Free (as from BIOS V17) 5

13 Floppy drive (MMC interface only) 6

14 Par. Interface 1: LPT1 7

IRQ 3 .. 7, 9 .. 12, 14 and 15 are available on the ISA bus of the AT box.IRQ 3..5, 7, 9, 10..12, 14 and 15 are available on the PCIC (interface on PCMCIA adapter).

Virtual interrupts

The multiport RAM driver assigns the two virtual interrupts 0 an 1 for the communication between theMMC CPU and the NCK/PLC:

- VINT0: (IRQ 10) 0D000:8000 to 0D000:807F MMC side

- VINT1: (IRQ 15) 0D000:8080 to 0D000:80FF MMC side

• Writing a data item into these multiport RAM areas from the link bus triggers thecorresponding interrupt on the MMC CPU. Reading out these areas from the MMC busautomatically cancels the interrupt request.

If standard PC modules are used in the AT box, please do not forget that theseinterrupts are already assigned and therefore cannot be assigned to additionalcards.

Page 48: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-28 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.3 Hardware interfaces on the MMC CPU

3.2.3.1 Serial interface RS232 (COM1)

This interface is reserved for the operator panel.Connector designation: X 141Connector type: 25-pin subminiature D socket connector

Signals:1: SHIELD Shield ground2: TxD O Transmit data V.243: RxD I Receive data V.244: RTS O Request to send5: CTS I Clear to send6: DSR I Data send ready7: MEXT O Signal ground8: DCD I Carrier detect18: RS422_5V 5V connection for RS42220: DTR O Data terminal ready21: MEXT Signal ground22: RI I Ring indicator24: MEXT Signal ground25: RS422 I Level switchover for

RS422

3.2.3.2 Serial interface RS232/TTY (COM2)

Connector designation: X 151Connector type: 25-pin subminiature D socket connector

Signal names:1: SHIELD Shield ground2: TxD O Transmit data V.243: RxD I Receive data V.244: RTS O Request to send5: CTS I Clear to send6: DSR I Data send ready7: MEXT O Signal ground8: DCD I Carrier detect10: TTY2 O Receive TTY12: T20mA O Transmit 20 mA13: TTY4 I Transmit TTY14: TTY3 I Transmit TTY16: R20mA I Receive 20 mA18: RS422_5V 5V connection for RS42219: TTY1 O Receive TTY21: MEXT Signal ground20: DTR O Data terminal ready22: RI I Ring indicator24: MEXT Signal ground25: RS422 I Level switchover for RS422

Signal type: I InputO Output

Page 49: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-29SINUMERIK 840C OEM Version for Windows (BN)

A mouse can be connected to this interface. See Subsection 1.2.3 OEM Installation Guide.

Note:

Users wishing to use a mouse for the control and having the problem that the operator panel is too faraway from the MMC, may connect a mouse with a cable length up to 50 m. For further information,please contact the SINUMERIK 840C Hotline.

3.2.3.3 Parallel interface (LPT1)

This interface is used in the system for connecting the streamer.

- Centronics

- Socket connector: 25-pin subminiature D

Connector designation: X 122

Connector type: 25-pin subminiature D socket connector

Signal names:

1: XSTB O Data strobe to printer2: PD0 I/O Printer data port, bit 03: PD1 I/O Printer data port, bit 14: PD2 I/O Printer data port, bit 25: PD3 I/O Printer data port, bit 36: PD4 I/O Printer data port, bit 47: PD5 I/O Printer data port, bit 58: PD6 I/O Printer data port, bit 69: PD7 I/O Printer data port, bit 710: XACK I Acknowledge signal from

printer11: BUSY I Busy signal from printer12: PE I Paper error signal from

printer13: SLCT I Select signal from printer14: XAFD O Autofeed printer signal15: XERR I Error signal from printer16: XINIT O Initialize printer signal

17: XSLIN O Select signal to printer 18-25: MEXT Signal ground

Signal type:

I InputO Output

Note:Connecting a printer

Recommendation for users wishing to connect a printer to the control:

When printing data via the parallel interface, various printer drivers may cause problems arising fromthe fact that locking of the system interrupt during printing may lead to interference with the internalcommunication of our control system. Since we have no influence on the software of printer drivers, werecommend you not to connect the printer directly to the parallel interface but to operate a networkprinter via an external PC which in turn is connected to the MMC using a network card. For furtherinformation, please contact the SINUMERIK 840C Hotline.

Page 50: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-30 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.3.4 Keyboard interface

For connection of a standard MF2 keyboard (for testing purposes only)

Connector designation: X 132Connector type: DIN socket connector to DIN 41524

3.2.3.5 RGB interface

Three BNC connectors for RGB analog signals

Connector designation: X111Connector designation: X121Connector designation: X131

Connector type: BNC socket connector

The ground connection on the BNC connectors must not be used for shielding.

3.2.3.6 VGA analog interface (PC-compatible)

This interface cannot be used at the same time as the BNC outputs (for testing purposes only).

Connector designation: X 221Connector type: 15-pin subminiature D socket connector

Signal names:2: KBData I/O Keyboard data1: KBClk I/O Keyboard clock4: 0 V Digital ground5: 5 V +5 V Digital supply,

Max. load 300 mA

Signal type:

I/O Bidirectional

Signal names:

R O RedG O GreenB O Blue

Signal type:O Output

R

G

B

Signal names:1: RED O Analog red2: GREEN O Analog green3: BLUE O Analog blue13: H_SYNC O Horizontal sync14: V_SYNC O Vertical sync5-8: MANA Analog ground10: MANA Analog ground

Signal type:

O Output

Page 51: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-31SINUMERIK 840C OEM Version for Windows (BN)

3.2.3.7 Hardware settings on the MMC CPU

Via the switches S1 and S4, the following settings can be made on the MMC CPU module.

Settings via S1, DIP switch

1 2 3 4 5 6 7 8 DescriptionON OFF ON ON ON ON OFF OFF DX/DX2 processor

(standard setting)OFF ON OFF OFF ON ON OFF OFF SX processor

(standard setting)ON/OFF ON/OFF ON/OFF ON/OFF ON ON OFF OFF VGA/RGB on MMCON/OFF ON/OFF ON/OFF ON/OFF OFF ON OFF OFF External VGA card

can be used(e.g. AT box)

S4

When you use the RGB interface, you must close S4 (standard setting)When you use the VGA interface, you must open S4 (OEM application)

Note:

When you pull out the MMC CPU from the rack and plug it in again, the control does not recognize thisimmediately. The control runs up and continues to operate normally.

An error does not occur until a PLC complete restart is executed. In this case, the link RAM copies thePLC machine data destroyed by the withdrawal of the MMC CPU to the internal interface of the PLC.Due to the missing PLC data, the restart is prevented (PLC STOP). The PLC data must be reloaded.

3.2.3.8 Operator controls and displays

- Reset pushbutton (recessed)- NMI pushbutton- 7 segment display signals the system status. In the case on the MMC CPUs (version B) the

display remains dark after a successful start-up.

3.2.3.9 SINUMERIK link bus

- To System 800 bus specification- Module power supply- Interface to NC and PLC via link memory- Connector: 96-pin plug connector to DIN 41612

Page 52: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-32 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.3.10 AT96 local bus

- Electrically compatible with PC I/O channel- Connector: 96-pin socket connector- Asynchronous to system clock (timer programmable)- Suitable for an additional module (no output driver)- Plug connector to DIN 41612C, adapted to industrial requirements- Module size: Double-height Eurocard format- Supply voltages: -5V, -12V and +12V are not implemented- The unlatched address lines LA17, LA18 and LA19 are not implemented

Connector assignment:

Pin Row a Row b Row c

1 0V XSBHE I

2 RESETDRV O XMEMCS16 I SD7 I/O

3 +5V LA23 I/O SD6 I/O

4 IRQ9 I IOCS16 I SD5 I/O

5 LA22 I/O SD4 I/O

6 DRQ2 I IRQ10 I SD3 I/O

7 LA21 I/O SD2 I/O

8 0WS I IRQ11 I SD1 I/O

9 LA20 I/O SD0 I/O

10 0V IRQ12 I I/OCHRDY I

11 SMEMW O UBATT O AEN I/O

12 SMEMR O IRQ15 I SA19 I/O

13 IOW I/O RES1 SA18 I/O

14 IOR O IRQ14 I SA17 I/O

15 DACK3 O RES2 SA16 I/O

16 DRQ3 I DACK0 I SA15 I/O

17 DACK1 O MEMR I/O SA14 I/O

18 DRQ1 I DRQ0 I SA13 I/O

19 REFRESH I/O MEMW I/O SA12 I/O

20 CLK O DACK5 O SA11 I/O

21 IRQ7 I SD08 I/O SA10 I/O

22 IRQ6 I DRQ5 I SA9 I/O

23 IRQ5 I SD09 I/O SA8 I/O

24 IRQ4 I DACK6 O SA7 I/O

25 IRQ3 I SD10 I/O SA6 I/O

26 DACK2 O DRQ6 I SA5 I/O

27 T/C O SD11 I/O SA4 I/O

28 BALE O SD12 I/O SA3 I/O

29 +5V SD13 I/O SA2 I/O

30 OSC O SD14 I/O SA1 I/O

31 0V O SD15 I/O SA0 I/O

32 DRQ7 I MASTER I DACK7 O

Connector designation: X216, X 217,

Signal names:

RESETDRV Reset drive

IRQ 3..7,14

IRQ 9..12,15 Interrupt request

DRQ 1,2,5 DMA request

XDACK 1,2,5 DMA acknowledge

XSMEMR Memory read (< 1MB)

XSMEMW Memory write (< 1MB)

XMEMR Memory read

XMEMW Memory write

XIOW I/O-Write strobe

XIOR I/O-Read strobe

T/C Terminal count

AEN Address enable

BALE Address latch enable

XSBHE High byte enable

SD 0..15 System data bus

SA 0..19 System address bus

LA 20..23 Latchable Address bus

CLK Bus clock

OSC 14.318 MHz clock

I/OCHRDY I/O channel ready

XIOCS16 I/O chip select 16-bit

XMEMCS16 Mem. chip select 16-bit

VCC Battery voltage

+5V 5V-supply voltage

0V Ground

Signal type:I Input

O Output

I/O Bidirectional

Page 53: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-33SINUMERIK 840C OEM Version for Windows (BN)

3.2.3.11 Use of interfaces COM3 and COM4

The serial interfaces of the interface module can be used under the Windows operating system in thesame way as the serial interfaces on any expansion boards. However, please note the following:

• If a serial interface COM1...COM4 is to be used independently of the other interruptsources, a free interrupt must be assigned to it. Real interrupt sharing on the ISA bus isnot generally possible because of the Tri-state driver used.

The interrupt numbers and the I/O address are set under the Windows for Workgroups operatingsystem via the Control Panel (in the menu "Connections" or "Further settings for ...."). The interruptnumbers are set on the MMC interface module with DIP switch S1.

The following table shows possible settings for COM3 and COM4:

I/O address (hex.) Interrupt No. (IRQ)

COM3 03E8 5

COM4 02E8 9

Note:

After the settings, the control must be rebooted.

The following table gives an overview of the possible interrupt assignments for COM3 and COM4 forMMC interface module 6FC5112-0DA01-0AA1. On the previous module COM3 and COM4 arepermanently wired to IRQ 12:

Setting S1, DIL switch(as of MLFB: 6FC5112-0DA01-0AA1)

The following jumpering (Flexos version) is the factory default setting:

1 2 3 4 5 6 7 8

OFF OFF OFF OFF ON OFF OFF OFF

You must set the following Windows setting on the DIL switches:

1 2 3 4 5 6 7 8

OFF OFF OFF ON OFF OFF ON OFF

1: Disable COM3/42: COM 4 (IRQ 3) exclusive operation possible only if COM 2 on MMC CPU is disabled (SETUP)3: COM 4 (IRQ 7)4: COM 4 (IRQ 9) → ON5: COM 3/4 (IRQ12) FlexOS compatible with previous module6: COM 3 (IRQ 4) exclusive operation possible only if COM 1 on MMC CPU is disabled (SETUP)7: COM 3 (IRQ 5) → ON8: COM 3 (IRQ 10)

Page 54: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-34 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.2.4 The AT box

3.2.4.1 Overview

Commercially available AT/XT standard modules can be used with the SINUMERIK 840C. Up to threeISA bus compatible modules (e.g. network cards) can be slotted into this AT rack. Low-cost networkingof the control together with Windows for Workgroups 3.11 is then possible.

The AT rack is situated next to the SINUMERIK 840C rack and contains three slots for a standardmodule. The connections are made via ISA plug connectors. The AT bus is linked to the AT96 local busof the MMC area.

F a n

3 A T s lo ts

S crew s fo r s ec uringth e A T m o d u les

S IN U M E R IKrac k

V iew from th e fron t

Fig. 3.10: AT rack without front cover

AT/XT modules with the following characteristics can be slotted into these slots:

• Required voltage: 5V, + 12V, voltage -5V which is connected to PIN B5 on thestandard 8/16-bit ISA bus is not available. Voltage -5 V on PC/ATs is not usuallyused.

• Unlatched address signals LA 17..19 are not used.

The large address bits on the standard PC/AT are not latched but merely amplifiedby the bus driver and are therefore valid on the bus earlier than latched addressesSA1..SA19. The large address bits can be used to activate *MEMCS16 causing a16-bit AT card to signal to the host CPU that it is supporting fast 16-bit access.

The relevant pins on the AT rack bus are assigned latched address SA 17..19. As aresult, the AT modules that require address signals LA 17..19 can still function.However, this should be tested from case to case.

The use of commercially available AT modules will affect the quality of theentire SINUMERIK 840C system with regard to electromagneticcompatibility, vibration strain, functional reliability and temperature strain.

Page 55: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-35SINUMERIK 840C OEM Version for Windows (BN)

3.2.4.2 The ISA local bus in the AT rack

The 16-bit ISA bus system is upwardly compatible with the 8-bit ISA bus. It sends signals in addition tothe signals of the 8-bit PC bus. The socket connector on the 16-bit ISA bus consists of two parts, a plugconnector compatible with the 8-bit ISA bus with 62 prongs and an expansion socket connector with 36contacts.

The double-sided prongs on the 8-bit ISA plug connector are named A and B according to the EISAspecification, those of the 16-bit expansion connector are named C and D.

The following table gives an overview of the pin assignment of the 16-bit ISA bus in the AT rack of theexpansion box:

Connector designation: X 219 to X 221 *) acc. to EISA specificationConnector type: ISA plug connector **) acc. to connector labelling

EISA*) Connector**) C*) D*) Connector**) EISA*)

18 1 SD 15 I/O 0V 2 18

17 3 SD 14 I/O *MASTER I 4 17

16 5 SD 13 I/O + 5V 6 16

15 7 SD 12 I/O DRQ 7 I 8 15

14 9 SD 11 I/O *DACK 7 O 10 14

13 11 SD 10 I/O DRQ 6 I 12 13

12 13 SD 9 I/O *DACK 6 O 14 12

11 15 SD 8 I/O DRQ 5 I 16 11

10 17 *MEMW I/O *DACK 5 O 18 10

9 19 *MEMR I/O DRQ 0 I 20 9

8 21 SA 17 1) I/O *DACK 0 O 22 8

7 23 SA 18 1) I/O IRQ 13 I 24 7

6 25 SA 19 1) I/O IRQ 15 I 26 6

5 27 LA 20 I/O IRQ 12 I 28 5

4 29 LA 21 I/O IRQ 11 I 30 4

3 31 LA 22 I/O IRQ 10 I 32 3

2 33 LA 23 I/O *IOCS16 I/O 34 2

1 35 *SBHE I/O *MEMCS16 I/O 36 1

A*) B*)

31 37 SA 0 I/O 0V 38 31

30 39 SA 1 I/O OSC O 40 30

29 41 SA 2 I/O +5V 42 29

28 43 SA 3 I/O BALE O 44 28

27 45 SA 4 I/O T/C O 46 27

26 47 SA 5 I/O *DACK 2 O 48 26

25 49 SA 6 I/O IRQ 3 I 50 25

24 51 SA 7 I/O IRQ 4 I 52 24

23 53 SA 8 I/O IRQ 5 I 54 23

22 55 SA 9 I/O IRQ 6 I 56 22

21 57 SA 10 I/O IRQ 7 I 58 21

20 59 SA 11 I/O CLK O 60 20

19 61 SA 12 I/O *REFRESH I/O 62 19

18 63 SA 13 I/O DRQ 1 I 64 18

17 65 SA 14 I/O *DACK 1 O 66 17

16 67 SA 15 I/O DRQ 3 I 68 16

15 69 SA 16 I/O *DACK 3 O 70 15

Page 56: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-36 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

EISA*) Connector**) C*) D*) Connector**) EISA*)

14 71 SA 17 I/O *IOR I/O 72 14

13 73 SA 18 I/O *IOW I/O 74 13

12 75 SA 19 I/O *SMEMR O 76 12

11 77 AEN I/O *SMEMW O 78 11

10 79 IOCHRDY I/O 0V 80 10

9 81 SD 0 I/O +12V 82 9

8 83 SD 1 I/O *0WS I 84 8

7 85 SD 2 I/O -12V 86 7

6 87 SD 3 I/O DRQ 2 I 88 6

5 89 SD 4 I/O 90 5

4 91 SD 5 I/O IRQ 9 I 92 4

3 93 SD 6 I/O +5V 94 3

2 95 SD 7 I/O RESETDRV O 96 2

1 97 *IOCHECK I/O 0V 98 1

See Subsection 3.2.3.10: "AT96 local bus" for a description of the signal names.

3.2.4.3 AT bus power supply

The voltages for the AT bus are provided as follows:

• The 5V supply is taken directly from the central power supply.

• The +12V supply is generated from the central +15V supply. Maximum currentconsumption must not exceed +500mA.

• Please also note the following:

The sum of +12V and +15V or -12V and -15V must not exceed themaximum current of the central controller with respect to +15V.

3.2.4.4 Using PC/AT cards

When using PC/AT cards, do not forget that several of the signals on the bus have already beenassigned internally and are therefore no longer available. None of the resources, whether they are inthe MMC or on the bus, must be assigned more than once.

For this reason, the interrupt and DMA channels and the I/O and memory address areas available tothe user for the use of PC/AT cards in the expansion box are listed below

• Free interrupt channels (cf. Subsection 3.2.2.10)

- IRQ 5 (for 8 and 16-bit cards)

- IRQ 9 (for 16-bit cards only)

- IRQ 11 (for 16-bit cards only)

- IRQ 12 (for 16-bit cards only, COM3/COM4 on the MMC interface cannot beused)

- IRQ 13 (if floppy drive on the MMC interface is not used)

Page 57: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-37SINUMERIK 840C OEM Version for Windows (BN)

• Free I/O address areas:

The free address areas can be deduced from the memory gaps in the table inSubsection 3.2.2.9.

• Free memory address area:

In the conventional memory between the adapters (640 KB - 1 MB) there aretwo free memory gaps (cf. Fig. 3.7) into which the memory from peripheral cardscan be inserted.

The two free memory areas lie between:

C800:0000 - C800:7FFF (1st free area)

E000:0000 - E000:FFFF (2nd free area)

Please observe the following when slotting in PC/AT cards:

• First remove the front cover from the AT rack expansion. Only remove fan if long ATmodules are to be inserted.

• Start slotting in modules from the right (for better heat dissipation).

• Short modules should be slotted in on the left and long modules slotted in on theright.

• The plastic protection strip in the base of the AT rack expansion for the slot that is tobe used must be removed (pinch out with side nippers).

• The bracket of the AT module must be screwed tight.

• Slotting in long AT modules:

- The fan must be pulled out so that the long AT modules can be inserted.

- When replacing the fan, ensure that the coding lugs of the fan connector are onthe left and fit into the two grooves.

- The fan cable must be placed in the channel and the resulting cable loop mustbe pushed to the back away from the fan impeller so that it does not touch it.

- The fan must be installed in such a way that the cable is seen from the outsideto exit the fan from the left.

• Additional AT module fastening:

- Black, compliant foam plastic is inserted in the AT frame expansion cover. Ithelps to retain the AT modules after the cover has been snapped on.

- The dimensions of the foam plastic must be adapted to the AT modules (byturning or cutting the foam plastic block to size). The recommended overlap ofthe foam rubber block onto the front AT module printed circuit board edge isapprox. 3-6 mm. Please ensure that the foam plastic does not press ontosensitive components on the AT module.

Page 58: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-38 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.3 New features in software version 6

3.3.1 Transmission of key code to PLC

The structure of key transfer from the operator panel on SINUMERIK 840C is displayed in the nextfigure. If the NCK display application is focused under FlexOS or Windows, all keys are transferred tothe NCK. The NCK then transfers the keys to the PLC!

Input

Processing

Kyro II Code

FlexOSCoding

MMCSystem

i Code

Control

Key FB

OPVT

MF2

FlexOSCoding

Fig. 3.14: Key transmission for SINUMERIK 840C

If the NCK display application of the MMC is not focused in the OEM Version for Windows, no keyswere transferred to NCK up to SW6. For this case, a special treatment has been implemented under

FlexOS ensuring that the "Acknowledge alarm" key is transferred to the NCK. In SW Version 6and higher, this special treatment is also implemented under Windows.

Page 59: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-39SINUMERIK 840C OEM Version for Windows (BN)

3.3.2 Program frame for WINDOWS and DOS applications (SW 6 and higher)

In SW 6 and higher, a basic program is available as a component of the basic system preventing anapplication from being started several times. The basic program OEMFRAME behaves in the followingway when an application is called up:

• If the application is not yet running, it is started withhInst = (HINSTANCE) WinExec (cmd, SW_SHOW);

• If the application is running, a window search is performed first.If the ClassName and / or WindowName has been transferred, the search is conducted withhWnd = (HWND) FindWindow (class, window);If the ClassName and WindowName have not been transferred,EnumTaskWindows (hTask, EnumTaskWndProc, 0L);is used to search for visible OVERLAPPED windows (GWL_STYLE != WS_POPUP &&GWL_STYLE != WS_CHILD). The application is then moved to the foreground withSetActiveWindow (hWnd)

The program can be integrated in the SINUMERIK 840C using the area switchover function (see alsoSubsection 3.4.3). The application to be called is passed to the basic program as a command line (e.g.oemframe 1 notepad). It is possible to manage up to 10 applications (tasks) with the program.

Command line of basic program:<Task> <AppName> {CmdLine="<cmd>" ClassName="<class>" WindowName="<window>"}

Meaning of entries:

verbose With the verbose option, status outputs can be monitored via a debug tool suchas DBWIN.EXE. This option is intended for test purposes only!Example: oemframe verbose 1 notepad.exe

Task Task management number of application (1 to 10) to be started.AppName Application to be started.CmdLine Command to be passed to the application to be started.ClassName Class name of application in Windows system.WindowName

Optional forWindowsapplicationsonly

Window name of application in Windows system.

The applications to be managed by OEMFRAME can be integrated in the SINUMERIK 840C controlthrough appropriate entries in the REGIE.INI initialization file or the REG_AUTO.CFG autostart file.

3.3.2.1 Integrating Windows programs

Sub-windows or POPUPs cannot be activated. When Windows programs are executed withoutspecification of the ClassName or WindowName, only top-level windows of the relevant application canbe located!

Examples: REGIE.INI entriesMenuEntry<XXYY>="Notepad", PW=OFF, KEY=0, PROG="oemframe 1 notepad CmdLine="c:\oem\test.txt""MenuEntry<XXYY>="Notepad1", PW=OFF, KEY=0, PROG="oemframe 2 notepad ClassName="Notepad"WindowName="Notepad - (Untitled)""

Examples: REG_AUTO.CFG entriesc:\mmcwin\pc\oemframe.exe 1 notepad CmdLine="c:\oem\test.txt" ;SHOWc:\mmcwin\pc\oemframe.exe 2 notepad ClassName="Notepad" WindowName="Notepad - (Untitled)" ;SHOW

When the control is powered down (Data Area/Exit), started applications are ended throughtransmission of a WM-CLOSE message. To avoid the risk of data loss, you should always closeapplications in the proper manner prescribed for the program.

Page 60: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-40 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

If an application (e.g. Notepad) which has not saved its data receives a WM-CLOSE message, thefollowing dialog window appears:

If this appears as the control is shutting down, the shutdown sequence is suspended until youacknowledge the window with YES or NO!

3.3.2.2 Integrating DOS programs

DOS applications must be started using a PIF file. The options "Background active, Exclusive notactive, background priority 50, foreground priority 100" must be used in the PIF file to avoid blockingthe Windows system.

Page 61: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-41SINUMERIK 840C OEM Version for Windows (BN)

Example: REGIE.INI entryMenuEntry<XXYY>="MS-DOS Editor", PW=OFF, KEY=0, PROG="oemframe 3 edit.pif"

Example: REG_AUTO.CFG entryc:\mmcwin\pc\oemframe.exe 3 edit.pif ;SHOW

Applications in a DOS window do not receive WM-CLOSE messages. When the control is poweringdown (Data Area/Exit), started DOS applications are displayed in the foreground. To avoid the risk ofdata loss, you should always close applications in the proper manner prescribed for the program. Thecontrol does not continue shutting down until the application has been ended!

Page 62: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-42 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.3.3 Storing the alarm messages as a file for DOS applications (SW 6 andhigher)

The ALARDOSC application is supplied in SW Version 6 as a component of the basic system enablingwriting of pending alarms to a file. A DOS application can have access to this file and perform variousevaluations.

ALARDOSC.EXE is a Windows program establishing a connection (link) to the alarm server.Communication takes place via the DDE mechanism of the Windows operating system. The receiveddata are processed and written in a file. As a maximum, the eight first pending alarms are entered.

The program is used for data exchange between a program in a DOS box and a Windows driver(alarms) of the control.

Functional principle of ALARDOSC.EXE

After startup, a connection to the DDE server of the control is established. A timer is then assigned andalarm data are requested cyclically by the NCDDE server. This transmits the files in the followingformat to the program:

[Alarm No.], [Alarm text], [Type], [Date], [Display site], [Priority], [Text color], [Background color],[Following text number], [Auxiliary text number], [Auxiliary text file], [Status text]\CRLF\0

In this entry, the alarm number and the alarm text are filtered out and entered in the file specified underthe entry "AlarmFile".

Structure and meaning of the entries in SIN840C.INI (see Section 3.5)

In the file SIN840C.INI, create the section "AlarmDos" (if not provided) with the following entries:

[AlarmDos]Start=ON

AlarmFile=c:\oem\alarmdos.dat

AnsiToOem=ON

Timer=1200

[NCDDESERVER]AlarmAdvise=ON

Meaning of the entries:

Start = ON/OFF Switch driver on (ON) or off (OFF)AlarmFile = c:\oem\alarmdos.dat Name of the file in which the alarms are enteredAnsiToOem = ON/OFF Convert Windows characters into OEM (ON) or

write Windows format (OFF)Timer = 1200 Time in milliseconds after which the pending alarms

must be queriedAlarmAdvise = ON Activate DDE connection mechanism of the

NCDDE server.

Page 63: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-43SINUMERIK 840C OEM Version for Windows (BN)

Data structure of the alarm file

Location Length Contents

[00] 1 byte Current access

[01] 1 byte Current message counter

[80...159] 80 byte 1st alarm

[160...239] 80 byte 2nd alarm

[240...319] 80 byte 3rd alarm

[400...479] 80 byte 4th alarm

[480...479] 80 byte 5th alarm

[480...559] 80 byte 6th alarm

[560...639] 80 byte 7th alarm

[640...719] 80 byte 8th alarm

Codes (ASCII or Hex) for current access

0 30 = Free, ALARDOSC may write (DOS application enables file)1 31 = Write request, illegal content (ALARDOSC writes data to file)2 32 = Request ready, valid content (ALARDOSC, data are valid)3 33 = DOS application reading (DOS application reads data)

Program start on 840C

Activate program with the Start=ON switch under the section [AlarmDos] and make the correspondingentries in SIN840C.INI (see Section 3.5) as described above. The file indicated under AlarmFile isgenerated automatically during the first start.

3.3.4 Mode switchover without displaying Siemens pictures (SW 6 andhigher)

The mode switchover function without displaying Siemens pictures is activated in the file SIN840C.INI.The file SIN840C.INI (see Section 3.5) has the following extension:

[Siemens]Picture = ON

ON = Basic Siemens pictures are displayed in the foreground with mode switchover, (default setting)

OFF = Basic Siemens pictures are not displayed in the foreground with mode switchover

Page 64: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-44 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4 Basic modules

3.4.1 Application structure and operation

The basic modules together with the operating systems Windows for Workgroups 3.11 and MS DOS6.22 are responsible for controlling the MMC. All the basic modules developed by Siemens have a fullycompatible structure and a uniform appearance. All Siemens applications are configured in such a waythat they can also be operated via softkey.

AUTOMATIC

X 123456Y 123345Z 345667

Application area

Softkeys

Machine

Alarm line

Status line

Clock

IconsAlarm and status line

Fig. 3.11: Display structure

The display, like that of the basic version, is divided into individual window areas. On the top left-handside there is an alarm line and a message line. The field for the current time display and the icons ispositioned to the right of these. The position and size of the alarm and message line is fixed.

The application window with the title line displaying the name of the application currently active (in thiscase Machine) is positioned below the alarm area. The application window reaches right down to thesoftkey bar. The standard applications are operated using the horizontal softkeys only, the verticalsoftkeys are not used and are therefore not displayed.

The OEM user can use the vertical softkeys for his own applications. The softkeys in question can bedisplayed on the screen and operated from the assigned keys.

DOS fullscreen applications can be integrated if they can be operated from the operator panelkeyboard.

The alarm/message line, softkey bar and clock can be hidden by making the appropriate entries inSIN840C.INI (see Section 3.5).

The Siemens basic applications and the associated INI files (control software and OEM testenvironment) are to be found in directory: C:/MMCWIN/PC.

The applications can generally be divided into two groups: Display applications and backgroundapplications.

Page 65: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-45SINUMERIK 840C OEM Version for Windows (BN)

3.4.1.1 Display applications

All Siemens display applications feature the following:

• They occupy the full application area of the screen.

• They have a window title.

• They do not have a system menu or change buttons (minimize, maximize) in the title line.

The size and the position of the application window on the screen can be altered by making an entry inthe relevant initialization file. If no position is entered, the screen display is entire application area. Theapplication window cannot be altered via operator input. The NCK task always occupies the wholeapplication area.

3.4.1.2 Background applications

Applications that run in the background (e.g. multiport RAM driver, keyboard driver, DDE server etc.)are configured in such a way that they do not appear in the task list. They have the window settingSW_HIDE. This ensures that the user can only access applications that are visible to him in the task listwhen he changes application. This method should also be followed in customized applications.

3.4.1.3 Operation via softkeys

The machine area of the OEM Version for Windows is operated in the same way as that of the 840CBasic Version.

The Siemens applications on the MMC under Windows are configured so that they can also beoperated via softkeys. The applications therefore either feature standard Windows menu operationand/or operation via dialog buttons.

This function allows the operation of all Windows applications via softkeys provided they have a menubar or dialog buttons.

Dialog buttons are only displayed in softkeys for non-system-modal dialog boxes. System-modaldialog boxes can only be operated via the MF2 keyboard on the central controller.

Please consult publication: SINUMERIK 840C, Software Version 6, OEM Version for Windows,Operator's Guide, for information about the operation of the various control elements of a Windowsapplication.

Page 66: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-46 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.2 Start-up of the control

The control is started up and the data on the hard disk booted in two steps: Start-up under operatingsystem MS DOS 6.22 and then under Windows for Workgroups 3.11.

Step 1 (Start-up under MS DOS 6.22):

• After the control has been switched on, the BIOS first performs a Power On self-test (POST) of thecontrol and then, if no errors have been detected, the operating system MS DOS 6.22 is loadedfrom the hard disk.

• Then a consistency check of the file system on the hard disk is performed by DOS programCHKDSK.EXE. If program CHKDSK reports an error, these errors are then corrected by callingCHKDSK /F. In this case, CHKDSK.EXE may ask a question that has to be answered with "Yes".

• This question is answered directly from the boot file AUTOEXEC.BAT with the "echo Y" instructionwhich is piped to the SCNDSK command. Correct installation is therefore only possible if theEnglish version of MS DOS has been installed. This is included in the standard scope of supply.

Important:

If a customer changes the language of the MS DOS operating system (because of re-installation),the "input" for SCN.EXE must also be changed. The letter that is used to answer the question(Yes/No) with "Yes" must be entered in the AUTOEXEC.BAT (e.g. "Y" in the English version).

• After this, the file PROFILES.BAT is called to complete the system files SYSTEM.INI and WIN.INI.The program MIXER.EXE is started in this file. This routine makes entries in the files WIN.INI andSYSTEM.INI to make the control software executable under Windows before Windows is started.

To do this, MIXER.EXE inserts the contents of files C:/MMCWIN/PC/WIN.INI andC:/MMCWIN/PC/SYSTEM.INI into the relevant files of the current Windows system.

This ensures that once the Windows system has been installed in the correct language, the relevantentries are automatically merged into the system files after the system has been selected andrestarted.

3.4.2.1 Merging files with the "MIXER" program

Using the program MIXER.EXE any INI, BAT, REG_AUTO.CFG or CONFIG.SYS source file can bemerged into a target file.

The syntax for calling the MIXER is:

MIXER <path><sourcefile> <path><targetfile>

Page 67: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-47SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.2 Merging initialization files (*.INI)

3.4.2.2.1 File structure

[<Section>]; <Comment><Key>=<Entry>

Section : Section Line that begins with [ e.g. [Regie]; : Comment lineKey : Entry name Line that does not begin with; or [ up to the first = e.g. LOGO=Entry : Entry Entry line from = to line end, e.g. off

Keys may only used once in each section. The entries device and EmmExclude in section [386Enh](SYSTEM.INI) are an exception and may be used several times.

3.4.2.2.2 Merge conventions

Comment lines from the source file are not transferred to the target file. To transfer a comment tothe target file, you must insert a + symbol in front of it in the source file!If you want to delete a comment line from the target file, you must insert a – symbolin front of it in the source file.

Sections in target file but not in source file are transferred complete from the targetfile

in source file but not in target file are attached complete to the target file.in source file and in target file Source file section entries are inserted

at the beginning of the target file sectionand any entries not contained in thesource file section are then transferredfrom the target file section.

If you want to delete a section from the target file, you must insert a – symbol infront of it in the source file!

Keys in target file but not in source file are transferred complete with entry fromthe target file.

in source file but not in target file are transferred complete with entry fromthe source file.

in source file and in target file Source file entry replaces thecorresponding target file entry.Exception:Keys device and EmmExclude insection [386Enh]are transferred from the source file asthey can occur several times!

If you want to delete an entry from the target file, you must insert a – symbol infront of it in the source file!

Page 68: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-48 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.2.3 Example

;Source file-; Delete comment

[boot]-; Boot old+; Boot new-DelEntry=

[386Enh]+; Source commentEmmExclude=D000-DFFF-EmmExclude=C800-E3FF

-[Test]

[NewSection]NewEntry=0NewEntry1=1

;Target file; Delete comment[boot]; Boot oldshell=c:\mmcwin\pc\regie.exetaskman=DelEntry=1234545

[386Enh]device=c:\mmcwin\pc\vxd.386device=c:\mmcwin\pc\vrbtd.386Com1FiFo=offCom2FiFo=offCom3FiFo=offCom4FiFo=offEmmExclude=C800-E3FF

[Debug]OutputTo=NUL

[Test]Entry1=1Entry2=2Entry3=3

;Target file[boot]; Boot newshell=c:\mmcwin\pc\regie.exetaskman=

[386Enh]; Source commentEmmExclude=D000-DFFFdevice=c:\mmcwin\pc\vxd.386device=c:\mmcwin\pc\vrbtd.386Com1FiFo=offCom2FiFo=offCom3FiFo=offCom4FiFo=off

[Debug]OutputTo=NUL

[NewSection]NewEntry=0NewEntry1=1

Page 69: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-49SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.3 Merging batch files (*.BAT)

3.4.2.3.1 File structure

:<Label>rem <Comment>

: : Branch label Line beginning with :<Label> : Branch label name Branch label up to first blank, e.g. :LABEL1rem : Comment line

: Section With batch files the section is defined in the source file:

Space line:<SECTIONA>...:<SECTIONE>Space line

3.4.2.3.2 Merge conventions

Comment lines from the source file are not transferred to the target file. To transfer a comment tothe target file, you must insert a + symbol in front of it in the source file!If you want to delete a comment line from the target file, you must insert a – symbolin front of it in the source file.

Sections in target file but not in source file cannot be transferred because sectionsare defined by the source file!

in source file but not in target file are attached complete to the target file.section start andsection end intarget file

source file section replaces target filesection.

in source file andtarget file

section start with-out section end intarget file

source file section is inserted in targetfile from start of section.

If you want to delete a section from the target file, you must insert a – symbol infront of the relevant branch label in the source file!

Entries (lines in one section)If you want to delete an entry from the target file, you must insert a – symbol infront of the relevant line in the source file!

Page 70: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-50 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.3.3 Example

rem Source file+rem Insert comment-rem Delete comment

:SECTIONA+rem Insert sectionif exist %tooldir%\streacon.bat call%tooldir%\streacon.bat:SECTIONE

-:SECDEL1Arem Delete section 1:SECDEL1E

-:SECDEL2Arem Delete section 2-:SECDEL2E

:SECREPAcall %0 NEWMAIN:SECREPE

:SECNEWA+rem Attach sectiongoto RETURN:SECNEWE

rem Target filerem Delete comment

:SECTIONAset TRACTRL=

:SECDEL1Arem Delete section 1call %0 MAIN:SECDEL1E

:SECDEL2Arem Delete section 2call %0 MAIN:SECDEL2E

:SECREPArem Replace sectioncall %0 OLDMAIN:SECREPE

rem Target filerem Insert comment

:SECTIONArem Delete sectionif exist %tooldir%\streacon.bat call%tooldir%\streacon.bat:SECTIONEset TRACTRL=

:SECDEL1E

:SECREPArem Replace sectioncall %0 NEWMAIN:SECREPE

:SECNEWArem Attach sectiongoto RETURN:SECNEWE

Page 71: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-51SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.4 Merging (CONFIG.SYS) configuration files

3.4.2.4.1 File structure

[<Section>]rem <Comment><Key>=<Entry>

Section : Section Line that begins with [ e.g. [MENU]rem : Comment lineKey : Entry name Line that does not begin with rem or [ up to first =

e.g. DEVICE=Entry : Entry Entry line from = to line end, e.g. C:\WINDOWS\HIMEM.SYS

Sections are not absolutely mandatory in the CONFIG.SYS file. If the file does not contain a section,the entire file content is regarded as one section. Entry names may be used only once per section withthe exception of device driver entries device and devicehigh which may be used more than once.

3.4.2.4.2 Merge conventions

Comment lines from the source file are not transferred to the target file. To transfer a comment tothe target file, you must insert a + symbol in front of it in the source file!If you want to delete a comment line from the target file, you must insert a – symbolin front of it in the source file!

Sections in target file but not in source file are transferred complete from the targetfile.

in source file but not in target file are attached complete to the target file.in source file and in target file section entries are processed

accordingly (see also Keys)If you want to delete a section from the target file, you must insert a – symbol infront of it in the source file!

Keys in target file but not in source file are transferred complete with entry fromthe target file.

in source file but not in target file are transferred complete with entry tothe target file.

in source file and in target file Source file entry replaces thecorresponding target file entry.Note:If the 'device' or 'devicehigh' entry hasbeen replaced, then all 'device' entriesfrom the source file section are insertedin the target file section, therebyensuring that the sequence of devicedrivers in the source file is maintained!

If you want to delete an entry from the target file, you must insert a – symbol infront of it in the source file!

Page 72: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-52 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.4.3 Example

rem Source file-rem Delete comment

[WINDOWS]+rem Source comment-switches=device=C:\DOS\EMM386.EXE NOEMS X=C800-E3FFdevice=C:\SCM\mmcd.exe /F:E000 /U:1 /W

[FLEXOS]+rem FLEXOS new-rem FLEXOS olddevice=a:\himem.sysdevice=A:\scm\mmcd.exe /F:E000 /U:1

-[TEST]

[NEWSECTION]newentry=0newentry1=1

rem Target filerem Delete comment[MENU]MENUITEM = WINDOWS, WindowsMENUITEM = FLEXOS, Flexos

MENUDEFAULT = WINDOWS,10

[WINDOWS]switches=/f /ndos=high,umbbreak=onbuffers=20files=20fcbs=4lastdrive=Zstacks=9,128device=a:\himem.sysREM device=c:\windows\accopen.exe /INT=11 /PORT=360device=C:\DOS\EMM386.EXE NOEMS X=D000-DFFFdevice=A:\ifshlp.sysshell=c:\dos\command.com c:\dos\ /e:2048 /p

[FLEXOS]rem FLEXOS oldswitches=/f /ndos=high,umbbreak=onbuffers=20files=20fcbs=4lastdrive=Zstacks=9,128device=a:\himem.sysdevice=a:\ifshlp.sysshell=c:\dos\command.com c:\dos\ /e:2048 /pset FlexOS=TRUE

[TEST]Entry1=1Entry2=2

rem Target file[MENU]MENUITEM = WINDOWS, WindowsMENUITEM = FLEXOS, Flexos

MENUDEFAULT = WINDOWS,10

[WINDOWS]rem Source commentdos=high,umbbreak=onbuffers=20files=20fcbs=4lastdrive=Zstacks=9,128device=a:\himem.sysREM device=c:\windows\accopen.exe /INT=11 /PORT=360device=C:\DOS\EMM386.EXE NOEMS X=C800-E3FFdevice=C:\SCM\mmcd.exe /F:E000 /U:1 /Wdevice=A:\ifshlp.sysshell=c:\dos\command.com c:\dos\ /e:2048 /p

[FLEXOS]rem FLEXOS newswitches=/f /ndos=high,umbbreak=onbuffers=20files=20fcbs=4lastdrive=Zstacks=9,128device=A:\HIMEM.SYSdevice=A:\scm\mmcd.exe /F:E000 /U:1device=a:\ifshlp.sysshell=c:\dos\command.com c:\dos\ /e:2048 /pset FlexOS=TRUE

[NEWSECTION]newentry=0newentry1=1

Page 73: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-53SINUMERIK 840C OEM Version for Windows (BN)

3.4.2.5 Merging autostart files (REG_AUTO.CFG)

3.4.2.5.1 File structure

# <Comment><Application> <Parameter> [; Option] [;Option] ...

# : Comment lineApplication : Application to be started, e.g. c:\mmcwin\pc\oemframe.exe

Line which doesn't begin with # up to first blankParameter : Call parameter for application to be started

from first blank up to ;e.g. 1 c:\windows\notepad CmdLine="c:\oem\oemframe.txt"

Option : File options from ; to line end, e.g. ;SHOW

3.4.2.5.2 Merge conventions

Comment lines from the source file are not transferred to the target file. To transfer a comment tothe target file, you must insert a + symbol in front of it in the source file!If you want to delete a comment line from the target file, you must insert a – symbolin front of it in the source file!

Applications in target file but not in source file are transferred together with parameterand options from the target file

in source file are transferred complete with parameterand options from the source file.

If you want to delete an application from the target file, you must insert a – symbolin front of it in the source file!

3.4.2.5.3 Example

#Source file# 1. Change+#(operator panel with parameter)-#(operator panel)c:\mmcwin\pc\KYRU.EXE parameter ; HIDE ;WAIT-c:\mmcwin\pc\KYRU.EXE ; HIDE ;WAIT+#+# Copyright message

# 2. Deletec:\mmcwin\pc\changel.exe ; SHOW ; ONCE-#-# Alarm to DOS-File Tool-c:\mmcwin\pc\alardosc.exe ; HIDE

# 3. Attach+#+# Attach entryc:\mmcwin\pc\WEDIT.EXE ; SHOW

#Target file#(operator panel)c:\mmcwin\pc\KYRU.EXE ; HIDE ;WAIT## Copyright messagec:\mmcwin\pc\CPYRIGHT.EXE ; SHOW ;WAIT...# Change Languagec:\mmcwin\pc\changel.exe ; SHOW ; ONCE## Alarm to DOS-File Toolc:\mmcwin\pc\alardosc.exe ; HIDE

#Target file#(operator panel with parameter)c:\mmcwin\pc\KYRU.EXE parameter ; HIDE ;WAIT## Copyright messagec:\mmcwin\pc\CPYRIGHT.EXE ; SHOW ;WAIT...# Change Languagec:\mmcwin\pc\changel.exe ; SHOW ; ONCE## Attach entryc:\mmcwin\pc\WEDIT.EXE ; SHOW

Page 74: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-54 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.3 Area switchover

The user can start additional applications with the area switchover (REGIE.EXE). With it, the user canconfigure or adapt the user interface to meet his own requirements simply. Area switchover isselected/deselected with the data area key.

In the standard version, the area switchover covers the whole application area. The entries in the menuline and in the pull-down menus can be freely configured by the user. If the area switchover is active,applications can be put on top using the "PgUp" and "PgDown" keys.

A freely configurable logo can also be displayed in the area switchover.

This basic module replaces the program manager under MS Windows. For this, the following entrymust be made in the system INI file C:/WINDOWS/SYSTEM.INI:

SHELL=C:\MMCWIN\PC\REGIE.EXE

3.4.3.1 Configuration options in REGIE.INI

The appearance and the selectable menu items, i.e. the applications that can be started by the user,can be configured by making the relevant entries in the initialization file REGIE.INI.

However, the area switchover can only perform the necessary access rights check when an applicationis started. If an application that has already been started is brought to the foreground again using thetask manager <alt><tab> access rights are not queried again.

Page 75: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-55SINUMERIK 840C OEM Version for Windows (BN)

The following entries are defined in the file REGIE.INI:

• Size and position of the area switchover on the screen [Regie] ; Window size and position Position=0, 42, 640, 447

In the entry above, the position of the alarm/message line and of the softkeys must be taken intoaccount

• Activating/deactivating a company logo ; Company logoLOGO=off

; x / y Offset of company logo from upper left-hand window corner (None ; *.bmp-File)

Logo_xOffset=120 Logo_yOffset=60 ; BMP Company logo file LogoFile=c:\windows\marmor.bmp ; Increase logo on/off (default setting) Logo_Stretch=off

If "Logo_Stretch=on" is selected, the logo is displayed across the whole area irrespective of itsactual size. if "Logo_Stretch=off" is selected, the bitmap is displayed in its original size

• Configuring a window title ; Window title TitleText="Area switchover"

• Specifying a "Help file" ; Help file HelpFile=c:\mmcwin\pc\reghelp.hlp

This help file is called if the user presses the "HELP" key on the NC operator panel or the F1 key onthe MF2 keyboard when the area switchover is active. If no entry has been made, pressing theabove key has no effect.

• Configuring a warm restart ; Warm start disable CtrlAltDel=off

A warm restart of the system when CTRL+ALT+DEL are pressed simultaneously on the MF2keyboard is prevented if "CtrlAltDel=off" (default setting) is entered.

• Time stamp of applications ; Time stamp of application StartStatus=Start : Time (hh.mm.ss): 13.24.21 Date (dd.mm.yy): 09.05.94 AbortStatus=Abort : Time (hh.mm.ss): 14.42.55 Date (dd.mm.yy): 09.05.94 Cause:DOS

AbortRequest=Start : Time (hh.mm.ss): 14.42.55 Date (dd.mm.yy): 09.05.94 Cause:DOS

The time stamp function is not supported in Software Versions 3 and 4.

Page 76: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-56 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

• Configuring the menu line and the pulldown menus

Up to 28 entries are possible for the menu line of the area switchover (4 softkey bars each with 7softkeys). If more than 7 menu items are configured, the ETC key is automatically displayed foradvancing the softkey bar. ; Max 28. Menu line entries ; in ascending order ; MenuBar1="&Machine" MenuBar2="&Parameter" MenuBar3="P&rogram" MenuBar4="&Services" MenuBar5="&Diagnosis" MenuBar6="&Information" MenuBar7="&Exit" ; Popup entries ; Max. 16 entries per menu item ; EntryXXYY="PopupText", PW=ON/OFF, KEY=0..3, ZSP=ON/OFF, PROG="ProgramParameter"

; MenuEntry01="" , PW=OFF, KEY=0, PROG="NCKTASK.EXE Machine" MenuEntry02="", PW=OFF, KEY=0, PROG="NCKTASK.EXE Parameter" MenuEntry0301="&Data management", PW=OFF, KEY=0, PROG="DATENMAN.EXE"MenuEntry0302="&Edit NC", PW=OFF, KEY=0, PROG="NCKTASK.EXE NC editor"

MenuEntry0401="&Parametrization V24", PW=OFF, KEY=0, PROG="PAR_V24.EXE" MenuEntry0402="&Data transfer FLEXOS", PW=ON, PROG="FLX2WIN.EXE" MenuEntry0403="&System control", PW=ON, KEY=0, PROG="CONTROL.EXE" MenuEntry0404="&File manager", PW=ON, KEY=0, PROG="WINFILE.EXE" MenuEntry0405="&Archiving", PW=OFF, KEY=0, PROG="C:\MMCWIN\PC\PCIN.PIF" MenuEntry0406="&Change language",BMP=C:\MMCWIN\PC\flags.bmp, PW=ON, KEY=0,PROG="CHANGEL.EXE"

MenuEntry0501="&Alarms, PW=OFF, KEY=0, PROG="ALARM.EXE" MenuEntry0502="&PLC status", PW=OFF, KEY=0, PROG="NCKTASK.EXE PLC status" MenuEntry0503="&NC service", PW=OFF, KEY=0, PROG="NCKTASK.EXE NC service" MenuEntry0504="&Installation NC/PLC", PW=ON, KEY=0, PROG="NCKTASK.EXEInstallation"

MenuEntry0505="&Machine data", PW=OFF, KEY=0, PROG="NCKTASK.EXE Machine Data" MenuEntry0506="NC &Memory configuration", PW=ON, KEY=0, PROG="NCMEMCFG.EXE" MenuEntry0507="&FDD/MSD status", PW=OFF, KEY=0, PROG="VSASERV.EXE" MenuEntry0508="&Backup / FLEXOS",PW=ON, KEY=0, PROG="FLXBACK.EXE" MenuEntry0509="&Password",PW=OFF, KEY=0, PROG="KENNWORT.EXE" MenuEntry0510="&CodeView",PW=OFF, KEY=0, PROG="c:\windows\cvw.exe" MenuEntry0601="&NC information ", PW=OFF, KEY=0, PROG="NCKTASK.EXE NCinformation"

MenuEntry0602="&MMC information", PW=OFF, KEY=0, PROG="CPYRIGHT.EXE" MenuEntry0603="&OEM information", PW=OFF, KEY=0, PROG="WEDIT c:\oem\oeminfo.txt -ro"

MenuEntry07="", PW=OFF, KEY=0, PROG="REGIE.EXE End

Page 77: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-57SINUMERIK 840C OEM Version for Windows (BN)

A menu entry takes the following general form:

MenuEntryXXYY=[Name],BMP=[BMP-Name],PW=[Status],ZSP=[Status],KEY[Keyswitch],PROG=[File]

MenuEntryXXYY:

The 4 characters at the end of each menu entry define the position within the line of the menu (XX)or the position within the pull-down menu (YY).

[Name]:

Name (including accelerator) in the pull-down menu from which the entry can be selected (e.g."&Alarms", A is the accelerator)

BMP=[Bitmap]:

As from SW 5, the parameterization of the pop-up menu has been expanded to include possibledefinition of a bitmap. Using the entry BMP=[Bitmap] a bitmap can be defined, where "Bitmap"stands for a bitmap file of type "*.bmp" with full path name.

A name [Name] that is to be displayed instead of the bitmap must be specified so that at least a textdisplay appears on incorrect access of the bitmap file.

This parameterization option makes it possible to replace any menu item of a pop-up menu with abitmap. It is not possible to replace a menu item in the menu line.

The following bitmaps are supplied as standard:

FLAGS.BMP: Flag bar with the national flags: Italy, France, Spain, GB and Germany

WORLD.BMP: Globe

ITALY.BMP: Italian flag

FRANCE.BMP: French flag

UK.BMP: British flag

SPAIN.BMP: Spanish flag

GERMANY.BMP: German flag

PW=[Status]:

In Software Version 5.1 the scope of functions of 840C OEM Version for Windows has beenexpanded to include graded access rights to the MMC and individual disabling and enabling ofapplications made possible (cf. Subsection 3.4.11).

Up to 6 password levels can be defined with the password status. The status is defined by adecimal value which is recognized as a bit mask by the area switchover. The individual bits of the bitmask specify the associated password levels.

Therefore:Bit 0: Password level 1Bit 1: Password level 2..Bit 5: Password level 6

If the bits for the various password levels are set to one the application cannot be started until theuser has signed on for one of the password levels with a valid password.

It is thus possible to simultaneously enable and disable the same application for different passwordlevels. Illegal values cause a general block of the application.

The values "ON" and "OFF" used until now (<= SW 4.6) continue to be valid.

Page 78: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-58 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

If "OFF" is defined no password level is taken into account. The application can always be startedwithout having to enter a password.

If "ON" is defined it is enough to enter a valid password for one of the password levels. Theapplication can be started when one of the max. 6 possible passwords has been entered(corresponds to setting PW=63).

ZSP=[Status]:

Locking by cycle disable("ZSP=ON,OFF")

KEY=[Keyswitch]:

Locking with keyswitch

("KEY=0...3": Application can only be started from the configured keyswitch position upwards)

PROG=[File]:

The application to be started including the associated parameter list

It is also possible to add menu items to the area switchover menu bar that are not part of a pull-downmenu and can be activated by the pressing a key.

The following entry must be made in REGIE.INI for such menu items: MenuBar1= "............" MenuEntry01= " ", PW=......, KEY=.., PROG="......." ↑↑↑↑

This empty string must be included

Notes:

• The syntax is the same as that for pull-down menus. Only the number of the pull-down menu (YY) in"MenuEntry" is missing.

• If the file REGIE.INI is changed by incorrect entries to the extent that the system is no longer exe-cutable, the Siemens stand. file C:/MMCWIN/PC/REGIE.SIE can be copied into the file REGIE.INI.

Tool Mixmen

In SW Version 6 and higher, the MIXMEN tool is supplied enabling configuration of the popup menus inthe area switchover. MIXMEN modifies the file REGIE.INI. The principle of operation is similar to that ofthe MIXER which is already known today, but MIXMEN can search the next free position within apopup menu additionally.

c:\mmcwin\pc\mixmen Section Entry="Text"

Example:c:\mmcwin\pc\mixmen [Regie] MenuEntry06$$="\"&MenueName\", PW=OFF, KEY=0,

PROG=\"c:\mmcwin\pc\program.exe\""

creates the following entry in the REGIE.INIMenuEntry0607="&MenueName", PW=OFF, KEY=0, PROG="c:\mmcwin\pc\program.exe"

Syntax description:The MIXMEN procedure is given 2 parameters:

1. Section: e.g. [Regie]

2. Entry="Text": e. g. MenuEntry06$$="\"&MenueName\", PW=OFF, KEY=0,

PROG=\"c:\mmcwin\pc\program.exe\""

Meaning of the individual characters:

$$: Is replaced in MIXMEN by the number of the next free position in the 6th popup menu"...": The first and last quotation marks enclose the entry content. They are not necessary if the

entry content does not include any blanks or special characters.\": Quotation marks are thus created in the entry.

Page 79: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-59SINUMERIK 840C OEM Version for Windows (BN)

Note:

If the user stores such calls in the OEM.BAT file, the modified menu configuration of the user isrestored by means of "Backup/Restore User Data" even after a SW upgrade.

3.4.3.2 Switching off the control

Before the control can be switched off, the MMC of the SINUMERIK 840C Version for Windows mustbe shut down with the softkey: End. This operation calls up (REGIE.EXE End) the area switchover withthe parameter "End". The area switchover now sends the message "UMSG_TERMINATE" to allapplications after an obligatory prompt for confirmation. The OEM applications should then shut downin the correct manner, i.e. back up any data that have not yet been stored and close files that havebeen opened. After this, Windows shuts down and NC_HALT.EXE is called up.

NC_HALT.EXE is a DOS application that only outputs the SYSTEM DOWN display and otherwiseremains in an endless loop. This ensures that COMMAND.COM is not reactivated and the operator isnot taken back to the "naked" DOS level.

In addition, a final data packet is sent to the PLC. This data packet has the following format:

Length: 0x000c Words without headerSender: 0x031a DDE serverReceiver: 0x0201 1st PLC componentsData structure: 0x0005 DDE data structureRequest number: 0x0815DDE request word: 0x0090 XTYP_POKEDDE format: 0x0001 CF_TEXTParameter header [0] 0xffff System end identifier[1] 0[2] 0[3] 0[4] 0[5] 0[6] 0[7] 0[8] 0[9] 0

Now the system can be switched off.

Page 80: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-60 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

The behavior of the NCK during MMC shutdown can be set in the INI file SIN840C.INI(see Section 3.5).

[Terminate]ResetNC=on/off

If "ResetNC=on" is set, the NCK is stopped and has to be rebooted. If "ResetNC=off" is set, the NCKcontinues. If no entry has been made under section [Terminate], the default setting is "ResetNC=off".

The area switchover can also be called up with the parameter "Reboot". Here too, controlledtermination of all the applications with the message "UMSG_TERMINATE" is performed and the MMCis subsequently rebooted.

If the control is not shut down in a controlled manner using the menu item but is simply switched off,there is the general problem with operating systems such as MS Windows that open files are notclosed correctly and data becomes inconsistent. In the worst case, the file system on the hard disk canbecome inconsistent because of a current write access to the hard disk. There is then a danger that theMMC will not start up again the next time the control is switched on.

3.4.3.3 Express shutdown

As has been mentioned in the previous section, switching off the control without closing down thesystem correctly with the softkey End can cause inconsistencies in the file system. However, to make itpossible to close down the MMCs quickly on PLC initiative while at the same time minimizing the risk ofinconsistencies, the function Express shutdown has been implemented as from Software version 5.1.

Express shutdown is essentially a message from the MPR server with which all applications (Siemensand OEM applications) are requested to close all open files without delay. To do this, the messageUMSG_ON_POWERDOWN with window handle HWND_BROADCAST is sent by the MPR server toall applications.

However the MS Windows operating system cannot guarantee that the remaining time is sufficient foreach application to close all open files correctly (without saving). This depends on the workload on thesystem. OEM applications with file access must also evaluate the message.

Express shutdown is triggered by the PLC via the OEM interface PLC-MMC. To do this the user mustassign the necessary values to function block FX73 OEM_Send and send a data package with I code"Express Shutdown MMC" (ID 42Fh) to the "MPR server" (component 319H). You will find a detaileddescription of FX 73 in Appendix 2.2, a description of I code 42Fh in Appendix 2.1.3.

Once all the applications signed on for express shutdown have acknowledged the messageUMSG_ON_POWERDOWN the system generates an acknowledgement package for the PLC whichsignals successful express shutdown. If the control is not to be switched off at this point the system ispowered down until the normal shutdown message appears.

Proceed as follows with applications (e.g. OEM applications) that are to be subject to expressshutdown:

1. Register application for express shutdown:

Registration is performed by calling up _admin_status(int, int, HANDLE, int) of GSTATUS.DLLwhich must be assigned as follows:

Page 81: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-61SINUMERIK 840C OEM Version for Windows (BN)

nRegistration number=_admin_status(EX_SHUTDOWN,REGISTRATION,<Handle>,0)

The window handle must be transferred for <Handle>. The function returns the registration numberin the return value. The registration number is required when the application is signed off.

2. Receipt of message UMSG_ON_POWERDOWN:

As soon as message UMSG_ON_POWERDOWN has been received with wParam=0 all open filesmust be closed. The application must then sign off from GSTATUS.DLL.

3. Acknowledgment (signing off) of express shutdown:

Signing off (acknowledgment) by calling _admin_status(int, int, HANDLE, int) of GSTATUS.DLLwhich must be assigned as follows:

_admin_status(EX_SHUTDOWN,LEAVE,<Handle>,<nRegistration number>)

The window handle must be transferred for <Handle>. The registration number returned whensigning on must be transferred for <nRegistration number>.

Note:

In SW 6 and higher, the macros and function prototypes are included in the fileC:\MMCWIN\PC\GSTATUS.H.

Caution:

• If express shutdown is not acknowledged with GSTATUS.DLL no acknowledgment package isreturned to the PLC.

• As standard Windows applications such as NOTEPAD, WRITE etc. Do not follow this procedurethey must not be included in express shutdown. If these programs have open files when expressshutdown is triggered, the data in the RAM are lost.

Page 82: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-62 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.3.4 Autostart function via REG_AUTO.CFG

The area switchover performs an "autostart" function when the control boots. The REGIE.EXE readsthe entries in the file REG_AUTO.CFG and starts the programs in the order entered there. Start-up isperformed in the following way because of the characteristics of the MS Windows operating system.

As soon as a program is activated it runs to the point where it initiates its message loop. Thenswitchover to other active programs and then back to REGIE.EXE is performed. REGIE.EXE thenexecutes the next program in the REG_AUTO.CFG file. As a result, the applications are started almostin parallel which can result in the following problems.

This procedure does not generally guarantee that the initialization procedure of one program iscompleted before the next program is started. This can cause incorrect start-up if some of theapplications are interdependent.

The MASTER CONTROL does not activate the menu bar until all applications have been started upsuccessfully.

Sequential start of applications

In Software Version 4, therefore, the start-up options have been extended. Now, in addition to almostparallel start-up, provision has been made to start up programs in a predefined sequence. If thekeyword WAIT has been entered at the end of the individual entries in file REG_AUTO.CFG,REGIE.EXE does not load the next program until the stated program reports that it has completedinitialization. If the keyword WAIT has not been entered, start-up is almost parallel.

The keyword must be entered after the entry for the start attribute and separated by a semicolon.

Example:c:\mmcwin\pc\server.exe ;HIDE ;WAIT

The started program must report the end of initialization via DDE calls (cf. Chapter 5). To do this, anexecute command containing the following must be sent to the SIEMENS DDE server:

INITREADY (szInst,[TRUE/FALSE])

szInst = String that contains the decimal value of the instance handle of the application.This string can be created, for example, with the C function "itoa".

TRUE: Start-up successfully completedFALSE: Start-up ended with error

Example of valid commands:

INITREADY (9612, TRUE)INITREADY (12312, FALSE)

If an error occurs and FALSE is sent, REGIE.EXE displays a message box with the name of theincorrectly started file and aborts start-up.

If the keyword WAIT has been entered, the module that has been started must report successfulinitialization! If this is not done, a message box is displayed by the master control after approximatelyone minute with the module name of the program that has not responded together with an appropriatemessage text.

Page 83: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-63SINUMERIK 840C OEM Version for Windows (BN)

Single start of applications

As from SW 5, an option for executing an application start has been introduced which makes it possibleto start applications once via file REG_AUTO.CFG.

The execution options ONCE, ONCE_1, ONCE_2,..., ONCE_9 have been introduced for the singlestart of an application. If an application in REG_AUTO.CFG is assigned this option, this application isonly started if the identifier PASSED is not included in initialization file REG_AUTO.INI in section[Regie] behind the entries FirstSession, FirstSession_1, FirstSession_2, ..., FirstSession_9.

The identifier PASSED is automatically entered at the end of a Windows session. In this way anapplication can be executed during initial start-up of the control and when the entry in question hasbeen deleted from REG_AUTO.INI.

The entry in REG_AUTO.INI can either by changed manually or automatically using the applicationMIXER.EXE.

Structure of file REG_AUTO.CFG

If the file REG_AUTO.CFG is changed by incorrect entries to the extent that the system is no longerexecutable, the Siemens standard file C:/MMCWIN/PC/REG_AUTO.SIE can be copied into the fileREG_AUTO.CFG.

#################################################################

# SIN840C.INI, Version 6.4.05, 21.06.2001

# AREA SWITCHOVER Application SIN840C Win

# Auto-start file REG_AUTO.CFG

#

# Copyright _ Siemens AG 1994 All Rights reserved

#

##################################################################

#

# Syntax

#

# DRV:\PATH\APP_NAME.EXE PARAMETER [; Option] [;Option] ...

#

# Options: SHOW or HIDE

# MINIMIZED = starts the application as an icon

# WAIT = the startup sequence is suspended until the

# application is sending a message or timeout occurs

# ONCE or ONCE1 ... ONCE9 = the application is started

# if the required entry

# First Session:

# First Session-1:

# First Session-9:

# at the ini-file reg_antw.ini is

# missing or set to false.

#

# CAUTION: Sequence of standard applications must not be changed!!

#

##################################################################

#(operator panel)

c:\mmcwin\pc\KYRU.EXE ; HIDE ;WAIT

#

# Copyright message

c:\mmcwin\pc\CPYRIGHT.EXE ; SHOW ;WAIT

#

Page 84: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-64 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

# Alarm line

c:\mmcwin\pc\ALARM.EXE ; MINIMIZED ;WAIT

#

# MPR server

c:\mmcwin\pc\SERVER.EXE ; HIDE ;WAIT

#

# Booting

c:\mmcwin\pc\boot840c.exe ; SHOW ;WAIT

#

# Watchdog

c:\mmcwin\pc\WATCHDOG.EXE ; HIDE ;WAIT

# Clock

c:\mmcwin\pc\UHR.EXE ; SHOW ;WAIT

#

# File manager

c:\mmcwin\pc\DATENMAN.EXE ; SHOW

#

# (Machine basic display)

c:\mmcwin\pc\NCKTASK.EXE Machine ; SHOW ;WAIT

#

# DDE-Server

c:\mmcwin\pc\ddesrv.exe ; HIDE

#

# Softkey bar

c:\mmcwin\pc\softman.exe ; SHOW

#

# Change Language

c:\mmcwin\pc\changel.exe ; SHOW ;ONCE

#

# Alarm to DOS-File Tool

c:\mmcwin\pc\alardosc.exe ; HIDE

Please also observe the following when creating or modifying this file:

• In addition to the keyword "WAIT", the additional parameters "SHOW", "HIDE" or "MINIMIZED" canbe transferred to the applications to be started (";": separator). Applications should also considerthese parameters in their behavior

• "SHOW" is transferred as an additional parameter in the standard version.

• The entries can be given comments ("#": comment character).

• Blank lines must not be used in the file.

• The sequence of the Siemens standard applications must not be altered.

Page 85: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-65SINUMERIK 840C OEM Version for Windows (BN)

3.4.3.5 Starting applications via the job list

As from SW 5 applications can be started from the job list with the SINUMERIK OEM Version forWindows. An application is started by calling the following:

CALL [drive][path][program];[status]

Status: WAIT

With Status=WAIT it is possible to define whether a checkback signal should be awaited before thejob list is executed or whether execution is to continue directly after the application has beenstarted.

Example:CALL C:\OEM\PROG\TEST.EXE;WAIT

If a checkback signal is expected the broadcast message UMSG_RETURNAPP must be sent by theapplication.

Example:UMSG_Return=RegisterWindowMessage("UMSG_RETURNAPP");...SendMessage(HWND_BROADCAST,UMSG_Return,wParam,lParam);

The message is sent with window handle HWND_BROADCAST. Parameters wParam and IParam arenot evaluated. If a checkback signal is not sent by the application, a timeout is generated after 1 minuteas a default and the following alarm is displayed:

100203 Time exceeded during execution of application in job list

If execution of the job list is triggered by the function "Copy" in menu Program/Data management amessage box is displayed by the data manager pointing to the incorrect instruction line.

The default setting in the timeout can be changed by making the following entry in section [Datenman]in the initialization file SIN840C.INI (see Section 3.5):

[DATENMAN]Timeout=[Value]

The value must be defined in seconds. Please remember to give the initiated application a sufficientreaction time. Execution of the job list is aborted if a timeout error occurs.

Page 86: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-66 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.4 NCK task

By NCK task we mean the entire control of the NCK. This includes both the display of graphicinformation that is prepared in the NCK area as well as the transfer of keyboard entries to the NCK.

It is also responsible for managing the current menus of the various data areas of the NCK.

On the NCK task level the menu is stored. This means that if an area that has already been selected isreselected, the same NCK menu reappears. In this way, an interrupted session can be continuedwithout any problem.

The NCK task is implemented as an independent EXE file. This means that only one instance of thisfile can be called up at a time. If it is called again, it switches to or reselects the menu area currentlyselected by the NCK. This prevents multiple windows to the NCK from being opened.

When the NCK task (or the entire WINDOWS system) is terminated, this is reported to the display andinput processing in the NCK. It is therefore possible to start up the NCK task again without affecting thefunctions of the NCK.

3.4.4.1 Output window

Graphic output of the NCK is in the form of a fixed window that cannot be sized. Other WINDOWSapplications can be placed on top of the NCK window at any time. The position of the NCK window isdefined by the height of the alarm line and a monitor screen resolution of 640×480 pixels. Even if theNCK window is covered its current display is updated (e.g.: a new axis position in the machine area /basic display). PLC inserts etc. are also displayed.

Fig. 3.12: Machine display

The NCK window in the basic display of the 840C OEM Version for Windows stretches from the bottomof the alarm display to the lower edge of the screen. Its total size is 638x438 pixels. The position of thetop left edge is (0, 42) and the bottom right edge is (640, 480).

Page 87: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-67SINUMERIK 840C OEM Version for Windows (BN)

3.4.4.2 Menus and softkey labeling

The NCK transfers the softkey labels to the MMC. The corresponding softkeys (buttons) with theselabels are displayed in the lower section of the NCK window. They can either be operated from thefunction keys on the MF2 keyboard or via the softkeys on the operator panel. Keyboard events arealways sent to the NCK even if the softkey in question is not labeled.

Pressing the M softkey triggers an area switchover of the NCK (and therefore also of the NCK task) tothe Machine area. This corresponds to a switchover to the Machine area via the area switchover. Theprogram that is triggered when the M softkey is pressed is defined in the INI file SIN840C.INI(see Section 3.5).

[KYRU]M=C:\MMCWIN\PC\NCTASK.EXE Machine

Pressing the information key (i key) outputs information that is also sent from the NCK as a graphicbuffer. The menu data of the NCK defines whether such information is available. If no such informationis defined for the current display, the i softkey does not have text and the i key is ignored when it ispressed. If help is available the standard color of the i key text is green.

The color is defined in the file NCKTASK.INI under the section [Colors]

Info=0, 255, 0

The Recall softkey has black text if a recall menu is offered by the NCK. Otherwise it has no text. Anentry for a valid Recall key at the highest menu level is not recognized, i.e. the Recall key is notdeclared invalid. If the associated function key is pressed, the active menu is deselected by the NCKand the NCK task immediately makes a new selection.

Recall=0, 0, 0

The ETC softkey for expanding the menu only has red text if it is defined in the NCK. If an ETC key thatis defined as valid is pressed, a new menu text is sent by the NCK to the NCK task which then displaysthe new softkey assignment. If the ETC softkey is declared in the menu description as "not valid", theETC key is ignored when it is pressed and no signal is sent to the NCK. The color is defined in the fileNCKTASK.INI under the section [Colors].

etc=255, 0, 0

3.4.4.3 Language dependence

All texts that the NCK supplies are displayed in the selected language. It is not possible to change thelanguage of the NCK task while it is running. However, the area titles of the windows are not fixed inthe NCK. They depend on the language version of the NCK_TASK currently loaded. For this reason,the language settings of the NCK and MMC might be different. This effect can be eliminated byperforming a system reset and subsequent boot.

Page 88: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-68 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.4.4 Available areas (menus) of the NCK

The following areas of the NCK menu can be addressed via the NCK task (cf. REGIE.INI):

• Machine Basic displays and functions of the individual machine modes

• Program parameters Tool data

• Setting data Setting data

• Computer link Computer link operation on the NCK

• Edit NC DIN program editor for NC programs in the NC

• PLC status PLC status information

• NC service Service displays

• NC information Information about the control

• Installation NC/PLC Installation of the NC/PLC (see Installation documentation)

Recall to the top level in each case causes reselection of the same NCK menu if Recall has beenenabled by the NCK.

3.4.4.5 Storing the menus in the NCK area

A menu storing function is also implemented in the NCK areas. The last menu to be active (e.g. Rparameter display) of an NCK area is automatically stored.

If you select a different NCK area (e.g. Machine) you can return to the same point in the previous menu(R parameter display) by pressing the key combination SHIFT+DATA AREA key.

3.4.4.6 Changing the operating mode

If you change mode, the NCK task automatically switches to the Machine area and becomes active(window put on top) if it is currently covered by another.

Note:In SW6 and higher, the function has been extended, for more information refer to the Subsection 3.3.4.

3.4.4.7 PLC inserts

PLC inserts are displayed when the NCK displays are displayed. In this case, the "Menu inserts by thePLC" are performed by the NCK together with the NCK task.

In order to ensure that PLC inserts can be displayed without any problems the NCKTASK must alwaysbe in the foreground when the PLC insert is selected. To ensure this the PLC user program mustperform the following steps:

1. Check status bits DB40, DW104, Bit6. This bit signals whether the NCKTASK is in the foreground(Bit6=1) or in the background (Bit6=0).

2. If the NCKTASK is not in the foreground it must first be brought to the foreground via function"Application start via PLC" (cf. 5.6.6.2).

3. The PLC insert can then be displayed with the Step 5 user program.

Page 89: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-69SINUMERIK 840C OEM Version for Windows (BN)

3.4.4.8 Color settings for NCK task and alarm/message line

The color settings for the Windows applications can be defined in the dialog "Colors" in the Windowscontrol panel. However, the color settings of the NCK displays (generated in the NCK) and the alarmand message line (configured in alarm database) are not affected by these settings.

The NCK uses the color palette table (color conversion lists) for setting colors in the NCK displays inwhich the elements (e.g. menu bar, toggle field, frames etc.) of the NCK displays are assigned toentries in the color definition tables (CLUTS= Color Look-Up Tables). It is in the color definition tablesthat the possible color values are set.

This double assignment allows separate definition from the color palette table and the color definitiontable - and therefore the most optimum adaptation - to the four possible system settings, such aspositive/negative representation or colour/monochrome mode.

CLUTs:

Each of the possible system settings in the combinations positive/negative representation andcolour/monochrome mode has its own color definition table which exists as a separate section in theinitialization file SIN840C.INI (see Section 3.5).

The names defined in this section are taken from the system setting, i.e. from the identifier for the typeof representation (Po=positive and Ne=negative) and the identifier for the mode (Co=color andMo=monochrome). The proportions of the RGB components in each case are defined in the individualentries in the CLUTs.

The four standard sections of file SIN840C.INI (see Section 3.5) are listed below!

[NckMoPoCLUT] [NckMoNeCLUT] [NckCoPoCLUT] [NcKCoNeCLUT]0=0,0,01=0,0,02=0,0,03=0,0,04=128,128,1285=128,128,1286=192,192,1927=255,255,2558=128,128,1289=192,192,19210=0,0,011=0,0,012=192,192,19213=192,192,19214=0,0,015=0,0,0

0=0,0,01=192,192,1922=255,255,2553=255,255,2554=255,255,2555=192,192,1926=192,192,1927=255,255,2558=128,128,1289=128,128,12810=0,0,011=0,0,012=128,128,12813=192,192,19214=0,0,015=0,0,0

0=0,0,01=255,0,02=0,176,03=0,0,1764=255,255,05=144,48,1126=0,255,2557=255,255,2558=112,112,1129=112,0,010=0,0,011=0,0,012=0,0,013=0,144,11214=0,0,015=0,0,0

0=0,0,01=255,0,02=0,176,03=0,0,2554=255,255,05=176,0,1766=0,255,2557=255,255,2558=112,112,1129=225,112,010=0,0,011=0,0,012=48,48,4813=0,144,11214=0,0,015=0,0,0

Each of the individual entries is to be interpreted as a CLUT index with RGB value. So the entry1=255,0,0, for example, in CLUT Color Positive represents the color RED.

Page 90: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-70 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

System palettes:The system colors in the 4 system palettes are defined by entries in the individual CLUTs. Systempalettes are tables with 0 to 255 entries in which a maximum of 256 system colors can be defined forthe individual system settings.The system palettes also exist as separate sections in file SIN840C.INI (see Section 3.5). Only indicesthat are not equal to 0 are specified.

[NckMoPoPalette] [NckMoNePalette] [NckCoPoPalette] [NcKCoNePalette]0 ... 63 Free for configurer64=765=866=767=868=169=570=771=772=573=974=775=176=1277=978=1279=780=1281=282=783=584=085=1386=787=888=789=1290=1291=092=193=394=995=096=597=598=999=8100=9101=7102=0103=3104=6105=2106=4

64=765=866=767=868=169=570=071=772=573=474=075=176=1277=478=1279=780=1281=282=783=584=085=1386=787=888=089=1290=1291=792=193=294=495=396=697=598=999=8100=4101=7102=0103=6104=3105=2106=4

64=765=866=767=868=169=570=771=772=573=974=775=176=1277=978=1279=780=1281=282=783=584=085=1386=787=888=789=1290=1291=092=193=394=995=096=597=598=999=8100=9101=7102=0103=3104=6105=2106=4

64=765=866=767=868=169=570=071=772=573=474=075=176=1277=478=1279=780=1281=282=783=584=085=1386=787=888=089=1290=1291=792=193=294=495=396=697=598=999=8100=4101=7102=0103=6104=3105=2106=4

107-255 Reserved for Siemens

In palette [NckMoPoPalette] entry 64=7 means:

In the system setting monochrome, positive, the system color 64 is defined by the index 7 in the table[NckMoPoCLUT], i.e. by 7=255,255,255 (white).

Page 91: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-71SINUMERIK 840C OEM Version for Windows (BN)

Display element assignment table:

The system color is assigned to each element of an NCK display in the display element assignmenttable. The display element assignment table is permanently coded in the system and can therefore notbe altered.

Display element Surfacecolor

Textcolor

Textbackground

Margincolor

Marginbackground

Input cursor -- 100 -- -- --

Margins for 3D representation -- -- -- 101102

--

Margin for active window -- -- -- 106 --

Data selector -- 90 92 -- --

Input values -- 73 88 -- --

Window title/NCK -- 82 83 -- --

Mode 89 71 89 102 88

Function -- 71 98 -- --

PLC status field -- 81 89 -- --

Channel status -- 81 89 -- --

Mode group + channel no. 89 71 89 102 88

Configuring area 0 and 1 88 free 88 -- --

Application field 88 -- -- -- --

Cursor text in configuring area -- free 88 -- --

Dialog line 70 69 70 91 88

Cursor text in dialog line -- 69 70 -- --

Input line 74 72 74 91 88

Part program cursor -- 92 88 -- --

Pseudo part program cursor -- 83 88 -- --

Actual values -- 83 88 -- --

Other/toggle fields -- 91 88 91 88

RECALL symbol -- * -- -- --

ETC symbol* -- * -- -- --

INFO symbol* -- * -- -- --

* The colors of these display elements can be set by entries in section [Colors] in file NCKTASK.INI. Ifno entry is made, the text color is black.

Example: Recall symbol red, Etc symbol red and Info symbol green:

[COLORS]Recall=255,0,0Etc=255,0,0Info=0,176,0

Page 92: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-72 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Defining the color setting:

The color settings are also defined in file SIN840C.INI (see Section 3.5). For this a section [SCREEN]must be set up with the entry Mode=. The following entries can be made under entry Mode=.

[SCREEN]Mode=color,positiv (Default)Mode=color,negativMode =monochrom,positivMode=monochrom,negativ

If an entry is made in file NCKTASK.INI in section [COLORS] under QGS= it overwrites the entry inSIN840C.INI (see Section 3.5) for the color settings of the NCK displays. Such an entry inNCKTASK.INI must therefore be removed again to ensure correct functioning.

The entry Mode= in file SIN840C.INI (see Section 3.5) affects both the machine application and thecolor setting in the alarm and message line. The effect on the alarm/message line are as follows:

color,positiv andcolor,negativ The colors from the alarm database are used.monochrom,positiv Black text on light grey background.monochrom,negativ White text on black background.

Page 93: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-73SINUMERIK 840C OEM Version for Windows (BN)

3.4.5 Keyboard driver

The control can be operated from three different keyboards:

• Two keyboards can be connected to the keyrequestunit (KYRU II). As standard, the KYRU II isconnected to the single board computer (SBC) of the 840C via serial interface COM1.

In this case the driver KYRU.EXE must be loaded for processing the key signals: This is usuallyperformed in the autostart file REG_AUTO.CFG (cf. Subsection 3.4.3.4)

• In the standard version the operator panel (OP) is connected to KYRU II. An additional fullkeyboard can be connected to KYRU II as an option.

• A conventional MF2 (US layout) can be connected as a third keyboard directly tothe keyboard port on the SBC (central controller)

In the standard version, the 840C is operated with an operator panel keyboard.

It is also possible to connect the operator panel to the COM2 interface on the MMC. The operator panelcan be assigned to COM2 by making a relevant entry in SIN840C.INI (see Section 3.5) under section[kyru].

[kyru] Device=COM2:9600,O,8,1

Interface: Baud rate, ODD/EVEN, Data bits, Stop bits

If the kyru has been connected to COM2, the environment variable KYRUCOM must be changed in fileAUTOEXEC.BAT, too.

The command SET KYRUCOM=1 must be changed in SET KYRUCOM=2.

Only this action will ensure a reset of the new kyru firmware when changing from Windows to FlexOS,which is required for reliable functioning of the kyru under flexOS.

You must also observe the following for devices that use the serial interfaces for data input/output:

• Up to 10 devices can be defined and their settings made via the V24 parameterization. In thisway, one of the interfaces COM1, COM2, COM3 or COM4 can be assigned to the devicesregardless of which interfaces are free or assigned to the operator panel.

• If the data manager now triggers data input/output via a device that wishes to assign theinterface of the operator panel, the following error message is displayed in the message line:"100404: Interface assigned". Data transmission is not started.

• If a serial data exchange is performed under Archiving using PCIN, the COM interface must bechanged to an interface not used by the operator panel when PCIN is called for the first time.This configuration must be stored when PCIN is terminated. The default setting for PCIN isCOM2.

An entry in the INI file SIN840C.INI (see Section 3.5) defines whether the connection to the KYRU II isto be monitored or not.

[kyru]Control=on/off

If the entry "off" has been made, no message is output if KYRU II is not slotted in or the connection isbroken. Operation of the control without an operator panel or operation of several controls from oneoperator panel (switching between controls) is thus possible.

Page 94: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-74 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

If the operator panel is connected to the control again it is automatically resynchronized with KYRU II.

When operating several keyboards at once it is important to remember that <shiftlock>, <capslock> and<alt> can be activated from all the connected keyboards. I.e. if <capslock> is activated on the fullkeyboard it affects input via the operator panel.

3.4.5.1 Operator panel keyboard

Normally the operator panel keyboard is used.

In addition to the keys used in the 840C Basic Version, the OEM Version for Windows additionally usesa free key on the operator panel. Its meaning is <alt> and, if pressed with a SHIFT key, '\'. This allowsyou to enter paths.

A detailed explanation of the operator panel keyboard standard assignment as well as the limitationsand special features is given in the publication:

SINUMERIK 840C OEM Version for Windows, Software Version 5, Operator's Guide.

3.4.5.2 Full keyboard on KYRU II

The full keyboard on the operator panel is essentially the same as the basic version keyboard with theaddition of the special operator panel keys

The following applies to the full keyboard:

• All the special keys which are labelled using the key caps to correspond to the keys of theoperator panel send the same key code as those of the operator panel.

• "NUM lock" does not affect the number keypad. The same code is sent as if "NUM lock" were notpressed. The code for the numbers is generated if the "SHIFT" key is pressed at the same time.

• All the other keys send the same code under Windows as on a standard keyboard that isconnected directly to the keyboard port on the SBC. The keys <shift>, <ctrl> and <alt> have noeffect until they are pressed together with another key (not one from this group).

• Even with a full keyboard, operation of any particular Windows application is as restricted as it ison an operator panel (see Operator's Guide).

• In contrast to the 840C Basic Version, the key <tab> in the "Machine" area has the function"Edit". This does not result in any other restrictions.

3.4.5.3 MF2 keyboard on SBC

The standard keyboard MF2 that is connected to the central controller allows the operation ofWINDOWS applications as described in the Microsoft documentation.

However, this connection only has limited noise immunity and is therefore not used by Siemens foroperator input at the control. However, the keyboard connected here can be used for testing purposesin the development of software.

You must ensure that a short cable is used and that noise immunity and local configuration (the SBC isusually installed in a cabinet) requirements for this keyboard are fulfilled.

The conventional MF2 keyboard must only be used for service tasks. Please follow therecommendations of the standard documentation.

Page 95: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-75SINUMERIK 840C OEM Version for Windows (BN)

Note:

Applications that have crashed can usually still be operated from this keyboard. Without thiskeyboard the control must be rebooted.

3.4.5.4 Key codes

Selected Windows applications receive the following virtual key codes from the operator panel:

Operator panel keys Microsoft meaningwithout Shift with Shift without Shift with ShiftA a WM_CHAR 'A' WM_CHAR 'a'B b WM_CHAR 'B' WM_CHAR 'b'C c WM_CHAR 'C' WM_CHAR 'c'D d WM_CHAR 'D' WM_CHAR 'd'E e WM_CHAR 'E' WM_CHAR 'E'F f WM_CHAR 'F' WM_CHAR 'f'G g WM_CHAR 'G' WM_CHAR 'g'H h WM_CHAR 'H' WM_CHAR 'h'I i WM_CHAR 'I' WM_CHAR 'i'J j WM_CHAR 'J' WM_CHAR 'j'K k WM_CHAR 'K' WM_CHAR 'k'L l WM_CHAR 'L' WM_CHAR 'l'M m WM_CHAR 'M' WM_CHAR 'm'N n WM_CHAR 'N' WM_CHAR 'n'O o WM_CHAR 'O' WM_CHAR 'o'P p WM_CHAR 'P' WM_CHAR 'p'Q q WM_CHAR 'Q' WM_CHAR 'q'R r WM_CHAR 'R' WM_CHAR 'r'S s WM_CHAR 'S' WM_CHAR 's'T t WM_CHAR 'T' WM_CHAR 't'U u WM_CHAR 'U' WM_CHAR 'u'V v WM_CHAR 'V' WM_CHAR 'v'W w WM_CHAR 'W' WM_CHAR 'w'X x WM_CHAR 'X' WM_CHAR 'x'Y y WM_CHAR 'Y' WM_CHAR 'y'Z z WM_CHAR 'Z' WM_CHAR 'z'Space _ WM_CHAR ' ' WM_CHAR '_'1 < WM_CHAR '1' WM_CHAR '<'2 > WM_CHAR '2' WM_CHAR '>'3 ! WM_CHAR '3' WM_CHAR '!'4 [ WM_CHAR '4' WM_CHAR '['5 ] WM_CHAR '5' WM_CHAR ']'6 ? WM_CHAR '6' WM_CHAR '?'7 ( WM_CHAR '7' WM_CHAR '('8 ) WM_CHAR '8' WM_CHAR ')'9 : WM_CHAR '9' WM_CHAR ':'0 ; WM_CHAR '0' WM_CHAR ';'/ " WM_CHAR '/' WM_CHAR '"'* ' WM_CHAR '*' WM_CHAR '''- ^ WM_CHAR '-' WM_CHAR '^'= @ WM_CHAR '=' WM_CHAR '@'. ± WM_CHAR '.' WM_CHAR '±'+ , WM_CHAR '+' WM_CHAR ','

Page 96: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-76 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

"Clear" "Clear" WM_CHAR'Backspace'

WM_CHAR'Backspace'

"Cancel" "Cancel" VK_DELETE VK_DELETE"Edit" "Edit" WM_CHAR 'Tab' WM_CHAR 'Tab'"Input" "Input" WM_CHAR 'Return' WM_CHAR 'Return'"LF" % WM_CHAR 'Line Feed' WM_CHAR 'Line Feed'"Alt" \ VK_MENU WM_CHAR'\'Unassigned key(only on 14"monitor)

Unassigned key(only on 14"monitor)

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

"i key" "i key" VK_F1 VK_F1"Home" "Home" VK_HOME VK_HOME↑ ↑ VK_UP VK_UP"Page Up" "Page Up" VK_PRIOR VK_SHIFT

VK_PRIOR"Alarm quit" "Alarm quit" WM_CHAR "esc"

(except in alarmwindow)

WM_CHAR "esc"(except in alarmwindow)

← ← VK_LEFT VK_LEFT"Selection key" "Selection key" VK_CLEAR VK_CLEAR→ → VK_RIGHT VK_RIGHT"Large actualvalue display"

"Large actualvalue display"

VK_SHIFTVK_F11

VK_SHIFTVK_F11

"End" "End" VK_END VK_END↓ ↓ VK_DOWN VK_DOWN"Page Down" "Page Down" VK_NEXT VK_SHIFT

VK_NEXT"Channelswitchover"

"Mode groupswitchover"

VK_F12 VK_SHIFTVK_F12

"Machine key" "Machine key" Switchover to machine Switchover to machine"Recall" "Recall" VK_F2 VK_SHIFT

VK_F2"Softkey 1" "Softkey 1" VK_F3 VK_SHIFT

VK_F3"Softkey 2" "Softkey 2" VK_F4 VK_SHIFT

VK_F4"Softkey 3" "Softkey 3" VK_F5 VK_SHIFT

VK_F5"Softkey 4" "Softkey 4" VK_F6 VK_SHIFT

VK_F6"Softkey 5" "Softkey 5" VK_F7 VK_SHIFT

VK_F7"Softkey 6" "Softkey 6" VK_F8 VK_SHIFT

VK_F8"Softkey 7" "Softkey 7" VK_F9 VK_SHIFT

VK_F9"ETC" "ETC" VK_F10 Alarm window placed

on top"Data area key" "Data area key" Area switchover Area switchover"Softkey 8" "Softkey 8" VK_SHIFT

VK_F3VK_SHIFTVK_F3

"Softkey 9" "Softkey 9" VK_SHIFTVK_F4

VK_SHIFTVK_F4

"Softkey 10" "Softkey 10" VK_SHIFTVK_F5

VK_SHIFTVK_F5

Page 97: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-77SINUMERIK 840C OEM Version for Windows (BN)

"Softkey 11" "Softkey 11" VK_SHIFTVK_F6

VK_SHIFTVK_F6

"Softkey 12" "Softkey 12" VK_SHIFTVK_F7

VK_SHIFTVK_F7

"Softkey 13" "Softkey 13" VK_SHIFTVK_F8

VK_SHIFTVK_F8

"Softkey 14" "Softkey 14" VK_SHIFTVK_F9

VK_SHIFTVK_F9

Remarks:

• Up to SW < 6: The cancel alarms are deleted with the "Alarm quit" key in the Machine area andwhen the alarm window is displayed (application "Alarm"). For other applications it has thefunction "ESC".

• In SW 6 and higher, the alarm/acknowledge key is effective independently of the applicationrunning in the foreground. It causes deletion of the cancel alarms and acts as the ESC key.

• In contrast to the Basic Version, in the OEM Version for Windows there are no differences in theinternal coding of the keys. It is not possible to detect whether a key has been pressed on theoperator panel, on the full keyboard or on the MF2 keyboard. The key code (DB 40) sent to thePLC is always the key code of the full keyboard.

3.4.5.5 Kyru expansions

The keyboard driver in file SIN840C.INI (see Section 3.5) also provides the following extendedparameterization options for the individual keys on the operator panel keyboard.

[kyru]M=C:\MMCWIN\PC\NCTASK.EXE MachineToggleM=off

M=Defines the applications that are started when the key MACHINE on the operator panel is pressed. Ifno entry is made the key sends the virtual key code VK_F1.

ToggleM=off | onDefines whether the previous application is called up again or not when the M key is pressed in anactive machine application. "On" means that the M key toggles between the machine application andthe previously active application whenever it is pressed (like pressing <alt> and <tab> in Windows).The default value is "off".

ShM=C:\MMCWIN\PC\NCTASK.EXEToggleShM=off

ShM=Like M=, Shift + Machine is defined here. If no entry is made, this key sends the virtual key codeVK_SHIFT, VK_F1.

ToggleShM=off | onAs for ToggleM= but for the application that is defined under ShM=. The default value is "off".

Page 98: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-78 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

D=C:\MMCWIN\PC\REGIE.EXE TaskswitchToggleD=off

D=As with M=, the function of the data area key is defined here. If no entry is made this key sends virtualkey code VK_F11.

ToggleD=off | onAs for ToggleM= but for the application that is defined under D. The default value is "off".

ShD=C:\MMCWIN\PC\NCTASK.EXE LastActiveToggleShM=off

ShD=As with M=, the function of Shift + data area key is defined here. If no entry has been made this keysends virtual key code VK_SHIFT, VK_F11.

ToggleShM=off | onAs for ToggleM= but for the application that is defined under ShD=. The default value is "off".

ShEtc=C:\MMCWIN\PC\ALARM.EXEToggleShEtc=on

ShEtc=As with M= the function of key combination SHIFT + ETC is defined here. If no entry is made this keysends virtual key code VK_SHIFT, VK_F10.

ToggleShEtc=off | onAs for ToggleM= but for the application that is defined under D=. The default value is "on".

SCR=ToggleSCR=off

SCR=As with M= the function of key combination SHIFT + "Large display" is defined here. If no entry is madethis key sends virtual key code VK_SHIFT, VK_F11.

A screen saver can be entered here as in the Basic Version. Files with the extension .SCR must alsobe enabled for execution in the WIN.INI file.

[Windows]Programs=EXE COM BAT PIF SCR

A screen saver is selected by making the entry

SCR=C:\WINDOWS\SSTARS.SCR /s

Parameter/s must be entered as otherwise only the configuration menu of the screen saver isdisplayed.

ToggleSCR=off | onAs for ToggleM= but for the application that is defined under ´SCR=. The default value is "off".

Page 99: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-79SINUMERIK 840C OEM Version for Windows (BN)

Regie=TraceExecute=off

Regie=Defines the application for which the "PgUp" and "PgDn" keys function as task switch keys. If no entryis made the same application as is entered in D= is used.

TraceExecute=off | onIs used as a debugging tool. The default value is "off". "On" ensures that all the special key functions(ShellExec or toggle) are output at the debugging terminal.

Caution:

• The defined keys will only function correctly if the applications have been fully specified, i.e. thewhole path must be entered. Only backslashes can be used in the path definition. The file nameextension of the application must also be entered.

• Only one instance of an application must be started at a time to ensure that the "PgUp" and "PgDn"keys and the toggle keys function correctly. Starting of a second instance must be explicitlyprevented in the program or the application must be compiled in the memory model "Large".

3.4.5.6 New features in Software version 5.1

The new KYRU firmware version makes it possible to control the operator panel and an MF2 keyboardconnected to it so that several keys can be pressed and evaluated simultaneously. Key assignment canalso be freely selected. With the new kyru firmware version the combined operation of keys (e.g.ALT+X) is also possible on the operator panel.

This OEM function is included in a DLL that is dependent on the kyru firmware version (with/withoutmulti-key mode) whose source code is contained in the OEM package. It is thus possible to use a keyassignment other than the standard assignment.

The entire kyru application consists of two parts, the basic application which is responsible forRS 232 C data transmission with the operator panel and the DLLs mentioned above which areresponsible for recoding the key functions. The interface between the application and the DLL isspecified independently of the kyru firmware version. The application is responsible for establishingcommunication to the operator panel and for processing the protocol between the MMC and theoperator panel.

After the connection has been established the kyru firmware is tested for its ability to operate in multi-key mode and this mode is then set. Then the relevant DLL is loaded for recoding and initialized. Thekey codes for Windows supplied by the DLL are also transferred to Windows by the basic application. Aselection from maximum 32 hotkey functions can also be chosen from the DLLs via the basicapplication. Six of these hotkey functions are assigned to the hotkeys described in Subsection 3.4.5.5.

Operator panel disable and definition of the key codes sent to Windows for pressed or released keysare implemented in the OEM keyboard DLL. The basic application only calls the relevant functions ofthe DLL and transfers any data it receives to Windows or starts other applications (hotkeys).

Page 100: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-80 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Freely modifiable key assignment:

To make it possible to implement any assignment of keys on the operator panel or MF2 keyboardconnected to it, recoding of key events into scan codes has been implemented in the DLL. This DLLcan be modified and included in the system. This strategy allows practically any assignment of physicalkeys and the keys simulated in Windows. This function is divided into three main areas:

1. Communication with operator panel firmware via RS 232 C

2. Transfer of scan codes to Windows

3. Conversion of key events on the operator panel into scan codes for Windows

Areas 1 and 2 are implemented by the basic task and do not influence the effect of individual keys. Item3 is executed by the DLL. This separates the functionality required for the effect that individual keyshave from the communication level and makes it possible to implement function expansions or changesby modifying the DLL.

Principle

Linking the OEM-kyru-DLL to the key strokes

The OEM kyru DLL can intervene in the data transfer of key codes in two ways. Either each key eventis signalled to the DLL via function call. As a result the DLL can transfer both scan codes and aselected hotkey. Or the DLL can request a specific key event from the kyru task via post message. Akey event is therefore simulated.

Detailed description of the required scan codes

US keyboard assignment is supported. It is here that the codes are stored that have to be transferredfrom the kyru OEM DLLs to the application being called (KYRU.EXE) to "press the relevant key".Unless otherwise stated in the table, to release the key in each case the same key code must beoutput, ORed bit by bit with 80H. I.e. the code for "press" and "release" is identical with the exception ofthe most significant bit. Exceptions to this rule are noted in the table. All values in the table are given inHex.

Page 101: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-81SINUMERIK 840C OEM Version for Windows (BN)

Table for Windows scan codes:Key Shift Alt Ctrl Shift+

AltShift+Ctrl

Alt+Ctrl

Shift+Alt+Ctrl

Com-ment

Escape 01 01 01 01 01 01 01 01F1 3B 3B 3B 3B 3B 3B 3B 3BF2 3C 3C 3C 3C 3C 3C 3C 3CF3 3D 3D 3D 3D 3D 3D 3D 3DF4 3E 3E 3E 3E 3E 3E 3E 3EF5 3F 3F 3F 3F 3F 3F 3F 3FF6 40 40 40 40 40 40 40 40F7 41 41 41 41 41 41 41 4F8 42 42 42 42 42 42 42 42F9 43 43 43 43 43 43 43 43F10 44 44 44 44 44 44 44 44F11 57 57 57 57 57 57 57 57F12 58 58 58 58 58 58 58 58

Print screen E0 2AE0 37

E0 37 54 E0 37 54 E0 37 54 54 1)

Scroll lock 46 46 46 46 46 46 46 46Pause E1 1D

45E1 9DC5

E1 1D45E1 9DC5

E1 1D45E1 9DC5

E0 46E0 C6

E1 1D45E1 9DC5

E0 46E0 C6

E0 46E0 C6

E0 46E0 C6

2)

` 29 29 29 29 29 29 29 291 02 02 02 02 02 02 02 022 03 03 03 03 03 03 03 033 04 04 04 04 04 04 04 044 05 05 05 05 05 05 05 055 06 06 06 06 06 06 06 066 07 07 07 07 07 07 07 077 08 08 08 08 08 08 08 088 09 09 09 09 09 09 09 099 0A 0A 0A 0A 0A 0A 0A 0A0 0B 0B 0B 0B 0B 0B 0B 0B- 0C 0C 0C 0C 0C 0C 0C 0C= 0D 0D 0D 0D 0D 0D 0D 0D

Backspace 0E 0E 0E 0E 0E 0E 0E 0EInsert E0 52 E0 52 E0 52 E0 52 E0 52 E0 52 E0 52 E0 52 3)Home E0 47 E0 47 E0 47 E0 47 E0 47 E0 47 E0 47 E0 47 3)

Page up E0 49 E0 49 E0 49 E0 49 E0 49 E0 49 E0 49 E0 49 3)Num lock 45 45 45 45 45 45 45 45Numpad / E0 35 E0 35 E0 35 E0 35 E0 35 E0 35 E0 35 E0 35 4)Numpad * 37 37 37 37 37 37 37 37Numpad - 4A 4A 4A 4A 4A 4A 4A 4ATabulator 0F 0F 0F 0F 0F 0F 0F 0F

Q 10 10 10 10 10 10 10 10W 11 11 11 11 11 11 11 11E 12 12 12 12 12 12 12 12R 13 13 13 13 13 13 13 13T 14 14 14 14 14 14 14 14Y 15 15 15 15 15 15 15 15U 16 16 16 16 16 16 16 16I 17 17 17 17 17 71 17 17O 18 18 18 18 18 18 18 18P 19 19 19 19 19 19 19 19

Page 102: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-82 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

[ 1A 1A 1A 1A 1A 1A 1A 1A] 1B 1B 1B 1B 1B 1B 1B 1B\ 2B 2B 2B 2B 2B 2B 2B 2B

Delete E0 53 E0 53 E0 53 E0 53 E0 53 E0 53 E0 53 E0 53 3)End E0 4F E0 4F E0 4F E0 4F E0 4F E0 4F E0 4F E0 4F 3)

Page down E0 51 E0 51 E0 51 E0 51 E0 51 E0 51 E0 51 E0 51 3)Numpad 7 47 47 47 47 47 47 47 47Numpad 8 48 48 48 48 48 48 48 48Numpad 9 49 49 49 49 49 49 49 49Numpad + 4E 4E 4E 4E 4E 4E 4E 4ECaps lock 3A 3A 3A 3A 3A 3A 3A 3A

A 1E 1E 1E 1E 1E 1E 1E 1ES 1F 1F 1F 1F 1F 1F 1F 1FD 20 20 20 20 20 20 20 20F 21 21 21 21 21 21 21 21G 22 22 22 22 22 22 22 22H 23 23 23 23 23 23 23 23J 24 24 24 24 24 24 24 24K 25 25 25 25 25 25 25 25L 26 26 26 26 26 26 26 26; 27 27 27 27 27 27 27 27' 28 28 28 28 28 28 28 28

Enter 1C 1C 1C 1C 1C 1C 1C 1CNumpad 4 4B 4B 4B 4B 4B 4B 4B 4BNumpad 5 4C 4C 4C 4C 4C 4C 4C 4CNumpad 6 4D 4D 4D 4D 4D 4D 4D 4DShift left 2A 2A 2A 2A 2A 2A 2A 2A

Z 2C 2C 2C 2C 2C 2C 2C 2CX 2D 2D 2D 2D 2D 2D 2D 2DC 2E 2E 2E 2E 2E 2E 2E 2EV 2F 2F 2F 2F 2F 2F 2F 2FB 30 30 30 30 30 30 30 30N 31 31 31 31 31 31 31 31M 32 32 32 32 32 32 32 32, 33 33 33 33 33 33 33 33. 34 34 34 34 34 34 34 34/ 35 35 35 35 35 35 35 35

Shift right 36 36 36 36 36 36 36 36Cursor up E0 48 E0 48 E0 48 E0 48 E0 48 E0 48 E0 48 E0 48 3)Numpad 1 4F 4F 4F 4F 4F 4F 4F 4FNumpad 2 50 50 50 50 50 50 50 50Numpad 3 51 51 51 51 51 51 51 51

Numpad enter E0 1C E0 1C E0 1C E0 1C E0 1C E0 1C E0 1C E0 1CCtrl left 1D 1D 1D 1D 1D 1D 1D 1DAlt left 38 38 38 38 38 38 38 38Space 39 39 39 39 39 39 39 39Alt right E0 38 E0 38 E0 38 E0 38 E0 38 E0 38 E0 38 E0 38Ctrl right E0 1D E0 1D E0 1D E0 1D E0 1D E0 1D E0 1D E0 1D 3)

Cursor left E0 4B E0 4B E0 4B E0 4B E0 4B E0 4B E0 4B E0 4B 3)Cursor down E0 50 E0 50 E0 50 E0 50 E0 50 E0 50 E0 50 E0 50 3)Cursor right E0 4D E0 4D E0 4D E0 4D E0 4D E0 4D E0 4D E0 4DNumpad 0 52 52 52 52 52 52 52 52Numpad . 53 53 53 53 53 53 53 53

Page 103: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-83SINUMERIK 840C OEM Version for Windows (BN)

Notes:

In the explanation below, key(Dn) means that the key in question is pressed and remains pressed. Anycodes that are repeated as a result are shown by ... . Key(Up) indicates that the key in question isreleased.

1) Repeat is only executed for E0 37, i.e. the following sequence occurs if print screen is kept pressedfor a longer time:

Print screen(Dn) E0 2A E0 37 E0 37 ... E0 37

Print screen(Up) E0 B7 E0 AA

The example is given for each key individually, i.e. without the shift, ctrl or alt key beingadditionally pressed.

2) The stated code is not repeated, i.e. no repeat is executed and no other code is output if the key isreleased again. This results in the following sequence:

Pause(Dn) E1 1D 45 E1 9D C5

Pause(Up)

The example is given for each key individually, i.e. without the shift, ctrl or alt key beingadditionally pressed.

3) Depending on the state of the shift key, the keys output additional scan codes to the one stated.This is illustrated by an example (Insert, special code is underlined in each case). Both the left andthe right shift key are taken into account (the right shift key is used in the example). The toggle stateof the numlock key also has an effect on the scan code output. The numlock toggle state is readdirectly before output, i.e. if the numlock key is pressed during a repeat sequence and thenreleased, this does not result in the output of an extra key code, only when the repeating key isreleased is a code output for the released key and the numlock toggle state. The followingsequences result (in this case for Insert, identical for other keys):

1. Numlock toggle state active

Insert(Dn) E0 2A E0 52 ... E0 52

Shift(Dn) E0 AA 36 ... 36

Shift(Up) B6

Insert(Up) E0 D2

2. Numlock toggle state active

Insert(Dn) E0 2A E0 52 ... E0 52

Shift(Dn) E0 AA 36 ... 36

Insert(Up) E0 D2 36 ... 36

Shift(Up) B6

3. Numlock toggle state active

Shift(Dn) 36 ... 36

Insert(Dn) E0 52 ... E0 52

Insert(Up) E0 D2

Shift(Up) B6

4. Numlock toggle state active

Shift(Dn) 36 ... 36

Insert(Dn) E0 52 ... E0 52

Page 104: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-84 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Shift(Up) B6 E0 2A E0 52 ... E0 52

Insert(Up) E0 D2 E0 AA

5. Numlock toggle state not active

Insert(Dn) E0 52 ... E0 52

Shift(Dn) 36 ... 36

Shift(Up) B6

Insert(Up) E0 D2

6. Numlock toggle state not active

Insert(Dn) E0 52 ... E0 52

Shift(Dn) 36 ... 36

Insert(Up) E0 D2 E0 36 36 ... 36

Shift(Up) B6

7. Numlock toggle state not active

Shift(Dn) 36 ... 36

Insert(Dn) E0 B6 E0 52 ... E0 52

Insert(Up) E0 D2 E0 36

Shift(Up) B6

8. Numlock toggle state not active

Shift(Dn) 36 ... 36

Insert(Dn) E0 B6 E0 52 ... E0 52

Shift(Up) B6 E0 52 ... E0 52

Insert(Up) E0 D2

4) The scan codes that the key "Numpad /" outputs depends on the shift key status. The othermodification keys (alt, ctrl) do not have any other effect on the output scan code. The examplebelow illustrates all possible combinations. In the example, the right shift key is used, response tothe left shift key is the same.

1. Numpad/(Dn) E0 35 ... E0 35

Shift(Dn) 36 ... 36

Shift(Up) B6

Numpad/(Up) E0 B5

2. Numpad/(Dn) E0 35 ... E0 35

Shift(Dn) 36 ... 36

Numpad/(Up) E0 B5 E0 36 36 ... 36

Shift(Up) B6

3. Shift(Dn) 36 ... 36

Numpad/(Dn) E0 B6 E0 35 ... E0 35

Numpad/(Up) E0 B5 E0 36

Shift(Up) B6

Page 105: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-85SINUMERIK 840C OEM Version for Windows (BN)

4. Shift(Dn) 36 ... 36

Numpad/(Dn) E0 B6 E0 35 ... E0 35

Shift(Up) B6 E0 35 ... E0 35

Numpad/(Up) E0 B5Unique codes are output to the OEM DLLs for each of the keys. These codes consist of the positionnumbers and a most significant bit set depending on the keyboard from which they are sent. Thiscoding therefore uniquely identifies the key pressed and keyboard used. This means that everyphysical key has a unique ID which is sent to the DLL. Other additional status information that can beevaluated is sent with the codes.

Key codes from full keyboard:

Key NCK function Key codeEscape Cancel error 238F1 Machine, Info 240F2 Recall, special Recall 241F3 Softkey 1 242F4 Softkey 2 243F5 Softkey 3 244F6 Softkey 4 245F7 Softkey 5 246F8 Softkey 6 247F9 Softkey 7 248F10 Etc 249F11 Data area, large screen 250F12 Channel, mode group switchover 251Print screen 252Scroll lock 253Pause 254` ~ 1291 ! 1302 @ 1313 # 1324 $ 1335 % 1346 ^ 1357 & 1368 * 1379 ( 1380 ) 139- _ 140= + 141Backspace Backspace, Clear 143Insert Edit 203Home 208Page Up 213Num lock 218Numpad / 223Numpad * 228Numpad - 233Tabulator 144q Q 145w W 146e E 147r R 148t T 149y Y 150

Page 106: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-86 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

u U 151i I 152o O 153p P 154[ { 155] } 156\ | 157Delete Delete block, cancel 204End 209Page down 214Numpad Home 7 219Numpad Cursor up 8 223Numpad Page down 9 229Numpad + Numpad + ± 234Caps lock 158a A 159s S 160d D 161f F 162g G 163h H 164j J 165k K 166l L 167; : 168' " 169Enter Input 171Numpad Cursor left 4 220Numpad 5 Selection 5 225Numpad Cursor right 6 230Shift left 172z Z 174x X 175c C 176v V 177b B 178n N 179m M 180, < 181. > 182/ ? 183Shift right 185Cursor up 211Numpad end 1 221Numpad Cursor down 2 226Numpad Page down 3 231Numpad Enter = 236Control left 186Alt left 188Space 189Alt right 190Control right 192Cursor left 207Cursor down 212Cursor right 217Numpad insert 0 Input 0 227Numpad delete . Delete block, cancel 232

Page 107: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-87SINUMERIK 840C OEM Version for Windows (BN)

Key codes from operator panel:NCK function Key code

A a 1B b 2C c 3D d 4E e 5F f 6G g 7H h 8I i 9J j 10K k 11L l 12M m 13N n 14O o 15P p 16Q q 17R r 18S s 19T t 20Shift 21U u 22V v 23W w 24X x 25Y y 26Z z 27Space _ 287 ( 298 ) 309 : 31/ " 32% LF 33Unlabelled key 1 34Info 354 [ 365 ] 376 ? 38* ' 39Channel switchover, mode group switchover 40Large screen display 41Cancel error 421 < 432 > 443 ! 45- ^ 46Home 47Cursor up 48Page up 49= @ 500 ; 51. ± 52+ , 53Cursor left 54

Page 108: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-88 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Selection 55Cursor right 56Backspace, Clear 57Delete block, Cancel 58Edit 59Input 60End 61Cursor down 62Page down 63Unlabelled key 2 (14" Monitor only) 64Machine area 65Recall Special recall 66Softkey 1 67Softkey 2 68Softkey 3 69Softkey 4 70Softkey 5 71Softkey 6 72Softkey 7 73Etc 74Data area 75Free key location (not addressable) 76Softkey 8 77Softkey 9 78Softkey 10 79Softkey 11 80Softkey 12 81Softkey 13 82Softkey 14 83

The OEM DLL that must be created for a specific keyboard assignment must export 2 functions. Thesefunctions are called by the task that maintains contact with the operator panel in order to convert therelevant information about key events on the hardware into code information for Windows. Receipt ofthe key messages from the hardware (operator panel), the conversion of received messages into theunique key codes listed above and transfer of the recoded scan codes to Windows takes place in thehigher level task and is transparent to the DLL. The DLL is only responsible for the recoding of keyevents (pressing and releasing) and reading the various shift keys.

KyruResetDll export number 3

The function to be exported, KyruResetDll, is called by the higher level task (kyru task) to achievesynchronization with the hardware and to put the DLL in a defined output status. Information istransferred in the process which enables the DLL, for example, to have the kyru task execute aparticular key event asynchronously. This structure also contains a mask with enabled/assigned hotkeyfunctions and information about whether an operator panel lock or the screen saver is active. Thisinformation can be changed asynchronously to the DLL at any time, i.e. it must not be copied but thedata it contains must always be updated via the transferred pointer. This ensures that an actual"physical" status is scanned without having to call any additional functions. The function KyruResetDll iscalled if a keyboard reset is recognized, a new operator panel is connected (operator panel switchover)or the DLL is reloaded. In this case internal states of the DLL must be reset to a basic value.

Page 109: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-89SINUMERIK 840C OEM Version for Windows (BN)

The function KyruResetDll is defined as follows:

int CALLBACK KyruResetDll(const KyruData __far *lpKyruData);

where KyruData is a structure type that contains the following information:

typedef struct tagKyruData {HWND hKyruWnd;UINT uUMSG_ForceKey;DWORD fFunMask;char szRegie[256];BOOL bSaver;BOOL bKeyLock;

} KyruData;

hKyruWnd and uUMSG_ForceKey are the information that are required to send a message to the Kyrutask so that it calls the 2nd function (key event) and forwards the code transferred from the DLL toWindows. This is useful in the event of a reset so that any keys that might still be pressed virtually canbe released etc. The parameter wParam of the message is passed to the function as a key code. Allother key states are set to 0. In this way it is possible to distinguish between such an event and aphysical keystroke. The results of this call are processed as described below in the functionKyruKeyDll. A message of this type should be sent via PostMessage to avoid unnecessary recursion.

Example: PostMessage(lpKyruData->hKyruWnd, lpKyruData->uUMSG_ForceKey, uKey, 0L);Here the function KyruKeyDll has been called and specified as a keycode uKey.

In fFunMask one bit is set for each hotkey function that is assigned. The hotkey functions arenumbered 1 to 32. The first six functions are permanently assigned to machine, shift machine, dataarea, shift data area, shift large display and shift etc. for reasons of compatibility. For this reason, thefollowing predefined constants exist for this functions:

HK_MASCHINEHK_SHMASCHINEHK_DATENBEREICHHK_SHDATENBEREICHHK_SHGROSSBILDHK_SHETC

All other hotkey functions can be freely used for OEM customers in the DLL. The Kyru task ensuresthat the corresponding string entries are loaded from the profile and that the procedure is followed inaccordance with the entries. The DLL determines when a key triggers a hotkey event in the functionKyruKeyDll.

The ASCII string szRegie contains the complete path name for the master control component. Thispath is required, for example, to assign the task switchover to the PageUp and PageDown keys as aspecial function if the master control is the active one.

bSaver is set if the screen saver is active. The OEM-DLL use this information to decide, for example, ifcertain keys can be forwarded or not.

bKeyLock is set if the operator panel disable is set by the PLC. In the OEM-DLL it can be decided on acase-by-case basis whether and which keys are disabled or allowed to pass.

Page 110: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-90 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

KyruKeyDll export number 2

The function KyruKeyDll is called by the Kyru task if a key event (pressing or releasing) has occurredon the operator panel or on the MF2 keyboard used with the operator panel. This function is also calledif the a call is requested via the mechanism described above. The function contains the parameterscurrent key code or the constant in uKey passed by the PostMessage call in wParam and the stateflags in uState, that indicate, for example, from which keyboard the key event originates (BT or MF2).With the old Kyru firmware, the state of the shift keys is also supplied because they are not supplied asseparate key events. Moreover, it is also coded in the flags whether the key is being pressed orreleased. A repeat is passed on as a second press.

If no bit is set in the state (uState) it is a special event that has either been triggered by the abovePostMessage mechanism or the key code is 0, in which case it is the last call of this function before theDLL is removed from the memory. The DLL is removed, for example, if operator panel switchover takesplace and an operator panel with other firmware is connected. With this call the DLL can release all thekeys that it still has pressed virtually. Virtually pressed keys are necessary to achieve special recodingbecause key codes are often assigned to the same key on the operator panel that are not assigned tothe same key on the US keyboard. To be able to forward the scan code data to Windows, a bufferbBuffer and its length nBufferLength are passed to the DLL, in which the scan codes can be enteredwith a final '\0'. These are then forwarded to Windows as keyboard events. As a return value a hotkeyfunction can be specified that calls the corresponding function (Starting an application). The DLL mustevaluate before transfer whether this hotkey function is assigned. It is able to do this because of theinformation in fFunMask in the data structure passed on to KyruResetDll. In this way, it is possible, forexample, to tell whether the hotkey function is assigned and if so, to trigger it and if not, to output thenormal scan code. The bits in fFunMask are numbered starting with 1 and correspond to hotkeyfunctions 1 to 32. A set bit means that the corresponding hotkey function is assigned. 0 or anunassigned hotkey function number as the return value causes no hotkey function to be executed.

The scan code is always forwarded to Windows first and then the hotkey is called, if it is assigned. It ispossible to output both scan codes and a hotkey functions in one call.

The status information that is passed to the function KyruKeyDll in uState, is bit-coded. The followingconstants with the appropriately defined constant are available for the individual bits:

NOTHING Special event (see text)SHIFT Shift key (only old Kyru firmware)CONTROL Control key pressed at the same time (only old Kyru firmware)ALTKEY Alt key pressed at the same time (only old Kyru firmware)ALTGROUP AltGr key pressed at the same time (only old Kyru firmware)MAKECODE Key was pressed or is in autorepeatBREAKCODE Key was releasedMF2 Key is on the MF2 keyboard

The function is defined as follows:

int CALLBACK KyruKeyDll (BYTE FAR *bBuffer, UINT nBufferLength, UINT uKey, UINT uState);

Page 111: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-91SINUMERIK 840C OEM Version for Windows (BN)

For reasons of compatibility, the entries managed for hotkeys in SIN840C.INI (see Section 3.5) are thefollowing:

[kyru]M=ToggleM=ShM=ToggleShM=D=ToggleD=ShD=ToggleShD=SCR=ToggleSCR=ShEtc=ToggleShEtc=

for hotkey functions 1 to 6, and

[HotKeys]Fun7=Toggle7=...Fun32=Toggle32=

where on or off can be entered after the Togglexxx entry (default = off). This means that if this key ispressed and the application specified in Funxxx is active, the last active application is selected. If theapplication is cooperative, i.e. it does not load a second instance but places itself in the foreground if itis called a second time, switchover between this and the last active task is achieved. According toWindows documentation, this ought to apply to applications that have been relocated in the large modeland always have more than one data segment. This mechanism cannot be guaranteed with everyapplication because of the characteristics of Windows. The SCR entry must not be used because it isreserved for the screen saver (Call by Shift large display) and is managed and altered automatically bythe corresponding configuration software.

Old and new Kyru firmware version

The two firmware versions differ with respect to the OEM-DLL in that the keys are always signalledsingly on the old Kyru firmware version. I.e. no more than one key is signalled as pressed at a time andonly when this has been released is the next signalled as pressed. To be able to handle shift keys aswell, these are sent as status information with each key.

In the new Kyru software version, each key is handled independently of the other keys. This means thatmore than one key can be pressed and detected at once and, in particular, that the shift keys are notgiven special treatment. They are signalled as normal key codes and must be processed appropriatelyin the OEM-DLL. The advantage is that the keys can be defined in anyway by the OEM-DLL.

This is dealt with by having two separate OEM-DLLs, one for each firmware version. In this way,execution remains transparent to both sides (Kyru task and OEM-DLL). The OEM customer only has toadapt one DLL to special assignments as long as he knows that a certain firmware has been used.

Which DLL is loaded depends on the firmware and some entries in the file SIN840C.INI(see Section 3.5).

The [DLL] section defines which firmware is used and which DLL is loaded.

Page 112: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-92 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Example:

[DLL]OldKyru=c:\mmcwin\pc\oldkyru.dllNewKyru=c:\mmcwin\pc\newkyru.dllDetect=auto

OldKyru and NewKyru define the DLL which is loaded. If it is not found or cannot be loaded thespecified default DLLs are loaded. Detect defines how to decide whether the DLL is loaded. automeans that the software asks the Kyru firmware automatically and receives information that is uses todecide whether it is the old or the new firmware and loads the appropriate DLL. fixold or fixnew canalso be entered here as an alternative then the specified DLL is loaded. However, if fixnew is enteredwith old firmware, no DLL is loaded and the operator panel keyboard is not functional. This entry isintended for special cases in which a new Kyru firmware is used but is not detected correctly by theauto setting.

3.4.6 Data manager

A special data manager (DATENMAN.EXE) has been developed for managing the NCK/MMC data inthe 840C OEM Version for Windows.

It has the following special features:

• NC data management is workpiece oriented.

• The machine operator can only access NC data.

• The data management supports individual enables and disables for functions and file types. Theenables and disables can be defined to depend on the cycle disable, the position of thekeyswitch and the password levels.

• The operator need not concern himself with the PC drives and directories.

• The data manager supports reading in/out of NC data via the serial interfaces.

• An editor for editing NC files is integrated in the data manager.

• The data manager can also be expanded by entering as many directory paths as are required inthe SIN840C.INI (see Section 3.5) file (e.g. network drives, local directories, diskette drives).

• In the same way, the data manager supports the selection and transfer of workpiece data withthe NCK data selector.

• Workpiece data can also be transferred via DB 37.

The file date format in the left list box of the data manager can only be changed in the Windows controlpanel. This is done by entering the appropriate date format (short date format) in the internationaloptions. The date format can therefore be changed by the user and is entirely language-independent. Itis also identical to the format used throughout the system.

Page 113: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-93SINUMERIK 840C OEM Version for Windows (BN)

It is also possible to select the previous date format in which each month is output as text. This settingis made by an entry in the SIN840C.INI (see Section 3.5) file:

[Datenman]Date=Name

If the above entry is not made, the international settings of the control panel apply. The languagesetting is entered in the SIN840C.INI file:

[Datenman]LBspeech=1

The codes for the individual countries are:

1: Germany2: England3: France4: Italy5: Spain

However, only 5 standard languages can be selected with these entries.

The machine-tool manufacturer can also define his own job list which is automatically created with eachnew workpiece. The associated template which can be changed as required is also stored in directoryC:\MMCWIN\PC and is called:

JOBLISTE.TXT

The "clock" (UHR.EXE) must have been started if data protection via the keyswitch and cycle disable isto function correctly. The "clock" usually starts automatically during start-up with the fileREG_AUTO.CFG (cf. Subsection 3.4.3.4)

3.4.6.1 Reading files in and out

Data can be transferred to and from the peripheral devices via the serial interface using the datamanager. The device names that have been declared active in the service program "ParameterizationV24" are displayed in the right-hand combo box of the data manager and can be selected for datatransfer.

The data manager uses another service program (SERCOM.EXE) for transferring the data, whichinitializes the serial interface and actually transfers the data. V24 data transfer in TAPE format can alsobe started with File....Run or from any Windows application.

The command syntax for this task is:

<Drive>:<Path>\SERCOM.EXE <Workpiece/program name>-<w,p> -<i,o> device<n>

The meaning of the individual parameters is:Workpiece/;.program:

Full path of workpiece/program to be read out; only the workpiece name has to be enteredwhen reading in.

-w Output of a workpiece

-p Output of a program

-i Data input

-o Data output

Page 114: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-94 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

device<n>:The serial interface is initialized for the nth device defined in INI file PAR_V24.INI.The parameters are defined in PAR_V24.INI with application "Parameterization V24".

Example: c:\mmcwin\pc\sercom.exe c:\local\tisch -w -o device1:

Caution:

• Data transfer cannot be initialized more than once. The call of a second instance of SERCOM.EXEis not supported.

• When data transfer is completed, broadcast message UMSG_V24STATUS, LParam=False is sent.

• Data transfer can be aborted with the broadcast message UMSG_V24BREAK.

• When data transfer is completed, i.e. when the ETX character has been sent, two more scratchcharacters (80h, C0h) are output, as is the case with other standard Windows programs(TERMINAL.EXE).

• After completion of data transfer to the control, WINDOWS does not change the RTS signal to"LOW". The external sender is given the impression that the control is ready to receive. Therefore,when transferring data to the NC, first the NC (receiver) and then the external device (sender) mustbe started.

When reading in data it is possible to select either overwrite, append or skip mode. This selection ismade by an appropriate entry in the SIN840C.INI (see Section 3.5) file.

[input]writemode=userselect

One of the entries, "userselect", "overwrite" or "append" can be selected under the keyword"writemode" (cf. SINUMERIK 840C OEM Version for Windows, Operators Guide):

userselect:If the data to be read in already exist in the root directory, the user is asked interactively whetherhe wishes to append, overwrite or skip (default setting) the file that already exists

overwrite:If the data to be read in already exist in the root directory they are always overwritten withoutconfirmation.

append:If the data to be read in already exist in the root directory they are always appended withoutconfirmation.

Caution:

When reading in machine data always check that not the clipboard but a different directory isselected in the left-hand data management combo box. The data are always automatically readinto the clipboard.

Page 115: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-95SINUMERIK 840C OEM Version for Windows (BN)

3.4.6.2 Editor "WEdit"

"WEdit" is a text editor for user-friendly creation and editing of NC files (cf. SINUMERIK 840C, OEMVersion for Windows, Operator's Guide). The editor is preset in INI file SIN840C.INI (see Section 3.5).If no entries are made in this file or the value entered is illegal, the default value is activated. Theentries are evaluated when the editor is called. Entries made at a later stage do not therefore affect theeditor if it has already been started but only when it is called again.

The following entries can be configured in SIN840C.INI (see Section 3.5):

[WEdit]

Identifies the beginning of the editor entries in SIN840C.INI

Position=0,40,640,448,25

Position of the window when the editor is called once. Coordinates:xa, ya, xe, ye, hs: upper left-hand corner xa, ya; lower right-hand corner xe, ye, height of the statusline.

The specification of the X and Y coordinates refer to the entire editor window including Status line. Theeditor calculates the size of the individual picture elements from the specification. If the specification ofthe status line height is missing, it is assumed that the status line is not to be displayed.Default: application area

Position1=0,40,320,448, 25Position2=320,40,320,448,25

Position1 and position2 identify the positions and height of the status line of the individual editors whenit is called twice.Default: half of the application area

Backup= on/off

Switches the backup function on/off. If "on" is selected a backup copy (.BAK file) is automaticallycreated. This entry can also be changed via the dialog box "WEdit - General options. Default=on

BackupMessage= on/off

Displays a dialog box the first time the editor is called if a backup copy exists. Default=off.

InsertMode= on/off

Specifies the input mode that is active when the editor is active.On=Insert mode, off=Overwrite mode. Default=on.

This entry can also be changed via the dialog box "WEdit - General options".

FirstBlockNumber=0..9999

The first block number generated with automatic block number generation.Default=1000.

Page 116: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-96 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

BlockIncrement=1...1000

The numerical value by which the block number is increased.Default=10.

BlockNumberSize=2...4

Number of digits in the generated block number. If the number of places is smaller than the definedBlockNumberSize, the number is filled up with leading numbers.Default=4.

The entries "FirstBlockNumber", "BlockIncrement" and "BlockNumberSize" can also be edited viadialog box "WEdit - Block number option".

Note:

In SW 6 and higher, WEdit is compatible with older SW versions, but it is possible to configure WEditvia SIN840C.INI (see Section 3.5) as follows:

[WEdit]CrLf=AUTO

Default setting; Wedit is automatically adapted to the source file

or

CrLf=LF_ON

WEdit only ever adds LF at the end of a line when a file is stored

or

CrLf=CRLF_ON

WEDIT always adds CR and LF at the end of a line when a file is stored

Since the WEdit must be compatible with the NCK/PP editor, it uses the NCK character set of thepreset language instead of the ANSI character set. If a file is created with a standard editor underWindows (e.g. notepad) and if this file contains special characters (allowed in the comment only), thesewill not be displayed correctly in WEdit! By single conversion (menu: file/convert) the special charactersare converted so that they are displayed correctly in WEdit. It is not advisable to process the file againwith a standard editor under Windows! If a file is created with a standard editor under DOS (e.g. Edit),the set character table must be observed. The following character tables are compatible with the NCKcharacter set:

Language (s) Character table

english, deutsch, français,italiano, español, svenska

437

cesky 852

português 860

Note:

In SW 6 and higher, WEdit offers the help function known from other Windows applications. Thatmeans, if the cursor is placed on a word and the "i" key pressed, help on this term is offered. Each usermust create his own help file and enter it in the SINU840C.INI (see Section 3.5) as follows:

Page 117: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-97SINUMERIK 840C OEM Version for Windows (BN)

Screen

write

read

Printer

convert

Page 118: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-98 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

[WEdit]Helpfile=<drive:\path\filename>

E.g.: c:\mmcwin\pc\wedit.hlp

3.4.6.3 Expansion options

In contrast to the Basic Version, in the Windows Version any directory paths can be integrated in the"root directory" of the data manager.

The initial setting provides only one subdirectory C:/LOCAL at the top level of the data manager forstoring workpieces. Workpieces are themselves subdirectories in which all the data required forproducing a physical workpiece can be stored. When a workpiece is created it can be assigned anyname with a maximum of 8 characters. The names of the workpieces stored on the hard disk indirectory C:/LOCAL are enclosed in square brackets [...].

This default setting can be changed by the OEM user by making the following entries in theSIN840C.INI (see Section 3.5) file:

Section:[Datenman]

Entries Examples

User[No.]=<name>;<path>...

Entry for convertingthe root directory"USER" into a virtualdrive by specifying asubdirectory (indexedby Nr.).The default setting is:User1=local;c:\local.Directory NCK for theNCK data selector isalways additionallygenerated.

User1=cycles;c:\cycleUser2=loc_flex;

c:\mmc.01\user.005\local.063

User3=netz;k:\local

The directories,cycles, nck, localand loc_flex aredisplayed, wheredirectory k:\local ison a different drive(e.g. network drive).Directory loc_flexindicates the work-piece directoryunder FlexOS.

Note:

• If several entries are made, the numbers under User must be entered in ascending order withoutgaps.

• Workpieces that are stored in a directory other than C:\LOCAL are displayed in the combo box ofthe data manager. The workpiece name is given the extension <name> after the square brackets(not <path>). Examples: [...]-netz, [...]-loc_flex, [...]-cycles etc.

The following can therefore be performed with the data manager:

• The data manager can be based on any path or the root can be extended by any number ofsubdirectories. In addition to diskette drives, the OEM user can also include network drives andFlexOS directories in the data manager.

Page 119: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-99SINUMERIK 840C OEM Version for Windows (BN)

• With the data manager it is easy to copy workpieces between a "remote computer" and the localhard disk. It is also possible to transfer workpieces from a "remote computer" directly to the NCKmemory or execute part programs from the "remote computer" (Execute from hard disk).

• As from SW 5 an additional list box in which the operator can select the required workpiecedirectory. The creation of new workpieces is possible in all workpiece directories - except those thatare located in the FlexOS file tree.

Up to and including SW 4 it was possible to create and delete workpieces only in the directoryC:\LOCAL.

• As from SW 5 part program that have been loaded in the NCK memory from these workpieces andedited there using the NC editor can be transferred back using the NCK function SAVE or SAVEAS.

• If entries for non-existent directories or drives are made under [Datenman] in the SIN840C.INI (seeSection 3.5) they are ignored by the system and not displayed in the combo box.

Caution:

• If a diskette drive is integrated in the data manager as a workpiece directory in SIN840C.INI andthen selected in the combo box, operation is slowed down if no diskette has been placed in the drive(waiting for timeout during display refresh).

The following special features apply to workpieces in a FlexOS directory:

• FlexOS workpieces are always displayed with the extension *.064. This is the standard identifier forworkpieces in the FlexOS file tree. This extension must also be specified when using DB 37.

• No new workpieces can be created in a FlexOS directory. Possible FlexOS workpiece directoriesare therefore not displayed in the list box for the selection of a new workpiece when a newworkpiece is created.

• FlexOS part programs can only be read with the editor "WEdit". They cannot be written or changed.It is therefore not possible to create any new part programs.

• FlexOS part programs/workpieces cannot be read in/out via V24 with the data manager (Remedy:First copy files to a Windows workpiece).

• In principle, processing of the job list of a FlexOS workpiece is possible. However, the FlexOS joblist must not contain a SELECT instruction. The NCK job pointer can only hold 8 characters. Thename of the selected workpieces could therefore be incomplete in certain circumstances (e.g.STANDARD instead of STANDARD.064)

As a result, the NCK functions, "Load the last active workpiece", "Save", "Job preselection" (whenthe last job to be loaded has to be loaded again) might function incorrectly.

Page 120: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-100 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.6.4 Access rights in data management

Like with the SINUMERIK 840C OEM Version for Windows interlocks can be configured in the datamanagement for functions such as copy, delete, edit etc. These enables or disables can be definedindividually to depend on the function to be executed and on the file type selected.

In this way, accesses to single files can be generally prohibited or restricted to a certain user group.

To configure the access rights, the following entries must be made in section [Datenman] of theinitialization file SIN840C.INI (see Section 3.5):

[Datenman]<function identifier>=<mask>

Function identifier:

The function identifier specifies the function whose default interlocking is to be replaced.

Example: PartToPart (Function identifier for copying workpieces to workpieces)

To achieve interlocking which is independent of the file type, a file-specific function identifier can becreated based on a general function identifier.

Example: <file short code>ToNC

The file short code are the first three letters of a filename (e.g. spf, zpf, mpf, tea, job, etc.). The fileshort code is not restricted to possible NC file names. Individual short codes can be used (e.g. why,if the associated file name is why_not).

Mask:

The mask specifies a decimal number that is interpreted by the data management as a bit mask.The individual bits in this bit mask enable or disable the function associated with the functionidentifier.

If a bit is set in the bit mask, the function for the corresponding level is enabled. Several bits in amask are ORed except for the cycle disable (which is ANDed).

If this bit is set, the data management evaluates the interface signal "cycle disable". The functioncan only be executed if the interface signal is not pending, i.e. it set to zero.

The following table shows an overview of the meanings of the individual bits of a mask:

Bit Function Example Value0 Cycle disable 1 11 Free 02 Keyswitch position 0 03 Keyswitch position 1 1 84 Keyswitch position 2 1 165 Keyswitch position 3 06 Free 07 Password level 1 1 1288 Password level 2 09 Password level 3 1 51210 Password level 4 011 Password level 5 012 Password level 6 0

=665

Example: 665=01010011001

Page 121: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-101SINUMERIK 840C OEM Version for Windows (BN)

The function is enabled if the keyswitch is in position 1 or in position 2 or the password for level 2 orfor level 4 has been entered and the interface signal "cycle disable" is not pending.

The specification of the read and write rights in the status line of the data management are alsoaffected by the above enables and disables. The following is displayed in the status line depending onthe position of the focus:

• Focus is on the combo box:

- Write right, if files can be copied to the selected directory.

- Read right, if the function edit is allowed for at least one file of the directory.

If the above conditions are not fulfilled no rights are displayed.

• Focus is on the list box:

- Write right, if the selected files can be deleted or, for NCK system files, copied.

- Read right, if the selected files can be edited.

If the above conditions are not fulfilled no rights are displayed.

Note:

Appendix A3 shows a list of all possible function identifiers and their default settings. The datamanagement is based on the default settings if the file SIN840C.INI (see Section 3.5) does notcontain any entries.

3.4.6.5 The NCK data selector

Using the data selector it is possible to access the workpiece data on the hard disk or the data on acomputer in the network from the NCK area Machine.

The default setting displays a root directory in the NCK data selector which initially only contains theentries LOCAL and NCK. Directory NCK is a virtual directory with which the NCK data selector canreturn to the NCK directory tree. LOCAL is the directory C:\LOCAL. No other directories or files of theroot level of the MMC are displayed in the NCK data selector default setting.

This default setting is now extended by the directories defined in SIN840C.INI (see Section 3.5). Inaddition to the standard "directories" LOCAL and NCK, these directories are now also displayed with<name>, e.g.:

LOCALNCKCYCLESLOC_FLEXNETZ

This gives the OEM user the following advantages:

• The OEM user can now include the network drives and FlexOS directories as well as the diskettedrives in the data selector. Workpieces can now be selected transparently from the "network" or"run-in" part programs can be backed up on the "remote computer".

• The data selector now displays all the files in each directory.

• If the data selector refers to a workpiece in a FlexOS directory, only the files with NCK data typenames and JOB and PATH files are displayed.

Page 122: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-102 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

When selecting a workpiece directory, the user can recognize whether the workpiece in questioncontains a job list and path files (e.g. for "Execution from external or from network") or not.

If an error occurs in the interpretation of the entries in the SIN840C.INI (see Section 3.5) file, an errormessage is output and displayed by the NCK in the NCK data selector window.

Error message When Causeno_drive When selecting the sub directory on the

MMCThe defined drive is illegal

Syntax! When selecting the root directory on theMMC

The syntax specified in the tableabove has not been followed

no_dir When selecting the sub directory the onMMC

An illegal directory has been selected

3.4.6.6 Data handling via DB 37

PLC controlled data transfer using DB 37 is the same as for the 840C Basic Version but with thefollowing additional functions for the SINUMERIK 840C Version for Windows.

1. RS 232C (V.24) handling

The control of data input/output is fully compatible with the 840C Basic Version. Here, the interfacenumber defined by the PLC is interpreted as a device number so that up to 10 devices can be selected.

Unlike the 840C Basic Version, input/output can be aborted in the OEM Version for Windows. Theidentifier for abort must be entered in DW 1 of DB 37 for this.

A value range (e.g. several part programs) can also be specified in DW 4 and DW 5 for data output.

Job lists are not processed on data output.

2. COPY function

As the data manager can now be expanded to any number of directories, it is now also possible to copya workpiece_1 (e.g. from the network drive) to workpiece_2 (e.g. to the local hard disk) with the help ofDB 37. For this, the following points were added to the assignment of DB 37 for the 840C OEM Versionfor Windows:

DW 1.11- Data copy

Start copy procedure

DW 2 - DW 7

- As before

DW 8

- Device type - sourceHard disk, user directories = 0

Page 123: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-103SINUMERIK 840C OEM Version for Windows (BN)

DW 9

- Device number - sourceHard disk, user directories = 0

DW 10 - DW 15

- Workpiece name - sourceWorkpiece name (12 bytes)Syntax: <workpiece name>#<user no.> The user no. defines the directory that has been "mounted"in the root of the data manager in SIN840C.INI (see Section 3.5). If no user no. is specified, theworkpiece name refers to directory C:\LOCAL.

DW 16

Device type - destinationHard disk, user directories = 0

DW 17

Device number - destinationHard disk, user directories = 0

DW 18 - DW 23

Workpiece name (12 bytes)Syntax: <workpiece name>#<user no.>The user number defines the directory that has been "mounted" in the root of the data manager inSIN840C.INI (see Section 3.5). If no user no. is specified, the workpiece name refers to directoryC:\LOCAL

Caution:

• The DB 37 expansions can only be used with the Windows version. If they are used in the 840CBasic Version an error is signalled to the PLC.

• The function "COPY" can only be used with device type "hard disk" and "user directory". Otherassignments (e.g. V24 interface, computer link, file transfer) are returned with the error ID "Functionnot allowed" (4FH).

• Workpiece source and workpiece destination must be different. If they are not the error ID "protocolerror" (44H) is returned.

• If data type "Job" (DW 2 - DW 3) is used all the files in the workpiece are copied. The job list is notprocessed.

• If the interface is assigned from DW 16 but one of the identifiers "Data start output" or "Data startinput" is set, the entries for the destination are ignored.

3. Workpiece selection

If a workpiece is selected and a job list exists, the data manager is called up on the screen and currentprocessing displayed.

If a workpiece/program is selected via DB 37, the user no. can be entered behind the workpiece name -as is the case with the COPY function - and workpiece/program selection performed by a directory"mounted" in the SIN840C.INI (see Section 3.5) file.

4. "New workpieces"

If a workpiece that does not yet exist is to be copied, it is created.

Page 124: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-104 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5. Acknowledgment

On a negative acknowledgment, the following error IDs in DW 7 are signaled to the PLC:

44 H

Protocol error- workpiece/file name not allowed- illegal user ID (entries for user directories in SIN840C.INI, see Section 3.5)

12 H

Part program/workpiece does not exist- workpiece/file to be output does not exist (MMC -> V24, MMC -> NCK)

22 H

Interface assigned- MMC <--> V24: Interface currently assigned

4F H

Function not allowed- illegal device ID, device number

Page 125: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-105SINUMERIK 840C OEM Version for Windows (BN)

3.4.7 V24 parameterization

SINUMERIK 840C OEM Version for Windows provides its own application (PAR_V24.EXE) for settingand managing the initialization parameters for the serial interfaces. The size and position of theapplication window can be modified by an entry in the SIN840C.INI (see Section 3.5) file.

[PAR_V24]Position=0,42,639,447

The application also has its own initialization file PAR_V24.INI in which the interface parameters formax. 10 devices can be stored. These V24 initialization parameters can then be evaluated by otherprograms (e.g. DATENMAN.EXE, SERCOM.EXE) as required. The structure of file PAR_V24.INI isbased on that of the "Parameterization V24" dialog box.

[PAR_V24]

COM1=TRUE

COM2=TRUE

COM3=TRUE

COM4=TRUE

DEVICE1:=PG750=on,COM2,9600,N,8,0,R,N,0,1,0,N,N,11,13,03,60

DEVICE2:=LAPTOP=on,COM2,19200,N,8,0,R,N,0,1,0,N,N,11,13,03,60

DEVICE3:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE4:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE5:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE6:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE7:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE8:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE9:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE1:=Standard=off,COM2,300,N,8,1,N,N,0,1,0,N,N,11,13,03,60

DEVICE10:=Standard=off,COM1,9600,N,8,1,N,N,0,1,0,N,N,11,13,03,60

The values next to the entries DEVICEn correspond to the following entered parameters:

Standard=on/off: Device: Active/not active. Only the active devices are released by the datamanager for data input/output

COMn: Interface number

300,...,115000 Baud rate

N, O, E: No, uneven, even parity

7, 8: Number of data bits: 7, 8

0, 1, 2: Number of stop bits: 1, 1.5, 2

N, R, X: No protocol, RTS protocol, XON/XOFF protocol

Y, N: DSR/DTR evaluated: Yes/no

0, 1: Read-in stop on: End character, M02/M30

1: Tape format

0, 1: End of block character: CRLF, LFCRCR

Y, N: Start with first XON: Yes, no

Y, N: Output of leader, trailer: Yes, no

11: XON character

13: XOFF character

03: End of transmission character

60: Time monitoring in secs.

Page 126: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-106 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.8 Softkey manager

The softkey manager (SOFTMAN.EXE) allows you to operate all the standard Windows applicationsvia softkey provided you have a menu list and dialog buttons. The menus must also be situated in themain window of the application and the buttons must be derived directly from the main window(subordinate windows). It is not possible to display menus and buttons at the same time.

The softkey manager reads the names of the menus and buttons from the window currently active anddisplays them on the softkey bar. If there are more than 7 items in the menu bar or dialog box thesoftkey bar is simply extended (ETC key).

If one of the softkeys is pressed, the softkey manager intercepts the Windows message in question andinstead sends a message with the associated hot key of the menu item or dialog button to the activeapplication.

The softkey manager is started per default by the REG_AUTO.CFG on start-up. It can be called at anytime with the parameters ON or OFF. This switches the softkey bar on or off. If no parameters arespecified when the softkey manager is called, it is possible to toggle between ON and OFF.

With an appropriate entry in the SIN840C.INI (see Section 3.5) file other application windows can beput on top of the softkey bar.

[softkeys]topmost=on/off

With the following entry, the function of the RECALL key (F2 key) can be altered.

[softkeys]F2Hook=On/Off

On:The RECALL key (F2 key) opens and closes the system menu of an application. It also closes an openpop-up menu. The RECALL key is filtered out and can no longer be used for other applications.

Off:The RECALL key is not filtered out and can be evaluated by all applications.

Note: Buttons are only automatically displayed in the softkey bar if both the class name of thedialog containing the buttons is "CDialog" (Visual C++ standard) and the class name of thebuttons used is "button" (Visual C++ standard).

If the class name of the dialog is not "CDialog" and that of the buttons is not "button", thefollowing steps are necessary:

1. Find out the class names of the dialog or buttons (e.g. with a suitablehelp program, SPY....)

Page 127: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-107SINUMERIK 840C OEM Version for Windows (BN)

With softkey manager 6.3 and later, the following analysis can be made to determine whichentries are necessary:

− Set up file SOFTMAN.INI in c:\mmcwin\pc with the following content[Diagnosis]Type=1

− After the control has booted, call the application whose switches are not displayed on the softkeymenu and then view the contents of file SOFTMAN.INI, e.g.:[Diagnosis]Type=1 [DlgWndName] Name0=ThunderForm Name1=AfxWnd [ButtonName] Name0=Static Name1=Static

− This means that DialogWnd=ThunderForm must be inserted in file SIN840C.INI.− Boot the control system again and call the application whose switches are not displayed in the

softkey menu. The content of SOFTMAN.INI is then, for example, as follows:[Diagnosis]Type=1 [DlgWndName] Name0=AfxFrameOrView Name1=AfxWnd [ButtonName] Name0=Static Name1=Static Name2=ThunderCommandButton Name3=ThunderCommandButton Name4=ThunderCommandButton Name5=ThunderCommandButton

− When the relevant switch name is added in SIN840C.INI, the application switches are displayed inthe softkey menu.

− If you do not want the switches in the softkey menu (e.g. applications created using Visual BasicVersion 4.0 (16 Bit)), you may need to determine the window style (GwlStyle) and enter it in INI fileSIN840C.INI (GwlProfile). SOFTMAN.INI then contains, for example, the following section:

[GwlStyle]Style0=0x40002000

CAUTION: When you have finished the analysis, please DELETE file SOFTMAN.INI again orset type=0 in order to DEACTIVATE the diagnostic function!!!

2. You must make the appropriate entries for the dialog and/or buttonclasses used in section [softkeys] of file SIN840C.INI (see Section 3.5).

Page 128: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-108 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

In total, three entries with 80 characters each are available for each of the used dialog and switch classnames and window styles. The individual names/styles of each entry must be separated by a comma orblank. The entries are evaluated by the softkey manager.

Example:

[softkeys]DialogWnd=bordlg ThunderForm ...DialogWnd1=...DialogWnd2=...ButtonClass0=BorBtn ThunderCommandButton...ButtonClass1=...ButtonClass2=...GwlProfile=0x40002000 ...GwlProfile1=...GwlProfile2=...

Example: The buttons for the Visual Basic test program TACHO.EXE (part of the OEM testenvironment) are only displayed on the softkey bar if the "class name" has been entered inthe SIN840C.INI (see Section 3.5) file as follows:

[softkeys]ButtonClass0=ThunderCommandButton

The font on the softkey bar can be determined with the entries "FontStyle", "Font" and "Fontsize":

FontStyle: Font style on the softkey buttons (bold, normal)Font: Name of the Windows font used for labeling the softkeysFont Size: Font size

Owner draw buttons (SW 6 and higher)

By means of the "OwnerDrawButton" entry, the user can influence the following:

OwnerDrawButton=1: OwnerDrawButtons are processed, that means displayed on the softkey bar(default setting)

OwnerDrawButton=0: OwnerDrawButtons are ignored and thus not displayed on the softkey bar.

Page 129: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-109SINUMERIK 840C OEM Version for Windows (BN)

3.4.8.1 Setting/deleting characters in the RECALL field

With SW version 6.4 and later, the softkey manager enables you to set and delete any character in thesoftkey menu. In this case, the individual fields are operated by the message UMSG_POKE_SKTXTwith parameters wParam and lParam.

wParam: 0xFF0N

FF= Color (see also Subsection 3.4.4.8 Color settings for NCK task and alarm/message line (systempallets

N=Softkey number 1..11

RCL SK1 SK2 SK3 SK4 SK5 SK6 SK7 INF

1 102

3 4 5 6 7 8 911

[M] ETC

lParam: Pointer to ZERO-terminated text to be displayed. Only one character can be displayedin each of the fields 1, 2, 10 and 11!

The text font can be determined by entries "ExtFontStyle", "ExtFont" and "ExtFontsize" in Section[softkeys] of file SIN840C.INI independently of the softkey menu:

ExtFontStyle: Font style of text to be set (bold, normal = default)ExtFont: Font name (e.g.: NCK Font = default) with which texts are displayed.

Here you must specify the font containing the character that you wish to display!ExtFontSize: Font size (default = 12)

The following example sends a message to the softkey manager to set the RECALL character in theRECALL field of the softkey menu.

WORD UMSG_SetSk;HWND hSKWnd;HGLOBAL hglb;void FAR* lpvBuffer;

UMSG_SetSk=RegisterWindowMessage ("UMSG_POKE_SKTXT");//...hglb = GlobalAlloc(GMEM_SHARE, 2);lpvBuffer = GlobalLock(hglb);_fstrcpy (lpvBuffer,"\x1E"); //RECALL character (30 in NCK Font)hSKWnd = FindWindow("SOFTMAN", ZERO);if (hSKWnd != ZERO){ //(WPARAM) 0x4401: 1=RCL-Feld, 44=Color of pallet entry (68->CLUT entry 1=red) SendMessage(hSKWnd, UMSG_SetSk, (WPARAM) 0x4401, (LPARAM) lpvBuffer);}GlobalUnlock(hglb);GlobalFree(hglb);

To delete the RECALL character, you need only send an empty string.

Page 130: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-110 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.8.2 NCK font

The NCK font is the same as the DOS standard fonts.

Code page Language437 deutsch, english, français, italiano, español, svenska852 cesky860 português

With the following deviations

Character NCK font16 ETC20 Info23 LF (part program editor)24 Tick25 Blank cursor (NC part program editor)30 Recall

3.4.8.3 Operating the softkey menu with an external keyboard

Field Name Number Fct. key RemarksRCL Recall 1 F2 System menu (F2Hook=ON)[M] Machine 2 Not activated by keyboard!SK1 Softkey 1 3 F3SK2 Softkey 2 4 F4SK3 Softkey 3 5 F5SK4 Softkey 4 6 F6SK5 Softkey 5 7 F7SK6 Softkey 6 8 F8SK7 Softkey 7 9 F9INF Info (Help) 10 F1 To application (F1Hook=ON/OFF)ETC More softkeys 11 F10 Extension of softkey menu

[softkeys]F1Hook=On/Off

On:The Info key (F1) acts on the INF field in the softkey menu. The Info key is not filtered out and is thusavailable to other applications.

Off:The Info key is not filtered out and can be evaluated by all other applications.

3.4.8.4 Operating the softkey menu with the mouse

With SW version 6.4 and later of the softkey manager, it is possible to operate the softkeys with the leftmouse button. To do this, set entry Mouse=ON in section [softkeys] of file SIN840C.INI. The defaultsetting is Mouse=OFF.

Page 131: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-111SINUMERIK 840C OEM Version for Windows (BN)

3.4.9 Clock

The clock (UHR.EXE) is an independent application which displays the RTC (real-time clock) systemtime and 3 icons in the top right-hand window area. As a standard setting, UHR.EXE is started by thefile REG_AUTO.CFG during start-up. Other application windows can be placed on top of the clock ifthe relevant entry has been made in the SIN840C.INI (see Section 3.5) file.

[clock]topmost=on/off

The clock is also involved in the execution of the following functions:

• Starting and stopping applications on PLC initiative.

• Refreshing the icons

• Central evaluation of data protection: Cycle disable and keyswitch.

3.4.10 Watchdog

The "sign-of-life" from the NCK and the PLC are monitored by a separate watchdog application(WATCHDOG.EXE). This application always runs in the background and can therefore not be selectedfrom the Windows task manager.

Sign-of-life generation on the MMC side is executed by the DOS TSR program MPR_INIT.COM whichis loaded on initial start before Windows is started. The watchdog simply monitors the sign-of-life trafficand displays a message window in the absence of a response from the NCK or PLC.

3.4.11 Access protection

Graded access protection of the MMC is a new feature of Software version 5.1. This function allowsindividual disabling and enabling of functions, applications and files. The password protection used untilnow (Software version <= 4.6) has been expanded to 6 possible password levels. Access rights areconfigured by making the appropriate entries in the initialization files SIN840C.INI (see Section 3.5) andREGIE.INI.

Not all of the maximum of six possible password levels have to be assigned. The enabling andassignment of password levels to NCK password are also implemented in file SIN840C.INI(see Section 3.5).

Page 132: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-112 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.11.1 Password management

The 6 password levels are managed as before using the application password (KENNWORT.EXE).

• Setting the password

Fig. 3.13: Entering the password

The operator can select his log-on ID, in the example, "Big Brother", from a list box and enter theassociated password in an entry field. These actions can be performed in any order.

When the dialog box above is first displayed the focus first points to the entry field for the password sothat the operator can enter his password. The function has been implemented in this way becauseusually passwords are entered much more often than log-on IDs changed.

The focus can be switched between the list box of log-on IDs and the entry field for the password withthe <Tab> key.

The log-on IDs are set up in file SIN840C.INI (cf. 3.4.11.2) (see Section 3.5). If no password levelshave been defined the system sets up one password level - in keeping with previous software version.The log-on ID that is displayed in the list box is then the NC password and the default password is1111.

Page 133: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-113SINUMERIK 840C OEM Version for Windows (BN)

• Deleting the password

Fig. 3.14: Deleting the password

The operator can select his log-on ID in a list field using the cursor keys in the dialog "Deletepassword". As soon as he has selected the button "OK" the password is deleted, i.e. access rights forthis password level are reset.

The NCK password is not cleared, i.e. the right to manipulate certain data in the NCK/PLC is not reset,until the associated password has been deleted on all the password levels that are linked to the NCKpassword.

To provide the greatest possible compatibility with previous software versions the dialog box "Deletepassword" is not displayed until at least two password levels have been set up. If only one passwordlevel exists a dialog box is not displayed.

• Changing the password

Fig. 3.15: Changing the password

The operator can select his log-on ID in a list field using the cursor keys and change the associatednames in the other input fields in the dialog "Change password". These steps can be performed in anyorder.

The log-on IDs for the operator, installation engineer etc. are defined in file SIN840C.INI(see Section 3.5). If no password levels have been defined the system automatically sets up a singlepassword level with log-on ID, "NC password" and the associated password 1111.

If passwords are changed they are automatically written into file SIN840C.INI (see Section 3.5) by thepassword application.

Page 134: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-114 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.11.2 Setting up the password levels

The individual password levels for the operator, installation engineer, etc. must be set up in initializationfile SIN840C.INI (see Section 3.5) in directory C:\MMCWIN\PC. The following entries must be made foreach password level in section [PassWord]:

[PassWord]PW[level]=[log-on ID];NCK=[enable]

Level=1...6

Numbering of the password level from 1 to 6, illegal numbers are ignored.

Log-on ID=Text

Text that appears in the list box as the log-on ID.

Enable=ON/OFF

If the NCK password is to be enabled for a particular password level, i.e. the user is to be given theright to change NCK/PLC data, NCK=ON must be set, otherwise OFF is set.

The NCK applications only recognize one password level, i.e. users with NCK=ON have identicalrights as far as access to NCK/PLC data is concerned.

If an entry is incorrect or incomplete the password level in question is not evaluated.

Any new passwords entered by the user in the "Change password" dialog are automatically written intofile SIN840C.INI (see Section 3.5) by the password application. The entries for this are:

PassWord[level]=[key]

Level: Number of the password level

Key: Password entered

The size and position of the password application window can also be altered by an entry in fileSIN840C.INI (see Section 3.5).

[PassWord]Position=0,42,640,447

Page 135: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-115SINUMERIK 840C OEM Version for Windows (BN)

3.4.12 FDD/MSD service display

This application reads the most important service data of a connected, digital feed drive (SIMODRIVE611D) and visualizes it in a display. The application is both part of the OEM package and permanentlyintegrated in the control.

The following entries are made in SIN840C.INI (see Section 3.5):

[VSAHSA]Position=0,42,640,447

This entry defines the size and position of the application window.

It is also possible to define whether the FDD (VSA) or MSD (HSA) service display is to appear on thescreen after a successful start-up. For this, the following entry must be made:

[VSAHSA]START=VSA | HSA

VSA: Start with the FDD service display (default).HSA: Start with the MSD service display.

An entry can also be made for the error message display:

[VSAHSA]ShowError=Yes | No

Yes:If an error occurs during service operation a message box is displayed.

No: (default)The data item that cannot be read is marked with - * -. This affects all the drive data if the drive fails.The service data are displayed again as soon as the drive is ready.

Errors that occur while the application is being initialized are always displayed in message boxes.

3.4.13 OEM information

Under the menu Information of the Area switchover you will find the menu item OEM information. Ifthis menu item is selected, the contents of file C:\OEM\OEMINFO.TXT is displayed in the WEdit editorin read-only mode. The SIEMENS standard file is empty. The OEM user can enter any importantadditional information specific to his requirements in this file. He can also configure his own OEMvisualization by making an appropriate entry in the REGIE.INI file.

The sum software version is displayed in the software version overview when menu item Info/Info isselected.

Page 136: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-116 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.4.13 840C language concept

The integration of OEM applications into the 840C OEM Version for Windows control concept istransparent and uncomplicated. It is possible to integrate OEM applications that have been created witha variety of different Windows tools. The only common feature of these applications is therefore theWindows operating system on which they are based and its configuration.

The decision as to which system features are to be incorporated is left to the OEM developer. He caneither create applications that define their own operating features or he can develop applications thatuse the Windows operating features, e.g., menu control, menu box display and Windows systemmessages.

For an integrated language concept this means that the control will only use the chosen languageconsistently if the NCK texts, the texts of the MMC applications and the Windows system use the samelanguage.

Because each Windows system used occupies memory space on the hard disk, it might seem practicalto install only the English Windows version for the five basic languages English, French, German,Italian and Spanish. However, if OEM applications use Windows-specific system outputs or standardWindows applications (e.g. Windows control panel) the texts will be displayed in English.

For languages such as Russian which requires a Cyrillic character set and Asian languages such asChinese, Korean etc. which also have their own character sets, the relevant Windows version must beinstalled.

To avoid such problems, the relevant Windows directories and files are installed in the control for eachlanguage. On language change during control start-up, the relevant Windows version and language-dependent application programs are started.

Using the correct international Windows version also minimizes translation effort. Character sets nolonger have to be converted and defined. The original Windows character sets are used.

3.4.14.1 Change language

With Software Version 4.1 and higher, the control language is no longer selected in the boot menu butby the Windows application "Change language" (CHANGEL.EXE) which runs under "Diagnosis".

A new feature of Software Version 4 is the additional language change in the Windows operatingsystem which ensures that one language is used across the whole system. With this program it is alsopossible to change the languages of the OEM applications.

When a new language is installed (Windows, basic software and OEM applications) it is automaticallyrecognized and displayed by the program. The language change program does not therefore have tobe adapted in the various initialization files.

As from SW 5 menu item Services/Change language is no longer displayed as text but as a flag bar.This flag bar contains the national flags of the 5 standard languages (French, English, Spanish, Italianand German).

This has been implemented by entering a bit map for menu item "Change language" in initialization fileREGIE.INI (cf. 3.4.3.1). The standard bit map FLAGS.BMP can be changed at any time by another bitmap. If the entry for the bit map is removed, the text "Change language" appears again.

Page 137: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-117SINUMERIK 840C OEM Version for Windows (BN)

3.4.14.2 Method of operation

The following display appears when you select "Change language":

Fig. 3.16: Change language

"Current configuration" area:

The language settings of the active installed Windows operating system, the basic and OEMapplications are displayed. The settings are made in the following way:

Basic system:

The contents of file C:\MMCWIN\PC\THISLANG.TXT with the format: [<language>], e.g. [English], isoutput. To avoid any mistakes, the name used in the file should be the same as the one used in thesubdirectory.

The file THISLANG.TXT must be contained in all the language subdirectories with the relevant entry(i.e. [deutsch] in the German version, [francais] in the French version...). When the language ischanged, this file is copied into the current directory c:\mmcwin\pc together with the other files ofdirectory c:\mmcwin\pc\<language>, which allows the current language to be displayed.

OEM system:

The language is identified for the OEM applications in the same way as it is for the basic applications.The contents of file C:\OEM\THISLANG.TXT with the format: [<language>], e.g. [English], is output.

The OEM user must ensure that the file C:\OEM\THISLANG.TXT is contained in all the languagesubdirectories with the relevant entries. When the language is changed, this file is copied into thecurrent OEM directory c:\oem together with the other files of the OEM language directoryc:\oem\<language>, which allows the current language to be displayed.

Page 138: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-118 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Windows system:

First of all the current path to the Windows system is determined. This path is defined in fileC:\TOOLS\SETWPATH.BAT. This batch file is generated by the language change program and calledin the AUTOEXEC.BAT file during start-up.

"New configuration" area:

Here, the user can select a language from three list boxes:

List box "Basic system":

All the subdirectories of c:\mmcwin\pc that contain the program REGIE.TXT are displayed.

List box "OEM system":

All the subdirectories under c:\oem that contain a specific file are displayed. The name of the file mustbe entered by the OEM user in the SIN840C.INI (see Section 3.5) file in the following format:

[LANGUAGE]OEMFILE=...

This method ensures that no empty subdirectories are displayed.

List box "Windows system":

All the subdirectories of c:\ that contain the program WIN.COM are displayed.

Caution: An executable version of the Windows system must exist in these directories!

A cold restart of the system must be performed after the language has been changed. This is done bypressing the softkey "Restart". The master control starts system shutdown.

First of all the batch file C:\TOOLS\SETWPATH.BAT is generated and C:\TOOLS\CHANGEL.BAT iscreated if the basic language or OEM language has been changed.

On start-up, file C:\TOOLS\SETWPATH.BAT which defines the active Windows path is executed. If fileC:\TOOLS\CHANGEL.BAT exists it is also executed and subsequently deleted.

CHANGEL.BAT copies all the files from C:\MMCWIN\PC\<new language> to C:\MMCWIN\PC if thebasic language has been changed. C:\OEM\<new language> is copied to C:\OEM if the OEM languagehas been changed.

If the softkey "Abort" is pressed all the changes are rejected and the program is terminated.

3.4.14.3 Special features of initial start-up

When the control is started up for the first time the input screen form for changing the language isautomatically displayed. The change language application has been included in the boot fileREG_AUTO.CFG and started with the option ONCE (cf. 3.4.3.4). In addition, the applicationNCKTASK.EXE has been assigned the option WAIT.

If the change language form is also to be displayed after initial start-up, the entry FirstSession=Passedin initialization file REG_AUTO.INI in section [Regie] must be deleted.

Page 139: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-119SINUMERIK 840C OEM Version for Windows (BN)

3.4.15 840C directory tree

C: MMC.001 Flexos MMC systemMEM FlexosTMP FlexosBIN FlexosBOOT FlexosDRIVERS FlexosMMCSYS Flexos

TOOLS MS DOS tools (Valitek......)DOS MS DOS 6.22

WINDOWS WfW 3.11 (English version)WINDEU WfW 3.11 (German version)WINFRA WfW 3.11 (French version)WINITA WfW 3.11 (Italian version)WINESP WfW 3.11 (Spanish version)WININST Installation diskettes WfW 3.11 (English)

MD USER User MDMD STANDARD.M Standard MD M versionMD STANDARD.T Standard MD T versionMD TEMP Buffer for V24 read-in

LOCAL STANDARD Workpiece, loaded onto NCK during start-upLOCAL <workpiece name 1> Workpiece 1LOCAL <workpiece name n> Workpiece n

MMCWIN PC System programs 840 C WINMMCWIN PC DEUTSCH System programs GermanMMCWIN PC ENGLISH System programs EnglishMMCWIN PC FRANÇAIS System programs FrenchMMCWIN PC ITALIANO System programs ItalianMMCWIN PC ESPAÑOL System programs Spanish

CYCLE SIEMENS Siemens cyclesCYCLE USER User cycles

PCIN PCIN program package

OEM OEM applicationsOEM DEUTSCH OEM alarm text files German, OEM

applicationsOEM ENGLISH OEM alarm text files English, OEM

applicationsOEM FRANCAIS OEM alarm text files French, OEM

applicationsOEM ITALIANO OEM alarm text files Italian, OEM

applicationsOEM ESPANOL OEM alarm text files Spanish, OEM

applications

Page 140: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-120 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3.5 SIN840C.INI;*************************************************************************; SIN840C.INI, Version 6.4.01, 28.08.2000; This is a part of the Sinumerik 840 C.; Copyright (C) Siemens AG 1995-2000. All rights reserved.;-------------------------------------------------------------------------; Initialization SINUMERIK 840C Windows;*************************************************************************

[Alarm]; alarm display; -------------; window position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right cornerPosition=0,42,640,448; amount of alarms displayed at the alarm windowEntries=0; Top-Level Window ?Topmost=on; sorting alarms by priority or timeAlarmpriority=onMessagepriority=off; At the alarm database every alarm can get a helpfile number. This number is; used to get the right helpfile.; HelpfileX=<path><name>Helpfile1=offHelpfile2=offHelpfile3=offHelpfile4=offHelpfile5=offHelpfile6=offHelpfile7=offHelpfile8=offHelpfile9=off; Display the alarms and messages with the highest priority or page through the; alarm and message line; Alarmpaging=OFF; Messagepaging=OFF; the rate at which alarms/messages are paged can be set.; AlarmTime=2000; MeldeTime=2500; Advise mode 0: all alarms/messages are send to OEM (via DDE); 2: only new alarms/messages are send to OEM (via DDE); AdviseMode=0

[Language]

; Window Position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right corner; Position=0,42,640,448; All the subdirectories under c:\oem that contain a specific file are displayed.; OEMFile=<Filename>; OEMFile=[Kyru]; Key Request Unit; ----------------

Page 141: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-121SINUMERIK 840C OEM Version for Windows (BN)

; Defines whether the connection to the KYRU is to be monitored or not.Control=off; Defines the applications that are started when the key <machine> on the operator panel; is pressed.M=c:\mmcwin\pc\ncktask.exe Maschine; "on" means that the M key toggles between the machine application and the previously; active application whenever the M key is pressed.;ToggleM=off; Defines the applications that are started when <shift> <machine> on the operator panel; is pressed.ShM=c:\mmcwin\pc\ncktask.exe; "on" means that <shift> <machine> toggles between the machine application and the previously; active application whenever it is pressed.;ToggleShM=off; Defines the applications that are started when <data area key> on the operator panel; is pressed.D=c:\mmcwin\pc\regie.exe TaskSwitch; "on" means that <data area key> toggles between the "D="-application and the previously; active application whenever it is pressed.;ToggleD=off; Defines the applications that are started when <shift> <data area key> on the operator panel; is pressed.ShD=c:\mmcwin\pc\ncktask.exe LastActive; "on" means that <shift><data area key> toggles between the "ShD="-application and the previously; active application whenever it is pressed.;ToggleShD=off; Defines the applications that are started when <shift> <ETC> on the operator panel; is pressed.ShEtc=c:\mmcwin\pc\alarm.exe; "on" means that <shift><ETC> toggles between the "ShEtc="-application and the previously; active application whenever it is pressed.ToggleShEtc=on; Defines the applications that are started when <shift><large display> on the operator panel; is pressed.;SCR=; "on" means that <shift><large display> toggles between the "SCR="-application and the previously; active application whenever it is pressed.;ToggleSCR=off; Defines the application for which the "PgUp" and "PgDn" keys function as task switch keys.; If no entry is made the same application as is entered in "D=" is used.; Regie=; Is used as a debugging tool. "On" ensures that all the special key functions are output at the; debugging terminal;TraceExecute=off; It is possible to connect the operator panel to the COM2 interface of the MMC; Interface: Baud rate, ODD/EVEN, data bits, stop bits;Device=COM2:9600,o,8,1

[WEdit]; Editor;-------

Page 142: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-122 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

; Window Positions; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right corner; Position of the window when the editor is called oncePosition=0,42,640,448,25; Position 1 and 2 when the Editor is called twicePosition1=0,42,320,448,25Position2=320,42,640,448,25; Specifies the input mode (insert/overwrite) that is active when the editor is active (on/off)InsertMode=off; Switches the backup function. (on/off)Backup=off; Displays a dialog box the first time the editor is called if a backup copy exists (on/off)BackupMessage=off; The first block number generated with aoutomatic block number generation (0...9999)FirstBlockNumber=1000; The numerical value by which the block number is increased (1...1000)BlockIncrement=10; Number of digits in the generated block number (2...4)BlockSize=4; Entry new file open file;CrLf=AUTO line feed [LF] (default) [LF] --> [LF] /; [CRLF] --> [CRLF];CrLf=LF_ON line feed [LF] [LF] / [CRLF] --> [LF];CrLf=CRLF_ON carriage return and line feed [CRLF] [LF] / [CRLF] --> [CRLF]CrLf=AUTO; This entry is used to get the right helpfile.; WEdit can enable the user to search for help topics based on full; keywords (F1). If the topic is not found, Windows Help displays; an error message. If more than one topic has the same keyword,; Windows Help displays only the first topic.;Helpfile=c:\mmcwin\pc\wedit.hlp

[PAR_V24]; V24 parameterization; --------------------

; Window Position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right cornerPosition=0,42,639,447

[Datenman]; Data manager; ------------

;Meas./ syst. changeover Metric/Inch;MicConfig=c:\mmc.001\user.005\mdas.140\config.141;MicPath=c:\mmc.001\user.005\ibn.090\mda.019

;Fanuc-G Converter;FanucPP=EPF;Fa2SinExe=c:\mmcwin\pc\fa2sin_e.exe;Fa2SinIni=c:\mmcwin\pc\konvf_on.ini;Fa2SinExt=NWD

Page 143: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-123SINUMERIK 840C OEM Version for Windows (BN)

;Filetransfer control for COPY_TO_NC and COPY_FROM_NC commands;FileOverwrite=OFF means, the destination file with the same name will be overwrite

without any checkback.;FileOverwrite=ON means, if the destination file exists, the user will be asked, if he; will this file overwrite.FileOverwrite=OFF

; CALL - Instruction of the JOB-File disable;CALLOFF=1; Defines a Timeout value (in seconds) for the CALL - Instruction of the JOB-File;Timeout=60; Definition of User Directories; User<index>=<name>;<path>; for example:;User1=Net;h:\parts

;You can choose two possibilities in which format the date greater 2000 will be delivered;by I-Code 214:;With Entry YearGreater2000=FlexosCompatible you get 00 for year 2000, 01 for year 2001 and so on;With Entry YearGreater2000=NotFlexosCompatible you get 100 for year 2000, 101 for year 2001 andso on;The default value is YearGreater2000=FlexosCompatible.YearGreater2000=FlexosCompatible

;; It is possible to select a date format in which each month is output as text by;Date=NAME

; The access rights can be defined by; <functionname>=<Bitmask>; The Functionname determines for which function the default access rigths should be; changed. For example: PartToNc. Its possible to achive file dependent access rights; by using the first three letters of a filename to build a new filename like:; [shortform of filename]ToNc (for example mpfToNc, spfToNC, zpfToNc, teaToNC ...).; The bitmask (decimal) specifies the access rights:; Bit 0 = cycle; Bit 1 = -; Bit 2 = Key 0; Bit 3 = " 1; Bit 4 = " 2; Bit 5 = " 3; Bit 6 = -; Bit 7 = Password Level 1; Bit 8 = " " 2; Bit 9 = " " 3; Bit 10= " " 4; Bit 11= " " 5; Bit 12= " " 6; Function: "Delete";DelPart=144;DelMdUser=144;DelCycleUser=129;DelTemp=128;DelDisc=128; Function: "Delete" - standard file dependencies;Delika=128;Delgia=128;Deltea=128; Function: "Delete" - user specified file dependencies;Del[shortform of filename]

Page 144: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-124 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

; Function: "Copy / Duplicating";PartToNc=156;PartToNcData=152;PartToPart=152;PartToDevice=152;PartToDisc=152;PartToCycleUser=145;NcToPart=152;NcToCycleUser=145;NcDataToPart=152;NcDataToMdUser=128;MdStdToMdUser=128;MdStdToNcData=128;MdUserToPart=128;MdUserToNcData=128;MdUserToDevice=128;MdUserToDisc=128;CycleUserToNc=157;CycleUserToPart=153;CycleUserToDevice=153;CycleStdToNc=153;CycleStdToCycleUser=153;TempToMdUser=128;DiscToPart=144;DiscToMdUser=128;DeviceToPart=144;DeviceToMdUser=128; Function: "Copy / Duplicating" - standard file dependencies;ikaToNc=128;giaToNc=128;teaToNc=128;ikaToNcData=128;giaToNcData=128;teaToNcData=128;ikaToPart=128;giaToPart=128;teaToPart=128; Function "Copy / Duplicating" - user specified file dependencies;[shortform of filename]ToNc;[shortform of filename]ToPart;[shortform of filename]ToDevice;[shortform of filename]ToDisc; Function: "Edit";EditMdUser=128;EditTemp=144;EditMdStd=128;EditCycleStd=129;EditCycleUser=129; Function: "Edit" - user specified file dependencies;Edit[shortform of filename]; Function: "New"NewPart=152

[PassWord]

; Window Position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right cornerPosition=0,42,640,447

Page 145: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-125SINUMERIK 840C OEM Version for Windows (BN)

; Installation of password levels: PW<level>=<logon>;NCK=<validation>; Level: Number of the password level (1...6); Logon: Text is appearing at the listbox; Validation: ON - the NC-Password is set when the password of this level is set.; PW1=NC password;NCK=ON; Passwords of password level/s password=<combination>password<level>=<combination>; level: numbering of password level from 1 .. 6; combination: password;Password1=1111Password=1111

[NCDriver]

; I Code Protocol: i-Code 601; Since SW5.1 the i-Code 601 can supplied with the pathname of the file, so that the; NCK-system is able to determine where the file is coming from. (NEW/OLD); i_Code601=NEW

[plcstart]

; Starting an MMC application from the PLC. The number of possible entries is limited to 5; appX=<path><program name>app1=app2=app3=app4=app5=

[VSAHSA]; VSA and HSA; -----------

; Window Position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right corner;Position=0,42,640,447; Defines the display which is to be displayed after starting the application;START=VSA; Displaying errors:; Yes = If an error occurs a message box is displayed.; No = If an error occurs the value is signed with *.;ShowError=No

Page 146: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-126 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

[AlarmDos]; Alarmwrite tool; Start driver (ON) or switch off (OFF);Start=ON; Name of file in which alarms are entered.;Alarm file=c:\oem\alarmdos.dat; Convert Windows characters to OEM (ON) or write Windows format (OFF=;AnsiToOem=ON; Time in milliseconds after which scanning of non-reset; alarms is to take place.;Timer=1200

[Siemens]Picture=ON

[NCDDESERVER]; DDE Server; ----------

; Service NamesService=NCDDETopic=NCKPLC; Window Position; x-coordinate of the upper left corner, y-coordinate of the upper left corner,; x-coordinate of the lower right corner, y-coordinate of the lower right cornerPosition=0,0,400,150; Timeout Value for asynchron connection (seconds);Timeout=3; Enable hotlink for ALARM item; AlarmAdvise=ON

[clock]

; Top-Level Window ?topmost=on

[Terminate]

; Rebooting NCK;ResetNC=on; NCK still running (Default);ResetNC=off

[input]; reading in data

; ---------------

; one of the entries, "userselect", "overwrite" or "append" can be selected; userselect= If the data to be read in already exist in the root directory,; the user is asked interactively whethet he wishes to append,; overwrite or skip the file that already exists; overwrite= If the data to be read in already exist in the root directory; they are always overwritten without confirmation; append= If the data to be read in already exist in the root directory they; are always appended without confirmationwritemode=userselect

Page 147: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-127SINUMERIK 840C OEM Version for Windows (BN)

[Softkeys]; Softkey Manager; ---------------

; Owner-Draw-Buttons enable/disable; OwnerDrawButton=1 means, Softman identifies Owner-Draw-Buttons (default); OwnerDrawButton=0 means, Softman don't identify Owner-Draw-ButtonsOwnerDrawButton=1; Bold or Default;FontStyle=; Name of the font;Font=; Size of the font;FontSize=16

; External font;ExtFontStyle=;ExtFont=;ExtFontSize=12

; Top-Level Window ?;Topmost=ON

; Help button ?;F1Hook=ON

; System menu ?;F2Hook=ON

; Mouse ?;Moude=ON

; If the class name of the dialog window containing the buttons is NOT Dialog, the; class names of the buttons and the dialog boxes can be entered.;ButtonClass0=Button;ButtonClass1=;ButtonClass2=; DialogWnd=<class name>,<class name>,<class name> ...;DialogWnd=bordlg;DialogWnd1=;DialogWnd2=; GwlProfile=<0x12345678>,<0x12345678> ...;GwlProfile=0x40002000;GwlProfile1=;GwlProfile2=

[screen]mode=color,positiv;mode=color,negativ;mode=monochrom,negativ;mode=monochrom,positiv

Page 148: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-128 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

[NckMoPoPalette]; NCK Monochrome Positiv; index= index CLUT64=765=866=767=868=169=570=771=772=573=974=775=176=1277=978=1279=780=1281=282=783=584=085=1386=787=888=789=1290=1291=092=193=394=995=096=597=598=999=8100=9101=7102=0103=3104=6105=2106=4

[NckMoPoCLUT]; NCK Monochrome Positiv; Clut index = R G B0= 0, 0, 01= 0, 0, 02= 0, 0, 03= 0, 0, 04=128,128,1285=128,128,1286=192,192,1927=255,255,2558=128,128,1289=192,192,192

Page 149: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 3-129SINUMERIK 840C OEM Version for Windows (BN)

10= 0, 0, 011= 0, 0, 012=192,192,19213=192,192,19214= 0, 0, 015= 0, 0, 0

[NckMoNePalette]; NCK Monochrome Negativ; index = CLUT index64=765=866=767=868=169=570=071=772=573=474=075=176=1277=478=1279=780=1281=282=783=584=085=1386=787=888=089=1290=1291=792=193=294=495=396=697=598=999=8100=4101=7102=0103=6104=3105=2106=4

[NckMoNeCLUT]; NCK Monochrome Negativ; Clut index = R G B0= 0, 0, 01=192,192,1922=255,255,255

Page 150: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

3 System Structure of 840C09.01

3-130 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

3=255,255,2554=255,255,2555=192,192,1926=192,192,1927=255,255,2558=128,128,1289=128,128,12810= 0, 0, 011= 0, 0, 012=128,128,12813=192,192,19214= 0, 0, 015= 0, 0, 0

Page 151: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

4 Alarms09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 4-1SINUMERIK 840C OEM Version for Windows (BN)

4 Alarms

The alarm dialog OEMFORM for the generation and integration of user's own alarm and message textsin the control 840C OEM Version for Windows , which was previously described in this section, hasbeen taken out to form a separate documentation with the following title:

Alarm Dialog for PCSoftware Version 6OEM Version for WindowsUser's Guide 09.01 Edition

Order No.: 6FC5197-6AC40-0BP2

Page 152: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

4 Alarms09.01

4-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Page 153: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-1SINUMERIK 840C OEM Version for Windows (BN)

5 DDE Interface

5.1 Windows DDE

DDE (Dynamic Data Exchange) is a Windows mechanism for dynamic data exchange (communication)between processes. Like most other Windows mechanisms, Windows' own communication system isthe basis for the concept of DDE. The data to be exchanged are stored in memory areas that can beaccessed by all processes (global heap or shared memory). A DDE link is restricted to two participants(a sender and a receiver). Of course, a process can maintain several links at once (with differentprocesses).

5.1.1 Establishing a link

The DDE communication link is directional. There is a "client" and a "server". The client initiates the linkwith the server by sending the message DDE_INITIATE to all other programs in a sort of broadcast.The parameters passed on with this message contain the name of the required server program("service") and the name of a "topic". Each program checks this message and if it finds its own nameand a suitable topic, it confirms the communication by returning a positive acknowledgement with theWM_DDE_ACK message.

W M _D D E _IN IT IA TE(S erv ice ,Top ic)

W M _ D D E_AC KC L IE N T SER VER

Fig. 5.1: DDE link established by the client

In this way, a link is initiated between two processes which is called a "conversation". Via this link, it isnow possible to transmit instructions which are called "transactions". All transactions come from theclient. The server performs the instructions and returns a positive or negative acknowledgement withWM_DDE-ACK, indicating whether the requested action has been performed or not.

If it is not possible for the server to accept a further link with a client (too many open files, no freeresources left, etc.), the server does not accept the request to establish a link but rejects it with anegative WM_DDE_ACK. The client can make another attempt later.

Because the role that the two communicating programs play depends on the type of link and thenumber of quasi-parallel conversations is not in any way restricted, a program A can be the server foranother program B and the client for yet another program C.

Once the link has been successfully initiated, the client addresses the requested data record or singledata item using a third name, the "item".

Page 154: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.1.2 Types of link

A client can request data from a server in three different ways. The associated link types are usuallydesignated "cold" (static), "warm" (message indicating a change) and "hot" (dynamic).

5.1.2.1 Static data

If a client wishes to read certain data about a topic from a server via a "cold" link, the client sends aWM_DDE_REQUEST message, the name of the requested data item and the required data format arespecified in the parameters passed on with the message. If the server has the requested data, itresponds with a message of the type WM_DDE_DATA and passes on the requested data record.

W M _ D D E _ R E Q U E ST (IT EM )

W M _D D E_D AT AC L IE N T SER VER

(W M _ D D E_ AC K)

Fig. 5.2: Static request for data (WM_DDE_REQUEST)

The client can now confirm to the server that it has received the data with WM_DDE_ACK. This step isoptional and therefore enclosed in brackets in the above figure.

If the server cannot fulfil the client's request, it does not respond with a WM_DDE-DATA but returns anegative acknowledgement WM_DDE_ACK.

This request for data and the corresponding response from the server can be repeated until the clienthas obtained all the requested data items.

Writing data works in the same way as the static reading of data. If a client wishes to transmit data to aserver, it sends a WM_DDE_POKE message with the address of the data. The server must thenacknowledge receipt of the data with a WM_DDE_ACK and store the transmitted data.

WM_DDE_POKE (ITEM, DATA)

CLIENT SERVERWM_DDE_ACK

Fig. 5.3: Writing data (WM_DDE_POKE)

If the server cannot interpret an ITEM, it acknowledges the write request by the client with a negativeWM_DDE_ACK.

A client can also transmit commands to execute instructions to a server. The commands are readabletexts with command names and parameters, in brackets and separated by commas.

Page 155: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-3SINUMERIK 840C OEM Version for Windows (BN)

They are sent to the server with a WM_DDE_EXECUTE message. The server interprets the text andexecutes the command with the specified parameters.

WM_DDE_EXECUTE(ITEM=Command, parameters)

CLIENT SERVERWM_DDE_ACK

Fig. 5.4: Execution of commands

All the transmitted commands must be known to the server. If the server cannot interpret a command itreturns a negative acknowledgement WM_DDE_ACK.

5.1.2.2 Dynamic updating

Quite often a client waits for a change in a certain data item. It would be complicated and time-consuming to repeat WM_DDE_REQUESTS to find out if the data item has changed, especially as themore frequent the operation the more often it would return no result. To avoid this there is the conceptof advise links ("hot" links).

W M _D D E_ AD VISE (IT EM )

C L IE N T SER VERW M _D D E_AC K

Fig. 5.5: Request for dynamic updating (WM_DDE_ADVISE)

In this case, the client transmits a WM_DDE_ADVISE message to request the server to send the newdata whenever the data item changes. If a server cannot fulfil the request, it responds with a negativeacknowledgement WM_DDE_ACK.

W M _ D D E_D AT A

C L IE N T SER VERW M _D D E_AC K

Fig. 5.6: Automatic updating of data

The server now transmits the requested data after every change without a previous request to theclient.

Page 156: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

When the "advise links" are initiated it is possible to define whether the client must acknowledge receiptof each data record or not. If acknowledgment is specified, the client is only sent a new data item whenthe it has acknowledged receipt of the previous data item. In this way, the client can ensure that it is notflooded with new data before it can process the previous data.

W M _ D D E_ U N A D VIS E

C L IE N T SER VER(W M _D D E_AC K)

Fig. 5.7: Terminating an "advise link"

If the client no longer wishes to receive current information about a certain data, it can terminate theadvise link by sending the message WM_DDE_UNADVISE.

"Cold" and "hot" links are not mutually exclusive: during one and the same conversation (initiated byWM_DDE_INITIATE) a client can request both static data with WM_DDE_REQUEST and dynamic datawith WM_DDE_ADVISE.

5.1.2.3 Notification of change

"Warm" links combine the features of "cold" and "hot" links. They also begin after link initiation with(WM_DDE_INITIATE) when the client sends a WM_DDE_ADVISE message.

W M _D D E_ AD V IS E (IT EM )

C L IE N T SER VERW M _D D E_AC K

Fig. 5.8: Start of a "warm" link (WM_DDE_ADVISE)

In this WM_DDE_ADVISE message, it is specified that instead of sending the changed data, only asignal is sent to the client. If the server cannot fulfil the required advise request, it responds to theclient's request with a negative acknowledgement WM_DDE_ACK.

Page 157: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-5SINUMERIK 840C OEM Version for Windows (BN)

WM_DDE_DATA (ZERO)

CLIENT SERVER(WM_DDE_ACK)

Fig. 5.9: Informing the clients (WM_DDE_DATA)

The signal consists of a message of the type WM_DDE_DATA with which, instead of the changed data, azero pointer is passed on. After the client has been informed of the change in this way, it can fetch theupdated data at a later time.

W M _ D D E _ R E Q U E ST (ITEM )

W M _D D E_D AT AC L IE N T SER VER

(W M _ D D E_ AC K)

Fig. 5.10: Request for updated data (WM_DDE_REQUEST)

The mechanism with which the client fetches the changed data is the same as that for requesting staticdata. Here too, it is possible to specify when the "advise link" is initiated whether receipt of the data bythe client must be acknowledged or not.

W M _ D D E _ U N A D V IS E (IT EM )

C L IE N T SER VER(W M _D D E_AC K)

Fig. 5.11: Terminating a "warm advise link" (WM_DDE_UNADVISE)

If the client no longer wishes to be notified of changes in a certain data record, it sends a message ofthe type WM_DDE_UNADVISE to the server like in a "hot" link. The server then stops automaticallynotifying the client by WM_DDE_DATA (Zero) messages.

Page 158: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.1.3 Terminating links

A conversation initiated with the message WM_DDE_INITIATE is be terminated by the messageWM_DDE_TERMINATE.

W M _ D D E _ T ER M IN A T E

C L IE N T SER VERW M _D D E_T E R M IN A T E

Fig. 5.12: Termination of a link (WM_DDE_TERMINATE)

This message (WM_DDE_TERMINATE) can be sent both by the client and by the server. Apart from thedynamic updating, termination of a conversation is the only DDE transaction where the serveraddresses the DDE interface without having been requested to do so. The other communicatingprogram also sends a WM_DDE_TERMINATE message to acknowledge termination of the link.

5.1.4 The DDEML library

As a whole, the DDE mechanism is relatively complicated and not entirely free of problems. For thisreason, Microsoft Windows 3.1 and Windows for Workgroups 3.11 are supplied with a library calledDDEML.DLL (DDE management library). The functions of the DDEML define an additional levelbetween the application program and the actual protocol and relieve the programmer of thetroublesome task of memory management and sending and receiving messages.

The DDEML defines a total of 27 functions with the prefix Dde- and a cancellation function whichprocess 16 different types of transaction. Moreover, the routines of the DDEML can be used by severalprograms, which is why they must be explicitly initialized and uninitialized with the callsDdeInitialize and DdeUninitialize.

When the DDEML is used, the DDE server and the DDE client do not define their own windows andwindow procedures but only simple cancellation functions whose addresses are passed on when theyare initialized. The data passed on are not stored directly in the common memory but transferred usinghandles that a function by the name of DdeCreateDataHandle returns. A client can request thesehandles and then release them again.

String handles are used to pass on items, for which DDEML defines the data type HSZ (Handle toString [terminated by] Zero).

Moreover, DDEML supports both synchronous and asynchronous calls to request data.

Because every DDE tool (Visual Basic, Excel, etc.) provides its own names for DDE calls, thisdocumentation uses the names of DDE calls used by the DDEML. The calls and functions of theDDEML are dealt with in detail in:

MS Windows Software Development KitProgrammer's Reference

Volume 1: OverviewMicrosoft Corporation

Page 159: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-7SINUMERIK 840C OEM Version for Windows (BN)

5.2 DDE server of the SIN 840C OEM version for Windows

The DDE server in SW 4 of SINUMERIK 840C OEM Version for Windows implements bothcommunication between OEM applications and MMC-side basic modules, such as the alarm module(ALARM.EXE) and the central status module (GSTATUS.DLL), and data transfer to the NCK/PLC and611D.

Using the DDE server, it is thus possible to set (POKE) and reset (POKE) alarms from any applicationsvia the standard Windows DDE mechanism or to read out the current alarms once (REQUEST) orautomatically (ADVISE). Moreover, the display mode of the alarm/status line can be changed duringoperation (EXECUTE).

The DDE server also makes operating states of the NC/PLC and MMC accessible to all Windowsapplications. In this way, the switch positions of the keyswitch, the status of the password and the cycledisable and the states of the NCK and PLC (e.g. "start-up", "crash", "cyclic operation") can beascertained.

Moreover, the DDE server executes any communication of OEM Windows applications with theNCK/PLC and 611D. The DDE server (DDESRV.EXE) is based directly on the actual multiport RAMserver (SERVER.EXE) of the multiport RAM and thus forms the interface for DDE capable Windowsapplications.

MMC

VDI

DPR

Mailbox

DDE server

Mailbox

System

FX 74

User programRead,Interpret,Write

Data

NCK PLC

OEM

Data

FX 73

I code

Fig. 5.13: Data exchange DDE server

Both read (REQUEST) and write (POKE) access to the data of the NCK is possible. During access theDDE server converts the DDE protocol of the Windows applications to the I code protocol (internalcode) of the NCK. However, only certain I code sequences are implemented via this mechanism(I code: 0x0100 - 0x01FF).

The DDE server also provides DDE commands (EXECUTE) for file transfer between the MMC and theNCK.

A special DDE transport mechanism can be used to access all I codes of the NCK and therefore also tosend cyclic or change requests (ADVISE LINKS).

Page 160: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

In this case the applications must generate the appropriate I code protocol themselves and execute thecorresponding protocol sequences (transparent mode).

There is also a special DDE interface with the PLC. For communication, variable names up to 20 byteslong can be formed on the MMC side. The DDE server transfers these variable names along with theassociated values to the PLC ADS interface (ADS = Allgemeine Daten-Schnittstelle = general datainterface), where they can be processed by the function blocks of the PLC. For data exchange with thePLC, the DDE mechanisms REQUEST, POKE and ADVISE can be used.

With a special I code it is also possible to start or terminate MMC applications on the initiative of thePLC.

5.2.1 Activating the server

The DDE server is a separate WINDOWS-EXE program called DDESRV.EXE. and can be called up assuch. A precondition of this is that the dynamic link library MEMBER.DLL is in the directoryC:\MMCWIN\PC. It is part of the OEM package and must be transferred to the control into the abovedirectory before the DDE server is called.

Normally, the DDE server is activated during start-up by the autostart file REG_AUTO.CFG.

The DDE data server is started as a hidden window and is thus not visible in the WINDOWS task list.

5.2.2 Link initiation with the server

Initiation of a link of a Windows application with a DDE server is performed using the DDEML functionDdeConnect(..). The associated service names (SERVICE,TOPIC) are defined in the INI fileSIN840C.INI (see Section 3.5) in the section [NCDDESERVER].

[NCDDESERVER]Service=NCDDETopic=NCKPLC

After successful link initiation, the client receives the conversation handle as a return value for theinitiated link. If no link can be initiated, the return value of the DdeConnect call is 0.

The maximum number of simultaneously registered clients is 32. If this number is exceeded the clientreceives the return value 0.

Termination of a link can be initiated either by the client or by the server. The application must call thefunction DdeDisconnect(..).

Page 161: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-9SINUMERIK 840C OEM Version for Windows (BN)

5.2.3 Time response

Because MS WINDOWS does not provide a realtime-capable environment, the time response of theDDE data server depends on the tasks currently running.

Because the data of the NCK are transferred to the MMC in a task with lower priority than the executionchannels, the requested data might be transferred more slowly if the great demand is being made ofthe NC CPU.

The total runtime for a transaction (client --> DDE server --> NCK/PLC --> DDE server --> client) isapprox. 100 ms in the best case (no other tasks require more than negligible CPU time). This includesthe runtime of the multiport RAM server and the response time of NCK/PLC

(MMC CPU: 386SX20 8 MB, NCK CPU: 386DX25 PLC CPU: 135WB cycle time 20 ms)

Depending on the DDE transfer mode, several requests to the DDE data server can be sent at thesame time:

With synchronous data transmission, the requests (read data, write data) are made sequentially, i.e. anew request can only be sent by the client when the previous one has terminated.

This response can be changed by selecting asynchronous transmission: The client applications areinformed that the data have arrived.

A file transfer, once initiated, runs parallel to other process, i.e. the client application does not have towait for the end of transmission to be serviced again.

Only one file transfer is possible at any one time throughout the system. If a client application attemptsto initiate another DDE transfer while a transfer is running, it receives the return value DDE_FBUSY.

Page 162: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-10 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.3 Alarm handling via DDE

With the following calls to the DDE server, alarms can be set and reset from within a customerWindows application or the current alarms can be read out. Moreover the display mode of thealarm/status line can be changed during operation.

The previous accesses (SW 3) of OEM applications via the DLL functions MeldeSet(), MeldeClear(),MeldeSetStruc() and MeldeClearAll() are no longer required.

5.3.1 Setting alarms

Function:Alarms in the range 1 000 000 to 1 099 999 can be set by OEM applications.

The function 'Set alarms’ can be performed by the transaction type XTYP-POKE of the functionDdeClientTransaction() after successful initiation of the link to the DDE server. The associatedITEM name must be specified as

Alarm

In the associated text data, the alarm number and the parameters required for alarm display must beprovided. The text data must have the following structure:

[Alarm No.],S,[Parameter0],...........,[Paramter9] \CRLF

[Alarm No.],S,[Parameter0],...........,[Paramter9] \CRLF

..

[Alarm No.],S,[Parameter0],...........,[Paramter9] \CRLF\0

[Alarm No.] = No. of the alarm to be setS = Specification "Set alarm".[ParameterN] = Parameter text for positions %0 to %9 of the alarm message.

Several alarms can be set at the same time. To achieve this, the specifications of each alarm must beseparated from the others by CRLF. \0 must be placed at the end of the alarm specification.

Error message:In the event of an error, the DDE data server returns DDE_FNOTPROCESSED to the requesting clientfunction. Some possible causes of error are:

• ITEM name could not be interpreted by the DDE server• The structure of the text data could not be interpreted by the DDE server• Alarms are not configured in the database• Alarm module (ALARM.EXE) was not started

Example:Alarm 1.000.030 is set:

Text data:

1.00.030,S,X axis,,,,,,,Y axis\CRLF\0 ;Setting the alarm 1.000.030 with;Parameter0 = X axis, Parameter7 = Y axis

Comment:Alarm 1.000.030 must be configured in the alarm database.

Page 163: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-11SINUMERIK 840C OEM Version for Windows (BN)

5.3.2 Clear all alarms

Function:With the aid of this function, all MMC alarms with numbers in the range 100.000 to 199.999 and from400.000 to 1.099.999 can be cleared. The function is identical to operating the softkey CLEAR in thealarm display. It is not possible to clear individual alarms.

The function 'Clear all alarms’ can be performed by the transaction type XTYP-POKE of the functionDdeClientTransaction() after successful initiation of the link to the DDE server. The associatedITEM must be

Alarm

The associated text data must have the following structure:

0,C,\CRLF\0

Error message:In the event of an error, the DDE data server returns DDE_FNOTPROCESSED to the requesting clientfunction. Some possible causes of error are:

• ITEM name could not be interpreted by the DDE server• The structure of the text data could not be interpreted by the DDE server• Alarms are not configured in the database• Alarm module (ALARM.EXE) was not started

Comment:With a DDE request it is possible both to clear alarms and to set alarms. In this case, the clearinstruction must be specified before the set request.

Example:Clear all alarms and then set alarms 1 030.000 and 1.004.567.

Structure of the text data:

0,C\CRLF ; Clear all alarms1.030.000,S,X axis,,,,,,,Y axis\CRLF ; Set alarm 1.030.000 with

; Parameter0 = X axis, Parameter7 = Y axis1.004.567,S,spindle1,,,,spindle3\CRLF\0 ; Set alarm 1.004.567 with

; Parameter0 = spindle1, Parameter4 = spindle3

Alarms 1.000.030 and 1.004.567 must be configured in the alarm database.

Page 164: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-12 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.3.3 Reading alarms

Function:Using this function it is possible to read once (DDE-REQUEST) or to read all current alarms on anychange (DDE-ADVISE).

The function 'Read alarms' can be performed by the transaction type XTYP_REQUEST orXTYP_ADVSTART of the function DdeClientTransaction() after successful initiation of the DDEserver link. The associated ITEM name must be

Alarm

Special features of: XTYP_ADVSTART

If an application sets up an automatic link to the DDE server in order to receive information of anychanges to alarms automatically, the following entry must be made in section [NCDDESERVER] of fileSIN840C.INI (see Section 3.5):

[NCDDESERVER]AlarmAdvise=On

OFF (default):The DDE server is not automatically informed of alarm changes by the alarmmodule. For this reason a DDE ADVISE link to the DDE server set up by anapplication does not have desired effect. Even though a DDE ADVISE link existsthe application is not informed of alarm changes.

ON:The DDE server is automatically informed of alarm changes by the alarmmodule. If a DDE ADVISE link to the DDE server is set up by the applicationthese alarm changes are automatically transferred from the DDE server to theapplication.

As of version 6.4, the Advice mode can be set in the [Alarm] section of the SIN840C.INI file.

Advise mode = 0 Default setting: as previously, all pending alarms are transferred in the case of analarm change.

Alarm mode = 2 New as of 6.4: only new alarms are transferred in the case of an alarm change.

Automatic information to the DDE server by alarm modules that alarms have been changed placesextra load on the CPU. The entry Alarm/Advise should therefore only be set to ON if a DDE ADVISElink to the DDE server really has been set up by an application.

The entries AlarmAdvise=ON/OFF are only evaluated when the alarm module ALARM.EXE is startedup.

Format of response data:

All the current alarms are transferred in the response data. The individual data items for every alarmare separated by a comma, the alarms themselves by CRLF. The end of the data block is markedby \0.

Page 165: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-13SINUMERIK 840C OEM Version for Windows (BN)

The specifications for each alarm have the following structure:

[Alarm No], ; Alarm number[Alarm text], ; Alarm text from database[Type], ; PO, RE, CA, ME, PA, ...etc.[Date], ; dd.mm.yy.hh:mm:ss; the date format is independent of the setting

under Windows[Display location], ; 1 = Alarm line, 2 = Message line, 4 = Logbook, 8 = Service logbook[Priority], ; Alarm priority[Text color], ; Color of the alarm text numeric value as for COLORREF format[Background color], ; Color of the background numeric value as for COLORREF format[Following text number], ; Following text number from the database[Help text number], ; Search number for the help text file[No. help text file], ; No. of the selected help text file[Status text]\CRLF\0 ; Text for status line

Error messages:In the event of an error the DDE data server returns DDE_FNOTPROCESSED to the requesting clientfunction. Some possible causes of error are:

• ITEM name could not be interpreted by the DDE server• Alarm module (ALARM.EXE) was not started

5.3.4 Changing the display mode of the alarm/message line

Function:Using this function it is possible to change the display mode of the alarm/message line.

The function 'Change display mode' can be performed by the transaction type XTYP_EXECUTE of thefunction DdeClientTransaction() after successful initiation of the link to the DDE server. The displaymode must be passed on as a command string.

The possible parameters for the command string are:

Alarm_Top The alarm/message line is active and can be covered

Alarm_Topmost The alarm/message line is active and can only be covered by other‘topmost’ applications

Alarm_Hide The alarm/message line is inactive, i.e. the space on the screen isempty and shows the background colour.

Error message:In the event of an error the DDE data server returns DDE_FNOTPROCESSED to the requesting clientfunction. Some possible causes of error are:

• Command string could not be interpreted by the DDE server• Alarm module (ALARM.EXE) was not started

Comment:The settings are active immediately. The corresponding entries in the file SIN840C.INI (see Section3.5) are not overwritten. The entries in the SIN840C.INI therefore become valid again after a restart.

The standard alarm display can also be deactivated in the windows start-up file REG_AUTO.CFG (cf.Chapter 3).

Page 166: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-14 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.4 Central status scan

Using a status module, the operating states of the NC/PLC and MMC can be made accessible to theWindows applications. Via the DDE interface of the SIEMENS DDE data servers, it is possible to readonce (DDE-REQUEST) or to read the operating states on every change (DDE-ADVISE). The previous(Software Version 3) ‘general message interface’ is no longer required.

The ‘central status scan’ can be performed by the transaction type XTYP_REQUEST orXTYP_ADVSTART of the function DdeClientTransaction() after successful initiation of the link tothe DDE server. Depending on the data type required, one of four ITEM names can be selected:

KEYSTATUS

LOCKSTATUS

NCSTATUS

PLCSTATUS

The information items KEYSTATUS, LOCKSTATUS are stored in the PLC in DB 48 and. DB 58. On achange these information items are automatically entered in the status DLL. These information itemsare static in character and should therefore not be overwritten "cyclically" in the PLC. This causes anunnecessary load in the MMC because of asynchronous execution in the PLC.

The response data must be requested in CF_TEXT format and are therefore returned as a string. Thisstring contains the value as a decimal number. The following table shows the possible status data.

Data type = item name Value Meaning

KEYSTATUS 0 Switch position 1

1 Switch position 2

2 Switch position 3

3 Switch position 4

LOCKSTATUS Bit 0 Any password level enabled

Bit 1 Cycle disable is active

Bit 2 Operator panel lock active

Bit 3 "Page alarms" active

Bit 4 Password level 1 enabled

Bit 5 Password level 2 enabled

Bit 6 Password level 3 enabled

Page 167: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-15SINUMERIK 840C OEM Version for Windows (BN)

Bit 7 Password level 4 enabled

Bit 8 Password level 5 enabled

Bit 9 Password level 6 enabled

NCSTATUS 1 NC not booted

2 NC in start-up(no I code exchange possible)

3 NC crash

4 NC: normal operating state

5 Start-up mode

6 Start-up completed

PLCSTATUS 1 PLC not booted

2 PLC in start-up(no I code exchange possible)

3 PLC crashed

4 PLC: normal operating state

The following applies to the bit values of the ITEM name LOCKSTATUS:

Bit set (1): Statement trueBit reset (0): Statement false

Bit 3 in PLCSTATUS corresponds to alarm "PLC not ready".

Example:

ITEM: LOCKSTATUSReturn string: 15Meaning: A password is set + cycle disable is active + operator panel lock is active +

"page alarms" is active

Error message:In the event of an error the DDE data server returns DDE_FNOTPROCESSED to the requesting clientfunction. Some possible causes of error are:

• ITEM name could not be interpreted by the DDE server

• Status module was not started

Page 168: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-16 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5 MMC NCK interface

5.5.1 Command interface (EXECUTE)

The following defined commands of the DDE data server can be executed by the transaction typeXTYP-EXECUTE of the function DdeClientTransaction(). The commands must be passed asstrings.

5.5.1.1 File transfer

COPY_TO_NC (WinFile, NC-File, TransferState)COPY_FROM_NC (WinFile, NC-File, TransferState)

Copies a file between the NC and the MMC.

Parameters:

Winfile File name in the Windows environment. Must always include the drive, path and filename.

NC-File Path name + file name of the NC. The following path names are permissible:

\NC\MPF for main programs\NC\SPF for subroutines\NC\CYC for cycles\NC\SYS for system data (RPA,TEA,SEA..)

The following system data are permissible:RPA0-RPAn R parameters n=channel number 0=central R parametersTEA1 NC machine dataTEA2 PLC machine dataTEA40-TEA4n Cycle machine data...n=channel numberIKA1,IKA2,IKA3 Data of the interpolatory compensationGIA Data of the gearbox interpolationSEA1 Setting dataSEA41-SEA4n Cycle setting data n=channel numberZOA0 Zero offsets G54-G57ZOA1-ZOAn Angle of rotation n=channel numberTOA1-TOAn Tool offsets n=channel number

File name must be a valid SINUMERIK 840C file name.

TransferState This variable (the name is invariable) is used to define the current transmissionstatus. Under this ITEM name the client can read the current transfer status fromthe server (only one transfer can be active at a time throughout the system!):

0: Transfer initiated1: File is opened50: File transfer active99: File is closed100: File transfer is successfully completed101: Not enough memory (#NEW; as of SW 6.4)

Page 169: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-17SINUMERIK 840C OEM Version for Windows (BN)

Error codes:

1010: Transfer stopped: Command line invalid1011: Transfer stopped: Error in file transfer through abort (COPY_FROM_NC)1012: Transfer stopped: Error in file transfer on the NC side

33796: Transfer stopped, error in file transfer on MMC side65534: Transfer stopped: Internal error

The client can obtain the value of TransferState from the server by a XTYP_REQUEST or an adviseloop.

If the variable TransferState is overwritten by the client by XTYP_POKE with a value greater than100, the current file transfer is aborted. The target file is then deleted.

If the value of TransferState is smaller than 100 no other file transfer is possible: A request for a filetransfer is rejected with the value DDE_FBUSY.

Example:

COPY_TO_NC (c:\ncdaten\siemens\mpf1,\NC\MPF\MPF1, TransferState)COPY_FROM_NC (c:\ncdaten\siemens\spf22, \NC\CYC\SPF23, TransferState)

Note:

As from SW 5 the files copied with DDE execute command COPY_TO_NC can beincluded in the function "Save part programs" (cf. Operator's Guide, Subsection3.4.6.6) under the following conditions:

1. The workpieces have been copied from workpiece directory C:\LOCAL into theNCK memory.

2. The workpieces have been copied from a workpiece directory that has theappropriate user entry (cf. 3.4.6.3) in file SIN840C.INI (see Section 3.5) into theNCK memory.

5.5.1.1.1 Transferring subblocks

As of 840C OEM Version Windows SW 6.4, RPA, TOA, SEA and IKA subblocks can be transferred.The instructions COPY_TO_NC and COPY_FROM_NC have therefore been amended by the optionalparameters number beginning and number end.

COPY_TO_NC (WinFile, NC_File, TransferState[, number beginning, number end])COPY_FROM_NC (WinFile, NC_File, TransferState[, number beginning, number end])

Example:The global R parameters 1000 to 4999 are to be written to file c:\temp\rpa0.

COPY_FROM_NC (C:\TEMP\RPA0, \NC\SYS\RPA0, TransferState, 1000, 4999)

Page 170: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-18 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5.1.1.2 Transferring to memory area

As from 840C OEM Version Windows SW 6.4, a memory area can be indicated in the instructionsCOPY_TO_NC and COPY_FROM_NC instead of WinFile. A (hexadecimal) handle with ID # is there-fore transferred. The length of the memory area is transferred in the first longword.

Example:Copy the global R parameters.A memory area (shared memory) is allocated by means of the WinApi function GlobalAlloc.The returned handle is converted to a hexadecimal number and provided with the ID #. The length ofthe memory area is transferred in the first longword. The handle must therefore be converted into apointer by means of GlobalLock. After the successful transfer, the number of bytes transferred isentered in the first longword and the transfer terminated with transfer status 100. If the memory area isnot sufficient, it is filled as far as possible with the data read and then the transfer is terminated withtransfer status 101.

HDDEDATA hReturn;HGLOBAL hGlb;HCONV hConv =???;char far* lpvBuffer;unsigned long ulpvLen=???;char StrTmp[11];char StrGlb[11];char szCommand[80];

//Allocate memoryhGlb = GlobalAlloc (GHND | GMEM_DISCARDABLE | GMEM_SHARE, ulpvLen);lpvBuffer = GlobalLock(hGlb); //Lock memory*lpvBuffer = ulpvLen;

//Convert memory handle from HGLOBAL into #hhhhmemset ( StrTmp, 0, sizeof (StrTmp) );memset ( StrGlb, 0, sizeof (StrGlb) );_itoa(hGlb, StrTmp, 16);_fstrcpy(StrGlb, "#");_fstrcat(StrGlb, StrTmp);

// COPY_FROM_NC (#067A, \NC\SYS\RPA0, TransferState)sprintf (szCommand, "COPY_FROM_NC (%s, \NC\SYS\RPA0, TransferState)", StrGlb);hReturn = DdeClientTransaction (szCommand, sizeof (szCommand), hConv, NULL, CF_TEXT, XTYP_EXECUTE, 2000, NULL);

//Wait until transfer is terminated (TransferState >= 100) and then process data

GlobalUnlock(hGlb); //Cancel lockGlobalFree(hGlb); //Enable memory

5.5.1.1.3 End-of-block character of ASCII files

Usually, an ASCII file with data in individual blocks is generated with the instruction COPY_FROM_NC.These blocks are separated by the ASCII code 0AH (LineFeed). However, text editors (DOS/Windows)normally require the character combination 0DH 0AH as line end (CarriageReturn + LineFeed). Byentering CrLf in the section [Wedit] of the SIN840C.INI file, you define whether the end-of-blockcharacter is 0AH or 0DH 0AH. As of 840C OEM Version Windows SW 6.4, this setting is taken intoaccount with the instruction COPY_FROM_NC.

Page 171: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-19SINUMERIK 840C OEM Version for Windows (BN)

5.5.1.2 DELETE_FILE

Deletion of a file on the NC side is implemented by the following command:

DELETE_FILE (NC-File)

The command is only successful if the file exists and write access exists.

If the file cannot be deleted, the client receives the return value DDE_FNOTPROCESSED.

NC-File Path name + File name of the NCThe following path names are permissible

\NC\MPF for main programs\NC\SPF for subroutines\NC\CYC for cycles

File name must be a valid SINUMERIK 840C file name.

Example:

DELETE_FILE (\NC\MPF\MPF23)

5.5.1.3 RENAME_FILE

The file name is changed on the NC side with the following command:

RENAME_FILE (NC-File1, NC-File2)

NC file1 Current name of the file whose name is to be changed.

NC file2 New file name. A file with this name must not already exist.

If the command cannot be successfully executed, the client receives the return valueDDE_FNOTPROCESSED.

File name conventions as for DELETE_FILE().

Example:

RENAME_FILE (\NC\MPF\MPF23, \NC\MPF\MPF231)

Page 172: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-20 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5.2 Read and write accesses

5.5.2.1 Data format

'Clipboard' formats are used for communication between the client and the server application. Thestandard format used by the DDE data server for data exchange with the standard Windowsapplications is the CF_TEXT format.

The decimal point/comma is the character specified in the international options of the Windows controlpanel.

The separator between items of a data field is CR-LF.

5.5.2.2 Variable names

The NCK data are accessed via the variable names (ITEM) after the link to the DDE server has beeninitiated.

The complete variable name (ITEM) consists of the names NC (NCK data), the I CODE number (datatype), the type and number range (address specification) and the channel/mode group specification:

<NC>_<I code number>_<type beg>_<type end>_<num beg>_<num end>_<chan/mode group>

Example:

NC_0x125_1_1_2_2_0 Actual speed spindle 3NC_0x101_0_0_5000_5006_0 Machine data 5000 to 5006NC_0x119_0_0_200_220_1 R parameters 200 to 220 of channel 2

The variable name is divided up from left to right and values are entered in the I code header.Unspecified values at the end of the string are preset with the value zero in the I code header. If anumber "0x" is placed in front of a value, the value is interpreted as a hexadecimal number. In this way,all I codes with numbers between 0x0100 and 0x01FF can be processed. Other I codes with largernumbers can only be accessed by "transparent data exchange" (Appendix 1).

5.5.2.3 List of the variable names

A brief overview is given here. For a detailed description of the available data please see SINUMERIKWS800A Configuration Software, User´s Guide, Manufacturer Documentation, Section 13.3.

I code ID Data type Type Number Chan/mdgrp

Com-ment

0100H Cannot be used

0101H Machine data 1-62039

0102H PLC number,DB number,DX number of thecurrent PLC statusimage

01234

PLC numberDB numberPLC No. for PG operationDX numberPLC No. for PLC operation

0103H IKA data 0 - 56 After consultation B_03)

0104H TO abs. 0 - 9 TO parameter 1 - 819 Tool number B_04)

Page 173: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-21SINUMERIK 840C OEM Version for Windows (BN)

I code ID Data type Type Number Chan/mdgrp

Com-ment

0105H TO tool-related 0 - 9 TO parameter 1 - 819 Tool number B_04)

0106H TO channel-related 0 - 9 TO parameter 1 - 819 Tool number B_04)

0107H Does not exist

0108H Angle of coordinaterotation abs.

0 1 - 6 G54 to G59

0109H Settable ZO fine, abs. 0-(x-1) 1st to xth axis 1 - 4 G54 to G57

010AH Settable ZO coarse,abs.

0-(x-1) 1st to xth axis 1 - 4 G54 to G57

010BH Progr. ZO fine, abs. 0-(x-1) 1st to xth axis 1 - 2 G58 to G59

010CH External ZO fromPLC, abs.

0-(x-1) 1st to xth axis

010DH Does not exist

010EH Mode group spec.Working arealimitation

0 - 3 0-(x-1) 1st to xth axis B_0E)

010FH TO abs. additive 0 - 9 TO parameters 1 - 819 Tool number B_04)

0110H TO tool-related,additive

0 - 9 TO parameters 1 - 819 Tool number B_04)

0111H TO channel-related,additive

0 - 9 TO parameters 1 - 819 Tool number B_04)

0112H Does not exist

0113H Angle of coordinaterotation

0 1 - 6 G54 to G59

0114H Settable ZO fine,additive

0-(x-1) 1st to xth axis 1 - 4 G54 to G57

0115H Settable ZO coarse,additive

0-(x-1) 1st to xth axis 1 - 4 G54 to G57

0116H Does not exist

0117H Gearboxinterpolationstatus data

0-(A-1)40-(S-1)

1st to max. ACHSANZ axis1st to max. SPINANZspindle

0-509 B_17)

0118H Setting data 0 - 5 Protection zone data fromSW 6.3 and higher

0 - 9999

0119H R parameters 0-599700-999

Channel-spec. central

B_19)

011AH Actual values 0-(x-1) 1st to xth axis 0 - 16 see below B_1A)

011BH Special bits

011CH Feed 01

Feed linearFeed revolutional 80-90

B_1C)

011DH Machine input buffers

011EH Program indicator (see I code 216H) from3.1

011EH Does not exist anymore as from P2.1

B_1E)

011FH Spindle channel-specific

0 - 16 0-(x-1) 1st - xth

spindleB_1F)

0120H Override 01

FeedrateSpindle 2 - 6

Page 174: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-22 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

I code ID Data type Type Number Chan/mdgrp

Com-ment

0121H Drive machine data 0 - 7 Set of parameters 1 - 8 0-19999 0-9999 drive10000-19999SERVO

B_21)

1)

B_21)

2)

0122H PLC machine data 0-8999

0123H Does not exist

0124H Mode group actualvalues

0 - 21106/206

0-(x-1) 1st to xth axis B_24)

0125H Spindle data spindle-spec.

01234

Spindle overrideActual speedActual positionSetpoint speed 4External speed

0-(x-1) 1st to xth

spindle

0126H Does not exist

0127H ZO, abs. fine, modegroup spec.

1 - 4 G54 to G57 0-(x-1) 1st to xth axis

0128H ZO, abs. coarse,mode group spec.

1 - 4 G54 to G57 0-(x-1) 1st to xth axis

0129H Prog. additive, ZOmode group spec.

1, 2 G58, G59 0-(x-1) 1st to xth axis

012AH External ZO fromPLC, abs., modegroup spec.

0-(x-1) 1st to xth axis

012BH ZO, fine, additive,mode group spec.

1 - 4 G54 to G57 0-(x-1) 1st to xth axis

012CH ZO, coarse, additive,mode group spec

1 - 4 G54 to G57 0-(x-1) 1st to xth axis

012DH Does not exist

012EH Cycle machine data 0 - 9491000 -8049

Channel-spec. MDCentral MD

012FH Cycle setting data 0 - 949 Channel-spec. SD

0132H NC configuration data 0 0 - 12 B_32)

0133H SEA/SCE and mixedI/O signals

0-24-23

0 - (x-1) 1st to xth axis B_33)

0134H Name of the motionaxis of the protectionzone

0 - 5 from SW 6.3 0 - (x-1) 1st to xth pro-tection zone

B_34)

B_03) Type number see IKA Documentation

B_04) Via MD expandable to Type: 0-31 The number range is then correspondingly smaller!

B_0E) Type: 0 Min. working area limitation SD 3000 - 30391 Max. working area limitation SD 3040 - 30792 NC scaling center SD 3120 - 31593 Programmable clamping torque SD 3200 - 3239

Page 175: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-23SINUMERIK 840C OEM Version for Windows (BN)

B_17) Type: 0-(ACHSANZ-1) Axis40-(SPINANZ-1) Spindle100 Input display (data number same as for data

type for axis)101 ... 106 Channel-specific EI data (channel 1 ... 6)

(data number same as for data type for axis)B_19) With option R parameter expansion

Number: 0 - 699 Channel-specificNumber: 700 - 1299 Central

B_1A) Number:0: DRF offset 1: Preset offset2: Does not exist 3: Current offset4: Actual position axis 5: Current actual value difference (distance-to-go) /

MDA, TEACH IN, AUTOMATIC6: JOG offset 7: Workpiece-related actual value (with calculation of the

indexing axis)8: Does not exist 9: Absolute actual value10: Machine-related 11: Workpiece actual value (without calc. of the indexing axis)

actual value with following error12/13/14/15: 16: TEACH IN: actual value for block with G53

TEACH IN: Actual value for blockwith G54 / G55 / G56 / G57

B_1C) Type: Designation: Number: Designation:0 Feed channel-spec. linear 0 Programmed (setpoint) 1 External (input) 2 Current (actual value)1 Feed channel-spec. rev. As for type 02 C-axis feed channel-spec. rev. As for type 03 Endlessly turning rot. axis (G295) As for type 0 channel-related to actual value As for type 04 Endless turning rot. axis (G195) As for type 0 channel-related to setpoint As for type 010 Programmed axis feed 0 Path feed

129 1st Axis---+ ... +-axis feeds 158 Last axis-+11 External axis feed As for type 1012 Current axis feed As for type 10

B_1E) Program preselection indicator as from package 3.1 I code 216H!

B_1F) Type:0: Cutting rate G96 1: Actual speed2: Actual position value 3: Set speed4: Main spindle number 5: Set position6: Main spindle power 7 - 13: as 0 - 614: Offset for level subroutine

B_21-1) Drive number or axis/spindle number

B_21-1) High byte = 0 Low byte = 1 - 15 (drive number)/0 = global

High byte = 1 Low byte = 0 - 39 (axis)/0 - 49 (spindle)/0xFF = global

B_24) Cf. also actual values (data group 1A)

Page 176: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-24 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

B_32) NC configuration data Memory configuration of NC module

No. Designation0 No. of memory-config. value1 Block buffer length2 Size of SSV header without exp. overst.3 Limit of VSKISEG before memory config.4 Limit of KSEG0 before memory config.5 Limit of HSA_FW before memory config.6 Limit of VSA_FW before memory config.7 Size of IKA header8 Size of R param. header9 No. of channel-spec. R parameters10 No. of central R parameters11 Size of SSV for ext. overstore12 Memory requirement of a real axis

B_33) Safety-relevant and mixed I/O signals

Type Designation0-2 Safety-related input signal low

0:FXP21:Flags (low byte of low word)2:Flags (high byte of low word)

4-7 Safety-related output signal low8-11 HW input = CSB_IN12-15 HW output = CSB_OUT16-19 Safety-related input signal high20-23 Safety-related output signal high

B_34) Name of motion axis of protective zone

No. Designation0 X coordinate P11 Y coordinate P12 Z coordinate P13 X coordinate P74 Y coordinate P75 Z coordinate P7

Page 177: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-25SINUMERIK 840C OEM Version for Windows (BN)

5.5.2.4 Data fields

It is possible to transfer several data of one type at once as a field.

A data field has the following structure: "type beg." < "type end" or "num beg." < "num end".

The separator used between the values in such a field is CR-LF.

The data of a field can only be requested without gaps. If there is a gap in a data field (e.g. non-existentmachine data), transmission stops after the last valid value.

Two-dimensional data fields ("type beg. " < "type end" and "num beg. " < "num end") are not supported.

The maximum number of data is limited by the mailbox size. If the data to be read or written do not fitinto a mailbox, an error message is output in debug mode from the DDE server and the transaction isacknowledged negatively. The maximum length of the useful data in the mailbox is 480 bytes.

In order to transmit larger volumes of data, several requests must therefore be sent or the data must beread or written by the file transfer (Subsection 5.5.1.1).

5.5.2.5 Error messages

If the DDE data server cannot interpret the variable name, the value DDE_FNOTPROCESSED is returnedto the requesting client function. No plausibility check is made of the variable names in the DDE dataserver. If the I code handler of the NCK returns an error to the DDE server, the client also receivesDDE_FNOTPROCESSED.

In order to obtain more precise information about the DDE transactions during program development ofthe client application, it is possible to put the DDE server into debug mode.

Debug mode is activated when the client sends the DDE execute command DEBUG to the DDE server.In the same way, debug mode is deactivated again by the DDE execute command NODEBUG.

In debug mode, a window whose size and position can be defined in the ini file SIN840C.INI(see Section 3.5) is displayed on top:

[NCDDESERVER]Position=100,100,500,200 (top left, bottom right corner)

In this window a listbox appears with the error messages in plain text whose content can be written tothe file C:\TEMP\DDESRV.TXT via menu item 'Save'.

Page 178: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-26 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Fig. 5.14: Debug window of the DDE server

The maximum number of entries in the listbox is 1000. If this value is exceeded, the oldest value isremoved.

The mode of the debug window can be changed via the menu item 'window':

- Hidden Window is hidden and no longer appears in the task list- Normal Default window setting- Always on top The window cannot be covered by other windows

The DDE server supplies the following error messages:

No CF test format: #0 With Advise Start/Stop to the PLC#1 With Alarm Advise Start/Stop#2 With Request#3 With Poke (file transfer)#4 With Poke to the NC#5 With Poke to the PLC

Maximum number of tasks hasbeen exceeded: #0 With Alarm Advise Start/Stop

#1 With Advise Start/Stop to the PLC#2 With I-Code Advise Start/Stop#3 With Request#4 With Poke to the NC#5 With Poke to the PLC#6 Conversation table full

Data package could not betransmitted to NC/PLC: #1 With Poke to the PLC

#2 With Advise Start/Stop to the PLC#3 On transmission of an I code (mailbox fully assigned)#4 On transmission of an I code (cancelation of current task)

No DDE-Icode format: #0 With Advise Start/Stop#1 With Poke

Internal error: #0 Global Lock failed with Advise Start/Stop#1 Invalid service name OEM#2 Invalid service name INTSIEM#3 Invalid service name SERVICE#4 DdeCreateStringHandle (internal service) failed#5 Old package discarded (I code 504H)#6 Data package of MPR-Global Lock failed#7 Invalid ITEM#8 Global Lock failed during ADS data test#9 With Poke to the PLC

Page 179: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-27SINUMERIK 840C OEM Version for Windows (BN)

Acknowledgement delay waitingfor response package: #0 Waiting for acknowledgement on request

#1 With Poke to the NC#2 With Poke to the PLC

Invalid data structure in ADSheader: #0 No DDE_DSTR with Request

Protocol type > 2 not supported: #0 With Poke to the NC#1 During ADS data test

Too much write data: #1 With Poke to the NC#2 With Poke to the PLC1#3 With Poke to the PLC2

Data cannot be converted: #0 With Poke to the PLC

Advise loop not started: #0 With Poke from I code Advise#1 With Advise Start/Stop (Advise loop to NC not permitted)#2 With Advise Request

ADS package too large #1 With Poke from I code#2 With Send Data

Invalid execute command: #1 With COPY_TO_NC#2 With COPY_FROM_NC#3 Open round bracket missing for DELETE_FILE#4 Close round bracket missing for DELETE_FILE#5 Directory not MPF, SPF or CYC for DELETE_FILE#6 File name not MPF* or SPF* for DELETE_FILE#7 NC cannot delete file#8 Open round bracket missing for RENAME_FILE#9 Close round bracket missing for RENAME_FILE#10 No second file name for RENAME_FILE#11 Open round bracket missing for SELECT_FILE#12 Close round bracket missing for SELECT_FILE#13 No file name for SELECT_FILE#14 Workpiece name not correct for SELECT_FILE#15 With ALARM_HIDE#16 With ALARM_TOP#17 With ALARM_TOPMOST#18 Open round bracket missing for INIT_READY#19 Close round bracket missing for INIT_READY#20 Unknown execute command

Comma missing in executecommand: #0 With RENAME_FILE

#1 With SELECT_FILE#2 With INIT_READY

NC cannot rename file: #0 With RENAME_FILE

Error initializing DDE: #0 Initialization failed

Multiport RAM server notlocated:

#0 MPR server not started

Error establishing link to MPRserver: #1 Link to SWK_DDE1 has failed

#2 Link to SWK_DDE2 has failedInsufficient memory available: #0 Global Alloc for Transmit ADS data has failed

Page 180: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-28 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

#1 Global Lock for Transmit ADS data has failed#2 Global Alloc for Transmit I code abort has failed#3 Global Lock for Transmit I code abort has failed

Package with invalid tasknumber received by NC/PLC: #0 Task not 1 or 2 (with running Advise loop)

#1 With task not 1 not SWK_DDE1 / AWK_DDE2#2 With task number 2 not SWK_DDE1 / AWK_DDE2

Invalid item name: #1 Wrong vocabulary word: Only PLC1, PLC2 or NC arepermitted

#2 The number between two underscores is not within validrange (>6 characters)

#3 No number between two underscores#4 The number between two underscores is not within valid

range (>0xFFFF)

Only 100s I codes supported: #0 Only 1xxH I codes permitted

Invalid format identifier in itemname: #0 PLC format of ADS data to the PLC not known

#1 PLC format not allowed

Item string tool long: #0 With ADS data to the PLC

I code error: #<n> n=error number in I code (see also A 2.1)#9999 With ADS error

Too many data requested: #0 Packet series is not supported

Num-End/Typ-End not found: #0 End number or end type missing

PLC error message: #<n> n=DDE error word (see also Section 5.6)

Cannot be converted toCF_TEXT:

#0 PLC format � Text format conversion failed

Data quantity too large: #0 Text format � PLC format conversion not possible#1 PLC format � Text format conversion not possible

Invalid PLC data format: #0 PLC format illegal

REQUEST in transparent modenot possible: #0 Cycl./modif. tasks not permitted

#1 ADS data test failed#2 ADS data transmission failed#3 ADS acknowledgement test failed#4 ADS data package filling failed

Invalid task number in ADSheader: #1 Task number 1 and not SWK_DDE1 or SWK_DDE2

#2 Task number 2 and not SWK_DDE1 or SWK_DDE2

Option not available: #0 Option password not set

Advise loop already started: #0 When an active Advise loop is started again

Advise data overwritten: #0 Previous package was not fetched on time

Page 181: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-29SINUMERIK 840C OEM Version for Windows (BN)

5.5.3 DDEML access to NC data

The data of the NC can be read by a request or written by a poke. In the required DDEML callDdeClientTransaction() a distinction is made between synchronous and asynchronoustransmission.

Irrespective of whether a synchronous or asynchronous transfer is triggered an independent timeout isimplemented in the DDE server. The default setting of this value is 3 s.

This value can be parameterized in file SIN840C.INI (see Section 3.5) in section [NCDDESERVER].

[NCDDESERVER]Timeout=4

The timeout value is specified in seconds. In the example above it is 4 seconds.

5.5.3.1 Synchronous reading

The function DdeClientTransaction() can be parameterized with timeout. The function is thenonly terminated when

1. the requested data have arrived (return value = data handle)

2. the server does not recognize the item (return value = FALSE)

3. the timeout has been exceeded (return value = FALSE)

With this type of instruction, the DDE data server must first send an I code to the CNC and wait for itsacknowledgement. During this action, other requests cannot be processed.

Program run:

Client: Server:

DdeClientTransaction(...) → DdeCallBack(...)

... ← XTYP_REQUEST:

Evaluate data Send request I code to the NC

Wait for response I code

Return (DdeCreateDataHandle(...)) ↓

Advantage: Simple request for data by calling a functionDisadvantage: "Simultaneous" reading of data not possible

Page 182: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-30 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5.3.2 Asynchronous reading

If TIMEOUT_ASYNC is specified instead of the timeout, the function DdeClientTransaction()terminates immediately with a Boolean value:

TRUE: Request being processedFALSE: Transaction not processed

In this type of data request, only the I code is transferred to the CNC. The client is informed of thearrival of the requested data by the running of the XTYP_XACT_COMPLETE branch in the call-backfunction of the client.

Program run:

Client: Server:

DdeClientTransaction(...) → DdeCallBack(...)

← XTYP_REQUEST:

Send request I code to the NC

Wait for response I code

Return (DdeCreateDataHandle(...)) ↓

DdeCallBack() ←

XTYP_XACT_COMPLETE

Evaluate data

Advantage: Parallel processing of requests to the NC possible.Disadvantage: Increased programming effort in the client.

Page 183: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-31SINUMERIK 840C OEM Version for Windows (BN)

5.5.3.3 Synchronous writing of NC data

In writing data a distinction is made between synchronous and asynchronous transmission in the sameways as for reading.

In order to write data, the client application must call the function DdeClientTransaction() withthe transfer parameter XTYP_POKE and the handle for the data to be transmitted.

In this way the DDE data server sends the appropriate I code to the NC and waits for acknowledge-ment. If an error occurs, the value DDE_FNOTPROCESSED is always returned.

In the debug window of the DDE server, an error text is displayed as described in Subsection 5.5.2.5.

Program run for synchronous writing of data:

Client: Server:

DdeClientTransaction(...) → DdeCallBack(...)

... ← XTYP_POKE:

Evaluate acknowledgement Send request I code to the NC

Wait for response I code

Return (DDE_FACK) ↓

Advantage: Simple request for data by calling a functionDisadvantage: "Simultaneous" reading of data not possible

5.5.3.4 Asynchronous writing of NC data

Program run for asynchronous transfer:

Client: Server:

DdeClientTransaction(...) → DdeCallBack(...)

← XTYP_POKE:

Send request I code to the NC

Wait for response I code

Return (DdeCreateDataHandle(...)) ↓

DdeCallBack() ←

XTYP_XACT_COMPLETE

Evaluate data

Advantage: Parallel processing of requests to the NC possible.Disadvantage: Increased programming effort in the client.

Page 184: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-32 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5.4 Transparent data transmission

In addition to the conventional DDE access to NCK data, "transparent data exchange" provides theuser with another DDE server interface with the NCK that permits all the options of internal MMC NCKcommunication and is not restricted to the I codes of the 0x0100-0x01FF group. In particular, thefollowing functions are implemented via the "transparent data exchange":

• Reading and writing of drive machine data

• Reading and writing of PLC data, even with PLC stop

• Setting/resetting of cyclic requests or change requests with the NCK

With "transparent data exchange" the DDE server does not perform any conversion or reconversion ofthe addressed variable name (ITEMS) and formats to the associated I code protocol of the NC. Theuser must put together the I code packets and control the protocol sequences in his application. TheDDE server only receives the I code packets coming from the client and passes them on (trans-parently) to the NCK. In the same way, the packets returned from the NCK are passed to the clientwithout a conversion. The client must then interpret and process the returned data in accordance withthe various protocol variations. With this function the NC data can also be transferred in various formats(byte, word, double-word, ...).

As from SW 5, data exchange is no longer limited to the communication path MMC <--> DDE-Server<--> NCK. Transparent data transmission is also possible between two MMC software components. Itis thus possible to send I code commands which are normally only requested from the NCK/PLC sidefrom an MMC application. However, it is important to note that the receiver components can alsointerpret and process the received I code.

Transparent data exchange between MMC applications makes it possible for any Windows applicationto trigger workpiece transfer and job list processing (cf. A2.1.4.2 and A2.1.4.3).

Assembly of the I code packets is only possible with the programming tools (MS C++, etc.) that permita binary structure of data packets. With programs such as MS Excel or MS Word that only have a text-oriented DDE interface, "transparent data exchange" is not possible.

The I code interface and the associated protocols are described in detail in Appendix 1.

5.5.4.1 How transparent data transmission works

To perform "transparent data exchange" via the DDE server the user must proceed as follows:

• First of all, the special clipboard data format "DDE_ICODE" must be registered. Dataexchange via DDE is only possible with data formats of the windows clipboard. The new dataformat must first be registered with the Windows operating system. This is done in pro-gramming language C with the function RegisterClipboardFormat().

• After this, a "transparent data channel" to the DDE server must be initiated. The programmermust start an advise link with the item name "ICODE_[x]1".

1[x] can be any string

Page 185: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-33SINUMERIK 840C OEM Version for Windows (BN)

On the basis of this special item the DDE server assigns a unique request number in the ADS(Allgemeine Daten Schnittstelle - general data interface) header of the data packets for allpackets transferred via this data channel. Generally, only the higher byte of the requestnumber is managed by the DDE server, the lower byte of the request number (3-256) can beused by the OEM user for his own management. When a data packet is received, the usermust mask the higher byte of the request number.

One exception are the change requests. Here, the whole request number (high byte and lowbyte) is managed by the DDE server.

With transparent data exchange, the sender component in the ADS header of the datapackets is always managed exclusively by the DDE server.

• After this, the appropriate I code packet is generated in its own data area. An I code packetessentially consists of an ADS header, the actual I code header (internal code) and the usefuldata. The user must generate a "handle" for this data area using the functionDdeCreateDataHandle() or DdeCreateStringHandle().

• Then the data packet to the DDE server must be passed on to the DDE server with thefunction DdeClientTransaction(). The following parameters must be specified:

Item name = as for starting an advise linkTransaction type: XTYP_POKEClipboard format = DDE_ICODE

• I code response packets that the NC returns to the DDE server with the appropriate requestnumber (higher byte) are passed by the DDE server to the client via the advise linkassociated with the request number.

Before the client application is terminated the client must close the data channel with the transactiontype XTYP_ADVSTOP of the function DdeClientTransaction().

Client

Client

Client

Server

Server

Server

NCK

NCK

NCK

AD S hea der

I co de

AD S hea der

I co de

Data Data

A dv ise sta rtITEM: ICODE_0815

ICODE_0815Poke

A dv ise d a ta

ICODE_0815

O pe n in g the "tra nspa re n t da ta ch ann e l"

T rans m itting an I co de p acke t to the N C

R ece iv ing th e I co de res ponse p acke t fro m the N CAD S hea der

AD S hea der

I co de

I co de

Fig. 5.15: Principle of transparent data exchange

Page 186: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-34 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.5.4.2 Cyclic requests/change requests

Cyclic or change requests are generated in two stages:

• In the first step, the user must transfer DBBs (data block descriptions) to the NCK afteropening an advise link using the I code 0500H. In these DBBs which are deposited in theNCK, the I codes are listed that designate the data to be transferred by the cyclicrequest/change request more precisely. A maximum of 22 I codes can be transferred for eachDBB.

ADS header 16 bytesI code header 20 bytesProtocol 4 4 bytesDBB header 20 bytes

60 bytes 1st I code 20 bytes2nd I code 20 bytes... ...22nd I code 20 bytes

22 x 20 =440 bytes

(ADS data package sizemax. 512 bytes)

Total 500 bytes

A total of 64 DBBs can be deposited in the NCK.

In cyclic requests, the user can also assign the lower byte of the request number within therange 3 to 256 (not for change requests). The client receives the appropriate acknowledge-ment packet from the DDE server after successful transfer of the DBBs.

The user must buffer both the sender component and the entire return request number fromthis acknowledgement packet.

Page 187: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-35SINUMERIK 840C OEM Version for Windows (BN)

Client

Client

Client

Server

Server

Server

NCK

NCK

NCK

AD S header

I code 05 00H

A cknow -ledgem en t

Adv ise sta rtITEM: ICODE_0815or ICODEADV

ICODE_0815ICODEADV

Poke

A dv ise d ata

ICODE_0815ICODEADV

O p e n in g th e "tran spa re n t da ta ch a nn e l"

Tran sm itting a D B B packe t to th e N C

R e ce iv in g a n I co de ackn o w le d g em ent pa ckag e from th e N C

I c ode 05 00H

S to rin g th e re qu e s t n um be r a n d se nde r co m po n en t fro m th e A D he a der o f the a ckn o w le d gem e nt p ack e t

Client Server NCKI code 05 04H

ICODE_0815ICODEADV

Poke

S tarting the cyclic reques t or chan ge reques ts

Client Server NCKData

A dv ise d ata

ICODE_0815ICODEADV

C yc lic re ce ip t o f the d a ta from th e N C K

I c ode 05 04H

AD S header

AD S header

AD S header

AD S h eade r

I c ode 05 00H

I c ode 05 00 H

I c ode 05 04 H

Data

I code 05 04H

AD S h eade r

AD S h eade r

AD S h eade r

Fig. 5.16: Generation of a cyclic request/change request

Page 188: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-36 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

• In the second step the user must start the cyclic request or change request using the I code0504H. To do this the user must put the same request number and sender component in theADS header of his I code packet as he received from the DDE server acknowledgementpacket. Each cyclic request or change request can obtain a maximum of 32 DBBs.

A distinction is made between cyclic requests and change requests. With cyclic requests, the data aresent from the NCK to the DDE server and then to the client cyclically. The cycle time can be set by theuser in the parameter "Repeat factor" in the appropriate I code 0500H (transfer DBB to the NCK). A"repeat factor" 1 means that the data are prepared and sent to the DDE server on every call (approx.100 ms) of the relevant NCK module. A "repeat factor" n ensures that data are only sent on every nth

call (cycle time: approx. nx100ms, recommendation: n>1).

The ADS data packet size is always 512 bytes both for the usual I code data traffic and for the cyclicrequests. The applies both to the request packet (MMC -> NC) and to the response packet (NC ->MMC).

With change requests, the data are also processed by the NCK but only sent to the DDE server when achange occurs. The packet size used depends on the item name under which the "Transparentchannel" was opened (see A1-4). A total of 4 change requests is possible.

To generate a change request, one of the following names must be used as the item name when anadvise link to the DDE server is opened:

• "ICODEADV"

• "ICODEADV1"

• "ICODEADV2"

• "ICODEADV3"

If an attempt is made to use the same item name twice, the requesting client receives a negativeacknowledgement. If the advise link is opened with another item name (e.g. ICODE_0815), a cyclicrequest is automatically generated.

The sum of the cyclic requests and change requests must be less than 32. Please note that the DDEserver can manage no more than 256 requests. With request and poke transactions, this is irrelevantbecause the request is cleared when the transaction terminates. With an advise link, however, a job isonly terminated when an advise stop is programmed.

Cyc./changerequest(I code 0504H)

1 2 3 ... 32 (max.)(of which max.4 are change

requests)DBB (with max.22 I codes)

123...22

A maximum total of 64 DBBs in the NCK

Change and cyclic requests can be cleared with the I code 0505H. The data block descriptions storedin the NCK can be cleared with the I code 0501H.

Page 189: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-37SINUMERIK 840C OEM Version for Windows (BN)

5.6 MMC PLC interface

The MMC PLC interface is a general interface for the OEM user to exchange information "freely"between his applications on the MMC and his user program in the PLC.

5.6.1 Overview

Data is transmitted between the MMC and the PLC via mailboxes as in the SINUMERIK 840C BasicVersion.

On the MMC side, the OEM user can specify his "own" protocol via freely parameterizable DDEcommands (ITEMS) and set up a link between his Windows applications (DDE client) and the PLC. Onthe MMC side all DDE mechanisms provided by Windows (REQUEST, POKE, EXECUTE andADVISE) are supported.

On the PLC side the user is responsible for supplying and clearing mailboxes, evaluating theinformation of the data packets transferred and processing or provision of the required data.

5.6.2 Data exchange on the PLC side

Two "parallel" mailboxes are implemented in either transmission direction between the MMC and thePLC. Each mailbox can accommodate several items (data packets) that are processed according to theFIFO principle. In this way, several data packets can be located in a mailbox simultaneously. Themaximum length of the transmitted data packets depends on the length of the mailbox.

The actual data transfer to and from the DDE server is performed by the operating system, whichregards data as pure "user data" and does not therefore interpret the content any further. The DDEserver evaluates useful data and converts the format, if necessary.

The user addresses the mailboxes using function macros FX73 for sending and FX74 for receiving.Transfer of the data between the function macro and the user is performed in a data transfer area thatis implemented by data blocks DB or DX. The user specifies the block number in the FX call.

Acknowledgements of function macros are stored in flag bytes. The number of flag bytes is alsospecified by the user in the FX call.

The flag word informs the user about whether and in which mailbox data have arrived for him and canbe read by the FX74. The number of the flag word is defined in machine data.

Both on the PLC and the MMC side there are two logical components to which the data can beaddressed. In this way data can be sent to specific PLC or MMC program parts.

The mailboxes are permanently assigned by the operating system to the logical components. Dataexchange between the components of a mailbox does not therefore affect the transmission betweenthe other components.

Data exchange always begins on the initiative of the client application on the MMC side.

Page 190: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-38 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.6.2.1 Writing to the MMC

Writing data from the PLC to the MMC is subdivided into the following steps:

1. The data packet is assembled in the data transfer area of the PLC. The datatransfer area can be located in any DB or DX. A packet header, a format identifierand an error word are placed in front of the data packet.

2. After this, the FX73 block is called and the following parameters are transferred:

- Block type DB or DX

- No. of the DB/DX block that the data packet contains.

- No. of the word in which the data packet begins

- No. of the 1st of 3 flag bytes in which the acknowledgement is stored.

The data packet must be assembled and FX73 called by appropriate user function blocks (cf. A2.2.1).

5.6.2.2 Reading from the MMC

Reading of the data packets using macro FX74 is subdivided into the following steps:

1. On the basis of the information "Data packet present", the FX74 block reads a datapacket from the mailbox and stores it in the specified data transfer area. A packetheader is placed in front of the data packet.

The following parameters must be passed to the FX 74:

- Block type DB or DX

- No. of the DB/DX block that data packet is to go into.

- No. of the word at which the data packet is to begin

- No. of the MBX from which the data packet is to be read

- No. of the 1st of 3 flag bytes in which the acknowledgement is stored.

2. Evaluation of the useful data.

FX74 must be called and the data packet (2.) evaluated by an appropriate user function block (cf.A2.2.2).

For transmission, only a rough protocol framework and the transport mechanism are specified. Theprotocol sequence must be controlled by the user with function blocks FX 73 and FX 74.

Page 191: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-39SINUMERIK 840C OEM Version for Windows (BN)

5.6.3 Data exchange on the MMC side

MMC PLC data exchange is performed via the Windows DDE interface. In this way, PLC data can beread from or written to any DDE capable applications (e.g. Excel).

The DDE server manages data transfer between the MMC and the PLC on the MMC side of the DDEserver. Read or write are requested by calling the relevant DDE functions from the client applications ofthe MMC.

The client performs a transaction [e.g. by DdeClientTransaction()] and at the same timetransfers an ASCII string (ITEM) to the DDE server. The DDE server interprets the string andgenerates a data packet that is stored in the addressed mailbox to the PLC.

The request to read or write PLC data must always come from the client on the MMC side (registrationin the DDE server).

The ITEM for access to the PLC comprises:

PLC<component_ID>_<format>_<parameter_string>

The meaning of the individual parameters are:

Keyword: PLC Data traffic to the PLC

Component ID: <1,2> 1 = PLC OEM component 1 Length of the mailbox: 512 bytes2 = PLC OEM component 2 Length of the mailbox: 128 bytes

Format string: <Format> TXT Useful data in CF_TEXT format(one ASCII value per character)

BG Useful data in BCD format

Parameter string <Parameterstring>

The keyword PLC1_... or PLC2_..., and the format ID are mandatory. The following parameter string isavailable to the user for the definition of an individual protocol. The length of the parameter string islimited to a maximum of 20 characters incl. '\0'.

Any useful data are transferred from the client application via a separate handle (DDE interface). If theformat string entered is "BG", the DDE server converts the useful data from the client from CF_TEXTformat to the required PLC format. If the format string entered is "TXT", the data from the client isinterpreted and no conversion is performed. The data are stored on the PLC side in the KC format.

The transmission procedure from the PLC to the MMC is similar.

MMC PLCData format Format string in the ITEM PLC format Identifier in DDE

formatCF_TEXT ..._TXT_... KC 0x001CF_TEXT ..._BG_... BG 0x002

Page 192: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-40 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.6.4 Structure of data packets on the PLC side

In the data transfer area which must be in a data block of type DB or DX on the PLC side, the userassembles the packet to be sent and obtains the received packets.

The block type, block number and first data word are transferred to function block FX73/74 when calledvia parameters DBTY, DBNR and DWNR (see paragraphs "FX73", "FX74" in A2.2).

To permit unique conversion to the Windows DDE interface, a rough framework is defined for the datapackets that are transferred to and from the PLC. This framework is defined by the new request datastructure "DDE data packet" in the packet header.

5.6.4.1 Structure for receiving

Each of the DDE data packets received from the PLC comprises:

Packet header Total length [words]SenderReceiverRequest data structureRequest number

DDE requestword

1st data word

DDE format 2nd data wordParameterheader

[10 words]

Useful data

Structure of a data packet in the transfer area: Receive

Packet header:

Data length, format KFWhen sending, the user enters the number of data words to be transmitted (useful data). TheFX73 transmits the number of specified data words. The data after this are not considered.The data length must not be greater than the length of a mailbox.

Value range: MB length 512 bytes: 0 - 248 [words]MB length 128 bytes: 0 - 56 [words]

When receiving, the FX74 transfers the number of received data words (useful data) to the user.Data behind this is invalid.

Value range: MB length 512 bytes: 0 - 248 [words]MB length 128 bytes: 0 - 56 [words]

With a data length=0, only the data header is transmitted.

Page 193: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-41SINUMERIK 840C OEM Version for Windows (BN)

Logical sender/receiver, format KH

When a packet is sent, the sender must specify the receiver so that the transport system candeliver the packet correctly. So that the receiver knows where the packet has come from and cansend an acknowledgement to the sender, if necessary, the sender of the packet must be knownto it. These two items of information are kept in the packet header.

Both in the PLC (201h, 202h) and on the MMC side (31A, 319h) two logical components arereserved for OEM applications. Only requests to and from these components are received andsent by the PLC function blocks FX73/FX74.

Logical component Componentname

Max. packet lengthwithout header

Maximum usefuldata length

1st PLC component2nd PLC component

201h202h

248 words=496 bytes56 words = 112 bytes

236 words=472 bytes44 words = 88 bytes

1st MMC component2nd MMC component

31Ah319h

248 words=496 bytes56 words = 112 bytes

236 words=472 bytes44 words = 88 bytes

Because data exchange between the MMC and the PLC is performed via the DDE server, theDDE server registers itself at the MPR server with the MMC components 31Ah and 319h. In thisway, client applications can address both PLC components (mailboxes) on the MMC side.

This gives rise to the following (fixed) addressing scheme because of the internal structure of thefunction blocks FX73/FX74:

MMC PLCDDE server 31AH 201HDDE server 319H 202H

Assignment of the logical components

Request data structure, format KF

The request data structure specifies the type of protocol of the data transmitted. Forcommunication, the request data structure = "DDE data packet" (0005H).

Request number, format KF 0-32767

With client requests from the MMC side the request number is assigned by the DDE server. Theresponse from the PLC to the DDE server must have the same request number.

DDE request word:

The type of DDE request (REQUEST, POKE, ADVISE, ...). The "transaction type" is entered.The associated IDs are taken from the Windows-SDK "ddeml.h" valid for this software version.

DDE format:

Format of the useful data [TXT,BG] (cf. Subsection 5.6.3).

Parameter header:

Parameter string from the ITEM (Parameter string from the DDE command sent by the MMCclient application). The DDE server fills the parameter header with zero bytes to a total length of10 words if necessary - if the parameter string specified on the MMC side is smaller than 20characters.

Page 194: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-42 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Useful data:

The useful data are entered in the format specified in the DDE format.

5.6.4.2 Structure for sending

Each data packet sent by the PLC comprises:

Packet header 5 words

DDE format [1 word]

Error word [1 word]

Useful data

Structure of the data packet in the transfer area: Send

Packet header:

(cf. 5.6.4.1)

DDE format:

Format of the useful data [CF_TEXT, BG].

Error word:

A value not equal to zero signals an error. In this case, the error number entered is displayed inthe debug window of the DDE server. The user must declare the error number in accordancewith his "own" protocol.

Useful data:

The useful data are entered in the format specified in the DDE format. The MMC DDE serverconverts to CF_TEXT format, if necessary.

The length of the useful data sent is limited to the length of the mailbox.

Max. Packet length withoutheader

Maximum useful length

PLC component 1 (201H) Length 248 words = 496 bytes Length 246 words = 492 bytes

PLC component 2 (202H) Length 56 words = 112 bytes Length 54 words = 108 bytes

Page 195: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-43SINUMERIK 840C OEM Version for Windows (BN)

5.6.5 MMC-PLC data exchange (examples)

5.6.5.1 Reading PLC data (DDE_REQUEST)

The MMC client sends a DDE_REQUEST; the DDE server receives an XTYP_REQUEST from the client.The parameter string from the ITEM "Read PLC data" (e.g. DB48, DW1) is taken over into theparameter header of the data packet as an ASCII string, a request number assigned by the DDE serveris entered in the packet and the type of request is entered in the DDE request word. The responsepacket must contain the same request number.

Example:

DDE call in the MMC client application:

Request Read from DB48, DW 1ITEM "PLC1_TXT_Read_DB_48_1";Transaction type XTYP_REQUEST

Receive packet in the PLC transfer area: Request to read

Packet header Total length [words] 000CH (without header)

Sender 031AH (DDE server)

Receiver 0201H (1st PLC component)

Request data structure 0005H (DDE data packet)

Request number 0316H (assigned by the DDE server)

DDE request word B000H (XTYP_REQUEST)

DDE format 0100H (CF_TEXT)

Parameter header "Read_DB_48_1\0" (parameter string incl. \0 = 13bytes)

00 00 00 00 00 0000 H

(7 filler bytes for total length of10 words)

(The data packet contains no useful data)

Response packet in the PLC transfer range:

Packet header Total length [words] 0005H (without header)

Sender 0201H (1st PLC component)

Receiver 031AH (DDE server)

Request data structure 0005H (DDE data packet)

Request number 0316H (same number as in request)

DDE format 0100H (CF_TEXT)

Error word 0000H (no error)

Useful data "1031\0" (content DB48, DW1)

In the client, reading is initiated by calling the function DdeClientTransaction(). With synchro-nous reading, the handle of the data read is returned. This means that the function is only terminatedwhen the data are available. On an error, FALSE is returned.

Page 196: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-44 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

With asynchronous reading, the function DdeClientTransaction() returns TRUE as soon as therequest has been successfully initiated. The data packet read is signaled via the client transactionXTYP_XACT_COMPLETE. On an error, FALSE is returned.

5.6.5.2 Writing PLC data (DDE_POKE)

The MMC client sends a DDE_POKE; the NCDDE server receives a XTYP_POKE and the handle of thedata to be written. A data packet is assembled in the NCDDE server from the item name "Write PLCdata" and the useful data.

Example:

DDE call in the MMC OEM client application:

Request Write from DB48, DW 1

ITEM "PLC1_TXT_Write_DB_48_1";

Transaction type XTYP_POKE

Receive packet in the PLC transfer area: Request to write

Packet header Total length [words] 000FH (without header)

Sender 031AH (DDE server)

Receiver 0201H (1st PLC component)

Request data struct. 0005H (DDE data packet)

Request number 0346H (assigned by the DDE server)

DDE request word 9000H (XTYP_POKE)

DDE format 0100H (CF_TEXT)

Parameter header "Write_DB_48_1\0" (parameter stringincl. \0 = 13 bytes)

00 00 00 00 00 0000H

(7 filler bytes, total length 10words)

Useful data "2032\0" (useful data length = 5 bytes)(The data packet contains useful data)

Response packet in the PLC transfer area:

Packet header Total length [words] 0002H (without header)

Sender 0201H (1st PLC component)

Receiver 031AH (DDE server)

Request data structure 0000H

Request number 0346H (same number as in request)

DDE format 0100H (CF_TEXT)

Error word 0000H (no error)

A DdeClientTransaction() function call returns the value TRUE with synchronous writing, if thedata are acknowledged by the PLC with a data packet with the same request number.

Page 197: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-45SINUMERIK 840C OEM Version for Windows (BN)

This means that the function is only terminated when the data packet for writing has arrived in the PLCand has been acknowledged with a response packet.

With asynchronous writing, the function DdeClientTransaction() returns TRUE as soon as therequest has been successfully initiated. As soon as the data packet has arrived in the PLC and hasbeen acknowledged by the PLC with a response packet with the same request number, this is signaledby the DDE server via the client transaction XTYP_XACT_COMPLETE with TRUE. If an error occurs, theXTYP_XACT_COMPLETE signals FALSE.

Depending on the format string in the ITEM, the appropriate DDE format is entered in the MBX packetand the useful data converted, if necessary.

5.6.5.3 Advise link for PLC data (DDE_ADVISE)

An advise link can be initiated by the MMC client application. The PLC user can decide whether therequired information is to be provided on every change or cyclically.

The useful data must be sent to the DDE server with the appropriate request number.

Using the request number and the information that an advise link exists for this request, the DDEserver passes on the data received to the client concerned.

Up to 256 possible request numbers are assigned in the DDE server per advise loop.

Example:

DDE call in the MMC client application:

Request Read from DB48, DW 1

"PLC1_BG_Read_DB_48_1";

Transaction type XTYP_ADVSTART

Receive packet in the PLC transfer area: Request to read per advise link

Packet header Total length [words] 000CH (without header)

Sender 031AH (DDE server)

Receiver 0201H (1st PLC component)

Request datastructure

0005H (DDE data packet)

Request number 0316H (assigned by the DDE server)

DDE request word 3000H (XTYP_ADVSTART)

DDE format 0200H (request for data in BGformat)

Parameter header "Read_DB_48_1\0" (parameter stringincl. \0 = 13 bytes)

00 00 00 00 00 0000H

(7 fill bytes for total length of10 words)

(The data packet contains no useful data)

Page 198: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-46 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Response packet in the PLC transfer area:

Packet header Total length [words] 0005H (without header)

Sender 0201H (1st PLC component)

Receiver 031AH (DDE server)

Request data struct. 0005H (DDE data packet)

Request number 0316H (same number as in request)

DDE format 0200H (useful data in BG format)

Error word 0000H (no error)

Useful data "1031 \0" (content DB48, DW1)

An advise link is retained until the client sends the request to abort.

Example:

DDE call in the MMC OEM client application to terminate an advise link:

Request Read from DB48, DW 1

ITEM "PLC1_BG_Read_DB_48_1";

Transaction type XTYP_ADVSTOP

Receive packet in the PLC transfer area: Request to abort an advise link

Packet header Total length [words] 000CH (without header)

Sender 031AH (DDE server)

Receiver 0201H (1st PLC component)

Request data struct. 0005H (DDE data packet)

Request number 0316H (allocated by DDE server)

DDE request word 4000H (XTYP_ADVSTOP)

DDE format 0200H (BG)

Parameter header "Read_DB_48_1\0" (Parameter stringincl. \0 = 13 bytes)

00 00 00 00 00 0000H

(7 fill bytes for total length of10 words)

(The data packet contains no useful data)

With advise stop the same ITEM must be specified as for advise start.

Special points when using Visual Basic:

• When an advise link is opened (Linkmode=Automatic) an empty string is returned atfirst.

Page 199: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-47SINUMERIK 840C OEM Version for Windows (BN)

• An Advise link to the PLC can also be triggered with Visual Basic applications.However, Visual Basic does not send XTYP_ADVSTOP when switching over fromlink mode AUTOMATIC or NOTIFY but XTYP_DISCONNECT. As from SW 5, thefunctionality of the DDE server is designed to deal with this problem.

If the DDE server receives an XTYP_DISCONNECT it checks whether an adviselink to the PLC exists. If it does, the DDE server terminates this advise link bysending an XTYP_ADVSTOP data packet to the PLC. The connection is thenterminated.

Error handling

On an internal error on the MMC side (e.g. when the data packet is too large to fit in the mailbox), theDDE server outputs an appropriate message text in the debug window.

If a response packet is received by the PLC in which the error word is not equal to zero, the string "PLCerror message # <content of error word>" is displayed in the debug window of the server.

The content of the error word is not specified in any more detail because it is defined by the OEM user.

The MMC client receives an acknowledgement as for the Windows DDE interface.

Page 200: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-48 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.6.5.4 PLC user program (DDETESST.S5D)

This PLC user program contains an example of a simple MMC�PLC and PLC�MMC datatransmission. MMC-PLC communication can be tested with MMC program OEM-Client (Subsection6.3.3).

The following preparations must be made for testing:

− Blocks with which PG are transferred to the PLC

Block type Number Doc file Length Library numberDX 73 260DX 74 276FX 73 53FX 74 56FX 173 91FX 174 98

− Enter number of flag word for data exchangePLC-MD 137 = 70

− Expand statement list for OB1NETWORK 1 0000 . . . :BA FX 173 NAME :FX73 :BA FX 174 NAME :FX73 . . . :BE

− Call sample program OEM-ClientThe first PLC component returns the first 6 characters of the parameter string in each case.E.g.: Item name: PLC1_TXT_Test 1 � PLC returns "Test 1".

The second PLC component returns the text "THIS IS MAILBOX 2 !?!" in each case; '?' stands for acharacter that is incremented after every call.E.g.: Item name: PLC2_TXT_Test 1 � PLC returns "THIS IS MAILBOX 2 !?!".

Page 201: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-49SINUMERIK 840C OEM Version for Windows (BN)

Statement list FX173:NETWORK 1 0000 NAME :FX73 0005 :A DB 40 0006 :UN M 55.5 Set for OEM-EMPF 0007 :UN D 100.15 0009 :SPB =M001 000A :R M 55.5 Flag: Delete OEM-EMPF 000B :AX DX 73 Assignment for OEM-SEND 000D :L KH 0008 000F :T DW 0 Packet length without header 0010 :L KH 0201 0012 :T DW 1 Sender is 1st PLC component 0013 :L KH 031A 0015 :T DW 2 Receiver is DDE server 0016 :L KH 0005 0018 :T DW 3 Request data structure 0019 :L DW 44 transferred from receive buffer 001A :T DW 4 Request number 001B :L DW 46 transferred from receive buffer 001C :T DW 5 DDE format 001D :L KH 0000 001F :T DW 6 Error word (0 = no error) 0020 : Useful data from this point onwards 0021 :L DW 47 Transfer the 1st 6 characters 0023 :T DW 7 of the received parameter 0024 :L DW 48 string 0026 :T DW 8 0027 :L DW 49 0029 :T DW 9 002A :L KH 0000 End of string (‚\0‘) 002C :T DW 10 Last data in transmission 002D :L KH 0255 002F :T DW 11 0030 :L KH 0255 0032 :T DW 12 0033 :L KH 0000 0035 :T DW 13 0036 :T DW 14 0037 :L KH 0000 0039 :T DW 15 003A :L KH 0000 003C :T DW 16 003D :L KH 0000 003F :T DW 17 0040 :L KH 0000 0042 :T DW 18 0043 :BA FX 73 0045 NAME :OEM-SEND 0046 DBTY : KC DX 0047 DBNR : KF +73 0048 DWNR : KF +0 0049 QTTG : KF +73 004A : 004B :BEA 004C : 004D M001 : 004E :U M 71.0 PLC-MD137=70!!! 004F :S M 55.5 Flag: Set OEM-EMPF 0050 :BAB FX 74 0052 NAME :OEM-EMPF 0053 DBTY : KC DX 0054 DBNR : KF +73 0055 DWNR : KF +40 0056 OEMN : KF +0 0057 QTTG : KF +80 0058 :BE

Page 202: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-50 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Statement list FX174:NETWORK 1 0000 NAME :FX73 0005 :A DB 40 0006 :UN M 66.6 Set for OEM-EMPF 0007 :UN D 100.14 0009 :SPB =M001 000A :R M 66.6 Flag: Delete OEM-EMPF 000B :AX DX 74 000D :L KH 000D 000F :T DW 0 Packet length without header 0010 :L KH 0202 0012 :T DW 1 Sender is 2nd PLC component 0013 :L KH 031A 0015 :T DW 2 Receiver is DDE server 0016 :L KH 0005 0018 :T DW 3 Request data structure 0019 :L DW 44 Request number transferred from 001A :T DW 4 receive buffer 001B :L DW 46 DDE format transferred from 001C :T DW 5 receive buffer 001D :L KH 0000 001F :T DW 6 Error word (0 = no error) 0020 : 0021 :L DW 16 0022 :I 1 Incrementation of ‚?‘ 0023 :T DW 16 in „!?“ 0024 : 0025 :SPA =M002 Continue at M002 0026 :L KC MB 0028 :T DW 7 0029 :L KC OX 002B :T DW 8 002C :L KC 2 002E :T DW 9 002F :L KH 0000 0031 :T DW 10 0032 :L KH 0255 0034 :T DW 11 0035 :L KH 0255 0037 :T DW 12 0038 :L KH 0000 003A :T DW 13 003B :T DW 14 003C :L KH 0000 003E :T DW 15 003F :L KH 0000 0041 :T DW 16 0042 :L KH 0000 0044 :T DW 17 0045 :L KH 0000 0047 :T DW 18 0048 M002 : 004A :BA FX 73 004C NAME :OEM-SEND 004D DBTY : KC DX 004E DBNR : KF +74 004F DWNR : KF +0 0050 QTTG : KF +93 0051 M001 : 0052 :U M 71.1 PLC-MD137=70!!! 0053 :S M 66.6 Flag: Set OEM-EMPF 0054 :BAB FX 74 0056 NAME :OEM-EMPF 0057 DBTY : KC DX 0058 DBNR : KF +74 0059 DWNR : KF +40 005A OEMN : KF +1 005B QTTG : KF +60 005C :BE

Page 203: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-51SINUMERIK 840C OEM Version for Windows (BN)

5.6.6 Execution of MMC applications by the PLC side

5.6.6.1 Overview

With the integrated PC of the SINUMERIK 840C OEM Version for Windows and the open operatingsystem Windows for Workgroups 3.11, it is possible to perform tasks with the MMC that werepreviously only performed in the PLC or in an external PC (e.g. tool management, measuring, etc.).

Applications of this kind can always be implemented as separate programs (.EXE files) that are startedeither via the area switchover or as an autostart application when the control is started up or"automatically", triggered by an event ("new tool", "PLC timer elapsed").

With this function, MMC applications can be triggered from the PLC by external or internal events.

Because starting or terminating an MMC application can be requested by the PLC at any time, anapplication (server) must always be ready (started) on the MMC side to receive and process therequests. In the 840C OEM Version for Windows, this server function is performed by the MMCcomponent 31BH, i.e. the basic module "clock" (UHR:EXE).

An MMC application is started or terminated using the I code 42EH.

5.6.6.2 Starting an MMC application from the PLC

The OEM user can enter the applications (*.exe, *.com, *.bat) that are to be started or terminated bythe PLC in the initialization file SIN840C.INI (see Section 3.5).

[plcstart]app1=messen.exe...app5=c:\anw\simula.exe -o

Using the application number that is transferred with the I code 42EH, the server obtains the name ofthe application to be started or terminated from the INI file SIN840C.INI. The number of possible entriesis limited to 5 entries. In addition to the program name the path and optional calling parameters canalso be entered. The resulting call string for the application that is converted to the Windows parameternCmdLine comprises the entry in the SIN840C.INI with any other necessary call para-meters that aretransferred with the I code.

If no path is specified, the application program is searched for in the current directory, in the Windowsdirectory or in the path specified in the PATH environment variable.

The window mode transferred in the I code is converted to the Windows parameter nCmdShow andtransferred when the application is started. This defines how the application is to be displayed on thescreen (e.g. full screen, window, icon, foreground/background).

If a DOS program is started the window mode is disabled. In this case, an entry must be made in theassociated PIF file defining whether the application is to be run full screen or in a window. If no PIF fileexists for the application, the entries in the DEFAULT.PIF in the Windows main directory apply.

Page 204: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-52 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.6.6.3 Terminating an MMC application from the PLC side

The PLC sends the I code 42eH with the value 0 as the start ID. The server (31BH) sends a WM_CLOSEmessage to the main window of the application. This also applies if, for example, a (modal) dialog boxis open in the application.

The precondition for terminating is always that the application can be terminated with WM_CLOSE.

The OEM application must not have the window style CS_NOCLOSE.

The application itself must ensure that it is terminated correctly by WM_CLOSE, i.e. without loss ofdata.

The I code 42EH for terminating an application is always acknowledged with a response packet.However, this response packet only indicates that the request for termination has been initiated but notthat the application really has been terminated.

If an application is started several times (several instances), only the last instance can be terminated.

5.6.6.4 I code description (42EH)

The OEM user is provided with a general interface in the form of an I code via which the start/stoprequests can be output from the PLC.

Basis:

The transport of the "data" is performed via the mailboxes in the MMC PLC dual-port RAM using theADS transport interface (cf. I code description) and the two function blocks FX73/FX74.

I code ID: 42EH

Function: Start or terminate Windows/DOS application in the MMC area

Processing softwarecomponent in the MMC: 31BH (UHR.EXE)

For the I code 42EH basic type I is used as the protocol.

Descriptions: Examples:

I code ID 2E04H

Control flags 0010H

Type beginning -

Type end -

Number beginning -

Number end -

Format 0600H (Structure)

Field -

Channel/mode group -

Spare -I code 42EH: Start/terminate MMC applications from the PLC

Page 205: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-53SINUMERIK 840C OEM Version for Windows (BN)

The data to be written in order to start or terminate an MMC application are appended to the I codeheader.

The following structure must be used.

Start ID [word] 0100H (1=start)

Window mode [word] 0300H (3=full screen)

No. of the OEM appl. [word] 0500H (app5=simula.exe)

ID of call string [string] 0100H (1=call parameter follows)

Call string -r -s '\0' (Call string)Data structure for starting/terminating MMC applications

Start ID: OEM applications can be both started and terminated by the PLC.1 = start OEM application0 = terminate OEM application

Window modes: All values permissible for the WINDOWS parameter nCmdShow (see: theWINDOWS.H file valid for this software version in WINDOWS SDK)Examples:2 = SW_SHOWMINIMIZED = as icon in the foreground3 = SW_SHOWMAXIMIZED = as full display in the foreground5 = SW_SHOW = as normal display in the foreground7 = SW_SHOWMINNOACTIVE = as icon in the background8 = SW_SHOWNA = as normal display in the background

No. of the OEM application: In the file: SIN840C.INI (see Section 3.5) there is an entry defining whichapplications can be started and terminated by the PLC.

[plcstart]app1=messen.exe...app5=c:\anw\simula.exe -o

ID call string: 1 = call string follows0 = no call string

Call string: The call string must be concluded with '\0', is appended to the callparameters specified in SIN840C.INI (see Section 3.5) and transferredwith the MMC application call. The length is limited to the total length ofthe data packet.

The requests to start or terminate an MMC application are always sent to the MMC softwarecomponent 31BH.

Only one MMC application per data packet can ever be started of terminated.

A complete data packet for starting MMC applications always comprises the following, from the point ofview of the PLC applications:

Page 206: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-54 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Data packet in the PLC transfer area: Start MMC application

2 bytes

Packet header(PLC)

Packet length (without header) 0010H (without header)

Sender 0201H (1st PLC component)

Receiver 031BH (clock)

Request data structure 0001H (I code)

Request number 2221H

I code header I code ID 2E04H

Control flags 0010H

Type beginning -

Type end -

Number beginning -

Number end -

Format 0600H (Structure)

Field -

Channel/mode group -

Spare -

Data structure Start ID 0100H (Start application)

Window mode 0300H

No. of OEM application 0500H (app5=)

ID call string 0100H

Call string -r

'\0'

I code acknowledgment:

For the response the "basic type for following packets and responses" is used.

I code ID 042EH

Control flags 1400H

Value ID 33 (Request successfully carried out)

Protocol type -Response to the I code 42EH

In the response to "Start application", the value ID indicates whether the MMC application has beenstarted successfully.

Value ID: Value > 32 = OK; otherwise exactly that value is returned that the Windowsfunction WinExec() returns (see Windows SDK description).

Page 207: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-55SINUMERIK 840C OEM Version for Windows (BN)

The response to "Terminate application" can contain the following value ID:

0 = OK; WM_CLOSE was sent1 = Application was not started from the PLC or has already been terminated2 = Instance of the application could not be found

5.6.6.5 Terminating DOS programs

In order to prevent data loss, DOS programs must always be terminated in the way appropriate to theprogram in question.

However, if an attempt is made to terminate a started DOS program via the PLC, the response is asdefined in the option "Allow Close When Active" in the associated PIF file. The response is exactly as ifan attempt were made to exit WINDOWS while the DOS program is running.

If the option "Allow Close When Active" in the associated PIF file is not set, the following message boxappears if an attempt is made to leave WINDOWS:

If the option "Allow Close When Active" is set, the following message box is displayed when an attemptis made to exit WINDOWS:

Caution: With "OK", the application is cancelled abnormally. This can cause loss of data and musttherefore not be used.

Page 208: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-56 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

5.6.6.6 PLC user program (WINOEMST.S5D)

This PLC user program contains an example for testing the "Execution of MMC applications by the PLCside".

You must make the following preparations to perform the test:

− Make the following additions to SIN840C.INI[plcstart]; Starting an MMC application from the PLC, The number of possible entries is limited to 5; appX=<path><programm name>app1=app2=c:\windows\calc.exeapp3=app4=app5=

− Blocks with which PG are transferred to the PLC

Block type Number Doc file Length Library numberFB 11 50FX 73 53FX 74 56FX 170 174

− Enter number of flag word for data exchangePLC-MD 137 = 70

− Add following to statement list for OB1NETWORK 1 0000 . . . :BA FX 170 NAME :APPSTART . . . :BE

− Start/end MMC-Application via PLCThe pocket calculator function on the MMC is started when you presscustomer key 1 (machine control panel).

The pocket calculator function on the MMC is ended when you presscustomer key 2 (machine control panel).

Page 209: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-57SINUMERIK 840C OEM Version for Windows (BN)

Statement list FX170:NETZWERK 1 0000 Block manages MMC application

The FX 170 enables you to start and end MMC applications. These applications must be entered in file SIN840C.INI.

70 must be entered in PLC-MD 137, OEM Info word. DX 170 is used as the transfer block for FX73 and FX74. Each of the total of 5 requests uses 50 data words in DX170

starting from DW 0

DWK+0 to DWK+9 acknowledge words from FX73 and FX74

DW K+0 Acknowledgement from FX73 on start of application DW K+1 dito DW K+2 Acknowledgement from FX74, response from MMC on start of application DW K+3 dito DW K+4 Acnowledgement from FX73 on end of application DW K+5 dito DW K+6 Acknowledgement from FX74 on end of application DW K+7 dito

Transfer data package

DW K+10 Package length without header DW K+11 Sender DW K+12 Receiver DW K+13 Request data structure DW K+14 Request number: 3rd digit= No.

4th dig=Start\Stope.g.:4441 App4 Start

DW K+15 I code identifier DW K+16 Control flags DW K+21 Format DW K+25 Start identifier DW K+26 Window mode DW K+27 No. of OEM application DW K+28 Call string identifier DW K+29+N Call string (optional) N <=10 DW K+29+N+1 End identifier = 0000H

I code acknowledgement from FX74

DW K+40 I code identifier DW K+41 Control flags DW K+42 Value ID, must be > 33, then everything OK;

otherwise error DW K+43 Protocol type

NAME :APPSTART

0005 :A DB 40 0006 :L DL 100 Customer keys on MSTT

Page 210: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-58 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

0007 :T MB 255 0008 :UN M 2.1 OB run at least once? 0009 :SPB =M001 000A :SPA FB 11 000B NAME :EINR-DB 000C DBAN : KY 170,1 000D DWNR : KF +255 000E DBTY : KC DX 000F : Assignment for application start 0010 :AX DX 170 5 words (0 to 4) are PAKHEADER 0012 :L KF +15 0014 :T DW 10 Packet length without header 0015 :L KH 0201 0017 :T DW 11 Sender is PLC component 0018 :L KH 031B 001A :T DW 12 Fixed receiver 001B :L KH 0001 001D :T DW 13 Request data structure 001E :L KH 2221 0020 :T DW 14 Request number 0021 : 0022 : I-CODE-KOPF 0023 :L KH 2E04 0025 :T DW 15 I code identifier 0026 :L KH 0010 0028 :T DW 16 Control flags 0029 :L KH 0000 002B :T DW 17 002C :T DW 18 002D :T DW 19 002E :T DW 20 002F :L KH 0600 0031 :T DW 21 Format (0006H=Structure) 0032 :L KH 0000 0034 :T DW 22 0035 :T DW 23 0036 :T DW 24 0037 : 0038 : DATA STRUCTURE 0039 :L KH 0100 003B :T DW 25 Request type (App-Start-End) 003C :L KH 0300 003E :T DW 26 Window mode 003F :L KH 0200 0041 :T DW 27 No. of OEM application 0042 :L KH 0000 0044 :T DW 28 Call string identifier (yes, no) 0045 : 0046 : CALL STRING 0047 :L KH 0000 String,terminated by 0000H 0049 :T DW 29 004A :T DW 30 004B : 004C : Assignment for application end 004D :L KF +15 004F :T DW 50

Page 211: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 5-59SINUMERIK 840C OEM Version for Windows (BN)

0050 :L KH 0202 0052 :T DW 51 0053 :L KH 031B 0055 :T DW 52 0056 :L KH 0001 0058 :T DW 53 0059 :L KH 2220 005B :T DW 54 005C :L KH 2E04 005E :T DW 55 005F :L KH 0010 0061 :T DW 56 0062 :L KH 0600 0064 :T DW 61 0065 :L KH 0000 0067 :T DW 65 0068 :L KH 0300 006A :T DW 66 006B :L KH 0200 006D :T DW 67 006E :L KH 0000 0070 :T DW 68 0071 :T DW 69 0072 :BEA 0073 M001 : 0074 :AX DX 170 0076 :U M 255.7 Application start from DW 10 0077 :BAB FX 73 0079 NAME :OEM-SEND 007A DBTY : KC DX 007B DBNR : KF +170 007C DWNR : KF +10 007D QTTG : KF +230 007E :L MW 230 007F :T DW 0 0080 :L MB 232 MW 70 in PLC-MD 137 !!! 0081 :T DL 1 Acknowledgement for start 0082 :U M 71.0 0083 :BAB FX 74 0085 NAME :OEM-EMPF 0086 DBTY : KC DX 0087 DBNR : KF +170 0088 DWNR : KF +40 0089 OEMN : KF +0 008A QTTG : KF +234 008B :L MW 234 008C :T DW 2 008D :L MB 236 008E :T DL 3 008F :U M 255.6 0090 :BAB FX 73 0092 NAME :OEM-SEND 0093 DBTY : KC DX 0094 DBNR : KF +170 0095 DWNR : KF +50 0096 QTTG : KF +240 0097 :L MD 240

Page 212: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

5 DDE Interface09.01

5-60 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

0098 :T DW 4 0099 :L MB 242 009A :T DL 5 009B :U M 71.1 009C :BAB FX 74 009E NAME :OEM-EMPF 009F DBTY : KC DX 00A0 DBNR : KF +170 00A1 DWNR : KF +90 00A2 OEMN : KF +1 00A3 QTTG : KF +244 00A4 :L MW 244 00A5 :T DW 6 00A6 :L MB 246 00A7 :T DW 7 00A8 :BE

Page 213: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-1SINUMERIK 840C OEM Version for Windows (BN)

6 Sample Programs

This chapter is intended to show you how to integrate your own applications into the control or OEMtest environment and to explain the sample programs contained in the OEM package. The programs, inparticular the commented source texts, are intended to provide help and guidance in the developmentof your own applications.

The sample programs were developed either with Microsoft Visual Basic 3.0 (\mmcsrc\vb) or withMicrosoft Windows 3.1 SDK (\mmcsrc\msc). Almost all sample programs are available both as exe-cutable *.EXE files and as complete projects with resources, source code, libraries and header files.

The sample programs VSASERV.EXE, TACHO.EXE, ADVTEST.EXE and GEAR.EXE are alreadyintegrated into your OEM test environment and can be started directly from the test environment (areaswitchover, menu: "OEM..."). The associated .EXE files are either in the directory \mmcwin\pc or in theassociated project directories.

You will find the individual OEM projects in the root directory of the OEM test environment underc:\mmcsrc\....

6.1 Integration of customer applications

This section shows you the main procedure for integrating your own applications into the OEM testenvironment or into the control.

Note:

In the case of MS-DOS applications running on the control in a DOS box, take note that the operatingsystem Windows presents an unfavorable time behavior if these applications are started in full screenmode. In this case, Windows applications running in parallel are slowing down considerably. In thecase of MS-DOS applications, running in window mode, this problem does not arise.

6.1.1 Development systems

For the development of your own applications, you require a development system. For this you can useany commercially available development tool that allows the creation of MS Windows 3.1 or MS Win-dows for Workgroups 3.11 compatible programs.

The most widely used tools are:

MS Visual Basic 3.0MS Visual C++ 1.5Borland C++ 4.0 etc.

Page 214: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

6.1.2 Integration into the OEM test environment

Integration of your own applications could not be more simple:

1. You develop your application with the development tool and as output you obtain a number of files(*.exe, *.dll, *.ini,...) that are required for correct running of the program.

2. In the OEM test environment, there are two ways of starting your application:

- automatically when your OEM test environment is started- by the operator via area switchover

If your application is to be started on start-up, you only have to make the appropriate entry in theREG_AUTO.CFG. Make sure that the area switchover (REGIE.EXE) starts the applications in thesequence in which the applications are entered in the REG_AUT.CFG file (cf. Section 3.4.2).

If your application is to be started by the operator via area switchover (REGIE.EXE), you have tomake the appropriate entry in the REGIE.INI file. In the configuration file REGIE.INI you can defineunder which entry in the menu line and at which point in the associated pull-down menu yourapplication is to be inserted. You will find the configuration file REGIE.INI in the directory\mmcwin\pc (cf. Section 3.4.2).

3. Terminate your Windows session and start your OEM test environment by calling the "mastercontrol" from the Windows Program Manager (The test environment only has to be started from theDOS level using the 840C.BAT the first time the test environment is called).

You can return to Windows or DOS. Your application is now entered in the area switchover and canbe executed.

6.1.3 Testing DDE client applications

If your application has a DDE interface and NCK/PLC/611-D data are to be read or written, you cancheck the working principle of your application within the OEM test environment.

To do this you must perform the following steps:

1. Configure the autostart file REG_AUTO.CFG so that when the OEM test environment starts up, firstthe applications MPRSIM.EXE and then the DDE server (DDESERV.EXE) are started from thedirectory \mmcwin\pc.

The DDE server must always be started before your application program.

2. Your client application can now register itself with the DDE server (DDE_CONNECT) and, ifnecessary, register the clipboard format DDE_ICODE.

3. In the next step, you must check that the DDE transactions of your client are being processed by theDDE server. The DDE requests REQUEST and ADVISE to the PLC always provide a serial "count",the REQUESTs to the NCK return the string that you wrote with POKE. In the DDE server the ITEMundergoes a plausibility check.

If the test of your application was successful in the OEM test environment, you can then test itdirectly on the 840C control.

Page 215: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-3SINUMERIK 840C OEM Version for Windows (BN)

6.1.4 Integration of applications into the control

The compatibility of the software versions of the OEM package and the SINUMERIK 840C OEMVersion for Windows basic system is a precondition for proper functioning of your application.

The following files must also be transferred from the OEM test environment (directory: \mmcwin\pc) tothe control (directory: c:\mmcwin\pc) so that your application can make read and/or write accesses toNCK/PLC/611-D data.

OEM test environment: -----> MMC SINUMERIK 840C:(DDESERV.EXE DDESERV.EXE)MEMBER.DLL MEMBER.DLL

Note: The DDE server (DDESERV.EXE) is part of the basic control software and normally doesnot need to be transferred from the OEM test environment to the control. However, it is onlyexecutable with the file MEMBER.DLL.

Your own files or the above files can be transferred using a diskette (if a diskette drive is available),using a commercially available transfer program such as LAPLINK, or using the utility PCIN.

As in the OEM test environment, the integration of applications into the control could not be easier.

1. Transfer your applications to the MMC of the SINUMERIK 840C and put all the files required to runyour application (*.exe, *.dll, *.ini) in a directory of your choice (e.g. c:\oem\...).

2. On the control there are three main ways of starting your application:

- automatically on start-up of the control software- by the operator via area switchover- or on PLC initiative

If your application is to be started on start-up, you only have to make the appropriate entry in theREG_AUTO.CFG. Please note, that Windows starts the applications in the order in which they areentered in the file REG_AUT.CFG.

If your application is to be started by the operator via area switchover (REGIE.EXE), you have tomake the appropriate entry in the file REGIE.INI. In the configuration file REGIE.INI you defineunder what entry in the menu line and at which position in the associated pull-down menu, yourapplication is to be inserted. The configuration file REGIE.INI is located in the directory\mmcwin\pc\<language> (cf. Section 3.4.3).

If your application is to be started (and/or terminated) on PLC initiative, you require not only theappropriate PLC integration but also an entry in the initialization file SIN840C.INI (see Section 3.5).Here, it is necessary to define the number of the application that is to be transferred with the I code0x42EH (cf. Section 5.6.6).

3. If your application makes read or write accesses to the NCK/PLC/611-D data, the DDE server(DDESERV.EXE) must have been started first. Modify the autostart file REG_AUTO.CFG so thatwhen the control starts up, first the application SERVER.EXE and then the DDE server(DDESERV.EXE) is started. The applications are located in the directory c:\mmcwin\pc.

The DDE server must always be started before your application.

4. Boot the control.

Page 216: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

6.2 Sample programs (MS Visual Basic)

The sample programs explained in this section have been developed in the Visual Basic programminglanguage.

6.2.1 Project: Tacho

This example program describes a DDE test client. It can be used to initiate a link to a DDE server andexecute the appropriate commands REQUEST, POKE and EXECUTE.

Fig. 6.1: Visual Basic DDE test client

Description:

"Waiting for The top left text field initiates the link to the data of a DDE server.DDE data": It contains data record read (REQUEST) or to be written (POKE) by the server.

Request: This button is for sending a read request (REQUEST) to the DDE server.

Poke: This button is for sending a write request (POKE) to the DDE server.

Exec: This button is for sending a command (EXECUTE) to the DDE server. The"EXECUTE string" must be entered in the "Item" field.

Quantity: In this input field it is possible to define the number of operations to be performed.For example, if the number 1000 is entered here and the "Request" button is thenpressed, the DDE client sends 1000 REQUEST instructions to the DDE server in aloop. This feature can be used to perform precise runtime measurements.

Counter: The value in this field specifies the current status of the loop variable for the aboveloop.

Page 217: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-5SINUMERIK 840C OEM Version for Windows (BN)

Service|Topic: Using this input field, the DDE server (SERVICE) and the topic (TOPIC) areselected. The following can be addressed as possible DDE servers:

• DDE server (DDESERV.EXE in the OEM test environment and on the NC control)with:Service|Topic: NCDDE|NCKPLC

• DDE test server (OEM test environment) with:Service|Topic: DDETEST|DDETEST

Item: In this input field, the ITEM is specified. When linking to the DDE server of the840C, all ITEMs are supported that satisfy the NCK syntax (cf. Section 5.5) and thePLC syntax (cf. Section 5.6).

In the OEM test environment, the actual multiport RAM server (SERVER.EXE), thatinitiates the connection to the NCK/PLC and the 611-D is replaced by a simulatorprogram (MPRSIM.EXE).

The DDE test server of the OEM test environment only supports the ITEM: MSG.The test server only generates ascending numeric values (0 to 100) that can beread out via the REQUEST.

Timeout: Because Visual Basic only supports synchronous DDE calls, a time must bespecified after which the DDE call (REQUEST, POKE, etc.) must have been pro-cessed completely. If the call is not processed within the specified time, theappropriate error message is output.

Linkmode: In the Visual Basic language, the various types of DDE connection (none, "cold","warm" and "hot") are specified using the value for link mode.

The possible values for the link mode are:

Link mode 0: Link broken, no link, (cf. Section 5.1.3)Link mode 1: Dynamic updating, "hot" link, (cf. Section 5.1.2.2)Link mode 2: Static data, "cold " link, (cf. Section 5.1.2.1)Link mode 3: Notification of change, "warm" link, (cf. Section 5.1.2.3)

If the tacho client is linked to the DDE server of the control, only the link modes 0, 2are supported for an NCK ITEM and all the link modes 0,1,2,3 for PLC ITEMS.

Debug: The debug window of the DDE server is displayed.

The following buttons are only used as "reset" buttons. They reset the input fields "Service|Topic","Item", "Timeout" and "Linkmode" to a default value.

Test: Link with the DDE test server with link mode 2.

PLC: Link with the PLC with a user-specific ITEM string.

NCK: Link with the NCK with selection of the central R parameters R1 to R3.

Over: Link with the NCK with selection of the value of the NC internal override switch.

Events: In this field, events (acknowledgement traffic with the server), such as open link(open), close link (close), notify about change (notify) are displayed.

"Gauge.vbx" In this additional control element of Visual Basic, only the value of the field "Waitingfor DDE data" is displayed graphically. If there are several values in the above field,display problems can arise.

Page 218: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Requirement: This program can be run both on the 840C control and in the OEM test environmenton an external PC. Before calling the program the servers to which a link is to bemade must be started (c:\mmcwin\pc\ddeserv.exe or c:\mmcwin\pc\ddetest.exe).

Control: To start the example program TACHO.EXE on the control, the file \mmcsrc\vb\tacho\tacho.exe must first be transferred to a suitable directory (e.g. c:\oem\..) andthe program integrated into the area switchover. However, TACHO.EXE also needsthe following system files that must be copied from the OEM test environment intothe appropriate directories on the control:

OEM test environment -----------> 840C control

c:\windows\system\vbrun300.dll c:\windows\system\vbrun300.dllc:\windows\system\gauge.vbx c:\windows\system\gauge.vbx

Test environ.: In the OEM test environment the DDE server and the MPR server simulator areboth started automatically on start-up (the DDE test server must be called"manually").

Content: This project gives rough guidance on the use of the programming tool MS VisualBasic:

• Initiation of DDE links from the client to the server application.

• Link of the text fields of a client application with the data records of a DDE server.

• Sending requests (REQUEST, POKE, EXECUTE)

Directory: All files belonging to this project are to be found in the OEM test environment in thedirectory:

c:\mmcsrc\vb\tacho

Page 219: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-7SINUMERIK 840C OEM Version for Windows (BN)

6.2.2 Project: DDETEST

This program describes a simple DDE test server (DDETEST.EXE) that provides a number between 1and 100 every second. It can be used to test DDE clients. The server is preset with the SERVICE:DDETEST and TOPIC: DDETEST. It also only supports the ITEM: MSG. The two methods REQUESTand ADVISE are implemented.

Fig. 6.2: DDE test server

Requirement: This program is intended for use in the OEM test environment. It can also be usedon the control. This program also needs the VB runtime DLL vbrun300.dll

Content: The listing of this program gives you guidance on the following points:

• General development of a server application with Visual Basic.

• DDE link initiation from the point of view of the server.

• Implementation of the various DDE methods from the point of view of the server

Directory: All files belonging to this project are located in the OEM test environment in thedirectory:

c:\mmcsrc\vb\ddetest

Page 220: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

6.3 Sample programs (MS Windows 3.1 SDK)

The sample programs explained in this section were developed with the programming language C.

6.3.1 Project: VSASERV

This sample program reads the most important service data of a connected digital feed drive(SIMODRIVE 611D) and displays them in the following window.

Fig. 6.3: VSA - service display

Requirement: This program is executable both on the 840C control and in the OEM testenvironment on an external PC. Before the program is called, the DDE server(DDESRV.EXE) from the directory: \mmcwin\pc: must be started. In the control, theDDE server is automatically started on start-up, in the OEM test environment, youeither have to call the DDE server either "manually" or make an entry which doesthis in the REG_AUTO.CFG file.

Control: To start the example program on the control, you first have to load the file\mmcrsc\msc\vsaserv\vsaserv.exe from the OEM test environment into the controland integrate it into the area switchover using the REGIE.INI file (cf. Section 3.4.2).The display fields of the example program are only supplied with current values if adigital FDD drive is connected.

Test environ.: If the program is run within the OEM test environment, the corresponding dialogelements are not supplied with values because there is no actual connection with areal drive.

Page 221: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-9SINUMERIK 840C OEM Version for Windows (BN)

Content: The source code (vsaserv.c) with detailed comments is intended to provide you withguidance and inspiration with the following problems:

• Transparent mode: registration with the DDE server, registration of the clip-board format DDE_ICODE.

• Reading drive machine data in the transparent mode via I code.

• Structure of an ADS package, structure of an ADS header

• Structure of an I code data package, evaluation of response packages of theNCK.

• Sequence of the data traffic when reading drive data.

• Termination of DDE links

Directory: All source, header, EXE and resource files for this project are located in the OEMtest environment in the directory:

c:\mmcsrc\msc\vsaserv

6.3.2 Project: Message

With this example program the MMC alarms and messages configured in the alarm database can beset and cleared. Before you transfer alarm databases generated with OEMFORM to the control, youcan test and check the content using this example program. If you have assigned your alarms andmessages additional call parameters, you can also specify up to two parameters (%0, %1) when thealarm/message is called.

Fig. 6.4: Setting and clearing alarms and messages

Description:

Message id: This input field selects the alarm or message configured under alarm/messagenumber (cf. documentation Alarm Dialog for PC).

Parameter 1/2: In this input field, it is possible to enter up to two strings that are inserted in the textof the alarm/status line instead of the runtime variables %1 and %2 when thealarm/message is called.

Set Message: The alarm/message specified in "Message id" is set.

Clear Message: The alarm specified in "Message id" is cleared. If the checkbox "Clear all" ismarked, all set alarms/messages are cleared.

Page 222: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-10 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Cancel: The application is terminated.

Requirement: Before the example program is called, the alarm block ALARM.EXE must havebeen started. This is normally called via the REG_AUTO.CFG file when the OEMtest environment is started up. You can, of course, only set those alarms/messagesthat are configured in the alarm database.

Content: The source code (message.c) of this example program is intended to give you ideasand information on the following points:

• Setting and clearing MMC messages/alarms by calling the appropriate Cfunctions.

• Parameterization of the functions and data structures, especially:- Setting an alarm/message with/without parameters- Clearing an alarm/message with the specified alarm number (ID)- Clearing all MMC alarms/messages

Directory: All the source, header, EXE and resource files for this project are in the OEM testenvironment in the directory:

c:\mmcsrc\msc\message

Note: On Software Version SW 4.1 and higher, the alarm block is addressed via a DDEinterface - with extended functionality. In future, only the DDE interface will bemaintained. The previous DDL calls (SW3) are not expanded any further.

6.3.3 OEM client

This program implements a simple DDE client that allows NCK and PLC data to be read in CF_TEXTformat (DDE standard mode).

Fig. 6.5: OEM client

Description:

Appl./Service: Entry of the "DDE service name"; default NCDDE

Topic/Share name: Entry of the "DDE-Topic" or the "Share name" for Net DDE default NCKPLC.

Page 223: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-11SINUMERIK 840C OEM Version for Windows (BN)

Connect: DDE connect. Link initiation to the specified server.

Item name: In this input field the ITEM for the NCK or PLC data access is entered.Default: NC_0x11a_0_3_4_4_0: Read actual values axes 1-3

Request: Read data

Poke: Write data; the data are in the input field "Data".

Autom. Start/Stop: Request/Poke cyclically, i.e. timer-controlled.

DDE command: In this group of radio buttons, the program indicates the current execution status.

Working: The current command is being executed.Done: The command has been executed successfully.Not done: The command has been aborted with an error message.

Transaction: Start the set DDE transaction.

Debug/NoDebug: Close or open the debug window of the NCDDE server.

Exit: Program end

Directory: c:\mmcsrc\msc\oemclien

6.3.4 OEM client ADVTEST

With this program, a DDE client for the DDE transparent mode is implemented. The structure of atransparent data link for cyclic requests and change requests to the NCK is demonstrated.

Fig. 6.6 OEM client ADVTEST

Page 224: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-12 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Description:

The entries in the file ADVTEST.INI are what count. This must be located in the directoryc:\mmcwin\pc. The entries have the following meanings (if they are not self-explanatory).

[APP]Position=0,42,640,448Service=NCDDETopic=NCKPLCItem=ICODEADV1_205 // ICODE_... cyclic request

// ICODEADV_... change request// ICODEADV(1..3) change request

[ICODE]Task=3 // request number (low byte) - has

// no meaning for change requestDBB=205 // assigned DBB ID

[WIEDERHOLFAKTOR]

W=8 // Frequency of the cyclic data (only for cyclic // requests)

Menu:

DDE-Connect: Link initiation with the DDE server.

DBB_Write: Assemble DBB with 5 defined I codes and deposit it in the NCK.

Start_ADV: Send cyclic request or change request.

Stop_ADV: Clear cyclic request or change request.

Exit: End of program

Start_JOB Edit a JOB list via Trigger DDE (transparent mode).For description see ADVTEST.INI in the project directory

Page 225: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-13SINUMERIK 840C OEM Version for Windows (BN)

6.3.5 Gearbox interpolation

This sample program provides a user interface that is easy to use for configuring and programminggearbox interpolation groups consisting of two leading axes/spindles and one following axis/spindle.The configuring data can be entered easily in clearly laid out screen forms. The current status andconfiguration of the groups is also displayed. The user can exit the application via the menu itemClose.

Fig. 6.7 Gearbox interpolation: Main screen form

Other entries can be made and display screens called up via the menu bar in the main menu.

Configuration

Fig. 6.8 Gearbox interpolation: Configuring the gear grouping

Page 226: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-14 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

This screen form is used for defining gearbox interpolation groupings consisting of max. two leadingaxes/spindles and one following axis/spindle. The following parameters can be defined for the indivi-dual leading axes/spindles and for the following axis/spindle:

Leading axis/spindle 1 and 2,Following axis/spindle:

The axis or spindle number and the axis type (axis or spindle) of the twoleading axes/spindles and the following axis/spindle are defined in thesefields.

The 1st (2nd etc.) axis corresponds to the axis configured via MD 2000 (MD2001, etc.).

The 1st (2nd etc.) spindle corresponds to the spindle configured via MD 4000(MD 4001, etc.).

The two axes/spindles that are entered or selected must be members of thesame mode group. The following axis/spindle must be defined as a realaxis/spindle.

Coupling:The coupling type (setpoint or actual value coupling) of the two leadingaxes/spindles to the following axis/spindle can be defined in this list field.

Configuration:The configuration is initiated when this button is pressed, i.e. the data enteredin the screen form are transferred to the NCK and the gearbox interpolationgrouping is checked and established in the NCK. Any mistakes made in theentry are indicated in a message box.

Back to main window:This button takes you back to the main screen form (Fig. 6.7).

Programming

Fig. 6.9 Gearbox interpolation: Defining and programming coupling factors

Page 227: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-15SINUMERIK 840C OEM Version for Windows (BN)

This screen form is used for entering coupling factors and activating or deactivating the coupling. Whena selection is made, the gearbox interpolation grouping belonging to the following axis with the lowestnumber is always displayed.

The following values can be entered for the two leading axes/spindles and following axis/spindle in thisinput screen form:

Numerator, Denominator:

The couple factor for the individual leading axes/spindles can be defined inthese two fields by entering numerator and denominator. Integers can beentered for numerator and denominator (format = long).

Position:

Input field for the synchronous position for inprocess synchronization (3.4E+/-38). Entries must always be made in absolute dimensions. The referencesystem is always the machine system.

Instruction:

The coupling for the currently selected gear grouping can be selected in thislist field. The following entries can be selected:

Delete configuration: The selected gearbox interpolation grouping is deletedin the NCK.

Switch on/ignore positions: The command "Switch on/ignore positions" isselected for the selected gearbox interpolation grouping.

Switch off: Switch off coupling for all axes.

Synchronization: The following axis is synchronized with the leading axesaccording to the positions entered.

Programming:

Programming is initiated, i.e. the coupling factors entered in the screen formand the command selected (instruction) are transferred to the NCK.

Axis++:Switches to the gearbox interpolation grouping of the next following axis if anadditional following axis has been defined.

Spindle++:

Switches to the gearbox interpolation grouping of the next following spindle ifan additional following spindle has been defined.

Back to main window:

Switches back to main screen form (Fig. 6.7).

Page 228: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-16 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Actual state

Fig. 6.10 Gearbox interpolation: Displaying status data

The status data of the selected gearbox interpolation grouping is displayed in the screen form above.When a selection is made the gearbox interpolation grouping assigned to the following axis with thelowest number is always displayed.

The following parameters are displayed for the leading axes/spindles and following axis/spindle:

Leading axis/spindle:

Number: Displays the numbers of the leading axes/spindles

Type: Displays the type (axis or spindle)

Position: Displays the synchronization positions (as floating value)

Numerator/Denominator:

Displays the numerator and denominator of the coupling factor

Status: Displays the status (On: coupling switched on or Off: Coupling switched off)of the individual leading axes/spindles

Following axis/spindle:

Number: Displays the number of the following axis/spindle

Type: Displays the type (axis or spindle)

Position: Displays the synchronization positions (as floating value)

Axis++:Switches to the status data of the gearbox interpolation grouping of the nextfollowing axis if an additional following axis has been defined.

Spindle++:Switches to the status data of the gearbox interpolation grouping of the nextfollowing spindle if an additional following spindle has been defined.

Page 229: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-17SINUMERIK 840C OEM Version for Windows (BN)

Back to main window:

Switches back to the main screen form (Fig. 6.7).

Changes to the gear status that have been made by G commands or via the PLC are not automaticallydisplayed. They can be displayed by entries in Axis++ and Spindle++.

Notes on installation:

The application can be stored in any directory of the MMC. The VBX control GRID.VBX must be storedin <WINDOWS> \system directory.

6.4 Network DDE

Using the network DDE, all DDE transactions (REQUEST, POKE, ADVISE LINK, EXECUTE) cannotonly be executed between different applications within one Window machine but throughout a network,i.e. between processes on different computers. The computers act as nodes of a LAN network.

In practice, this means for your applications: the SINUMERIK 840C DDE server provides the requiredinformation (NCK/PLC/611-D data) not only to the clients running locally on the MMC of the control butalso to those clients on an external PC that is connected with the MMC of the control via a networkcard.

For you, this means: reading actual values from the control, machine data, R parameters via a LAN iseasy with SINUMERIK 840C OEM Version for Windows.

Requirement: Windows for Workgroups 3.11 or Windows NT must also be installed on theexternal PC. Before the DDE link is initiated a DDE share must be set up on thecomputer that is to function as the server.On a PC with Windows 95, NETDDE.EXE must also be started (e.g. in Autostart).

6.4.1 Link initiation for network DDE

The use of network DDE with SINUMERIK 840C does not principally differ from the use of local DDE.With local DDE, the link from the client to the DDE server is established using the two entries:

SERVICE: TOPIC:NCDDE NCKPLC

After this, the required transaction can be performed via the ITEM.

In network DDE, the link is established in the same basic way, but with the one difference that therequired TOPIC and the computer assignment must be known throughout the network. This achievedby creating a SHARE.

6.4.2 Creating a DDE SHARE

Using the functions of the NDDEAPI.DLL or of the network DDE SHARE manager DDESHARE.EXE ofWindows for Workgroups 3.11 resource kits it is possible to create a DDE SHARE.

In the following example the SHARE is defined on the MMC of the SINUMERIK 840C for the DDEserver DDESERV.EXE:

• First transfer the Windows for Workgroups 3.11 share manager DDESHARE.EXE from the resourcekit to the control (as of SW 6.4, also to the 840C OEM Version Windows package under\mmcwin\pcmcia).

Page 230: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-18 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

After DDESHARE.EXE has been started, the list of all SHARES entered in the INITIALIZATION fileSYSTEM.INI is displayed.

Fig. 6.11: Network DDE Share Manager

• To enter a new share, select the dialog box with the command: Share ... New

• The following entries must be made in the dialog box:

Share Name: Name of the share that has to be made known within the network (any name can be chosen).

Application Name: Name of the server with call path or SERVICE (the server is addressed by thisname, here: NCDDE).

Topic Name: TOPIC of the DDE servers (this is the topic being dealt with, here: NCKPLC)

Fig. 6.12: Structure of a link using a DDE SHARE

• The link to the DDE server from the SINUMERIK 840C is opened using the local DDE dataexchange via the following function call (SDK syntax):

DDEInitiate("service name","topic"); E.g.: DDEInitiate("NCDDE","NCKPLC");

If NET DDE is used, the "service name" (SERVICE) and "topic" (TOPIC) are defined via the entriesin the share. The link is therefore initiated using the following syntax:

DDEInitiate("\\PCName\NDDE$","ShareName") E.g.: DDEInitiate("\\n90\NDDE$","NETDDES");

Page 231: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 6-19SINUMERIK 840C OEM Version for Windows (BN)

The following DDE transactions were tested in the network:

• REQUEST Read actual values and R parameters

• POKE Write R parameters

• EXECUTE File transfer MMC-->NCK and NCK-->MMC

6.4.3 Network modules

The MMC for SINUMERIK 840C Windows can be networked with a network card in the AT box or apocket adapter in the LPT interface.

For more information about modules (network cards, PCMCIA adapter cards, etc.) contact the AUT2Technical Support Center. See also subsection 3.2.2.8 PCMCIA software support.

6.4.4 Summary

First of all a DDE SHARE must be set up on the network computer that is to function as a server inorder make the SERVICE or the TOPIC of an application known throughout the network. IfSINUMERIK 840C OEM Version for Windows is to make your data available throughout the network, itis necessary to set up a SHARE on the MMC for the DDE server DDESERV.EXE. Via the share namethe DDE server can be addressed by any computer in the network.

Link initiation to the DDE server via the network is basically the same as initiating a link with a localDDE. The only difference lies in the differing meaning of the keywords used in the function call.

When a link has been successfully established, the NET DDE communication is performed in the sameway as local DDE communication.

The following table shows the use of the keywords, based on the currently valid entries in theSIN840C.INI (see Section 3.5):

Local DDE or DDEML Network DDEApplication Name NCDDE \\rechner\NDDE$Topic NCKPLC Share Name

Page 232: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

6 Sample Programs09.01

6-20 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Page 233: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-1SINUMERIK 840C OEM Version for Windows (BN)

A Appendix

A1 I Code InterfaceThe I code interface (internal code) is a general communications interface in the SINUMERIK, viawhich processes can exchange data and trigger functions. The communication is performed viamailboxes in accordance with the ADS concept (Allgemeine Datenschnittstelle/General Data Interface).From MMC applications it is possible to make direct use of the I code interface and its full functionalityvia the "transparent mode" (cf. Section. 5.5.4) of the DDE server.

A1.1 ADS communication via mailboxesThe ADS transport layer is the basis for communication via the I code. The information is packed intoADS packets. The max. length of an ADS packet is 512 bytes both for a request packet (MMC -> NCK)and for a response packet (NCK -> MMC) (exception: receive packets for change requests)

Length of the total packetError number ADSSenderReceiver ADS headerRequest data structureRequest numberSpareSpareI code IDControl flagsData description for I code header- Data transfer and commands- File handling- Following packets and acknowledgements

Values in the relevant protocol Useful dataStructure of an ADS packet with I code content

The ADS header contains the information required for transport, such as the packet length (measuredin bytes), the sender SWK and the receiver SWK. Every request can be assigned any request numberby the request sender but it must be unique. This together with the sender information permitsunambiguous assignment. One exception to this is the request number 0 that is reserved for internalmanagement tasks. In the job data structure a note is made that the following request header has Icode format (ID = 1). In the error number of the ADS header, only packet and transport specific errorssuch as 'Receiver not available' are entered. The two words spare are assigned value 0.

The I code header follows straight on from the ADS header and consists of I code ID, control flags andan appropriate data description.

The rest of the packet is free for useful data. The useful data are listed in the protocol types 0 to 5.Each protocol type is described in Appendix A1.2.3.

Page 234: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A1.2 I code descriptionThe I code is a binary code. It is subdivided into various types:

- I code for file transfer

- I code for the transmission of NCK data and the initiation of functions

- I code for following packets and acknowledgements

The types differ in their I code ID. An I code header is defined for each of these types.

A1.2.1 Application areas

Various types of information transfer are possible via I code commands. As these often have to meetdifferent requirements, special transmission and protocol mechanisms were designed. The commandshave been divided into different groups (I code IDs) according to the special requirements they have tomeet.

A1.2.1.1 Single data item and list transfer

I code ID range 1xxH:

Based on existing SINUMERIK data drivers, individual data items and contiguous data areas can beaddressed in this I code group. They are addressed by number and type.

The functions of the individual data and list transfer (I code area: 0x100 - 0x1FF except for 0x121) arefully implemented in the DDE server of 840C OEM Version for Windows and can be called by Windowsclients via the conventional DDE interface - without "transparent data exchange" (cf. Section 5.5).

Contiguous data areas are regarded as one or two-dimensional arrays. In this case, the beginning andend number and the beginning and end type are noted in the I code header. The I code interpretersees this information as a control variable and processes the data by repeatedly calling the appropriateSINUMERIK driver. For list transfer, the I code protocols 0 to 3 have been defined. Errors that occurhere are logged precisely and compactly so that they can also be located in the list data.

A1.2.1.2 Data transfer extensions

I code ID area 2xxH:

Data requests that are not accessed via the existing DAD data driver.

A1.2.1.3 Executing functions

I code ID area 4xxH:

In this group functions are concealed that trigger certain functions in the system. In order to keep the Icode header as uniform as possible, the same I code header is used for addressing the command as isused for data transfer. Any other parameters required for a particular application can be placed afterthe I code header (see the command description).

Page 235: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-3SINUMERIK 840C OEM Version for Windows (BN)

A1.2.1.4 Selective data transfer

I code ID area 5xxH:

Selective data transfer provides the option of grouping certain non-contiguous I code data andtransferring it in a compact form (only accessible via ICD_SWK; ID range: 1xxH - 4xxH).

With selective data transfer, it is now possible to process requests cyclically or on a change. For this,individual I codes are first listed in data block descriptions (DBBs) that then have to be transferredindividually to the NCK (one transmission per DBB with I code 0500H). A cyclic or change request cancomprise several DBBs that are executed one after the other.

The data sent from the NCK or expected by the NCK must be assembled according to protocol 5. It isalso important to ensure that the individual I code useful data items are only in protocol type 0 or 4 (i.e.without errors or gaps). The sequence of the I codes in the DBBs determines the sequence of the datain the result or receive packet.

The change requests are an exception: for certain reserved request numbers the result data of the lastprocessing are buffered. For every new cyclic pass the data packets for these requests are only sent ifa change has been detected by comparison with the data of the last pass noted. In this way, the datathroughput via mailboxes is reduced. A total of four change requests can be sent (see: Section 5.5.4:Transparent data transmission).

Throughout the system, a total of 16 cyclic and change requests can be assigned (KANZYK)

For cyclic requests the following also applies:

• A cyclic request/response packet can consist of up to 32 DBBs (DBBZYK).

• A DBB description can hold up to 22 I codes (I_MAX).

• A maximum of 64 DBBs can be allocated throughout the system as a whole (DBBMAX).

• Only 1 value can be read per I code (num beg. = num end; exception: protocol 4)

• The response packet can consist of several packets (series). The division is not made on DBBboundaries but on I code boundaries.

• The "number of DBB" contained in the response packet always refers to the current packet (1st,following, last). If the division is made within a DBB, the DBB ID is no longer entered in the followingpacket.

• The maximum ADS packet length is 512 bytes in both communication directions.

Page 236: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

With change requests it is important that:

• The total length of the data requested in a DBB incl. the protocol must not be longer than an ADSpacket (not a series packet).

• The max. length of request/response packets to the NCK (MMC -> NCK) is 512 bytes.

• The maximum size of a request/response packet to the PLC (MMC -> PLC) depends on the itemname under which the "transparent channel" was opened. It is:

Sender MMC Receiver PLC Request no. Max. packet lengthICODEADV 0x31A 0x201 2 512 bytesICODEADV1 0x319 0x202 2 128 bytesICODEADV2 0x31A 0x201 1 512 bytesICODEADV3 0x319 0x202 1 128 bytes

1. MMC component 0X31A SWK_DDE1 (corresponds to SWK_OEM1_CMD under Flexos)

2. MMC component 0X319 SWK_DDE2 (corresponds to SWK_OEM1_FT under Flexos)

See also Section 5.6.4.1

The procedure for generating cyclic or change requests:

1. Definition of the data required for the display

2. Assembly of the associated I code in data block descriptions. Generation of theDBB headers.

3. Transfer of the required DBBs to the NCK via I code 500H. One transfer must beinitiated per DBB.

4. Requesting the cyclic data transfer via I code 504H. The response data for achange packet must fit into an ADS packet (not follow packets). Packet series areformed for cyclic requests.

Page 237: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-5SINUMERIK 840C OEM Version for Windows (BN)

E code identif ier

Contro l flags

Beginning of type

End of type

Beginning of number

End of number

Form at

Fie ld le ngth

M ode group/channel

Reserved

I code identifier

FFF

F

F

F

DBB header

i code 1

i code 2

i code n-2

i code n-1

i code n

F

F

F

DBB header

i code m

i code m+1

i cod e k-2

i cod e k-1

i code k

F

F

F

I code identif ier

Contro l flags

Beginn ing of type

End of type

Beg. of number

End of num ber

Format

Fie ld le ngth

Rese rved

0504H

0

0

0

j+3

DBB 100 DBB j

2

0

0

0

j+3

0

100

j

.

.

.

302

1234

0

j

End of num ber

End of type

Sender

Reque st no.

Chann el n o.

Num ber of DBBs

Idenfig ier 1s t DBB

Identifier jth DBB

DBB header DBB identifier0 0 0 0 0 0 Repeatfactor

Numberof I codes 0

I codes fordisp lay data

Generated data blockdescription

.

.

.

I code for init iatingcyclic transfer

I code identifier

Beginn ing of type

End of type

Beg. of num ber

End of num ber

Form at

Fie ld le ngth

Mode group/channel

Reserved

0500H

9000H

0

9

0

n

2

0

0

0

nEnd of num ber

End of type

i code 1

i code k

9

DBB header 0,0 ,0,0,0 ,0 ,100,1,n ,0

i codes 1..n i-Code 1

...

...

.

.

.

I code for trans ferringDBBs

9000H

i-Code 2

i-Code n

Contro l flags

Beginn ing of type

End of type

Beginning of number

End of number

Form at

Fie ld le ngth

M ode group/channel

Reserved

Contro l flags

Mode group/channel

Fig. A1.1: Procedure for generating a cyclic transfer

A1.2.1.5 File transfer

I code ID area 6xxH:

Using these commands, files can be transferred and deleted as well as directories read. The I codeheader consists only of an ID and control flags as well as of two reserve words which are notevaluated. Command-specific parameters are passed on in the useful data part of the I code packet ifrequired.

A1.2.1.6 Reserved applications for OEM

I code ID area F000H – FFFFH: reserved for OEM.

Page 238: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A1.2.2 Structure of the I code header

The I code comprises the I code header and any necessary extra parameters for the commanddescription or the useful or result data.

The common part of the I code header consists of an ID and control flags. The command to beexecuted is coded using the ID. The ID is always included in the transmission in order to permit uniqueinterpretation of the following data at all times. The various groups are distinguished using the I code ID:

0100H - 01FFH General data transfer0200H - 02FFH Data transfer (extensions)0400H - 04FFH Commands/functions0500H - 05FFH Selective data transfer0600H - 06FFH File treatmentF000H - FFFFH Free for OEM

The relevant functions are also coded within each group.

The packet content is specified using control flags.

0/1

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

- - - - - - - -0/1

--

Packetcontents

Acknow ledge-m entrequest

Se ria lident if ie r

R ead/w rite

0 re ad/1 wr ite

00 Indiv idual01 Beginning10 End11 Sequence

00 W ithout01 Every packet10 Request

0 R equest/1 w rite

0011

0101

001

010

Fig. A1.2 Structure of the control flags

Meaning of the control flags:

- Read/Write:This specifies in which direction the data transfer is made from the point of view ofthe request issuer

- Series ID:These bits code whether the current packet is a single packet or a series packet(beginning, following, end packet).

- Acknowledgment attempt:These bits code whether no acknowledgment, an acknowledgment after executionof a request or an acknowledgment after every single packet of a series is to bereturned. A read request without an acknowledgment attempt code is aborted witherror.

- Packet content:This codes whether the current packet contains a command or an acknowledge-ment.

Example:

Read an NC data: The I code request in question is assigned control flags0x1000.

Write an NC data: The I code request is assigned control flags 0x9000. Thewrite request is acknowledged with a response packet.

Page 239: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-7SINUMERIK 840C OEM Version for Windows (BN)

After the control flags, permanent data/parameters are issued for every function (group). For this,various types of I code header structures (basic types 1, 2 and 3) are defined.

I code ID I code ID I code IDControl flags Control flags Control flagsType beginning Spare Value identificationType end Spare protocol typeNumber beginningNumber endFormatField lengthChannel/axis/modegroup...Spare

Basic type 1 forGen. Data transferCommandsSelective data transfer

Basic type 2 forFile handling

Basic type 3 forFollowing commandsand acknowledgements

IDs 100H - 5FFH IDs 600 - 6FFH All IDs

i c o d eid e n t i fie r C o ntro l flag s T y p e N u m b er F o rm a t

s p e c i fic a t io nChannel/a x is /s p in d le /m o d e g ro u p

s p e c i fic a t io n R e s e rv e dw o rd

Va lueidentifica tion

P r o toc o ltype

B e g in n in g E n d o f ty p e

B e g in n in go f n u m b e r

E n d o fn u mb e r

F o r m a tFie ld length

fo r AS C II,

i code header:

T yp e sp e c ifica tio n :

N u m be r sp ec ifica tio n :

F o rm a t sp ec ifica tio n :

R e s e r v e d

W o r dR e s e rv edW o rd

le n g th o f

s p e c ific a tio n

of type

struc tu re

Fig. A1.3 Syntax diagram of the I code header

Page 240: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

With the I codes of basic type 1 there are, in principle, two loop counters, one at the beginning and oneat the end of the counting loop for the requested data. Generally, type beginning and type end form the"inner" loop and number beginning and number end form the "outer" loop. The current applicationsrequire arrays of up to two dimensions.

For data with more than two dimensions, new I code basic types can be defined without impairing theexisting definitions.

The required data format is defined in the format.

0 ASCII string 0 - 480 bytes1 unsigned byte 1 byte2 unsigned short int 2 bytes3 signed long int 4 bytes4 float 4 bytes5 double 8 bytes6 structure x bytes7 signed short int 2 bytes hitherto only for drive8 unsigned long int 4 bytes hitherto only for drive

For now, not every format is permissible for every function or data item. If a data item or function isrequired with a format that is not implemented, an error message is generated.

The field length indicates the maximum available memory area (in bytes) for the string or the structurewhen ASCII data or a data structure (format 0 or 6) are requested. In the case of all other formats, thefield length is irrelevant, e.g. = 0.

In the next word of the I code header, the axis, the spindle, the channel, the PLC number or the modegroup is specified depending on the function or data item.

One word is left spare to place the following addresses for the CPU 80386 on modulo 4 limits.

In the I code header of basic type 2 only the ID and the control flags are entered. The following twowords are left spare. Parameters required for a particular command are passed on in the useful dataarea.

The four word long I code header of basic type 3 is used for responses (acknowledgements) andfollowing packets. It contains only the I code ID, the control flags, a global error ID and the protocol typeused.

In following packets only the I code ID and the control flags are evaluated.

On writing, the transfer parameters or data follow the I code header in the defined protocols.

The protocol type itself is not passed on in the request packet but is fixed for the user.

On reading, the data follow the I code header of basic type 3 in the specified protocol type.

Page 241: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-9SINUMERIK 840C OEM Version for Windows (BN)

A1.2.3 Protocol types

The useful data follow the I code header in the various protocol types. Five different protocol types aredefined for the I code:

With protocol types 0 to 4, the structure of arrays of up to two dimensions is defined. Whereas types 1to 3 describe a data flow with gaps or errors, protocol type 4 can only represent one continuous fieldwithout any gaps or errors. Protocol type 0 describes a single data item or even no data item.

Protocol type 5 has been designed for selective data transfer of data assembled from any data blockdescriptions.

As a general rule, no data item is stored if an error is detected. If no error is detected, the value isstored in the format that was entered in the I code header, i.e. all data of a request have the sameformat. The protocol entries such as end numbers, value identification etc. are always 16-bit (integer)values.

End oftype

End of type

End of type

Protocol 0:

Protocol 4:

Number ofDBBs

Position ofincorrect icode

Length in bytes of theDBB

Value/s) inprotocol type0 or 4

Valueidentification

DBBidentifier

Valueidentification

Valueidentif ication

Valueidentification

Valueidentification

End ofnumber

End ofnumber

End ofnumber

Value

Value

Value

Value

Protocol 1:

Protocol 2:

Protocol 3:

Protocol 5:

Value

Fig. A1.4 Syntax diagram of protocol types 0 to 5

Page 242: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-10 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

If the protocol type of the I code command is not defined, e.g. in the I code group 100H to 1FFH, thedimension of the data fields is distinguished (by the type and number).

Protocol type 0 - A single value or no value - if:number beginning = number endtype beginning = type end

Protocol type 1 - One-dimensional array - if:number beginning < number endtype beginning = type end

Protocol type 2 - One-dimensional array - if:number beginning = number endtype beginning < type end

Protocol type 3 - One-dimensional array - if:number beginning < number endtype beginning < type end

Every value identification applies to a data item or several data items in one dimension. The end of theerror-free or erroneous data sequence is specified in the protocol. The next highest data item is thebeginning for the next protocol section. The first protocol section begins with the number/type that isspecified in the I code header.

A1.2.3.1 Protocol type 0

Here, a single value or no value is transferred (see syntax diagram).

A1.2.3.2 Protocol type 1

A one-dimensional array is to be read by I code command, e.g. machine data 100 to 203.

The data area is addressed by the number. The ID for MD is determined by the I code ID. Therequested data format is an unsigned short integer.

The I code request has the following format:

I code ID 0101H ID for machine dataControl flags 1000H Read, request, single packet, request

acknowledgementType beginning 0Type end 0Number beginning 100 From MD 100Number end 203 To MD 203Format 2 Request in unsigned short intField 0Channel/mode group 0Spare 0

Page 243: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-11SINUMERIK 840C OEM Version for Windows (BN)

The machine data have the following assignment at this time:

MD Value100 12101 23102 43103 45104 835105 0106 99107 to 199 not available - gap200 0201 776202 1203 5

The following packet is generated as the acknowledgement:

I code ID 0101H ID for machine dataControl flags 1400H Read, acknowledgement, single packet, request

acknowledgementValue identification 0 No errorProtocol type 1 The following data are available in protocol 1Number end 106 Up to MD 106Value identification 0 Without errorData 12

234345835099

Number end 199 Up to MD 199Value identification DAT_NV Data not available - gapNumber end 203 Up to MD 203Value identification 0 Without errorData 0

77615

A1.2.3.3 Protocol type 2

Here the number beginning and number end are assigned the value 0. The data are addressed by thetype. The protocol is structured in a similar way to protocol type 1, except that the number and type are'swapped round'.

A1.2.3.4 Protocol type 3

A two dimensional array is to be read by I code, e.g. tool data. The tool area for tool 40 to tool 43 isaddressed by the number. The tool offset parameter range is addressed by the type. The ID for the tooldata is determined from the I code ID. The requested data format is double.

Page 244: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-12 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

The I code request has the following format:

I code ID 0104H ID for tool offsetsControl flags 1000H Read, request, single packet, request

acknowledgementType beginning 2 From tool parameter 2Type end 4 To tool parameter 4Number beginning 40 From tool 40Number end 43 To tool 43Format 4 Request in doubleField 0Channel/mode group 0Spare 0

At this time, the tool offsets have the following assignment:

Parameter 2 Parameter 3 Parameter 4Tool 40 12.4 7.0 6.5Tool 41 131.2 131.3 131.4Tool 42 67.0 64.9 83.6Tool 43 22.2 34.5 7.0

Then the following packet is generated as an acknowledgement:

I code ID 0104H ID for tool offsetsControl flags 1400H Read, acknowledgement, single packet, request

acknowledgementValue identification 0 No errorProtocol type 3 The following data are available in protocol 1Number end 43 Up to tool 43Value identification 0 Without errorType end 4 Up to parameter 4Value identification 0 Without error

12.47.06.5

Type end 4 Up to parameter 4Value identification 0 Without error

131.2131.3131.4

Type end 4 Up to parameter 4Value identification 0 Without error

67.064.983.6

Type end 4 Up to parameter 4Value identification 0 Without error

22.234.57.0

Page 245: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-13SINUMERIK 840C OEM Version for Windows (BN)

A1.2.3.5 Protocol type 4

One or two-dimensional arrays with no errors or gaps are to be read by I code.

A list of data is supplied which, depending on the application, is considered as a one dimensional array(by number or type) or as a two dimensional array (by number and type). The data are stored in theformat specified in the I code header.

An I code request could have the following form:

I code ID ID IDControl flags 1000H Read, request, single packet, request

acknowledgementType beginning Beg. No. Specifies the max. range for theType end End No. "Inner" data dimensionNumber beginning Beg. No. Specifies the range for theNumber end End No. "Outer" data dimensionFormat Format Specifies the data formatField 0 or field lengthChannel/modegroup

0 Possibly channel ...

Spare 0

The required data can be represented as the following two-dimensional array.

Inner loopType 0 Type 1 Type 2

Outer loop Number 0 0.0 0.1 0.2Number 1 1.0 1.1 1.2Number 2 2.0 2.1 2.2Number 3 3.0 3.1 3.2

The following packet is then generated as the acknowledgement:

I code ID ID IDControl flags 1400H Read, acknowledgement, single packet, request

acknowledgementValue identification 0 No errorProtocol type 4 The useful data are available in protocol 4Number end 3 Current end No.Type end 2 Current end No.

0.00.10.21.01.11.22.02.12.23.03.13.2

Page 246: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-14 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A1.2.3.6 Protocol type 5

Protocol type 5 is used for selective data transfer. It describes the structure of data that were gener-ated using data block descriptions.

This protocol type is used for cyclic and change request processing by the ATR task.

I code ID 504HControl flags FlagsType beginning 0Type end 0Number beginning 0Number end n - 1 + 4 n = number of DBBs to be fulfilled, here

e.g. 2Format 2Field 0Channel/mode group 0Spare 0Number end n - 1 + 4Type end 0Request number 1234Sender 5678Channel number - 1 i.e. channel number is taken from the I code

of the DBB (fixed setting)Number of DBBs 21st DBB ID DBB_KENN1nth DBB ID DBB_KENN2

In protocol type 5, the data requested in the data block descriptions specified in the I codes arereturned.

The cyclically assembled packet in protocol type 5 has the following structure:

I code ID 504H ID for cyclic requestControl flags Flags Read, acknowledg., single pack., req. acknowledg.Value identification 0 No errorProtocol type 5 The following useful data are available in protocol 4No. of DBBs in the packet n Current end No. (here: n = 2)1st DBB ID DBB_KENN1 Current DBB No. From the cyclic requestValue identification 0 All data error-freePosition of erroneous I code 0 All I code data error-freeLength of DBB data in bytes 18Data of the 1st I code xxxData of the 2nd I code yyy... ...... ...Data of the nth I code zzznth DBB ID DBB_KENN2 Current DBB No. From the cyclic requestValue identification Error ID 1st occurrence of I code errorPosition of erroneous I code 3 Error in the 3rd I code occurredLength of DBB data in bytes 12Data of the 1st I code xxxData of the 2nd I code yyy

Page 247: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-15SINUMERIK 840C OEM Version for Windows (BN)

A1.3 Tabular overview of the I code command inSINUMERIK 840C OEM Version for Windows

The following table is intended to provide a quick overview of the parameters used with I codes.

'Function': is a brief description of the function executed

'ID': specifies the I code ID as a hexadecimal code

'Flags': specifies which access types (R/W) are possible; o.Q. means, that no acknowledgement is generated.

'Type beginning/Type end': delimit the range of requested data in the one dimension of the inner loop.

'Number beginning/Number end': delimit the range of the data in the other dimension of the outer loop.

'Format': designated the data format.

'Field length': specifies the maximum available memory range in bytes for the string or data structure in formats 0 or 6; otherwise without meaning, i.e. 0.

'Channel/axis/mode group': specifies the channel/mode group/axis/spindle/drive or PLC number depending on the I code command.

'Transfer values': follow with the write access in the specified protocol type.

'Protocol type': designates in which protocol the data are transferred (request) or returned (acknowledgement).

'SWK': specifies the receiver or sender software component for this I code.

'DDE access' for 840C: ASCII text A (conventional access via DDE server)OEM Version for Windows Transparent T

not possible -

I codes to which the following conditions apply can be processed by the ATR task (protocol 5):

Processing SWK (receiver) ICD (101H)I code ID: 100H to 4FFHFlags: RProtocol type acknowledgement: 0 or 4

Function ID Flags Typebeg.

Typeend

Num.beg.

Num.end

For-mat

Fieldlength

Chan.axisModegroup

Trans-fervalues

Pro-tocoltype

SWK :Sndr.Rcvr.

DDEac-cess

Read list 100H -1FFH

R x x x x 0-5 (x) Chan-nel

- 0-3 R: ICD A,T

Write list 100H -1FFH

W x x x x 0-5 (x) Chan-nel

- 0-3 R: ICD A,T

Read/write MDdrive

121H R/W x = TB x = NB 1-4,7,8

0 x - 0 R:Drive

T

Page 248: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-16 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Service valuesaxes

20EH R 0 12/13 <axisNo.>

<axisNo.>

3 0 0 x 0, 4 R: ICD T

Service valuesspindles

20FH R 0 13 <spin.No.>

<spin.No.>

3 0 0 x 0, 4 R: ICD T

PLC I/Q/F/T/C 0210H R/W 0-1270-255

=TA 0-5 =NA 0-5 (x) PLC No. for S 0-3 R: ICD T

PLC DB/DXblocks

0211H R/W DWNo.

=TA DB/DX-No.

=NA 0-5 (x) PLC No. for S 0-3 R: ICD T

Read PLC erroridentification

0212H R 0 4 0 0 3 0 0 - 0, 4 R: ICD T

Read controlmode

0213H R 0 0 0 0 1 0 0 - 0 R: ICD T

Read/writeprogram pointer

0216H R/W x x x x 0 x Chan. x 0-3 R: ICD T

Abort runningrequest

400H W 0 0 Callno.

Callno.

0 0 0 - 0 R: all T

Initiate driftcompensation

0419H W 0 0 AxisNo.

AxisNo.

1 0 0 - 0 R: ICD T

Initiatefile transfer

0421H W 0 0 0 0 6 x Requeststructure

0 R:MMCR: RKP

T

Preselectworkpiece/program pointer

0422H W 0 0 0 0 - 1 0 x Chan-nel

Name 0 - 1 R: ICD T

Start/stop MMCapplication ofPLC

042EH R - - - - 6 - - 1 R:CLOCK

T

MMC expressshutdown

042FH W - - - - 0 - - 0 R: Ser-vices

T

Function ID Flags Typebeg.

Typeend

Num.beg.

Num.end

For-mat

Fieldlength

Chan.AxisModegroup

Trans-fervalues

Pro-tocoltype

SWK:Sndr.Rcvr.

DDEac-cess

Transfer DBBto NCK

0500H W 0 9 0 k (1) 2 0 0 DBB A: 4Q: 0

R: ICD T

Delete DBBfrom NCK

0501H W 0 0 0 0 2 0 0 DBB ID A: 4Q: 0

R: ICD T

DBB datatransfer

0502H R 0 0 0 0 2 0 Chan-nel

DBBID/datain pr.

A: 0Q: 5(3)

R: ICD T

DBB datatransfer

0502H W 0 0 0 0 2 0 Chan-nel

DBBID/datain pr.

A: 5Q: 5(3)

R: ICD T

Read DBBdirectory

0503H R 0 0 0 0 2 0 0 - A: 0Q: 4(4)

R: ICD T

Issue cyclicrequest

0504H W 0 0 0 n (2) 2 0 Chan-nel

Cyclicrequest

A: 4Q: 0

R: ICD T

Delete cyclicrequest

0505H W 0 0 0 1 2 0 0 Re-questno.Sndr

A: 4Q: 0

R: ICD T

(1) k: Number of I codes contained in the DBB(2) n: Number of DBBs contained in the cyclic request(3) Errors where no processing of the DBBs is implemented are interrupted with protocol 0 (without date)(4) If there is no DBB available at the time of the request or if an error incurred this is reported with protocol 0 (without value)

Page 249: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A1-17SINUMERIK 840C OEM Version for Windows (BN)

Function ID Flags Spare Parameter Transfervalues

Protocoltype

SWK:Sndr.Rcvr.

DDEaccess

Open file 0601H W 0 File parameter R: ASCII TClose file 0602H W 0 File description R: ASCII TRead file 0603H R 0 File description R: ASCII TWrite file 0604H W 0 File description File R: ASCII TDelete file 0605H W 0 File name R: ICD TRename file 0606H W 0 File name R: ICD TDisplay directory 0607H R 0 Directory name x 1 R: ICD TRead/change file attribute 0608H R/W 0 File name, attributes Attributes R: ICD T

Page 250: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A1 I Code Interface09.01

A1-18 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Page 251: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-1SINUMERIK 840C OEM Version for Windows (BN)

A2 Reference Guide

A2.1 I code command description

A2.1.1 Single data item and list transfer: 1xxH

A2.1.1.1 Read value(s): 01xxH

Software version:

SW 3.1 and higherSW 3.1 and higher (SERVO, drive)

Processing software component:

101H NCK Task ICD120H / 121H SERVO, drive Task SECCOM (T only)

DDE access: A T

Function:

NCK data can be read individually or in lists. In this group, all data can be addressed that can beprocessed by the NCK data driver DALG/DASC of the SINUMERIK software.

SERVO, drive data can only be read individually.

Parameter assignment:

For the parameter assignment for each data item, the number and type must be set in the I codeheader. For each value, the number beginning and end and the type beginning and end must be set tobe identical. Lists are generated if

- number beg. < number end or- type beg. < type end

is specified. These entries are interpreted as control variables and the NCK data driver is called thecorresponding number of times. This gives rise to one and two-dimensional result arrays that arearranged according to protocols 0 to 3. The result values have the format specified in the I codeheader.

In conventional access via the DDE server (access: A), only one-dimensional arrays without gaps aresupported (not protocol type 3).

The following formats are permissible:

NCK Formats 0 to 5Drive Formats 1 to 4, 7, 8

In the mode group/axis/channel field, the following applies:

NCK the channelDrive the drive or axis/spindle number

Page 252: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Result:

The required data are returned to protocols 0 to 3. If the result length exceeds one packet a series ofpackets is generated.

Example:

I code ID 0101H I code ID 0101HControl flags 1000H Control flags 1400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 123 Result 9Number end 123Format 2 Read NCK-MD 123Field 0 (Response)Channel/mode group 0Spare 0

Read NCK-MD 123(Request)

Error IDs:

See the following error description.

Page 253: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-3SINUMERIK 840C OEM Version for Windows (BN)

A2.1.1.2 Write value(s): 01xxH

Software version:

SW 3.1 and higherSW 3.1 and higher (SERVO, drive)

Processing software component:

101H NCK Task ICD120H / 121H SERVO, drive Task SECCOM (only T)

DDE access: A T

Function:

NCK data can be written individually or in lists. In this group, all data can be addressed that can beprocessed by the NCK data driver DALG/DASC of the SINUMERIK software.

SERVO, drive data can only be written individually.

Parameter assignment:

For the parameter assignment for each data item, the number and type must be set in the I codeheader. For each value, the number beginning and end and the type beginning and end must be set tobe identical. Lists are accepted if number beginning < number end ortype beginning < type end. Theseentries are interpreted as control variables and the NCK data driver is called the corresponding numberof times. This gives rise to one and two-dimensional result arrays that are arranged according toprotocols 0 to 3.

In conventional access via the DDE server (access: A), only one-dimensional arrays without gaps aresupported (not protocol type 3).

The parameter values have the format specified in the I code header.

The following formats are permissible:

NCK Formats 0 to 5Drive Formats 1 to 4, 7, 8

In the mode group /axis/channel field, the following applies:

NCK the channelDrive/SERVO the drive or axis/spindle number (see below)

For drive 611x/SERVO the following also applies:

Type field: 0 to 7 (equivalent to parameter set 1 to 8)

Number field: Machine data number1000 -9999 drive 611x10000 -12003 SERVO

Mode group/axis/channel field: High byte = 0 Low byte = 1 to 15 (drive number) /0 = global

High byte = 1 Low byte = 0 to 39 (axis /40 to 49 (spindle) /0xFF = global

Page 254: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Result:

Acknowledgment if required.

Example:

I code ID 0101H I code ID 0101HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 123Number end 123 Write NCK-MD 123Format 2 (Response)Field 0Channel/mode group 0Spare 0Value 9

Write NCK MD 123(Request)

Error IDs:

Meaning NCK: on Meaning SERVO, drive: on0 = OK No error W R No error W R2 = OK_WRITE No error (on writing) W -10H = DAT_NV Data item not available W R Variable not available (block, element,

parameters unknown)W R

11H = LISTEND Data item according to list end /file end

W R -

14H = KAN_NV Channel /mode group / axis /PLC number incorrect

W R Variable address incorrect (driveaddress incorrect)

W R

20H = KWRIT - Access protection W22H = KZG_ZZ Currently no read/write authorization

(write-protected)W R Temporary access protection W

23H = KZG_SEM No semaphore for R/W received W R -28H = OVERFLOW Overflow/underflow on format

conversionW R -

29H = FRM_UNG Invalid format (Format is notsupported)

W R Format unknown (is not supported) W (R)

2AH = FRMW_NV - Format wrong (request does not matchdescription

2BH =WANDL_UNG

Format cannot be converted W R -

30H =MINWERT_ERR

- Value < Min. value W

31H =MAXWERT_ERR

- Value > Max. value W

32H = WERT_ERR - Value not allowed W40H = AUFTR_ERR At least one error during request

processingW R -

42H = RPAK_VOLL Response packet overflow W -44H = PROT_ERR I code protocol with error / incomplete W Protocol group error W R47H = LAUF_ERR - Number or type end incorrect W R48H = INTER_ERR Internal error - (cause unknown) W R -4CH = MODE_ERR - The current state does not allow the

request (e.g. 611-D not connected)W R

Page 255: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-5SINUMERIK 840C OEM Version for Windows (BN)

Meaning NCK: on Meaning SERVO, drive: onFRMW_NV0x2A

- Format incorrect (request does not fitdescription)

W (R)

KWRIT0x20

- Access protection W

LAUF_ERR0x47

- Number or type end incorrect W R

MINWERT_ERR0x30

- Value < minimum value W

MAXWERT_ERR0x31

- Value > maximum value W

MODE_ERR0x4C

- The current state does not allow therequest (e.g. 611-D not connected)

W R

WERT_ERR0x32

- Illegal value W

Comments:

The I codes are formed from the data group coding of the NCK data driver by adding an offset of 100H.The assignment of the number, type, channel etc. must be made in accordance with the driver para-meter assignment for the DALG/DASC.

Access to the drive machine data (I code 0121H) is only possible via "transparent data exchange".

The table with the complete overview of the I codes 0x0100h to 0x01FFh is to be found inSection 5.5.2.3.

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 256: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.1.3 Read/write GI buffer: 0117H

Software version:

as from SW 5.1

Processing software component:

101H NCK Task ICD

DDE access: A T

Function:

With this I code the electronic gearbox can be programmed and the state values of the gearbox inter-polation buffer read.

Parameter assignment:

I code formats 0 to 5 are permitted. Data to be written must also be specified in the protocol type(0 to 3) behind the I code header.

1st example: Write GI buffer (define configuration)

I code ID 0117H I code ID 0117HControl flags 1000H Control flags 9400HType beginning 100 1) Value identifier 0Type end 100 1) Protocol type 0Number beginning 2 2)

Number end 2 2) Write GI bufferFormat 0 (Response)Field 0Channel/mode group 0 3)

Spare 0Value 1 4)

Write GI buffer(Request)

1) Type beginning/end: 100 equivalent to "Write gearbox interpolation control data"2) Number beginning/end: 2 equivalent to "Instruction"

3) Is not evaluated by I code 117H.4) Value: 1 equivalent to "Define configuration"

Page 257: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-7SINUMERIK 840C OEM Version for Windows (BN)

2nd example: Read GI buffer (signal number)

I code ID 0117H I code ID 0117HControl flags 1000H Control flags 9400HType beginning 100 1) Value identifier 0Type end 100 1) Protocol type 0Number beginning 1 2) Result 9 4)

Number end 1 2)

Format 0 Read signal numberField 0 (Response)Channel/mode group 0 3)

Spare 0

Read signal number(Request)

1) Type beginning/end: 100 equivalent to "Read/write gearbox interpolation control data"2) Number beginning/end: 1 equivalent to "Signal number"

3) Is not evaluated by I code 117H.4) Value: 1 equivalent to "GI configuration impermissible"

3rd example: Read GI state data (numerator coupling factor leading axis 1)

I code ID 0117H I code ID 0117HControl flags 1000H Control flags 9400HType beginning 1 1) Value identifier 0Type end 1 1) Protocol type 0Number beginning 101 2) Result 240 4)

Number end 101 2)

Format 0 Read coupling factorField 0 (Response)Channel/mode group 0 3)

Spare 0

Read coupling factor(Request)

1) Type beginning/end: 1 is equivalent to 2nd axis. The number of the axis/spindle for which the GI statevalue is to be read in the data type is passed to the function. For data type 0..ACHSANZ-1 one of theaxes is selected, for data type 40..40+SPINANZ-1 one of the spindles is selected. Data types 30..39are not allowed, an error signal is output.

2) Number beginning/end: 101 is equivalent to "Coupling factor numerator of the first leading axis". Withthe data number, a data within the "GIA data" structure is selected.

3) Is not evaluated by I code 117H.

4) Coupling factor numerator returned.

Page 258: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

I code ID Type of data Type Meaning of type Num-ber

Meaning of number Chan-nel/modegroup

Rem.

0117H Gearbox inter-polation state data

Memory of current data,(e.g. after pro-gramming). Data couldbe read and changed,they are only activatedafter power-on.

Gearboxinterpolation controldata

0-29

40-45

100

Axis 1 to 30(axis number -1)

Spindle 1 - 6(spindle number -1+40)

An interface for enteringGI data for all axes/spindles.The data are activatedwhen the control bits"Buffer assigned" and"First call" are set.

(Caution: The sameinterface is used in theprocessing of the GIdata via input (areaparameter)).

01234569

100101102103104105106107108109

.

.

.

Control bitsSignal numberInstruction:Axis/spindle number (followingaxis)Synchronizing position ( " )State bits ( " )State bits 2 ( " )Address group ( " )

Axis number (leading axis)Coupling factor numerator ( " )Coupl. factor denominator ( " )Coupling structure ( " )IKA table number ( " )Synchronizing position ( " )State bits ( " )State bits 2 ( " )IKA coupling branch no. ( " )Address group ( " )

The single leading axes(LA1..LA5) are selected byhundreds position (e.g.: LA3 KF-denominator = data number 302)

-

Description of the value range of the numbers:

Control bits: Bit0: Buffer assignedBit1: First call Bit0 + Bit 1 Starts the processing of the bufferBit2: Data are invalid Checkback from the GI moduleBit3: Request processed Checkback from the GI moduleBit4: Signal present Error occurred, see signal no.Bit7: GI start-up Pending during start-up

Signal number Signal from control if control bit 4 is set.1: Following axis not defined 2: Leading axis/spindle not defined3: Reconfiguration/delete illegal 4: Following axis not in C axis mode

5: Following spindle not in spindle mode 6: Following spindle not defined 7: Coupling factor KF with error 8: Overwriting the position illegal 9: GI configuration illegal 10: Wrong chan. assignm. of following spindle 11: Option not available 12: General programming error 13: Coupling factor switchover illegal 14: Cancellation of the GI request (Reset ...) 15: IKA path reconf./delete illegal 16: Input/output designation not consistent 19: Synchronous position not defined

Instruction Is processed when control bits bit0 + bit1 are set.1: Define configuration 2: Delete configuration

3: Coupling on/change without position 4: Coupling on/change with pos.rel. switchover5: Coupling on/change with/without position 6: Coupling off selective without pos.

7: Coupling off selective with pos. 8: Coupling off total with/without position 9: Coupling on in-process synch. 11: Define IKA configuration 12: Delete IKA configuration 13: IKA on/change without positions 13: IKA_on/change without positions 14: IKA_on/change with pos. rel. switchover

16: IKA off without positions 17: IKA off with positions

Axis-spindle number Axis 0 - 29 and state bits Bit0=1 Spindle 0 - 5 and state bits Bit0 = 0state bits Bit0: Axis (0=spindle) (must match address group)

Bit1: Position programmed Bit2: Coupling on set GI StatusBit3: Coupling on actual GI Status Bit4: Coupling factor programmedBit5: IKA path is programmed Bit6: Control curve no. is programmed

Page 259: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-9SINUMERIK 840C OEM Version for Windows (BN)

State bits 2 Bit0: Overtravel direction programmedBit1: Negative (0: positive) direction programmed

Coupling structure 1st meaning if feed axis, spindle, channel or R parameter is selected in address group: 1: Set position 2: Actual position 5: Override 6: Compensation value 10: Global R parameter 11-16: channel-spec. R parameter channel 1-6

2nd meaning if GI axis or GI spindle is selected in address group: 1: Setpoint coupling real axes 2: Actual value coupling 3: Setpoint coupling simulation axes 4: Combined actual value/setpoint coupling 11: Setpoint coupling with IKA real axis 12: Actual value coupling with IKA real axes

Address group 1: Feed axis 2: Spindle3: Channel 4: R parameter5: GI axis 6: GI spindle

Comment: Coupling structure and address group correspond to IKA parameters T20, T26 and T33(hundreds and units position).

The error identifiers correspond to the error identifiers of I codes 1xxh.

Page 260: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-10 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2 Data transfer extensions: 2xxH

A2.1.2.1 Read service values of axes: 020EH

Software version:

SW 5.1 and higher

Processing software component:

R: 101H NCK Task ICD

DDE access: T

Function:

With this I code, the service values of the axes can be read. If the service values are beingdisplayed on the NCK screen, you have to wait until the servo interface is free (max. 5 seconds,see Error IDs).

Parameter assignment:

Requests can be made in format 3 only. Values for the axis specified in number beginning= number end are supplied in protocol 4 (limited to the type-related one-dimensional field). Theaxis number has to be specified globally!

Result:

The service values are returned as demonstrated in the sequence (4 bytes/value) of theexample. Errors are returned in protocol 0 (value identifier) without value.

Example:

I code ID 020EH I code ID 020EHControl flags 1000H Control flags 1400H

Type beginning 0 Value identifier 0=OKType end 12/13(as from P6.1) Protocol type 4

Number beginning Axis Number end AxisNumber end Axis Type end 12 / 13(as from P6.1)

Format 3 Result Setpoint positionField 0 Position lag

Channel/mode group 0 Partial actual valueSpare 0 Speed setpoint

Contour deviationService values read axes Actual position

(Request) Partial setpointOverflow cycle time

Service numberCompensation valueError synchr. operation

Last value if Position controlType end = 12 -----------> RatioType end = 13(as from P6.1) --> Absolute encoder

overflows(Response)

Page 261: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-11SINUMERIK 840C OEM Version for Windows (BN)

Error IDs:

Protocol Value identifier Explanation4 OK = 0 No error (values were supplied)0 OK = 0 Undefined / fictitious axis (no values!)0 DAT_NV=10H Axis not available0 FRMW_NV=2AH Format <> 30 IC_UNDEF=45H Length of I code instruction wrong0 FLAG_ERR=46H Wrong control flags (see example)1 LAUF_ERR=47H Type or number wrong (see example)0 QVZ_SRV=51H Servo does not report in0 QVZ_DID=52H Servo interface occupied by NCK screen

Page 262: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-12 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.2 Read service values of spindles: 020FH

Software version:

SW 5.1 and higher

Processing software component:

R: 101H NCK Task ICD

DDE access: T

Function:

With this I code, the service values of the spindles can be read. If the service values are beingdisplayed on the NCK screen, you have to wait until the servo interface is free (max. 5 seconds,see Error IDs).

Parameter assignment:

Requests can be made in format 3 only. Values for the spindle specified in number beginning =number end are supplied in protocol 4 (limited to the type-related one-dimensional field). Thespindle number has to be specified globally!

Result:

The service values are returned in the sequence (4 bytes/value) demonstrated in the example.Errors are returned in protocol 0 (value identifier) without value.

Example:

I code ID 020FH I code ID 020FHControl flags 1000H Control flags 1400H

Type beginning 0 Value identifier 0=OKType end 13 Protocol type 4

Number beginning Spindle Number end SpindleNumber end Spindle Type end 13

Format 3 Result Speed setpointField 0 Progr. speed setpoint

Channel/mode group 0 Actual speed valueSpare 0 Position setpoint

Actual position valueService values read spindles Position lag

(Request) OverrideGear stage

Effective speedsetpoint

Service numberCompensation valueError synchronized

operationPosition control

Ratio(Response)

Page 263: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-13SINUMERIK 840C OEM Version for Windows (BN)

Error IDs:

Protocol Value identifier Explanation4 OK = 0 No error (values were supplied)0 OK = 0 Undefined / fictitious spindle (no values)0 DAT_NV=10H Spindle not available0 FRMW_NV=2AH Format <> 30 IC_UNDEF=45H Length of I code instruction wrong0 FLAG_ERR=46H Wrong control flags (see example)1 LAUF_ERR=47H Type or number wrong (see example)0 QVZ_SRV=51H Servo does not report in0 QVZ_DID=52H Servo interface occupied by NCK screen

Page 264: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-14 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.3 Read/write PLC data via PLC DAD: 0210H

Software version:

SW 5.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

With this I code, PLC inputs, outputs and flags can be read or written. Timers, counters and peri-pherals can also be read in. Access to the PLC data is via NCK and is thus considerably slower thandirect access via the MMC PLC interface with the "free" protocol.

Parameter assignment:

I code formats 0 to 5 are permitted.The individual data types are differentiated according to their data number:

PLC ID PLCarchiveformat

Explanation Number Type Runtime optimumI code format

82H 10H Inputs 0 0 - 127 183H 10H Outputs 1 0 - 127 184H 10H Flags 2 0 - 255 185H 22H Timers 3 0 - 127 486H 23H Counters 4 0 - 127 489H 10H Peripherals 5 0 - 127 1

The PLC number is specified in the I code header. Data to be written must also be specified in the pro-tocol type (0 to 3) behind the I code header.

Result:

The protocol type is based on the specified I code. 0 to 3 are possible. The data are supplied in therequired format.

Page 265: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-15SINUMERIK 840C OEM Version for Windows (BN)

Example:

I code ID 0210H I code ID 0210HControl flags 1000H Control flags 1400HType beginning 5 Value identifier 0Type end 5 Protocol type 0Number beginning 4 Result ´13579´ 0HNumber end 4Format 0 (Response)Field 20Channel/mode group 0Spare 0

Read state of counter 5 in the PLC(Request)

Error IDs:

DAT_NV 0x10 Data source (pointer, value/text) not availableOVERFLOW 0x28 Format cannot be convertedKWRIT 0x20 Writing not permittedINTER_ERR 0x48 Indirect addressing not permittedDAT_NV 0x10 DB (pointer, value/text) not availableLISTEND 0x11 End of list / PLC failureKAN_NV 0x14 PLC number not availableINTER_ERR 0x48 - other undefined error states -

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 266: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-16 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.4 Read/write PLC data blocks: 0211H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

With this I code PLC data blocks DBH and extended data blocks DX can be read or written. The PLCdata are accessed via the NCK. This is considerably slower than direct access via the MMC PLCinterface with the "free" protocol.

Parameter assignment:

The I code formats 0 to 5 are permitted. However, the unsigned short integer (2) is to be preferred foroptimum runtime. DB and DX blocks are distinguished by the numbers:

- 0 to 255 are DB and- 256 to 511 are DX blocks.

The PLC number is specified in the I code header.

Data to be written must also be specified in protocol type (0 to 3) after the I code header.

The input format (field length) of the individual values is specified by its format. Formats 0 to 5 arepermitted. With format 0 = ASCII, the I code issues a PLC decimal format request (0xE / word -->Display of 5 digits + decimal point) via PLCDAD which is limited to a field length of 6 bytes includingEOS! As from package 4.1, format bit 15 serves as ID for the PLC archive format (PLCDAD description/7/). If a PLC archive format (format bit 15 = 0) has not been specified, the setting of the PLC archiveformat is implemented firmly on word, fixed point without sign (corresponding with PLC archive format20H).

15 8 7 00 Format 0 - 5

1 Format 0 - 5 PLC archive format

PLC formats I code formats (0..5)--> ASCII uChar uShort Long float doubleBit 0...Bit 15

8000H...800FH

8100H...810FH

8200H...820FH

8300H...830FH

-

-

-

-Byte on the left, fixed point without sign 8010H 8110H 8210H 8310H - 8510HByte on the left, fixed point with sign 8011H - - - - -Word, fixed point without sign 8020H - 8220H 8320H 8420H 8520HWord, fixed point with sign 8021H - - - - -Byte on the right, fixed point without sign 8050H 8150H 8250H 8350H - 8550HByte on the right, fixed point with sign 8051H - - - - -

Page 267: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-17SINUMERIK 840C OEM Version for Windows (BN)

Result:

The protocol type corresponds with the specified I code. 0 to 3 are possible (see I code interfacedescription, part 1, Section 1.2.3). The data are provided in the required format. The output format(field length) of the individual values is specified by the format. With format 0 = ASCII, the field length islimited to 6 bytes (including EOS)! Errors in protocol 0 (value identifier) are returned without value.

Example:

I code ID 0211H I code ID 0211HControl flags 1000H Control flags 1400HType beginning 15 Value identifier 0Type end 15 Protocol type 0Number beginning 37 Result ´13579´ 0HNumber end 37Format 0 (Response)Field 20Channel/mode group 0Spare 0

Read DB 37, data word 15 in the PLC(Request)

Page 268: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-18 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Example 2:

I code ID 0211H I code ID 0211HControl flags 1000H Control flags 1400HType beginning 3 1st DW Value identifier 0 = OKType end 3 nth DW Protocol type 0Number beginning 10 1st DB Result Value of bit 2Number end 10 nth DBFormat 8102H (Response) With format: 0Field x (ASCII only) (ASCII)Channel/mode group 0 field length = 6Spare 0 (limitation)

Read DB 10, data word 3 bit 2 of PLC.Output format unsigned char (request)

Error IDs:

Protocol Value identifier Explanation0 - 3 OK = 0 No error (values were supplied)0 DAT_NV=10H Data cell (pointer, value/text) not available.

DB (pointer, value/text) not available0 LISTEND=11H List end/PLC failure0 KAN_NV=14H PLC number not available0 KWRIT=20H Writing not permitted0 OVERFLOW=28H Format cannot be changed0 FRM_UNG=29H Format not valid0 IC_UNDEF=45H Length of I code instruction wrong0 LAUF_ERR=47H Type or number wrong0 INTER_ERR=48H Type or number wrong.

Otherwise non-defined error statusesDAT_NV 0x10 Data cell (pointer, value/text) not availableOVERFLOW 0x28 Format cannot be convertedKWRIT 0x20 Writing not permittedINTER_ERR 0x48 Indirect addressing not permittedDAT_NV 0x10 DB (pointer, value/text) not availableLISTEND 0x11 End of list / PLC failureKAN_NV 0x14 PLC number not availableINTER_ERR 0x48 - other undefined error states -

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 269: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-19SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.5 Read PLC error ID: 0212H

Software version:

SW 6.1 and higher

Processing software component:

R: 101H NCK Task ICD

DDE access: T

Function:

With this I code, the PLC error ID (fine coding: cause and extensions) can be read.

Parameter assignment:

Requests can be made in format 3 only. The values for the PLC are supplied in protocol 4(limited to the type-related one-dimensional field).

Result:

The PLC error ID is returned as a binary number in the sequence (4 bytes/value) demonstratedin the example. Errors are returned without value in protocol 0 (value identifier).

Example:

I code ID 0212H I code ID 0212HControl flags 1000H Control flags 1400HType beginning 0 Value identifier 0=OKType end 4 Protocol type 4Number beginning 0 Number end 0Number end 0 Type end 4Format 3 Result CauseField 0 1st extensionChannel/mode group 0 2nd extensionSpare 0 3rd extension

4th extensionRead PLC error ID

(Request) (Response)

Error IDs:

Protocol Value identifier Explanation4 OK = 0 No error (values were supplied)0 FRMW_NV=2AH Format <> 30 IC_UNDEF=45H Length of I code instruction wrong0 FLAG_ERR=46H Wrong control flags (see example)0 LAUF_ERR=47H Type or number wrong (see example)

Page 270: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-20 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.6 Read control mode: 0213H

Software version:

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

With this I code it is possible to find out in which operating mode the NCK is located.

Parameter assignment:

Format 1.

Result:

One byte is provided to indicate the control mode.Normal mode Bit 0 = 1Installation mode Bit 1 = 1

Example:

I code ID 0213H I code ID 0213HControl flags 1000H Control flags 1400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0 Control mode 1Number end 0Format 1 Read control modeField 0 (Acknowledgement)Channel/mode group 0Spare 0

Read control mode(Request)

Error IDs:

OK 0x0 No error

Page 271: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-21SINUMERIK 840C OEM Version for Windows (BN)

A2.1.2.7 Read/write program pointers: 0216H

Software version:

SW 4.1

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

With this I code it is possible to read or write single elements of the program pointer.

Parameter assignment:

Each element of the program pointer is described by the data type, data number and channel inaccordance with the driver parameters. The format is 0 (ASCII).

Data type for

Preselect pointer Execution pointer

Workpiece name 10 30Part program name 11 31Number of passes 12 32Block number 13 33(*)Line number 14 34(*)Block or line number 15 35Complete program level 18 38No. of the active level 19 39

Preselect pointer: determines which workpiece or program is to be executed on the next RESET or NCSTART. The part program to be executed on the next RESET - NC START is displayed in theAUTOMATIC basic display.

Execution pointer: designates the workpiece or part program currently being processed.

Program level Data number0 01 12 23 34 45 56 67 7

Current program level (0 to 7) 98Current subroutine level (1 to 7) 99

Type(*) Program executed Program not executed

33 = programmed block number ok → block number = 0!

34 = line number ok ERROR (no valid value can be read)

Page 272: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-22 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Result:

The value is read or written.

Example:I code ID 0216H I code ID 0216HControl flags 9000H Control flags 9400HType beginning 11 Value identifier 0Type end 11 Protocol type 0Number beginning 2Number end 2 Write filename for SR level 2 inFormat 0 channel 2Field length 8 (Response)Channel/mode group 1Spare 0Filename ´SPF1234\0´

Write file name for SR level 2 inchannel 2(Request)

Error IDs:

OK 0x0 No errorDAT_NV 0x10 Data not availableKAN_NV 0x14 Incorrect channel number / axis not availableSP_GVOLL 0x25 Field length too smallINTER_ERR 0x48 Incorrect G group / parameterization error

(invalid MIB parameter / condition not fulfilled)LISTEND 0x11 End of list, no more dataKZG_SEM 0x23 No valid value can be readOVERFLOW 0x28 String is too longMODE_ERR 0x4C Program not interruptedKZG_ZZ 0x22 Data are read

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 273: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-23SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3 Command execution: 4xxH

A2.1.3.1 Abort current I code request: 0400H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICDAll components

DDE access: T

Function:

The specified request, e.g. a file transfer, is aborted.

Parameter assignment:

A request can only be aborted by its own source. It is selected by specifying the request number in the Icode header. Only one request per I code can by aborted.

Result:

Acknowledgement, if required. Current transfer is aborted.

Example:

I code ID 0400H I code ID 0400HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 135Number end 135 Abort requestFormat 0 (Response)Field length 0Channel/mode group 0Spare 0

Abort request no. 135(Request)

Error IDs:

In the event of an error, a value not equal to 0x0 is returned, otherwise OK = 0x0.

Page 274: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-24 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.2 Initiate drift compensation: 0419H

Software version:

SW 5.1 and higher

Processing software component:

R: 101H NCK Task ICD

DDE access: T

Function:

With this I code, the drift compensation can be initiated in the servo. A test is carried out whetherthe axis has been defined. If this is the case, then the drift compensation is initiated. If driftcompensation is already being executed via softkey function, you have to wait until thecompensation has been completed (max. 5 seconds, see Error IDs).

Parameter assignment:

Requests can be made in format 1 only. The drift compensation is initiated for the axis specifiedin number beginning = number end. The axis number is to be specified globally!

Result:

The drift value determined is entered directly into the machine data specified by the axis number.Errors are returned without value in protocol 1 (value identifier).

Example:

I code ID 0419H I code ID 0419HControl flags 9000H Control flags 9400H

Type beginning 0 Value identifier 0=OKType end 0 Protocol type 0

Number beginning AxisNumber end Axis (Acknowledgement)

Format 1Field 0

Channel/mode group 0Spare 0

Initiate drift compensation for axis(Request)

Error IDs:

Protocol Value identifier Explanation0 OK = 0 No error (drift compensation executed)0 DAT_NV=10H Wrong axis/axis not available0 KZG_SEM=23H Data error during drift compensation0 FRMW_NV=2AH Format <> 10 IC_UNDEF=45H Length of I code instruction wrong0 FLAG_ERR=46H Wrong control flags (see example)0 LAUF_ERR=47H Wrong type or number (see example)0 NO_RESET=5BH Stop axes (possible in reset only)0 QVZ_DID=53H Drift compensation via softkey function

Page 275: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-25SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.3 Initiate file transfer: 0421H

Software version:

SW 5.1

Processing software components:

30EH MMC Data man10EH NCK RKP

DDE access: T

Function:

Via this I code a data transfer is initiated on the MMC (or file transfer on the NCK). The componentsthat can be specified for the SINUMERIK 840C are the RS232 interface, the hard disk, the NCK, theNCK circular buffer (for execution from external) and the file transfer. The device and the file name andcertain request parameters must be specified as the source and the destination.

When transferring files from and to the NCK only the file name IDs listed in the table for files names(see below) must be used.

Parameter assignment:

A parameter block with 11 parameters containing the information necessary for the request is trans-ferred.The parameter block contains a structure because the parameters are of different data types. A new IDis therefore specified for the format information in the I code header which is the structure ID (ID 6).The description of the data within the structure with the format specification and meaning must bedefined for each I code. The size of the structure used - measured in bytes - is entered in the fieldlength in the I code header.

To describe the request, the device is defined together with device type and device number for sourceand destination. Other parameters specified are Number beginning and Number end. Numberbeginning and Number end can be used to delimit the range (e.g. read machine data 1000 - 1200).These parameters are entered in format 2 as unsigned short integers. The last parameters to bedefined are the workpiece name and file name for source and destination as ASCII strings. Theseparameters are of variable length and end with '\0'. If a name is to be omitted an empty string ('\0' only)must be entered.

Parameter block structure:

Source: Device typeDevice number

Destination: Device typeDevice number

- Number beginningNumber end

- SpareSource: 'Workpiece name\0'

'File name\0'Destination: 'Workpiece name\0'

'File name\0'

Page 276: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-26 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

The following source/destination combinations are implemented:

Destination -->Source

HD V24 NCK RSP RAW_HD

HD O X X X -V24 X - - - -NCK X - - - -RAW_HD - - X - -

O: 840C WIN only X: possible -:not permitted

Result:

Initiation of data transfer from the specified source to the destination.

If data are to be copied from or to the NCK, then the I code sequence for the file handling "Openfile", "Read file" or "Write file" and "Close file" are available. When copying to the hard disk, theMMC can make use of its own resources.

Initiation of file transfer:If you initiate the file transfer with this I code, the error message RKP_ERR can beacknowledged. The computer link error incurred is then found in the first word of the useful dataof the acknowledgement frame.

Page 277: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-27SINUMERIK 840C OEM Version for Windows (BN)

Parameter assignment:

Device type: HD/user directories 0RS 232C (V.24) 1NCK 3RSP=NCK-circular buffer 4RAW_HD=Hard disk absolute 6 SW 6.1 and higher

Device number: Hard disk/user/directories 0RS 232C (V.24) 1 presently a V.24 onlyNCK 1-4 only relevant for job, channel numberNCK circular buffer 1-4 channel 1-4File transfer 0Hard disk absolute 0 open file in binary format

1 open file as text file

Number beginning: When reading NCK data only the range number beginning to number end isreadRead all: 0

Number end: See Number beginning;Read all: enter maximum valueStarting number > end number: -> nothing is output

Workpiece name: For device "hard disk" only. Specifies the workpiece (directory) to which thefile name refers. Otherwise empty string '\0'.Is ignored when defined for other devices.

File name: File name in ASCII terminated with '\0'If file name destination ('\0') is missing file name source is taken. If file namesource is missing, the entire workpiece is transferred, or if it exists, the job listis processed.

The following file names (individual name or ranges) are allowed when transferring with the NCK:

Main programs 'MPFn\0' 'MPF[n,m]' ;n,m = 0 ... 9999Subroutines 'SPFn\0' 'SPF[n,m]' ;n,m = 0 ... 9999Tool offsets 'TOA\0' 'TOAk' ;k = 1 ... no. of channelsR parameters 'RPAk\0' ;k = 0 ... no. of channelsNC machine data 'TEA1\0'PLC machine data 'TEA2\0'Cycle machine data 'TEA4k\0' ;k = 0 ... no. of channelsZero offsets 'ZOAk\0' ;k = 0 ... no. of channelsNCK setting data 'SEA1\0'Cycle setting data 'SEA4k\0' ;k = 1 ... no. of channels

All data '*\0' For RS 232C (V.24) input only or when transferringfrom hard disk to NCK (state workpiece name)

Process workpiece list '\0' For source device "hard disk" only. The workpiecename must be defined. The associated workpiece listis processed; if the workpiece list is missing the wholedirectory is copied.

Caution:

When processing the workpiece list the "select" instruction is also executed. This is the same as formanual initiation via Machine/Automatic/Select program or when initiating file transfer via DB37 and notthe same as for initiation of workpiece transfer via data management.

Page 278: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-28 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Result:

Initiation of data transfer from the specified source to the destination.

An acknowledgment packet with the following structure is returned.

I code ID 0421HControl flags 9400HError ID 0Protocol type 0

The error ID is 0 if no error has occurred.

Example:

I code ID 0421H I code ID 0421HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 0 Copy PLC-MD 1000-2000 from NCK to

V24-1Format 6 (Response)Field length xAxis/mode group 0Spare 0Source:Device type 3

Device number 0Dest.: Device type 1

Device number 0No. beginning 1000Number end 2000Spare 0

Source:Workp. nameFile name

'\0''TEA2\0'

Dest.: Workp. nameFile name

'\0''\0'

x: Length of structure (in this example 22 bytes)

Copy PLC machine data 1000-2000from NCK to V24-1(Request)

Page 279: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-29SINUMERIK 840C OEM Version for Windows (BN)

Other example in abbreviated form:

Source:Device type 1 1 3 3Device number 0 0 0 0

Dest.: Device type 3 3 1 1Device number 0 0 0 0Number beg. 0 0 700 0Number end 0 0 12999 0Spare 0 0 0 0

Source:Workp. name '\0' 'Welle1\0' '\0' '\0'File name 'MPF123\0' '*\0' 'RPA1\0' 'MPF[10,99]\0'

Dest.: Workp. name '\0' '\0' '\0' '\0'File name '\0' '\0' '\0' '\0'

(Request) Copy MPF123from V24 toNCK. Otherfiles areignored

Copy all filesfrom V24 toNCK(workpiecename isignored).

Copy RPA1from NCK toV24

Copy MPF10to 99 fromNCK to V24

Source:Device type 0 0 3 3Device number 0 0 0 0

Dest.: Device type 3 3 0 0Device number 0 0 0 0No. beginning 0 0 0 0No. end 0 0 0 0Spare 0 0 0 0

Source:Workp. name 'Welle1\0' 'Welle1\0' '\0' '\0' File name 'MPF123\0' '*\0' 'MPF123\0' 'MPF[1,2]\0'Dest: Workp. name '\0' '\0' 'Welle1\0' 'Welle1\0'

File name '\0' '\0' '\0' '\0'

(Request) Copy MPF123from harddisk/Welle1 toNCK

Copy directoryWelle1 fromhard disk toNCK

Copy MPF123from NCK intodirectoryWelle1 on thehard disk

Copy MPF1and MPF2from NCK intodirectoryWelle1 on thehard disk

Page 280: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-30 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Error IDs:

OK = 0 No errorPP_NV=12h 840C WIN only: File not availableKZG_ZZ=22h 840C WIN only: Error when reading the source or writing the

destinationPROT_ERR=44h 840C WIN only: Small or incomplete path and/or

File name, \\ instead of /PPNAM_ERR=49h 840C WIN only: Wildcards (? or *) in file namesFUNCT_NOT_ACCEPT=4Fh

840C WIN only: Source/Destination combination not permitted

840C WIN errors:

Destination -->Source

HD V24 NCK RSP RAW_HD

HD 044h

012h22h44h

012h44h

012h44h

4fh

V24 012h22h44h

4fh 4fh 4fh 4fh

NCK 044h

4fh 4fh 4fh 4fh

RAW_HD 4fh 4fh 012h22h44h49h

4fh 4fh

Others 4fh 4fh 4fh 4fh 4fh

Page 281: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-31SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.4 Initiating job list processing/workpiece transfer with Windows applications

The DDE server interface for "transparent data transfer" between MMC components implemented asfrom SW 5 is used for initiating job list processing with Windows applications.

Processing is triggered by I code command 421H that is sent to the data management.

The I code must be assigned as follows:

Length Total length of the packetError number ADS 0000 HSender Assigned by DDE serverReceiver 30E HRequest data structure 1 ADSRequest number More significant byte is assigned

by the DDE server, lesssignificant byte can be used formanagement

header

Spare 0Spare 0I code ID 421 HControl flags 9000 HType beginning 0Type end 0Number beginning 0 I codeNumber end 0 headerFormat 6Field length 24Axis/mode group 0Spare 0Source:Device type 0

Device number 0Dest.: Device type 3

Device number 0No. beginning 0 I codeNumber end 0 useful dataSpare 0

Source:Workp. nameFile name

'WELLE1\0''\0'

Dest.: Workp. nameFile name

'\0''\0'

Source: Workpiece name in which the job list is stored

Page 282: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-32 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.5 Select workpiece name / machining program: 0422H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The specified workpiece list or the specified part program is preselected.

Parameter assignment:

The workpiece list or part program are distinguished by the number:

Workpiece list (number beginning = number end = 0)Part program (number beginning = number end = 1)

The workpiece list or part program name is entered as an ASCII string (format = 0) behind the I codeheader. The string length (incl. end ID '\0') must be entered in the field length. The associated channelmust be entered in the channel/mode group field.

If both a workpiece list and a part program are selected in a request, two ASCII strings must betransferred in protocol 1 (number beginning = 0, number end = 1) - each concluded with '\0'.

Result:

Acknowledgment if required.

Example 1:

I code ID 0422H I code ID 0422HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 0 Select workpiece list 'WELLE1'Format 0 (Response)Field length xChannel/mode group 0Spare 0Workpiece list name 'WELLE1\0'

x: String length

Select workpiece list 'WELLE1'(Request)

Page 283: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-33SINUMERIK 840C OEM Version for Windows (BN)

Example 2:

I code ID 0422H I code ID 0422HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 1Number beginning 0 Number end 1Number end 1 Value identifier 0Format 0Field length x Select workpiece listChannel/mode group 0 'TEIL1' and programSpare 0 'MPF12'Number end 1 (Response)Value identifier 0Workpiece list name 'TEIL1\0'Part program name 'MPF12\0'

x: String length (of the longerparameter)

Select workpiece list 'TEIL1'and program 'MPF12'(Request)

Error IDs:

FRMW_NV 0x2A Incorrect formatLAUF_ERR 0x47 Number or type parameter assignment incorrectWANDL_UNG 0x2B Error in ASCII parametersAUFTR_ERR 0x40 General error ID,

see protocol 2 for more detailINTER_ERR 0x48 Parameterization error data driverSP_EVOLL 0x26 End of dataKAN_NV 0x14 Incorrect channel numberSP_GVOLL 0x25 Field length (ASCII) too smallINTER_ERR 0x48 Incorrect G groupKZG_SEM 0x23 No valid value can be readKZG_ZZ 0x22 Data are read

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 284: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-34 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.6 Start / stop an MMC application from the PLC side: 042EH

Software version:

SW 3.1 and higher

Processing software component

R: 031BH MMC WIN.UHR

DDE access: T

See SINUMERIK 840C WindowsTM OEM version (BN)Stored in: sinx\ph\win2\ddesrv.doc© Siemens AG 1994. All Rights Reserved 6FC5198- AA70Chapter 5 DDE Interface5.8.2.4 I code description (0x42EH)

A general interface in the form of an I code is made available to the OEM user through which start/stoprequests can be issued from the PLC.

Basis: "Data" transport is executed via the mailboxes already specified in the DualPortRam of theMMC PLC using the general data interface for transport.Further use is made of the function blocks FX73 and FX74 on the PLC side. The OEM interfaceavailable in SIN840-FlexOs is therefore retained as a transport level.

I code ID: 0x42EH

Function: Start or stop a Windows/DOS application in the MMC area

Processing software component in MMC: 0x31BH

For the I code 0x42EH basic type 1 is used.

Description: Examples: Remarks:

I code ID 2E04HControl flags 0010HType beginning -Type end -Number beginning -Number end -Format 0600H (Structure)Field -Channel/mode group -Spare -

I code 0x42EH: Start/stop of MMC applications from the PLC

Page 285: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-35SINUMERIK 840C OEM Version for Windows (BN)

The data to be written for the start/stop of an MMC application are attached to the I code header.The following structure is laid down for this:

Start ID [Word] 0100H (1=Start)Window mode [Word] 0300H (3= Full screen)No. of OEM application [Word] 0500H (app5=messen.exe)Call string ID [String] 0100H (1=Call parameter follows)Call string -r -s '\0' (Call string)

Data structure to start/stop MMC applications

Start ID: OEM applications can be started as well as stopped from the PLC.1 = Start OEM application0 = Stop OEM application

Windows modi: All values permitted for the Windows parameter nCmdShow (see: windows.h– Windows SDK valid for this software version) are allowed.Examples:5 = SW_SHOW = as normal screen, in forefront3 = SW_SHOWMAXIMIZED = as full screen, in forefront

2 = SW_SHOWMINIMIZED = as icon, in forefront8 = SW_SHOWNA = as normal screen, in background7 = SW_SHOWMINNOACTIVE = as icon, in background

No. of OEM application: The OEM user is given the file sin840c.ini which allows checking for whichapplications can be started/stopped by PLC initiation....[plcstart]app1=messen.exeapp2=c:\anw\simula.exe -o...

Call string ID: 1 = call string to follow2 = no call string

Call string: The call string must be closed with '\0', it is attached to the call parametersspecified in SIN840C.INI and transferred to the MMC application when called.The length is limited by the total length of the data packet.

In principle, requests to start or stop an MMC application are sent to the MMC SW component 0x31BH.Only one MMC application can be started or stopped per data packet.

From the view of PLC applications, a complete data packet to start MMC applications always consistsof the following: packet header, I code header, data.

Page 286: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-36 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Data packet in PLC transfer area: Start MMC application

2 bytesPacket header Packet length (without header) 0010H

Sender 0201HReceiver 031BHRequest data structure 1 (I code)Request number 1230H

I code header I code ID 2E04HControl flags 0010HType beginning -Type end -Number beginning -Number end -Format 0600H (Structure)Field -Channel/mode group -Spare -

Data structure Start ID 0100H (Start application)Window mode 0300HNo. of OEM application 0500H (app5=)Call string ID 0010H

Call string -r'\0'

I code acknowledgement:

For the response the "Basic type for following packets and responses" is used [2].

I code ID 042EHControl flags 1400H (see [2])Value identifier 33 (Request successfully completed)Protocol type -

Response to I code 0x42EH

In the response to "Start application" a report is displayed in the value identifier whether the MMCapplication has been successfully started.

Value identifier: Value > 32 = OK; otherwise the exact value is returned which the Windowsfunction WinExcel() has returned (see Windows SDK description).

The response to "Stop application" may contain the following value identifiers:0 = OK; WM_CLOSE has been sent1 = Application not started from PLC or already stopped2 = Entity of application not found

Page 287: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-37SINUMERIK 840C OEM Version for Windows (BN)

A2.1.3.7 Express shutdown: 042FH

Software version:

5.1 and higher

Processing software components:

R: 319H MMC Services

DDE access: T

Function:

The Step 5 user program can initiate an express shutdown on the MMC side with function block FX 73.As soon as the mulitport RAM server has received the I code from the PLC it sends the broadcastmessage UMSG_ON_POWERDOWN to all Windows applications.

All the files of the applications signed on for express shutdown must be closed.

Parameter assignment:

Only the I code ID is evaluated. The other entries of the I code packet are of no significance.

Result:

Acknowledgement. All the files of the applications signed on for express shutdown are closed. Thecontrol is in a stable state and can be switched off.

Example:

I code ID 042FH I code ID 042FHControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 0 Express shutdown

completedFormat 0 (Response)Field length 0Channel/mode group 0Spare 0

Initiate Express shutdown(Request)

Error IDs:

None.

Page 288: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-38 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4 Selective data transfer: 5xxH

A2.1.4.1 Transfer data block description to the NCK: 0500H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

A data block description (DBB) is transferred to the NCK.

Parameter assignment:

In protocol 4 the size and number of I codes defined in this DBB are specified. All information is informat 2 (unsigned short integer). The length of an I code header is 10 words. 0 to 9 in entered in thetype for the inner counting loop. In number, the number of I codes contained in the DBB is stored: k - 1.An additional data block of length 10 must be placed in front to accommodate the DBB header.

If the value 0FFFFH is entered in the I code in the channel/axis/mode group field, the channelspecification is taken over from the current cyclic request when, for example, a cyclic transfer isperformed. By entering the required channel in the I code within the DBB it is possible to make thechannel permanent. It is generally true that if 0FFFFH is entered in the channel/axis/mode group field,the real value is only taken over when the command referring to the DBB is executed.The control flags within the I codes contained in the DBB do not need to be filled in.

Result:

The DBB is taken into the DBB directory of the NCK.

Error IDs:

FRM_UNG 0x29 Format in the I Code incorrect (<> 2)LAUF_ERR 0x47 Type specifications in the I code header incorrectSP_EVOLL 0x26 Number specification in the I code header incorrectKWRIT 0x20 DBB ID not permittedSP_GVOLL 0x25 No space to insert the DBBDAT_BV 0x21 DBB already existsINTER_ERR 0x48 Internal software errorOK_WRITE 0x2 DBB taken over without errorIC_UNDEF 0x45 Length of I code instruction too short

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 289: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-39SINUMERIK 840C OEM Version for Windows (BN)

Example:

I code ID 0500H I code ID 0500HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 9 Protocol type 0Number beginning 0Number end 2 (k) Transfer DBB 100 to NCKFormat 2 (Response)Field length 0Channel/mode group 0Spare 0Number end 2 (k) Protocol 4Type end 9

000000

DBB ID 100 DBB headerRepeat factor 1No. of I codes in DBB 2Spare 01st I code: ID 110H I codesControl flags 0Type beginning 0Type end 0Number beginning 3Number end 3Format 2Field length 0Axis/mode group 0FFFFHSpare 02nd I code: ID 10BHControl flags 0Type beginning 0Type end 0Number beginning 4Number end 4Format 2Field length 0Axis/mode group 0FFFFHSpare 0

(k: number of I codes contained in the DBB)

Transfer DBB 100 to NCK(Request)

Page 290: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-40 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4.2 Delete DBB from NCK: 0501H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The specified DBB is deleted from the NCK.

Parameter assignment:

In protocol 0, the ID of the DBB to be deleted is transferred. The format is 2.

Result:

The DBB is deleted from the DBB directory.

Example:

I code ID 0501H I code ID 0501HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 0 Delete DBB 100 from NCKFormat 2 (Response)Field length 0Channel/mode group 0Spare 0DBB ID 100

Delete DBB 100 from NCK(Request)

Error IDs:

FRM_UNG 0x29 Format in I code incorrect (<> 2)KWRIT 0x20 0 not permitted as DBB IDSP_GVOLL 0x25 No more space in the empty stack vectorDAT_NV 0x10 DBB not available

Range overflowINTER_ERR 0x48 Internal software errorOK_WRITE 0x2 DBB was deletedIC_UNDEF 0x45 Length of I code instruction too short

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 291: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-41SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4.3 DBB data transfer 0502H

Software version:

SW 5.1

Processing software components:

101H NCK Task ICD

DDE access: T

Function:

Data described in a DBB can be selected for reading and writing.

Parameter assignment:

During reading, the DBB ID is also transferred with protocol type 0. During writing, the data must betransferred according to protocol type 5. The total length of the data must not exceed one packetlength! The following applies to the channel/axis/mode group field of the I codes described in the DBB:If value 0FFH has been entered, the entry is taken from the channel/axis/mode group field of I code502H. Otherwise the channel defined in the I code of the DBB is addressed.

Result:

During reading, the data of the I codes described by the DBB are sent with protocol type 5. Duringwriting, the data of the I codes described by the DBB are put in the NCK. Errors during processing arereturned in protocol type 5.

Example:

I code ID 0502H I code ID 0502HControl flags 1000H Control flags 1400HType beginning 0 Value identifier 0Type end 0 Protocol type 5Number beginning 0 Prot. 5: No. of DBBs 1Number end 0 DBB ID 100Format 2 Error 0Field length 0 Pos. incorrect I code 0Channel/mode group 1 Length in bytes nSpare 0 Data Result valuesDBB-identifier 100 of I codes

Read DBB 100(Request) Read DBB 100

(Response)

Page 292: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-42 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Error IDs:

ID HEXcode

Read/Write

Explanation

OK 0 R/W No errorDAT_NV 10 R/W Date not availableKWRIT 20 R/W No authorization to read/writeKZG_SEM 23 R/W Semaphore to read/write not

receivedFRM_UNG 29 R/W Format in I code wrong (<> 2)PROT_ERR 44 W Protocol incomplete/faultyIC_UNDEF 45 R Length of I code instruction too

shortLAUF_ERR 47 R/W Type or number wrongINTER_ERR 48 R Internal errorIIPERR 1550 W Error reading I code interpretation/

area overshooting

Example 2:

I code ID 0502H I code ID 0502HControl flags 9000H Control flags 1400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 0 Write DBB 100 With errorFormat 2 (Response) protocol 0Field length 0Channel/mode group 0Spare 0Number of DBBs 1DBB ID 100Value identifier 0Spare 0DBB length 4Value 1 5Value 2 6

Write DBB 100(Request)

Page 293: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-43SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4.4 Read DBB directory of NCK: 0503H

Software version:

SW 5.1

Processing software components:

101H NCK Task ICD

DDE access: T

Function:

The data block descriptions currently existing in the NCK are returned.

Parameter assignment:

2 must be defined as the format (unsigned short int). Type beginning/end and Number beginning/endare 0.

Result:

The IDs of the DBBs are returned in protocol type 4. The number end of the protocol specifies thenumber of IDs.If there are no DBBs in the NCK at the time of the request, this is signaled in protocol type 0.

Example:

I code ID 0503H I code ID 0503HControl flags 1000H Control flags 1400HType beginning 0 Value identifier 0Type end 0 Protocol type 4Number beginning 0 Number end 2Number end 0 Type end 0Format 2 1. DBB identifier 100Field length 0 2. DBB identifier 134Channel/mode group 0 3. DBB identifier 200Spare 0

Read DBB 100Read DBB directory of NCK (Response)(Request)

Error IDs:

FRM_UNG Format in I code incorrect (<> 2)LAUF_ERR Type or number incorrectDAT_NV No DBBs existOK OK - IDs to follow (in protocol type 4)IC_UNDEF Length of I code instruction too short

Page 294: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-44 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4.5 Issue cyclic request/change request: 0504H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

A cyclic request is entered in the NCK. A distinction is made between cyclic requests and changerequests. With change requests, data are only sent from the NC to the DDE server on a change. ForWindows clients, only change requests are allowed.

Parameter assignment:

The request is transferred in protocol type 4. The type beginning and end and the number beginningare 0. The number end is used to define the number of parameters. The permissible format is 2(unsigned short int).

The parameters must have the same structure as a cyclic request, i.e. the request number, sender,channel number and number of DBBs in the request and the IDs of the DBBs to be processed must bepassed on.

In this I code, the component number assigned by the DDE server must be entered as the sendercomponent. The same applies to the request number.

To generate a change request, "ICODEADV" must be specified as the ITEM. If an attempt is made touse the same ITEM twice, the requesting client receives a negative acknowledgement.

Result:

The request is entered in the cyclic request list of the NCK.

Requests are processed cyclically via the output device.

The channel number of the cyclic request is always used if the ID 0FFFFH is noted in the channel/axis/mode group field of the I code contained in the DBB.

Error IDs:

FRM_UNG 0x29 Format in the I code incorrect (<> 2)LAUF_ERR 0x47 Type or number incorrect,

Numbers from I code header and protocol header do not matchDAT_BV 0x21 Cyclic request already existsASP_VOLL 0x27 No space in ZAL to insert the requestOK_WRITE 0x2 Request was transferred without errorIC_UNDEF Length of I code instruction too short

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 295: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-45SINUMERIK 840C OEM Version for Windows (BN)

Example:

I code ID 0504H I code ID 0504HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end n+4-1 Send cyclic requestFormat 2 (Response)Field length 0Channel/mode group kSpare 0Number end n+4-1Type end 0Request number 5678Sender 1234Channel number kNo. of DBBs n1st DBB ID 1002nd DBB ID 123... ...nth DBB ID 200

(n: Number of DBBS contained in the request)

Send cyclic request(Request)

Page 296: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-46 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.4.6 Delete cyclic request/change request: 0505H

Software version:

SW 3.1 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The cyclic request is deleted from the cyclic request list of the NCK.

Parameter assignment:

Because several components can send cyclic requests, the request number and the sender must bespecified for unique identification of the required request. These specifications are transferred inprotocol 4. The format is 2.

Exception: All requests of a component are deleted if the request number is 0 and the ID of thecomponent is passed as the sender.

Result:

The request is deleted from the cyclic request list or, with the request number is 0, all requests of thespecified component are deleted.

Example:

I code ID 0505H I code ID 0505HControl flags 9000H Control flags 9400HType beginning 0 Value identifier 0Type end 0 Protocol type 0Number beginning 0Number end 1 Delete cyclic requestFormat 2 (Response)Field length 0Channel/mode group 0Spare 0Number end 1Type end 0Request number 5678Sender 1234

Delete cyclic request(Request)

Error IDs:

FRM_UNG 0x29 Format in the I code incorrect (<> 2)LAUF_ERR 0x47 Type or number incorrect,AUFTR_NV 0x13 Cyclic request to be deleted not availableOK_WRITE 0x2 Request deleted from ZALIC_UNDEF 0x45 Length of I code instruction too short

All error IDs are to be found in the header file ICDK1.H in directory c:\mmcsrc\msc\inc of the OEM testenvironment.

Page 297: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-47SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5 Process file: 6xxH

A2.1.5.1 Open file: 0601 H

Software version:

SW 5.4 and higher

Processing software components:

10CH NCK Task ASCII121H SERVO, drive Task SECCOM

DDE access: T

Function:

The file specified in the I code header is opened. The file can be opened for reading (O_READ) orwriting (O_WRITE). You can also define whether an existing file is to be deleted (O_DELETE) when afile is written. When opening part programs to be written you must define whether a file 'SPF' is to becreated as a cycle (O_ZYKLUS) or as a subroutine (O_SPF).

In SW 6 and higher, a workpiece name can be defined for a part program in addition to the file name. Inaddition, there is an option which deletes an existing file only if the workpiece name of the existing filecoincides with the workpiece name of the file to be written (O_DEL_WKSG).

Parameter assignment:

The following parameters are assigned

- Access- Mode- Number beginning- Number end and- File name.

Access rights to the file are entered in the word Access. They are added to the file as an attributewhen it is created. They are not currently evaluated for NCK RAM data. The cycle ID 'O_ZYKLUS' isspecified for cycle programs to distinguish them from subroutines ('O_SPF').

In later expansions the FlexOS access rights can be Read, Write, Execute and Delete.

The mode in which processing of the file can be continued is coded in the word Mode.

0=O_READ Open file for reading1=O_WRITE Open file for writing; if the file already exists, abort3=O_WRITE_D Open file for writing; if the file already exists, delete5=O_WRITE_V Open file for writing; if the file already exists, compare files9=O_WRITE_DG Open file for writing; if the file already exists with the same workpiece name

delete file (SW 6 and higher)

There is currently no disable that prevents simultaneous reading and writing by different componentswhen transferring NCK RAM data.

The data range can be delimited with Number beginning and Number end when reading NCK RAMdata. If reading and writing all the files (NCK RAM data and part programs) 0 must be entered forNumber beginning and a maximum value for Number end (see table).

Page 298: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-48 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

File type File name Initial number (min.) End number (max.)

Main programs MPFxxxx - -

Subroutines SPFxxxx - -

NC machine data TEA1 0 65535

PLC machine data TEA2 0 9999

Drive machine data TEA3

Cycle machine data TEA40 0 999

TEA4k 1000 9999

NC setting data SEA, SEA1 0 9999

Cycle setting data SEA4k 0 9999

R parameters RPA0 0 699

RPAk 700 1299

Tool offsets TOAk 0 999

Zero offsets ZOA0 - -

ZOAk - -

User memory module UMS - -

Clear files CLF - -

IKA data IKA 1-3 - -

Gearbox interpolation data GIA - -

Fanuc part programs 0xxxx(x) **) - -

xxxx: 4-digit program number 0-9999k: Channel number 1-6**) Only if Fanuc part program converter is integrated

The file name of the file to be opened is entered in ASCII. It consists of an ID and a number which iswritten left-justified, without leading zeros or blanks, immediately following the ID.The ASCII name is terminated with '\O'.

In SW 6 and higher, a Workpiece name can be indicated behind the file name. It is entered directlybehind the file name and also terminated with '\0'. The workpiece name is only evaluated for partprograms. In the workpiece indicated, the program is stored in connection with the "Automatic saving"function. In addition, the origin of this program can be found via this workpiece name, which enables,for example, specific deletion or a deletion protection. The workpiece name can be read out via theI code 60cH "Read directory with workpiece name".

Note:It is possible to open up to 10 files simultaneously.

Result:

The file is opened and/or created for the component in the processing mode defined. If the file cannotbe opened because another component is already accessing it, an error message is output.

A file descriptor (1 word) is returned as a return parameter. This file descriptor must be used instead ofthe file name for the following I codes 'Read file', 'Write file' and 'Close file'.

Page 299: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-49SINUMERIK 840C OEM Version for Windows (BN)

Example (control flags representing NCK task ASCII):

I code ID 0601H I code ID 0601HControl flags 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0Access 0 File descriptor 1234Mode O_READNumber beginning 0 Open file for reading (TEA1)Number end 20999 (response)File name 'TEA1\0'

Open file for reading (TEA1)(request)

I code ID 0601H I code ID 0601HControl flags 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0Access O_ZYKLUS File descriptor 1234Mode O_WRITENumber beginning 0 Open file for writing (cycle SPF12)Number end 0 (response)File name 'SPF12\0'

Open file for writing (cycle SPF12)(request)

Error IDs:

SW 6 and higher

0=OK No error, file description is reported12H=PP_NV Part program (MPF, SPF, PCF) does not exist (when opening for output)

KWRIT generally no write/read authorization (open in normal mode for UMS)21H=DAT_BV No write authorization since file is already existing and must not be overwritten22H=KZG_ZZ At present, no write/read authorization since:

- the file has already been opened by other user,- the program cannot be overwritten since it has a delete protection- the requested data transfer is disabled by the PLC

24H=SP_GVOLL The program cannot be opened because the memory is full or insufficientmemory space (processing external)

44H=PROT_ERR Something is missing in the request46H=FLAG_ERR Incorrect flags (no single request, no write request, no request)48H=INTER_ERR Internal error: Too many files opened simultaneously (at present, a maximum of

10 is possible)49H=PPNAM_ERR Unknown file name4DH=KENNW_ERR No write authorization, since no password has been entered (for PCF, TEA)

Page 300: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-50 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.2 Close file: 0602H

Software version:

SW 5.4 and higher

Processing software components:

10CH NCK Task ASCII121H SERVO, drive Task SECCOM

DDE access: T

Function:

The file identified by the file descriptor is closed.

Parameter assignment:

The file descriptor (1 word) is specified as a parameter.

Result:

The file for the component is closed.

Example (control flags representing NCK Task ASCII):

I code ID 0602HControl flags 8000HReserved 0Reserved 0File descriptors 1234

Close file No acknowledgement required(request)

Error IDs:

If an error occurs a return value not equal to 0H is returned, otherwise OK = 0H.

Error IDs: (see /3/)

0=OK No error12H=PP_NV File descriptor unknown (file not opened)44H=PROT_ERR Something is missing in the request46H=FLAG_ERR Flags wrong (no write request, no single request, no request)

Page 301: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-51SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.3 Read file: 0603H

Software version:

SW 5.4 and higher

Processing software component:

10CH NCK Task ASCII121H SERVO, drive Task SECCOM

DDE access: T

Function:

The file specified by the file descriptor can be read. Files may be transferred in several packets that arecombined to form a series of packets.

When reading the NCK RAM data, the data area can be delimited by a number beginning and anumber end in 'Open file'. Otherwise only complete files (part programs) can be transferred.

Parameter assignment:

During reading the file descriptor is positioned on the required file in the request packet. The range ofthe NCK data to be read can be delimited with Number beginning and Number end in the previous Icode 'Open file'. Otherwise the whole file (part programs) is transferred.

Result:

The data (NCK RAM data or part programs) are sent as a response in a packet or a series of packets.The I code header for responses and following packets is used. The protocol type does not have to beevaluated. Any errors that occur are noted in the value identifier. Each packet of the series contains asection of the program or data file in question. Its length is determined by the length of the ADS headerused. A packet must always be filled completely.

Page 302: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-52 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Example (control flags representing NCK Task ASCII):

I code ID 0603H I code ID 0603HControl flags 2800H Control flags 2C00HReserved 0 Value ID 0Reserved 0 Protocol type 0File descriptor 1234 Result data N10...LF

N20...LFRead file N30...LF(request) N40.....

Starting packet

I code ID 0603H I code ID 0603HControl flags 6800H Control flags 6C00HValue ID 0 Value ID 0Protocol type 0 Protocol type 0

Result data ....LFFollowing packet

Following packet

I code ID 0603H I code ID 0603HControl flags 6800H Control flags 4C00HValue ID 0 Value ID 0Protocol type 0 Protocol type 0

Result data ...LFFollowing packet N200..LF

N300..LF

End packet

Read file(response)

Error IDs:

If an error occurs a return value not equal to 0H is returned, otherwise OK = 0H.

Error IDs: (see /3/)

0=OK No error, data in packet12H=PP_NV File descriptor unknown 0 (file not opened)41H=PAKFOL_ERR Wrong packet sequence (e.g. not started with initial or single packet)44H=PROT_ERR Something is missing in the request46H=FLAG_ERR Flags wrong (acknowledgement request not set, no request)

Page 303: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-53SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.4 File transfer NCK →→→→ MMC (MMC: Services/NC/Save Start)

Page 304: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-54 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.5 Write file: 0604H

Software version:

SW 5.4 and higher

Processing software components:

10CH NCK Task ASCII121H SERVO, drive Task SECCOM

DDE access: T

Function:

The file specified by the file descriptor can be written. Files may be transferred in several packets thatare combined to form a series of packets.

Parameter assignment:

When writing, the 1-word-wide file descriptor is located in the starting packet or single packet after the Icode header. This is followed by the useful data to be transferred. The protocol type does not have tobe evaluated for following packets and end packets; any errors that have occurred are noted in thevalue identifier.The length of the useful data to be transferred per packet is calculated from the packet length specifiedin the ADS header. A packet must always be filled completely. The data to the NCK are transferred intape format. NCK RAM data are transferred directly to the NCK memory.

Result:

When writing, one acknowledgment per packet or (in start-up mode only) per request.

Page 305: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-55SINUMERIK 840C OEM Version for Windows (BN)

Example (control flags representing NCK Task ASCII):

I code ID 0604H I code ID 0604HControl flags A800H Control flags AC00HReserved 0 Value ID 0Reserved 0 Protocol type 0File descriptor 1234Data N0001...LF Starting packet

N0010...LFN0015...LFN0030

Starting packet

I code ID 0604H I code ID 0604HControl flags E800H Control flags EC00HValue ID 0 Value ID 0Protocol type 0 Protocol type 0Data ....LF

N0060...LF Following packetN0070...LFN0080....

Following packet

I code ID 0604H I code ID 0604HControl flags C800H Control flags CC00HValue ID 0 Value ID 0Protocol type 0 Protocol type 0Data ....LF

N0200...LF Write file(response)

End packet

Write file(request - series of packets)

Error IDs:

If an error occurs a return value not equal to 0H is returned, otherwise OK = 0H.

Error IDs: (see /3/)

0=OK No errors10H=DAT_NV Date to be read in not available12H=PP_NV File descriptor unknown (file not opened)25H=SP_GVOLL At least one error during processing:

- Block too long (in the case of part programs up to 120 char. without blanks)- Format error (in the case of part programs: input errors, comment errors; in the case of program data: block structure wrong, value wrong)

42H=PAKFOL_ERR Wrong packet sequence (e.g. not started with initial or single packet)44H=PROT_ERR Something missing in request46H=FLAG_ERR Flags wrong (wrong acknowledgement request set, no request)

Page 306: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-56 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.6 File transfer MMC →→→→ NCK (MMC: Services/NC/Load Start)

Page 307: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-57SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.7 Delete file: 0605H

Software version:

SW 5.4 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The specified file(s) is/are deleted. Only part programs, i.e. MPFs and SPFs can be deleted in theNCK. All the files of a part program directory (e.g. MPF directory) can also be deleted. Wild cards ('*' or'?') can also be used.

Parameter assignment:

The file name of the file to be deleted is specified as a parameter in ASCII. Wildcards '*' and '?' arepermitted, e.g.:

Main program directory ´MPF*´Individual file file name (e.g. ´MPF1234´)All MPF1* ´MPF1*´All SPF3? ´SPF3?´

Result:The specified file(s) and its/their directory entry(ies) is/are deleted. If an error occurs in the deletedriver, I code error 20H is output. The function is not aborted with delete area but continues to deleteomitting all files that cannot be deleted

Example:

I code ID 0605H I code ID 0605HControl flags 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0File name 'MPF1234\0'

Delete fileDelete file 'MPF 1234' (response)(request)

I code ID 0605H I code ID 0605HControl flags 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0File name 'MPF1*\0'

Delete fileDelete all ´MPF1*´ (response)(request)

Error IDs: SW 3.1 and higher

KWRIT (20H) (at least) one file could not be deleted

Page 308: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-58 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

New error IDs: SW 4.1 and higher

ICD error PPD error Explanation

12H=PP_NV F_KEINPP Part program not available

21H=DAT_BV F_PPEXIST No write access since PP already existing

23H=KZG_SEM F_EDIT Semaphore for reading/writing not received

23H=KZG_SEM F_WRITE Semaphore for reading/writing not received

23H=KZG_SEM F_READ Semaphore for reading/writing not received

23H=KZG_SEM F_EXEC Semaphore for reading/writing not received

23H=KZG_SEM F_NOWRITE Semaphore for reading/writing not received

25H=SP_GVOLL F_SP_VOLL Part program memory completely full

45H=IC_UNDEF - I code length too short

46H=FLAG_ERR - Wrong control flags (see example)

48H=INTER_ERR F_UNIT Internal error

48H=INTER_ERR F_NOCHAN Internal error

49H=PPNAM_ERR F_NAME File name wrong

Page 309: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-59SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.8 Rename file: 0606H

Software version:

SW 5.4 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The file specified in the I code header is renamed to the name specified as a parameter. Only partprograms can be renamed in the NCK.

Parameter assignment:

The file names are entered after the I code header in ASCII. The old and the new name are entered.

Result:

The file is renamed. (No other component must access the file).

Example:

I code ID 0606H I code ID 0606HControl flags 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0Old file name 'MPF1234\0'New file name 'MPF5678\0' Rename file

(response)Rename file 'MPF1234' to 'MPF5678'(request)

Error IDs:

ICD error Explanation PPD error

12H=PP_NV File not available F_KEINPP

21H=DAT_BV Second file name already available F_PPEXIST

23H=KZG_SEM Renaming not possible for the time F_EDIT, F_WRITE,being F_READ, F_EXEC,

F_NOWRITE

25H=SP_GVOLL Part program memory completely full F_SP_VOLL

45H=IC_UNDEF I code length too short -

46H=FLAG_ERR Wrong control flags (see example) -

48H=INTER_ERR Internal error F_UNIT, F_NOCHAN

49H=PPNAM_ERR Wrong file name F_NAME

Page 310: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-60 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.9 Display directory: 0607H

Software version:

SW 5.4 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The contents of the directory are displayed.

Only part program directories can be read by the NCK where a distinction is made between mainprograms and subroutines.

Parameter assignment:

The file/directory name is passed as an ASCII parameter.Wildcards '*' and '?' are permitted.

The following assignments are possible:

Main program directory 'MPF*'Subroutine directory 'SPF*'Single file File name (e.g. 'MPF1234')All MPF1* 'MPF1*'All SPF3? 'SPF3?'

Note: *\0' to call all part program directories is not possible!

Result:

The contents of the directory are displayed.

The part program directory is returned as a string field. An ASCII string is returned for each directoryentry.

The strings are returned in protocol type 1. The number of entries is displayed in Number end. Each fileinformation entry consists of three parameters:

the part program name,size andaccess rights.

The following access rights are used:

R Read programW Write programE Execute programZ CycleA UMS programP Circulating memory (pipe)

The parameters are separated in the string by a comma. Every string is terminated with an '\0'.

The size of the remaining free memory area is the last entry of the string. This memory size entrybegins with an '#' to distinguish it from the other file information entries.

Page 311: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-61SINUMERIK 840C OEM Version for Windows (BN)

Structure of the PP directory entry:

File name, reserved memory in bytes, access rights \0...File name, reserved memory in bytes, access rights \0#Size of free memory area in bytes

Example:

I code ID 0607H I code ID 0607HControl flags 1000H Control flags 1400HReserved 0 Value ID 0Reserved 0 Protocol type 1File name 'SPF\0' Number end 5

Value ID 0SPF12,348,RW\0SPF56,23,RWE\0SPF567,231,ZARE\0SPF700,300,ZRWE\0SPF721,53,ZARE\0#501045\0

Display directory (subroutines) Display directory(request) (response)

I code ID 0607H I code ID 0607HControl flags 1000H Control flags 1400HReserved 0 Value ID 0Reserved 0 Protocol type 1File name 'MPF12´ Number end 1

Value ID 0MPF12,12,RW\0#341039\0

Display directory (MPF12) Display directory (MPF12)(request) (request)

Error IDs:

PPNAM_ERR File name incorrectPP_NV File does not existSP_GVOLL Packet buffer for DIR entry too smallINTER_ERR Internal errorIC_UNDEF I code length too shortFLAG_ERR Wrong control flags (see examples)

Page 312: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-62 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.1.5.10 Read/write file attribute: 0608H

Software version:

SW 5.4 and higher

Processing software component:

101H NCK Task ICD

DDE access: T

Function:

The access rights of a file can be read and altered.The following attributes can be set:

R Read rightsW Write rightsE Execution rightsZ Cycle (copyrights)

Syntax attribute specification

Parameter assignment:

The file name is specified as a parameter. When writing the required attributes must be specified as anASCII string according to the following syntax.

Result:

The attributes are returned as an acknowledgment (for reading and writing if no errors have occurred).If an error occurred during writing, this is signaled (in which case the current attributes are notreturned!).

Page 313: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-63SINUMERIK 840C OEM Version for Windows (BN)

Example:

I code ID 0608H I code ID 0608HControl flags 1000H Control flags 1400HReserved 0 Value ID 0Reserved 0 Protocol type 0File name 'MPF1234\0' 'RW\0'

Read file attributesRead file attributes of MPF1234 (response)(request)

I code ID 0608H I code ID 0608HControl flag 9000H Control flags 9400HReserved 0 Value ID 0Reserved 0 Protocol type 0File name 'MPF1234\0' 'RWE\0'Access '+R+W+E\0'

Set file attributesSet file attributes of MPF1234to 'R W E'

(response)

(request)

Error IDs:

If an error occurs a return value not equal to 0H is returned, otherwise OK = 0H.

49H PPNAM_ERR File name incorrect F_NAME22H KZG_ZZ File cannot currently be renamed F_ZYKSCHUTZ,

FEXEC12H PP_NV File does not exist F_KEINPP25H SP_GVOLL Memory full F_SP_VOLL48H INTER_ERR Internal error F_UNIT,

F_NOCHAN,F_VERS

44H PROT_ERR Error in parameter assignment45H IC_UNDEF I code length too short -4FH FUNCT_NOT_ACCEPT Function cannot be handled due to wrong access

authorization.

Page 314: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-64 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.2 PLC function macros FX73/FX74

A2.2.1 Function macro FX73, OEM-SEND

The block OEM-SEND sends data from the PLC to a logical receiver on the MMC side.

The data are stored by the user in the data transfer area, a data block of type DB or DX from anyselected data word. The block must be called once for every packet to be sent. While the function blockis running, the complete packet is transferred to the receiver. The actual information transport ishandled by the PLC-Besy.

On an error ID the function block is aborted and passes an error message to the user.

OB1

Acknowl.

PLC user

Transfer areauser DB

Fig. A2.2.1 Block diagram FX73, OEM-SEND

The OEM-SEND block can be called both in STEP5 and in high-level language blocks. It can only becalled in OB1 or in a PB, FB FX called within OB1. This means that the block must be called cyclically.

If the OEM-SEND block is called via a STEP5 block, the parameters can be assigned via callparameter or via the flag area. If the OEM-SEND block is called by a high-level language blocks, itsparameter can be assigned only by call parameters.

After the call, the block checks the call parameters, assembles a system-compatible packet from thedata packet, passes it to the receiver specified in the packet header and passes an acknowledgment tothe user in the specified flag bytes.

Page 315: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-65SINUMERIK 840C OEM Version for Windows (BN)

A2.2.1.1 Additional information

Lib.-No. FX 73FBs to be loaded NoneDBs to be loaded NoneType of FX call Conditional or unconditionalDBs to be entered None

Error messages:

- %1: Parameter QTTG illegalAKKU1 (FX No.): FX 73AKKU2: 1 = illegal acknowledgment flag byte

- All other errors are signaled in the parameterized acknowledgment flag byte

After the call, the block checks the call parameters, assembles a system-compatible ADS packetfrom the data packet, passes it to the receiver specified in the packet header and passes anacknowledgment to the user in the specified flag bytes.

A2.2.1.2 Block call (FX73: OEM-SEND)

D, KS DBTYD, KF DBNRD, KF DWNRD, KF QTTG

FW240 DBTYFW242 DBNRFW244 DWNRFW246 QTTG %1

Page 316: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-66 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.2.1.3 Signal description

DBTY Block type in the transfer range: 2 ASCII characters: DB or DX

DBNR Block number that contains the data to be sentDBNR = 1 to 255DBNR = 0: The parameters are assigned from the flag area

DWNR Number of the word at which the packet to be sent beginsDWNR = 0 to 2032The specifiable DW number is based on the length of the DB/DX and the number of data words to be transferred

QTTG The number of the flag word in which the function block stores the acknowledgmentQTTG: 25..253

See A2.2.4 Acknowledgements for a description of the error numbers.

A2.2.1.4 FX73 behavior on restart

When the PLC is restarted, the user program is normally continued at the point of interruption.The MMC cannot perform a warm restart, only a cold restart. During this cold restart, the MMCre-initializes the mailboxes. As a result, all the information that the MMC has not yet read fromthe mailbox is lost.

If the interruption occurred while the FX73 was accessing the mailboxes, the FX73 must on noaccount be restarted. A restart of the FX73 does not synchronize PLC and MMC mailboxaccesses.

If the FX73 is interrupted by an event that causes a restart of the PLC, FX73 starts at thebeginning of the block again (local restart). This can cause the data packet last sent to be sent asecond time. Whether these data need to be processed is determined by the user application onthe MMC.

Page 317: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-67SINUMERIK 840C OEM Version for Windows (BN)

A2.2.2 Function macro FX74, OEM-EMPF

When called, the OEM-EMPF block reads an existing ADS packet from the logical component specifiedin the call (see Subsection A2.2.3 "OEM information bit"), stores it under the specified address(DB/DX:DW) and passes the user an acknowledgment in the specified flag word.

The OEM-EMPF block processes one complete packet per call. On an error ID, the function macro isaborted and an error message is passed to the user.

Calling the block while the mailboxes are empty does not cause any malfunction but does havea negative effect on the runtime.

The function block OEM-EMPF should be called only if the user has been notified via the OEMinformation bit that one or more packages for the OEM component have arrived.

OEM info bits Acknowl.Transfer areauser DB

PLC user

Fig. A2.2.2 Block diagram FX74, OEM-EMPF

The OEM-EMPF block can be called both in STEP5 and HLL blocks. It can only be called in OB1.

If the OEM-EMPF block is called via a STEP5 block, the parameters can be assigned via callparameters or via the flag area. If the OEM-EMPF block is called via HLL blocks, its parameters can beassigned only by call parameters.

Page 318: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-68 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.2.2.1 Additional information

Lib.-No. FX 74FBs to be loaded noneDBs to be loaded noneType of FX call conditional or unconditionalDBs to be entered none

Error messages:

- %1: With illegal parameter QTTG:AKKU1 (FX No.): FX 74AKKU2: 1 = illegal acknowledgment flag byte

- All other errors are signaled in the parameterized acknowledgment flag byte

A2.2.2.2 Block call (FX 74: OEM-EMPF)

%1

D, KS

D, KF

D, KF

D, KF

D, KF

DBTY

DBNR

DWNR

OEMN

QTTG

MW240

MW242

MW244

MW246

DBTY

DBNR

DWNR

QTTG

Page 319: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-69SINUMERIK 840C OEM Version for Windows (BN)

A2.2.2.3 Signal description

DBTY Block type: 2 ASCII characters: 'DB' or 'DX'

DBNR Block number that contains the data to be sentRange = 1 to 255DBNR = 0: The parameters are assigned from the flag area

DWNR Number of the word at which the packet received beginsRange = 0 to 2032The specifiable DW number is based on the length of the DB/DX and the number of data words to be transferred

OEMN Number of the OEM component for which data are read from the MBX(equivalent to the number of the OEM information bit OEMN)

QTTG The number of the flag word in which the function block stores the acknowledgment.Range: 25 - 253

With variable assignment via the flag area, the parameters must be specified in the same format as for direct parameter assignment.

A2.2.2.4 FX74 behavior on restart

When the PLC is restarted, the user program is normally continued at the point of interruption.The MMC cannot perform a warm restart, only a cold restart. During this cold restart, the MMCre-initializes the mailboxes. As a result, all the information that the PLC user has not yet readfrom the mailbox is lost.

If the interruption occurred while the FX74 was accessing the mailboxes, the FX74 must on noaccount be restarted. A restart of the FX74 does not synchronize PLC and MMC mailboxaccesses.

If the FX74 is interrupted by an event that causes a restart of the PLC, FX74 starts at thebeginning of the block again (local restart).

Depending on the interruption point and on the time of the interruption it is possible that receivedata might be transferred to the destination data block partially or completely. The data must beconsidered invalid by the user.

Because of the local cold restart, FX74 accesses an empty mailbox and outputs the errormessage "Receive mailbox empty". This message must be considered invalid during the warmrestart.

Page 320: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-70 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A2.2.3 OEM information bit

With the OEM-EMPF function macro, the user reads the packets from the mailboxes that are sent tothe PLC by other components. Because the OEM-EMPF function block call should only be used whenpackets have really arrived, the PLC operating system informs the user that packets have arrived in aflag word.

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

FWx res. FYx2 FYx1

Bit = '0': Mailbox (FYx) is emptyIs set by the PLC-Besy when the last packet has been read from the mailbox bythe user.

Bit = '1': At least one packet in the mailboxIs set by the PLC-Besy when the first packet has arrived in the mailbox.

The number of the flag word is defined with PLC machine data MD137. It is possible to specify flagwords FY25 to FY198.

A2.2.4 Acknowledgements

Macros FX73 and FX74 store acknowledgements in three bytes. The number of the first FXacknowledgement byte is specified in parameter QTTG when FX is called.

MBx Errorbit

0: No error1: Error

MBx+1 =0: No coupling error>0: Coupling error

MBx+2 =0: No user error>0: User error

Memory bit MBx.0: Error bitThe error bit must be evaluated by the user PLC program before FX73 is next called, because it isoverwritten on the next macro call. When MBx.0=0 (no error), the entries in MBx+1 and MBx+2 areinvalid.

Flag byte MBx+1: Coupling error, format KHCoupling errors are errors detected by FX73 when addressing the mailbox.

Flag byte MBx+2: User error, format KHUser errors are errors made in the FX73 call, e.g. parameterization errors or errors in the data transferarea.

Page 321: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-71SINUMERIK 840C OEM Version for Windows (BN)

A2.2.4.1 Error lists for FX73/FX74

FX parameter errors:

Error No.(Hex)

Error designation Block Cause/Response User response

01 DBTY: Wrong block type(only "DB" or "DX")

FX73FX74

Request is not executed Call FX with correctparameters

02 DBNR: Impermissible DB-Number (only 1 to 255)

FX73FX74

Request is not executed Call FX with correctparameters

03 DWNR: DW number toolarge (max. 2032)

FX73FX74

Request is not executed Call FX with correctparameters

04 MBXN: Illegal OEM No.(only 0/ 1)

FX74 Request is not executed Call FX with correctparameters

05 Source DB/DX notavailable

FX73 Request is not executed Call FX with correctparameters

Destination DB/DX notavailable

FX74 Request is not executed Call FX with correctparameters

06 Specified DW not in theDB/DX

FX73FX74

Request is not executed Call FX with correctparameters

07 OEM number not assigned FX73FX74

Request is not executed Call FX with correctparameters

Errors in the data header:

Error No.(Hex)

Error Block Response User response

10 DB too short for specifieddata length

FX73 Request is not executed Check the information in thedata header of theparameter assignment DB

DB too short for receiveddata

FX74 Request is not executed - Check the information inthe data header of theparameter assignment DB

- Check sender program

11 Data length > MBX-elementlength

FX73 Request is not executed Check the information in thedata header of theparameter assignment DB

12 Logical sender does notexist

FX73 Request is not executed Check the information in thedata header of theparameter assignment DB

13 Logical receiver does notexist

FX73 Request is not executed Check the information in thedata header of theparameter assignment DB

14 Logical sender is the PLCitself

FX73 Request is not executed Check the information in thedata header of theparameter assignment DB

Page 322: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-72 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Errors in the mailbox header when receiving:

Error No.(Hex)

Error Block Response User response

20 Logical receiver not knownin the PLC

FX74 Error in MMC applicationor system errorData are not read

Check MMC application, ifOK: Service

21 Logical receiver known inthe PLC but not a PLCcomponent

FX74 Error in MMC applicationor system errorData are not read

Check MMC application, ifOK: Service

22 Packet length = oddnumber (not word grid!)

FX74 Error in MMC applicationor system errorData are not read

Check MMC application, ifOK: Service

23 Packet length > MBXelement length

FX74 Fatal error:Data are not read

Service

24 Packet length < ADSheader length

FX74 Fatal error:Data are not read

Service

General errors:

Error No.(Hex)

Error Block Response User response

30 FX call not in cyclic level(OB1)

FX73FX74

Request is not executed Call FX73 / FX74 from OB1or PB, FB or FX calledsubsequently

General errors:

Error No.(Hex)

Error Block Response User response

1x Object ID not valid FX73FX74

Fatal error: (block error)/Request is not executed

Service

2x MBX is re-initialized FX73FX74

Fatal error: Request is notexecuted

Service

3x TIMEOUT: no accesspossible to MBX

FX73FX74

Fatal error: Request is notexecuted

Service

4x Destination MBX full FX73FX74

Request is not executed Repeat request

5x Receive MBX empty FX73FX74

Request is not executed Only call FX74 if the OEMinformation bit is set

Page 323: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A2-73SINUMERIK 840C OEM Version for Windows (BN)

x-detailed error code for communication errors:

0 FX73: on assigning an MBX element for sending

1 FX73: on sending

2 FX74: on reading an MBX element

3 FX74: on enabling a read MBX element without previous ANW error

4 FX74: on enabling a read MBX elements after ANW error

With errors:

11, 13, 14, 21, 23, 24, 31, 33, 34

an assigned mailbox element can no longer be enabled by the PLC. The consequence is a reduced mailbox capacity.

Access to this assigned mailbox element is only possible again after a RESET (cold restart or warmrestart).

A2.2.5 Transmission times

When sendingThe send block OEM-SEND transfers the send data to the receiver's mailbox immediately. As a result,the program runtime is the only appreciable delay in the PLC.

When receivingIn the worst case scenario, a packet arrives in the PLC when the user has just tested the OEMinformation bit with result '‚'‘. The next test cannot be performed until the following PLC cycle, resultingin a maximum reaction time of one PLC cycle in the PLC.

Page 324: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A2 Reference Guide09.01

A2-74 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Page 325: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A3-1SINUMERIK 840C OEM Version for Windows (BN)

A3 Function Identifiers for Data Management

The function identifiers are subdivided into the following function groups: delete, edit and copy/duplicate. The function identifiers listed reflect the complete function scope of the file handling.

Explanations of the tables:

Column Explanation

Identifier: Entry for SIN840C.INI (see Section 3.5)

Explanation: Specifies the interlocking or release that isaffected by this entry.

Fkz = File short code

Comment: Explanations function restrictions that can occur ifthe combo box or list box has been selected forexample.

Default bit mask: P1 to P6 = Password level 1 to 6

S0 to S3 = Keyswitch position 0 to 3

Z = Cycle disable

x = If the conditions is fulfilled the correspondingfunction is enabled

! = This condition must always be fulfilled. Noinfluence possible by reconfiguring.

Page 326: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

A3-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A3.1 Function group: delete

Function identifiers which are possible but not listed refer to prohibited (e.g. DelCycleStd = delete fromstandard cycles is generally prohibited) or generally permitted (e.g. DelNc) operator actions.

Bit mask of the default values(see also Section 3.4.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

1. DelPart Delete a completeworkpiece or a file ofa workpiece.

Flexos - workpieces anduser-defined workpiecescannot be deleted.

x x

2. DelCycleUser Delete a cycle in thedirectory UserCycles.

The directory cannot bedeleted. (Release only forlist box)

x !

3. DelMdUser Delete a machinedata file in thedirectory MD User.

see: 2. x x

4. DelTemp Delete a file in thedirectory Clipboard.

see: 2. x

5. DelDisc Delete a file on theDiskette drive.

The diskette drive cannotbe deleted completely.(release only for list box)

x

6. Delika Delete a IKA file. Single files can only bedeleted inside a listbox.

x

7. Delgia Delete a GIA file. see: 6. x

8. Deltea Delete a TEA file. see: 6. x

9. Del[Fkz] Delete the file(s)specified by fileshort code.

Standard interlocks onlyexist for 6., 7. and 8.

Page 327: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A3-3SINUMERIK 840C OEM Version for Windows (BN)

A3.2 Function group: edit

Function identifiers which are possible but not listed refer to prohibited (e.g. EditDevice) or to generallypermitted (e.g. EditPart) operator actions. If editing is generally permitted, this does not mean thatread/write rights to not apply. In a workpiece all files can at least be viewed with the editor as ReadOnlyfiles. Restrictions are only possible via Edit[File short code].

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

1. EditCycleStd Edit in the directoryCycles Standard.

Because only single filescan be edited, only for listbox.

x !

2. EditCycleUser Edit in the directoryCycles User.

s.1. x !

3. EditMdUser Edit in the directoryMD User.

s.1. x

4. EditTemp Edit in the Clipboard. s.1. x x

5. EditMdStd Edit in the directoryMD Standard T andMD Standard M

s.1 x

6. Edit[Fkz] Edit the files indexedby file short code

No standard interlocks.

Page 328: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

A3-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A3.3 Function group: copy/duplicate

Function identifiers which are possible but not listed refer to prohibited (e.g. CycleUserToCycleStd)operator actions. The function duplicate only refers to the duplication of single files within a workpiece.Therefore they are only released when single files of workpiece are selected. The general identifier ofthe function duplicate is therefore PartToPart. The directory entry Untitled can never be copied/duplicated. Copying is only permissible if the target and source directory are not identical. If a completedirectory is copied, the file-specific interlocks Points 27. to 42. are not considered.

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

Copying a workpiece or a file of workpiece

1. PartToNc To the NC Programmem.

Only NC relevantfiles. If theworkpiece containsfiles for the NCSystem Data, theyare copied withoutevaluation of 2.

x x x x

2. PartToNcData To the NC SystemData.

Only NC relevantfiles. If theworkpiece containspart programs,they are copiedwithout evaluationof 1.

x x x

3. PartToPart To anotherworkpiece

Identifier alsoapplies to dupli-cate.

x x x

4. PartToDevice To a device definedwith "Parameteri-zation RS232".

Flexos directoriesand files cannot beoutput on RS232.

x x x

5. PartToDisc To the Diskettedrive.

x x x

6. PartToCycleUser To the directoryCycles User.

Only spf files canbe copied.

x x !

Page 329: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A3-5SINUMERIK 840C OEM Version for Windows (BN)

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

Copying of NC Program mem. or single files

7. NcToPart To a workpiece. x x x

8. NcToCycleUser To Cycles User. s. 6 x x !

Copying the NC System Data or single files

9. NcDataToPart To a workpiece. x x x

10. NcDataToMdUser To the directory MDUser.

Only MD files canbe copied.

x

Copying the directories MD Standard M or MD Standard T orsingle files of this directories

11. MdStdToMdUser To MD User. x

12. MdStdToNcData To the NC systemdata.

x

Copying the directory MD User or single files

13. MdUserToPart To a workpiece. x

14. MdUserToNcData To the NC systemdata.

x

15. MdUserToDevice To a device definedwith "Parameteri-zation RS232".

x

16. MdUserToDisc To the diskette drive. x

Page 330: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

A3-6 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

Copying the directory Cycles User or a cycle

17. CycleUserToNc To the NC ProgramMemory

x x x x !

18. CycleUserToPart To a workpiece x x x !

19. CycleUserToDevice To a device definedwith "Parameteri-zation RS232".

x x x !

Copying the directory Cycles Standard or a cycle

20. CycleStdToNc To the NC ProgramMemory

x x x !

21. CycleStdToCycleUser To the directoryCycles User

x x x !

Copying the Clipboard

22. TempToMdUser To the directory MDUser

x

Copying from the diskette drive

23. DiscToPart To a workpiece. x x

24. DiscToMdUser To the directory MDUser.

s. 10. x

Copying from a device defined with "Parameterization RS232"

25. DeviceToPart To a workpiece. x x

26. DeviceToMdUser To the directory MDUser.

s. 10. x

Page 331: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A3-7SINUMERIK 840C OEM Version for Windows (BN)

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

Copying an IKA file

27. ikaToNcData To the NC systemdata.

x

28. ikaToPart To a workpiece x

Copying a GIA file

29. giaToNcData To the NC systemdata.

x

30. giaToPart To a workpiece x

Copying a TEA file

31. teaToNcData To the NC systemdata.

x

32. teaToPart To a workpiece x

Copying a file indexed with a file short code

33. [Fkz]ToPart To a workpiece

34. [Fkz]ToDevice To a device definedwith "Parameteri-zation RS232".

Flexos files cannotbe output onRS232.

35. [Fkz]ToDisc To the diskette drive. s. 38

37. [Fkz]ToCycleUser To the directoryCycles User.

Only spf files canbe copied.

38. [Fkz]ToNcData To the NC systemdata.

Only NC relevantfiles can be copied.

39. [Fkz]ToNc To the NC ProgramMemory

s. 38.

40. [Fkz]ToMdUser To the directory MDUser.

Only MD files canbe copied.

Page 332: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A3 Function Identifiers for Data Management09.01

A3-8 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

A3.4 Function group: create

Only workpiece directories can be created.

Bit mask of the default values(see also Section 3.3.6.4)

P S Z

Identifier Explanation Comment 6 5 4 3 2 1 3 2 1 0

1. NewPart Create a newworkpiece

Only workpieces x x

Page 333: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A4 Abbreviations09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A4-1SINUMERIK 840C OEM Version for Windows (BN)

A4 Abbreviations

Abbreviation Meaning

A ASCII text (access for 840C OEM Version for Windows)

ADS General data interface

ASCII American Standard Code of Information Interchange

BCD Binary coded decimal

BIOS Basic input output system

CLIENT Program that sends a request

COM Communication

CPU Central processing unit

CR Carriage return

CRT Cathode ray tube

CSB Central service board

CTS Clear to send

DAC Digital-analog converter

DB/DX Data block/extended data block

DBB Data block description

DCE Data communication equipment

DDE Dynamic data exchange (Windows mechanism for data exchange)

DIR Directory

DLL Dynamic link library

DOS Disk operating system

DPR Dual-port RAM

DRAM Dynamic RAM, dynamic read/write memory

DSR Data set ready

DTE Data terminal equipment

DW Data word

EPROM Erasable programmable read only memory

ETC ETC key, extends the text bar

FB/FX Function block/extended function block

Page 334: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A4 Abbreviations09.01

A4-2 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

FDD Floppy disk drive

FIFO First in/first out

FTR File transfer

GI Gearbox interpolation

HD Hard disk

HEX Hexadecimal code

ICD task ICODE DATA driver

IKA Interpolation and compensation with tables

INI Initialization data

ISA Industrial standard architecture (Standard 16-bit bus system for PCs)

ISO International Standard Organization

ISO code Special tape format

KYRU Key request unit

LCD Liquid crystal display

LED Light-emitting diode

LF Marks end of block of data in ISO code (line feed)

MCP Machine control panel

MD Machine data

MF2 Multi-functional keyboard

MMC Man machine communication (PC area in SIN 840C)

MPF NC part program (main program file)

MPR Multiport RAM

MS- Microsoft (software manufacturer)

NC Numerical control

NCK Numerical control kernel

OEM Original equipment manufacturer

PC Personal computer

PCIN Siemens data transmission program

PCMCIA Personal Computer Memory Card International Association

PG Programming device

PLC Programmable logic controller

RAM Random access memory (read-write memory)

RPA R parameter

RTS Request to send

Page 335: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A4 Abbreviations09.01

© Siemens AG 2001. All Rights Reserved 6FC5198-6AA70 A4-3SINUMERIK 840C OEM Version for Windows (BN)

SBC Single board computer

SEA Setting data

SERVER Program that processes the requests of a client

SK Softkey

SPF Subroutine (subprogram file)

SW Software

TEA Testing data active (machine data)

TOA Tool offset active (tool offsets)

UMS User memory submodule

V.24 (RS 232 C) Serial interface (defines the communication line between DTE and DCE)

ZOA Zero offset active (zero offsets)

Page 336: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

A4 Abbreviations09.01

A4-4 © Siemens AG 2001. All Rights Reserved 6FC5198-6AA70SINUMERIK 840C OEM Version for Windows (BN)

Page 337: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

Suggestions and/or corrections

ToSIEMENS AG

Suggestions

Corrections

A&D MC BMSP.O. Box 3180

For Publication/Manual:

SINUMERIK 840CSoftware Version 6OEM Version for Windows

D-91050 Erlangen, Germany(Tel. ++49 - 180 / 5050 - 222 [Hotline] Fax ++49 - 9131 / 98 - 2176 email: [email protected])

Manufacturer Documentation

From

Name______________________________________________________________________________________________________

User's Guide

Order No.: 6FC5198-6AA70-0BP2Edition: 09.01

Company/Dept.

Address_______________________________________________________________________________________________________

_______________________________________________________________________________________________________

Telephone: /_______________________________________________________________________________________________________

Telefax: /

Should you come across any printing errors when reading thispublication, please notify us on this sheet. Suggestions forimprovement are also welcome.

Page 338: SINUMERIK 840C Software Version 6 - Siemens AG · SINUMERIK 840C Software Version 6 ... •Planning Guides - Package 0: Basic Functions ... 3.4.1 Application structure and operation

User Documentation

SINUMERIK

840C

SINUMERIK

Overview of SINUMERIK 840C Documentation / OEM Version for Windows

Brochure Catalog NC 36

Accessories

Catalog NC Z

SINUMERIK

SINUMERIKSINUMERIK

840C

SINUMERIK

General Documentation

Manufacturer Documentation

SINUMERIK

ACR 20/805SM/840C

User/Manufacturer/Service Documentation

Link to SINEC L2–DP with Module– IM328–N, Slave– IM329–N, Master and Slave

Operator’s Guide– OEM Version Windows– Standard

Cycles,ProgrammingGuide

SINUMERIK SINUMERIK

Measuring CyclesVersion 20User’s Guide

User’s GuideSimulation Millingand Turning

SINUMERIK

840C

User Documentation

User’s Guide Graphic Programming System– Drilling/Boring and Milling Parts 1 + 2– Turning Parts 1 + 2– On DOS PC– Environment Description 840C

840C 840/840C/880/880 GA2

840/840C/850/880/880 GA2

840C 840C

Service Documentation

Manufacturer Documentation

SINUMERIKSINUMERIK

840C

SINUMERIK

Interface:– Signals – Connection Conditions

SINUMERIKWS 800A– CL 800 Cycle Language– User’s Guide

SINUMERIK

Function Block PackagesFunction Macros

SINUMERIK

Planning GuideGraphicProgramming System

User’s GuideOEM Versionfor Windows

SINUMERIK

PLC 135 WB/WB2d/WDQuick Reference,PlanningS5–HLL

840/840C/880/880 GA2

840C 840C840C840/840C/880/880 GA2

SINUMERIK

Computer Link– SINT – SIN PS 231– SIN PS 315

SINUMERIK

840C

Spare PartsList

SINUMERIK

Measuring CyclesVersion 20Start-up Guide

Installation Guide– Instructions– Lists– Difference Description Windows

SINUMERIK

Computer Link– Message Frame Description– General Description

840/840C/880/880 GA2

840/840C/880/880 GA2

840/840C/850/880/880 GA2

SINUMERIK

Diagnostics Guide

840C

840/880

SINUMERIK

Alarm Dialogfor PCOEM Versionfor Windows

SINUMERIKSIMODRIVE

SafetyIntegrated

840C

Description ofFunctionsSINUMERIKSafety Integra-ted

SINUMERIKSIMODRIVE

840C611D

SINUMERIK

840C611D

SIMODRIVE

DOC ON CD

Electronic Documentation

ProgrammingGuide