840c 880 ga2 high-level language programming...sinumerik 840/840c sinumerik 880/880 ga2 plc 135 wb,...

271
Planning Guide 11.92 Edition Manufacturer Documentation SINUMERIK 840/840C SINUMERIK 880/880 GA2 PLC 135 WB, S5-HLL, High-Level Language Programming

Upload: others

Post on 26-Apr-2020

58 views

Category:

Documents


5 download

TRANSCRIPT

Planning Guide 11.92 Edition

Manufacturer Documentation

SINUMERIK 840/840CSINUMERIK 880/880 GA2PLC 135 WB, S5-HLL,High-Level Language Programming

SINUMERIK 840/840CSINUMERIK 880/880 GA2PLC 135 WB, S5-HLL,High-Level Language Programming

Planning Guide

Manufacturer Documentation

11.92 Edition

Valid for:

Control Software Version

SINUMERIK 840T/M 01 or higherSINUMERIK 840C 01SINUMERIK 880T/M 04 or higherSINUMERIK 880 GA2 01

SINUMERIK® documentation

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 ”Remarks” column:

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

If factual changes have been made on the page since the last edition, this isindicated by a new edition coding in the header on that page.

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.

This publication was produced on the Siemens 5800 OfficeSystem.Subject to change without prior notice.

The reproduction, transmission or use of this document or itscontents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rightscreated by patent grant or registration of a utility model ordesign, are reserved.

© Siemens AG 1990, 1991, 1992, All Rights Reserved

Edition Order No. Remarks

02.90 6ZB5 410-0CQ02-0BA0 A

11.91 6ZB5 410-0CQ02-0AA1 C

11.92 6FC5 197-0AC00-0BP0 C

SINUMERIK 840/880CSINUMERIK 880/880 GA2

Part 1: S5-HLL Block Generator

Planning Guide

Manufacturer Documentation

Requirements for the Operation of the Block Generator

Introduction 1

2

Installation 3

Operation 4

Interfaces of the HLL Block 5

Format of the Module Header 6

Programming with PL/M 7

Programming with C 8

Programming Examples 9

Information for the Use of the Block Generator 10

Error Messages and Warnings 11

Contents

Page

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1

1.1 PLC Programming with High-Level Languages . . . . . . . . . . . . . . . . . . 1–11.2 PL/M and C Function Blocks for the PLC 135 WB . . . . . . . . . . . . . . . . 1–11.3 Testing the HLL Function Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–21.4 Definition of Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–21.5 Modifications since the Preceding Version . . . . . . . . . . . . . . . . . . . . . 1–3

2 Requirements for the Operation of the Block Generator . . . . . . . . . 2–1

2.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–12.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1

3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1

3.1 Required Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13.2 Installation Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13.3 Integration of the Program Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–33.4 Installation Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–43.5 Files and Directories . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–6

4 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–1

4.1 General Operating Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14.1.1 Menu Tree . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14.1.2 Default Settings in Menus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–24.1.3 Use of Upper and Lower Case Letters for Input . . . . . . . . . . . . . . . . . . 4–24.2 Block Generation Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–24.3 Calling the Block Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–44.4 Parameters for HLL Block (Menu 1) . . . . . . . . . . . . . . . . . . . . . . . . . . 4–44.4.1 Define Key Data of HLL Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–54.4.2 Function Keys and Special Keys in Menu 1 . . . . . . . . . . . . . . . . . . . . . 4–74.5 Define Directories (Menu 1.1) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–84.5.1 Paths . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–94.5.2 Function Keys and Special Keys in Menu 1.1 . . . . . . . . . . . . . . . . . . . 4–94.6 Select Processing Steps (Menu 2) . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–104.6.1 Description of the Processing Steps . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.1 Define Block Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.2 Change Block Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.3 Create Block Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.4 Generate Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.5 Prepare Block for Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–114.6.1.6 Check Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–124.6.2 Function Keys in Menu 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–13

4.7 Define/Change Call Parameters (Menu 5) . . . . . . . . . . . . . . . . . . . . . . 4–144.7.1 Block without Call Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–144.7.2 Block with Call Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–154.7.2.1 Add Call Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–154.7.2.2 Change Call Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–164.7.3 Exit Menu 5 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–174.7.4 Function Keys and Special Keys in Menu 5 . . . . . . . . . . . . . . . . . . . . . 4–174.8 Define/Change System Interface (Menu 6) . . . . . . . . . . . . . . . . . . . . . 4–194.8.1 Function Keys and Special Keys in Menu 6 . . . . . . . . . . . . . . . . . . . . . 4–204.9 Edit HLL Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–214.10 Compile and Link HLL Block (Menu 3) . . . . . . . . . . . . . . . . . . . . . . . . 4–214.10.1 Function Keys and Special Keys for Menu 3 . . . . . . . . . . . . . . . . . . . . 4–224.11 Generate S5-DOS Block File (Menu 4) . . . . . . . . . . . . . . . . . . . . . . . . 4–234.11.1 Define S5-DOS Block File Name and Block List . . . . . . . . . . . . . . . . . . 4–234.11.2 Function Keys and Special Keys in Menu 4 . . . . . . . . . . . . . . . . . . . . . 4–24

5 Interfaces of the HLL Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1

5.1 Type and Scope of the Block Interfaces . . . . . . . . . . . . . . . . . . . . . . . 5–15.2 STEP 5-Specific Data Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–15.3 Call Parameters of HLL Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–35.3.1 Types of Call Parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–35.3.2 Data Format Conversion for Call Parameters . . . . . . . . . . . . . . . . . . . . 5–45.4 PLC System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–45.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–55.4.2 HLL_ADB(), Open Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–55.4.3 HLL_S5(), Call STEP 5 Program Blocks . . . . . . . . . . . . . . . . . . . . . . 5–65.4.4 HLL_MACRO(), Call Function Macro . . . . . . . . . . . . . . . . . . . . . . . . . 5–65.4.4.1 Available Function Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–75.4.4.2 Passing Parameters to Function Macros . . . . . . . . . . . . . . . . . . . . . . . 5–85.4.5 HLL_HLL(), HLL Block Calls HLL Block . . . . . . . . . . . . . . . . . . . . . . . 5–85.4.6 HLL_LIM(), HLL_SIM(), Disable and Enable OBs . . . . . . . . . . . . . . . . 5–95.4.7 HLL_STOP(), Initiate System Stop . . . . . . . . . . . . . . . . . . . . . . . . . . 5–115.5 PLC System Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–115.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–115.5.2 I/Q/F/C/T Areas . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–125.5.2.1 Process Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–135.5.2.2 Flag Area and Extended Flag Area . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–135.5.2.3 Timers and Counters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–145.5.3 Interpreter Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–155.5.3.1 Status Bits on PLC Systems with COP/ACOP . . . . . . . . . . . . . . . . . . . 5–165.5.3.2 Active OB No. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–175.5.4 Processing of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–175.5.4.1 Global Declaration of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–185.5.4.2 Opening Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–185.5.4.3 Length of the Active Data Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–185.5.4.4 Processing of Data Blocks with Pointers . . . . . . . . . . . . . . . . . . . . . . . 5–195.5.5 Memory Management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–195.5.6 Block and I/O Address Lists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–215.5.6.1 Block Address Lists on PLC Systems with COP/ACOP . . . . . . . . . . . . . 5–215.5.6.2 I/O Address Lists on PLC Systems with COP/ACOP . . . . . . . . . . . . . . 5–22

6 Format of the Module Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1

6.1 Task of the Module Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–16.2 Call Parameter Definitions in the Module Header . . . . . . . . . . . . . . . . . 6–16.3 Evaluation of the Module Header by the Block Generator . . . . . . . . . . . 6–46.3.1 Operating Situations in which the Module Header is Evaluated . . . . . . . 6–46.3.2 Criteria for Cancellation of Evaluation of the Module Header . . . . . . . . . 6–4

7 Programming with PL/M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–1

7.1 Language-Specific Features of PL/M . . . . . . . . . . . . . . . . . . . . . . . . . 7–17.2 Format of the PL/M Module Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–17.2.1 Module Body of a PL/M Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–37.2.1.1 Module Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–37.2.1.2 Compiler Statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–47.2.1.3 Module Block and Literally Declarations . . . . . . . . . . . . . . . . . . . . . . . 7–47.2.1.4 External Declarations of System Data and Functions . . . . . . . . . . . . . . 7–47.2.1.5 Procedure Declaration of Main Program, Call Parameters . . . . . . . . . . . 7–67.2.1.6 Local Data and Statement Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–77.3 Parameter Check for HLL Calls in PL/M . . . . . . . . . . . . . . . . . . . . . . . 7–77.3.1 Parameter Data Types Recognized in the Parameter Check . . . . . . . . . 7–77.3.2 Cross-Reference List . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–87.4 Brief Examples for PL/M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–87.5 Rules for Upper and Lower Case Notation . . . . . . . . . . . . . . . . . . . . . 7–107.6 Reserved Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–10

8 Programming with C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1

8.1 Language-Specific Features of C . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–18.2 Format of the C Module Body . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–18.2.1 Module Body of a C Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–28.2.1.1 Module Header . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–38.2.1.2 Definition of Types of Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–38.2.1.3 External Declarations of System Data and Functions . . . . . . . . . . . . . . 8–38.2.1.4 Procedure Declaration of Main Program, Call Parameters . . . . . . . . . . . 8–58.2.1.5 Local Data and Statement Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–68.3 Brief Examples for C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–68.4 Processing of Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–98.5 Use of C Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–118.6 Rules for Upper and Lower Case Notation . . . . . . . . . . . . . . . . . . . . . 8–128.7 Reserved Identifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–13

9 Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–1

9.1 Examples in PL/M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–19.1.1 FB 1, Access to Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–19.1.2 FB 2, Access to Process Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–69.1.3 FB 4, Processing of Counters and Timers . . . . . . . . . . . . . . . . . . . . . . 9–99.1.4 FB 6, Search in Data Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–129.1.5 FB 8, Call Other HLL Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–159.1.6 FB 10, FB 15, Use of Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–189.1.7 FB 20, I/O Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–22

9.2 Examples in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–269.2.1 FX 1, Access to Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–269.2.2 FX 2, Access to Process Image . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–309.2.3 FX 4, Processing of Counters and Timers . . . . . . . . . . . . . . . . . . . . . . 9–339.2.4 FX 6, Search in Data Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–369.2.5 FX 8, Call Other HLL Procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–409.2.6 FX 10, FX 15, Use of Semaphores . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–439.2.7 FX 20, I/O Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9–47

10 Information for the Use of the Block Generator . . . . . . . . . . . . . . . 10–1

10.1 Information for the Use of HLL Programson the Programmable Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–1

10.2 Restrictions for the Use of the Block Generator . . . . . . . . . . . . . . . . . . 10–210.3 Restrictions for Programming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–210.3.1 General Restrictions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–210.3.2 Further Restrictions for C Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10–3

11 Error Messages and Warnings . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–1

11.1 Error Messages from the HLL Block . . . . . . . . . . . . . . . . . . . . . . . . . . 11–111.2 Error Messages of Block Generator . . . . . . . . . . . . . . . . . . . . . . . . . . 11–211.3 Warnings of Block Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11–2

11.92 1 Introduction

1.1 PLC Programming with High-Level Languages

1 Introduction

1.1 PLC Programming with High-Level Languages

The PLC 135 WB is programmed with the control language STEP 5. This language is tailoredto the needs of a programmable logic controller, i.e. to high-speed bit processing.

The tasks performed by the PLC as an interface between numerical controls (NC) andmachine tools have increased enormously over the years. The PLC has taken on a key role inthe powerful combination of NC and machine.

PLC programs have become so complex that high-level programming languages haveemerged as powerful tools for programming the PLC. Program branches, conditions and theprocessing of large data blocks can be programmed faster and more compactly in high-levellanguages than in STEP 5. Structogram generators are also available for high-level languagesfor the graphical description of program structures and the automatic generation of high-levellanguage source code (e.g. XTOOLS).

When programming the PLC, the high-level language compiler must generate code andruntime-optimized machine programs, because the program memory has to be utilized aseffectively as possible and the programs are components of a real-time system.

The availability of software development tools for many high-level languages even makes itpossible to create and test programs on standard PCs.

1.2 PL/M and C Function Blocks for the PLC 135 WB

The S5-HLL block generator supports the formulation of function blocks for the PLC 135 WBin the high-level languages PL/M and C. Compilers for these languages, which are producedby the intel Corporation especially for the processors used in PLCs, enable PLC programmersto utilize the full potential of the languages STEP 5, PL/M and C, with the aid of the S5-HLLblock generator.

The S5-HLL block generator performs the following main tasks:

• Menu-driven definition of the key data for the block and block interfaces• Automatic generation of the module body for the block• Integrated program editors for the creation of the block program• Generation of the function block from the source code• Generation of S5 block files with multiple function blocks• Management of the high-level language program blocks from interface definition to S5

block file

The following are obtainable for the block generator:

• The HLL data generator, which enables testing of HLL function blocks on the PC incombination with a standard high-level language debugger; the system environment issimulated

• The HLL on-line debugger for testing the programs on the target hardware

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 1–1SINUMERIK 840/880 Part 1 (PJ)

1 Introduction 11.91

1.3 Testing the HLL Function Blocks

1.3 Testing the HLL Function Blocks

The high-level blocks generated with the S5-HLL block generator can be tested both on-lineand off-line.

Off-line test

In combination with a standard high-level language debugger, the HLL data generator enablesthe HLL blocks to be tested on the same PC on which they are programmed. The PLC issimulated with the aid of the data generator. The PLC system data can be displayed andmodified.

On-line test

The HLL on-line debugger enables the HLL blocks to be tested on the PLC. You can use aprogramming device to test the operation of your HLL function blocks directly in the applicationenvironment.

1.4 Definition of Terminology

In order to prevent misunderstandings and to make the documentation as concise as possibleby avoiding unnecessary repetition, terms which occur frequently are defined below. You canalso refer to the section entitled "Terms and Abbreviations" at the end of this documentation(Appendix).

HLL

Abbreviation for high-level language. HLL is used as a synonym for the languages PL/M and/orC, particularly in cases where it is irrelevant whether the language is PL/M or C.

PLC

In this documentation, the term PLC always refers to the PLC 135 WB. A distinction is madebetween the PLC 135 WB version with the COP coprocessor and the version with the ACOPcoprocessor.

PLC system data

The term PLC system data refers to all PLC data which can be accessed by an HLL programblock (e.g. process image, I/Os, etc.).

PL/M

The term PL/M always refers to PL/M-86 of the intel Corporation.

C

C always refers to iC86 of the intel Corporation.

1–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 1 Introduction

1.5 Modifications since the Preceding Version

1.5 Modifications since the Preceding Version

The present version 2.2 of the block generator incorporates the following main modificationscompared with the preceding version:

• The modification of the block interface, i.e. the call parameters and the use of PLC systemdata, can now be performed with the block generator. In this case, the declarations of theold block interface are deleted; please refer to the section on "Block Interfaces" and thesection on "Format of the Module Header".

• Logical drives are no longer supported. The corresponding menu has been omitted.

• The version with ACOP is also supported on the PLC 135 WB. The data to be entered inthe block have been extended with this item.

• The library number and the block name can also be changed with Version 2.1 of the blockgenerator. It was previously only possible to enter this data.

• The system interface to the PLC has been extended.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 1–3SINUMERIK 840/880 Part 1 (PJ)

11.92 2 Requirements for the Operation of the Block Generator

2.1 Hardware Requirements

2 Requirements for the Operation of the BlockGenerator

2.1 Hardware Requirements

A PC 16-20, PG 750 or any other IBM-compatible PC with the following configuration isrequired for the operation of the S5-HLL block generator:

• A hard disk with at least 1 MB free capacity• At least 640 KB main memory• A Hercules graphics card or a color graphics card (CGA, EGA or VGA) or compatible

graphics card

The target hardware for the generated function blocks is the PLC 135 WB. The blockgenerator distinguishes between versions of the PLC 135 WB with COP or with ACOP.

2.2 Software Requirements

The block generator runs under MS-DOS. The following software components are required:

• S5-HLL block generator for SINUMERIK (Siemens, Version 2.2)• ASM86 for DOS (intel, Version 2.1)• PL/M-86 for DOS (intel, Version 2.7)• iC-86 for DOS (intel, Version 4.1)• LINK86 for DOS (intel, Version 2.7)• LOC86 for DOS (intel, Version 2.5)• OH86 for DOS (intel, Version 1.1)• SuperCopy (Comfood Software GmbH)• Program editor (e.g. Aedit, Word, etc.)

Compatible versions can also be used.

If required, a structogram editor such as XTOOLS can be used for the development of HLLblocks for the application software.

The function blocks generated with the block generator are intended for use on the PLC 135WB and require a system environment with the PLC operating system and a STEP 5 standardprogram which calls the HLL function blocks.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 2–1SINUMERIK 840/880 Part 1 (PJ)

11.91 3 Installation

3.1 Required Programs

3 Installation

This chapter describes the installation of the S5-HLL block generator on your MS-DOScomputer.

3.1 Required Programs

The installation program INSTALL.EXE and the files of the block generator are stored on theprogram diskette containing the S5-HLL block generator.

In addition to the files on the block generator program diskette, you will also require thefollowing programs for the installation of the block generator:

• PLM86 (PL/M compiler)• iC86 (C compiler)• ASM86 (Assembler)• LINK86 (Linker)• LOC86 (Locator)• OH86 (Hex converter)• SuperCopy• Program editor (e.g. Aedit, Word, etc.)

The producers of these programs and permissible versions are listed in the section entitled"Requirements for the Operation of the Block Generator".

3.2 Installation Program

On the supplied diskette, you will find the installation program INSTALL.EXE, which is used toinstall the S5-HLL block generator on your hard disk. Insert the diskette in a diskette drive onyour computer and change to this drive. To start the program, enter the following command inthe command line:

INSTALL

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–1SINUMERIK 840/880 Part 1 (PJ)

3 Installation 11.92

3.2 Installation Program

When you press the Return key, the following menu appears on the screen:

Installation Menu

Welcome tothe installation programfor the block generator

• To start, define your individual path environment with function key F1.• Then start the installation with function key F2.• Press function key F8 to exit the installation.

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Copy

a a a a a a

a a a a a a

a a a a a a

a a a a a a

End

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Paths

a a a

a a a

a a a

a a a

a aa aa aa a

a aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Installation Program Block Generator Menu 1 Version 1.1

When you press function key F1, a menu appears in which you can define the directorystructure to be used for the installation.

Definition of the Directories for Installation

Block Generator

System Data : > C:\PLM <

Source Data : > C:\PLM\SOURCE <

Object Files : > C:\PLM\OBJECT <

Program Lists : > C:\PLM\LIST <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Copy

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

End

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Installation Program Block Generator Menu 1 Version 1.1

3–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 3 Installation

3.2 Installation Program

The software suggests default directories for the standard installation of the block generator.The following files are stored or are expected to be found in the following separate directories:

Block generator:

System Data All data relating to the block generator are stored here.Source Data The C or PL/M source files are stored here.Object Files The compiled, linked and located HLL blocks are stored here.Program Lists The program lists and MAP files of the HLL blocks are stored here.

The conventional editing keys are available for changing the default directories: Ins, Del, BS,Home, Ret and the cursor control keys. If you change the name of a directory, you can restorethe old name by pressing the Escape key as long as the cursor is positioned in the field.

When you have defined all the directories, start the installation by pressing F2.

The installation then proceeds as follows:

• The defined directories are created.

• The batch file INST.BAT is started. This file copies the files from the supplied diskette intothe directories which you have defined on the hard disk.

When all the files have been copied, you can exit the installation program by pressing functionkey F8.

Note:

When installing the HLL data generator, the directories which you define for the blockgenerator must be the same as entered here.

3.3 Integration of the Program Editor

A program editor call is integrated in the block generator. You can thus edit HLL programsdirectly by calling the program editor from the block generator. You can choose your ownprogram editor; the AEDIT editor (intel) is the default setting.

The program editor is called by the block generator via the batch file EDIT_HLL.BAT. You canintegrate the desired program editor (or, to be more precise, you can integrate the call) byediting the EDIT_HLL.BAT file. In the most straightforward case (where the editor is storedwithin the search path of the operating system) you will only need to change the name of thedefault editor (AEDIT).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–3SINUMERIK 840/880 Part 1 (PJ)

3 Installation 11.92

3.3 Integration of the Program Editor

Suggestion for EDIT_HLL.BAT:

aedit %3%4%5,%6%7%8

Meaning of parameters %1 ... %8:

%1 Current drive%2 Current path%3 Drive where the source file to be edited is stored%4 Path of the source file to be edited%5 Name and extension of the source file to be edited%6 Drive where the list file to be edited is stored%7 Path of the list file to be edited%8 Name and extension of the list file to be edited

Parameters %1 to %8 for the batch file are passed by the block generator.

Note:

Following processing of the batch file by the operating system, the same current directory anddrive must be set as when the block generator was called. If the current directory is changedin EDIT_HLL.BAT, it must be reset at the end of EDIT_HLL.BAT using parameters %1 and%2.

Example for EDIT_HLL.BAT with directory change:

c:cd \editoreditor %3%4%5%1cd %2

The block generator expects to find the file EDIT_HLL.BAT in the current directory (thedirectory that was set when the block generator was called). This allows any user to use aprogram editor of his choice without having to modify the installation of the block generator.

3.4 Installation Procedure

This section summarizes all the steps for installing the block generator with the aid of theinstallation program.

Installation steps:

• Start the computer

• Insert the program diskette containing the S5-HLL block generator in drive A: of yourcomputer.

• Make drive A: the current drive by entering A: and pressing the Return key.

• If a README file is stored on the program diskette, please read this file and follow theinstructions provided.

• Start the installation program by entering INSTALL and pressing the Return key.

• Enter the desired directory names in the menu of the installation program.

3–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 3 Installation

3.4 Installation Procedure

• Start the file transfer for the block generator by pressing function key F2. When therequired directories have been set up and the files have been copied from the programdiskette, you can exit the installation program by pressing function key F8.

• Press function key F1 to call up the menu for entering the directories. Enter the desireddirectory names.

• Install the programs

PLM86iC86ASM86LINK86LOC86OH86

in the directory which you have defined in the installation menu as the system directory forthe block generator. Please follow the installation instructions provided by themanufacturers of these programs.

• Install the SUPERCOPY program in accordance with the instructions of the manufacturer.

• Define the program editor:

In the file HLL_EDIT.BAT, specify the program editor which you want to use to edit HLLprograms from the block generator (see the section entitled "Integration of the ProgramEditor"). If the program editor is not yet ready for operation, please install it now on yourcomputer.

• Check the FILES command:

The block generator opens up to 10 files simultaneously. Check whether the value in theFILES command in the CONFIG.SYS file on your computer is sufficiently high andincrease the number if necessary.

• Specify the screen type:

If the computer on which you install the block generator has a plasma screen, you mustinclude the following entry in the AUTOEXEC.BAT file of your computer (please rememberto enter the command in upper case letters):

SET SWSCREEN=MONO

When you have done this, restart your computer to invoke the command. In the event ofan operating system error message (such as "Insufficient environment memory"), pleaseconsult your DOS manual.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–5SINUMERIK 840/880 Part 1 (PJ)

3 Installation 11.92

3.5 Files and Directories

3.5 Files and Directories

The block generator distinguishes between the following directories:

• Directory with system programs• " " system data• " " source programs• " " object files• " " lists• S5-DOS directory• Current directory

The paths to these directories are defined during the installation and can be displayed andmodified in Menu 1.1 "Define Directories" of the block generator (see the section entitled"Operation"). The directory with the system programs and the S5-DOS directory are not yetrequired at the time of installation. Please enter these directories in Menu 1.1. The currentdirectory is the directory which is active when you call the block generator.

The following list shows which files of the block generator are stored or are expected to befound in the individual directories.

• Directory with system programs:

The following programs must be stored here:

– PLM86– iC86– ASM86– LINK86– LOC86– OH86

Note:

If no path for the system programs is specified in Menu 1.1 "Define Directories", the DOSsearch path is used when the listed system programs are called.

• Directory with system data:

This directory must contain the files with the texts for the system data and with the locatedsystem data.

– SYSDATxn.DBF– DAT_COMn.LOC

with x=P for the PL/M languagex=C for the C language

and n=1 for the PLC system with COPn=2 for the PLC system with ACOP

• Directory with source programs:

– File with assembler code for the block header (*.ASM)– File with assembler code for the block end (*.ASM)– Source files for the HLL blocks (*.PLM or *.C)

3–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 3 Installation

3.5 Files and Directories

• Directory with the object files:

– File with the object code for the block header (*.OBJ)– File with the object code for the block end (*.OBJ)– Object files for the HLL blocks (*.OBJ)– All files which are to be linked to the block (e.g. *.OBJ, *.LNK, *.LOC, *.LIB)– Files with the linked blocks (*.LNK)– Files with the located blocks (*.LOC)– Files with the intel hex code for the blocks (*.H86)– Files with the prepared binary code for the blocks (*.BIN)

• List directory:

– Compiler lists for the HLL source blocks (*.LST)– Assembler lists for the block headers and block ends (*.LST)– Error list of the assembler (*.ERR)– List file for diagnostics data and error messages (S5HLL.ERR)– Cross-reference lists (*.CRF)– Map files for the linker (*.MP1)– Map files for the locator (*.MP2)

• S5-DOS directory:

– S5-DOS block file– Copies of the link and list files for the HLL blocks entered in the block file (insofar as

link and list files exist for the blocks)

• Current directory:

– Batch file for calling the program editor EDIT_HLL.BAT– Include files of HLL blocks (if no path is specified in the include statement)– Temporary files for the block generator– Parameter file S5.PAR with the data of the last block generator call made from this

directory

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–7SINUMERIK 840/880 Part 1 (PJ)

11.91 4 Operation

4.1 General Operating Information

4 Operation

4.1 General Operating Information

The operation of the block generator is performed mainly using the function keys. Certainother special keys are also used in some of the menus. Particular reference should thereforebe made to the meaning of the special keys in the individual menus.

The active input field is always displayed in inverse format and/or highlighted in color.

Some functions in the block generator do not require a menu. If errors occur with thesefunctions, the error messages appear, where possible, in the menu last displayed.

4.1.1 Menu Tree

Menu Tree of the Block Generator

Menu 5Menu 4Menu 3

Call block generatora a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Menu 2

Editor

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a aMenu 1

a aa aa aa aa a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Menu 6a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Menu 1.1

Next menu depends on input in Menu 2

Notes:

• If several processing steps are selected simultaneously in Menu 2, the block generatordetermines the sequence of the menus and the other processing steps automatically. Thesequence of the processing steps is based on the requirements of the block generation.

• If the predefined directory structure does not match the real directory structure, Menu 1.1"Define Directories" appears with an error message when the block generator is called.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–1SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.1.2 Default Settings in Menus

4.1.2 Default Settings in Menus

Where possible, appropriate default values are entered in the menus. These defaults arebased, for example, on:

• the last entries in that menu

• the current values for the selected block, or

• the processing steps which must be performed on the basis of your entries.

4.1.3 Use of Upper and Lower Case Letters for Input

You can use upper or lower case letters for input. The block generator converts the entries inthe menu fields to upper case.

When you use a progarm editor to edit the source files of the block programs, the inputnotation (upper or lower case) is retained.

4.2 Block Generation Sequence

The following flow chart illustrates the generation sequence of an HLL block. The framed stepsin the block generation flow chart must be performed by the user; the unframed steps areperformed by the block generator.

The block generation steps can be performed individually, and the order of the individual stepscan be changed. The selection of the processing steps and their meaning are described in thefollowing sections on the operation of the block generator.

4–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.2 Block Generation Sequence

Block Generation Sequence (Principle)

Define block interfaceor

Change block interface

Generate module body for the HLL source programor change declarations and module header

in HLL source program

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Include any modified input/outputparameters in HLL source program 1)

Compile HLL source program

Check parameters 2)

Generate ASM block header and block end, assemble,link block, locate, generate hex code

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Correct hex code and convertGenerate S5-DOS block file

Transfer HLL blocks

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Define block key dataor

Select existing block

Edit HLL source program(integrated editor call)

Correct errors (integrated editorcall)

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Edit HLL source program(integrated editor call)

_______1) Only relevant for HLL blocks generated with Version 1 of the block generator

(see section entitled "Format of Module Header")

2) Only possible when calling other PL/M blocks from PL/M blocks

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–3SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.3 Calling the Block Generator

4.3 Calling the Block Generator

The block generator is started by entering

S5_DOS

and pressing the Return key.

Note:

If an S5.PAR file already exists in the current directory (it is generated automatically by theblock generator), the data of the last block to be processed from the current directory arereactivated.

4.4 Parameters for HLL Block (Menu 1)

When the block generator is called, the following menu (Menu 1 "Parameters for HLL Block")appears on the screen. (The data in the input fields are examples.)

Menu 1, Parameters for HLL Block

Block Type (FB, FX) : >X<

Block Number : >004<

Block Name : >TOOLVERW<

Library Number : >09135<

Language (PL/M, C) : >PL/M<

PLC System : >PLC 135WB with ACOP<

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Defpath

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Continue

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 1 Version 2.2

In this menu, you enter the basic parameters for the function block which is to be processed.The block generator checks your parameters to see if the block already exists. This checkincludes the directories which appear in Submenu 1.1. You should therefore make sure thatthe desired directory structure has been defined (see the description of function key F2"Defpath" and of Menu 1.1).

4–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 4 Operation

4.4.1 Define Key Data of HLL Block

4.4.1 Define Key Data of HLL Block

This section describes the meaning of the input fields in Menu 1 "Parameters for HLL Block".

Unique definition of block identification

Within the selected directory structure, an HLL block is identified by block type, block numberand programming language. If a block matching the parameters entered for the block type,block number and programming language does not yet exist, a new block is subsequentlycreated. This is indicated by the following message in the lower region of Menu 1:

Note: New block will be created

When you move the cursor away from one of the input fields for the block type, block numberor programming language, the block generator checks whether a block for the current dataalready exists in the defined directory structure. If the block generator finds a matching HLLblock, the remaining input fields of Menu 1 are filled with the data of this block.

Block type (FB, FX)

Input: Meaning, effect:

Space bar Switch block typeB Select block type FBX Select block type FX

When you enter "B" or "X", the appropriate block type is set and the cursor jumps to the nextfield in the menu.

Block number

Input: Meaning, effect:

0...255 Here you enter the number of the function block you want to process.(decimal number)

Language (PL/M, C)

Input: Meaning, effect:

Space bar You enter the programming language in which the block is to be, or hasbeen, created. Press the space bar to change the programminglanguage in the display.

Block name

Input: Meaning, effect:

Alphanumeric, Here you can define a name for the block. The definition of a block max. 8 characters name is optional and is not required for operation of the block

generator.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–5SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.4.1 Define Key Data of HLL Block

Library number

Input: Meaning, effect:

Decimal number Here you can define the number of a block library. The definition of alibrary number is optional and is not required for operation of the blockgenerator.

PLC system

Input: Meaning, effect:

Space bar Here you can define the PLC system on which the block is to be used.Use the Space bar to toggle the display between the PLC 135 WB withCOP and the PLC 135 WB with ACOP.

File names

This parameter defines the file name under which the block generator stores the source file fora block. File names have the following structure:

xFyxxx.xxx

File name extensionPLM for PL/M function blockC for C function block

Block numberValue range: 000...255Parameter with leading zeroes

Block type "FB" or "FX"

Language identifierP for PL/MC for C

Notes:

• When you call the block generator, the data of the last block to be processed are generallyreactivated (see note in the section entitled "Calling the Block Generator"). If there are noparameters for previous blocks, the following fixed values appear as the defaults inMenu 1:

– Block: FB 000– Block Name and Library Number: unassigned– Language: PL/M– PLC System: PLC 135 WB with ACOP

• If the last directories to be used no longer exist, Menu 1.1 appears (see the section"Define Directories (Menu 1.1)").

• The input fields for block type, block number, language and PLC system must be filled in.

4–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.4.1 Define Key Data of HLL Block

• The meaning of the PLC system for block generation is described in the section entitled"Upwards Compatibility".

• A new block is not created until you reach the "Define Block Interface" processing step.This processing step is therefore always selected for new blocks in Menu 2 "SelectProcessing Steps".

Modifications to the library number or block name for existing blocks:

Modifications to the library number or block name only take effect when you reach the"Change Block Interface" processing step. If you do not run this processing step followinga change to the block name or library number, the changes are cancelled.

When you change to Menu 2 "Select Processing Steps", the "Change Block Interface"step is therefore always selected following a change to the library number or block name.

• The file names are assigned by the block generator and cannot be changed.

Examples:

• PL/M function block FB 16File name: PFB016.PLM

• C function block FX 8File name: CFX008.C

4.4.2 Function Keys and Special Keys in Menu 1

F1 Continue

The entries in Menu 1, for selecting and defining the block to be processed, are accepted.They are used for further processing of the block. Menu 2 appears for the selection of theprocessing steps.

F2 Defpath

Menu 1.1 appears for defining the directories.

F8 Back

Exits the block generator. The last block to be processed and the directory structure whichwas used are stored in the current directory. These parameters are used as defaults the nexttime the block generator is called up (from the current directory).

If you exit the block generator without having activated F1 "Continue" from Menu 2 "SelectProcessing Steps", F8 "Back" in Menu 1 acts as a Cancel function. Because the block hasnot been processed in this case, no data are saved.

Space bar

Use the Space bar to toggle between the valid values in the input fields for block type,language and PLC system.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–7SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.5 Define Directories (Menu 1.1)

4.5 Define Directories (Menu 1.1)

The directories used by the block generator when processing the block are defined duringinstallation. The directories are displayed and can be modified in Menu 1.1. The files which theblock generators stores or expects to find in the individual directories are described in thesection entitled "Files and Directories".

When you select Menu 1.1, the current directory structure is displayed. (The paths in the inputfields of the illustrated menu are examples).

Menu 1.1 Defining the Directories

System Programs : >C:\SYSTEM\ <System Data : >C:\S5HLL\SYSDAT\ <Source Files : >D:\PROJEKT\MASCHINE\PLC1\SOURCE\ <Object Files : >D:\PROJEKT\MASCHINE\PLC1\OBJ\ <Program Lists : >D:\LISTEN\TEMP\ <S5-DOS Directory : >H: <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a

a a a

a a a

a a a

a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Continue

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 1.1 Version 2.2

Notes:

• When the block generator is called, it searches in the current directory for information onthe last directory structure to be used. These settings are reactivated when the blockgenerator is called.

• If the block generator does not find any information on the default directory structure, thecurrent directory is used for all paths. In this case, the fields in Menu 1.1 are empty.

• If the defaults for the last directory structure to be used do not match the real directorystructure, Menu 1.1 appears immediately after the block generator is called. In this case,you must change the settings in the menu.

If you do not change the incorrect paths (and activate F8 "Back" instead), the blockgenerator uses the current directory for all paths. The default settings are deleted.

The above situation can arise when directories are deleted.

4–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.5.1 Paths

4.5.1 Paths

The length of the path for the directories is limited to 30 characters (including the driveparameter).

Paths must be terminated with a Backslash (\); if the Backslash is omitted, it is automaticallyinserted by the block generator. If you only enter a drive, you do not need the Backslash; yourentry is accepted unmodified by the block generator.

4.5.2 Function Keys and Special Keys in Menu 1.1

F1 Continue

The block generator initially checks whether the directories defined in Menu 1.1 exist. If not allof the defined directories exist, the block generator outputs an error message. If this happens,you should correct the path. If the defined directories exist, the directory structure set in Menu1.1 is activated immediately.

When the path check is complete, you exit Menu 1.1 and Menu 1 "Parameters for HLL Block"appears.

F8 Back

Menu 1 "Parameters for HLL Block" reappears. Any changes which you have made in Menu1.1 are cancelled. The parameters which were active before you selected Menu 1.1 remainvalid; no checks are performed (exception: see notes above).

, , Ret, PgUp, PgDn, Home, End

When the block generator is called, it searches in the current directory for information on thelast directory structure to be used. These settings are reactivated when the block generator iscalled.

, , BS, Del, Ins

These key functions are available for editing text in the input fields.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–9SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.6 Select Processing Steps (Menu 2)

4.6 Select Processing Steps (Menu 2)

In Menu 2, you can enter the processing steps for the block selected in Menu 1. You candefine several processing steps simultaneously. The block generator executes the definedprocessing steps in an appropriate order.

The processing steps are selected with an "X" or the Space bar. The Space bar has a togglefunction which you can use to deselect processing steps which are already selected, and vice-versa.

Menu 2, Select Processing Steps

PL/M Function Block: >PFX004< Name: >TOOLVERW<

Please Select:

Define Block Interface > <Change Block Interface >X<Create Block Program >X<Generate Block > <Prepare Block for Transfer > <

Check Block > <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a

a a a

a a a

a a a

a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Continue

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 2 Version 2.2

4–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.6.1 Description of the Processing Steps

4.6.1 Description of the Processing Steps

4.6.1.1 Define Block Interface

This function defines the call parameters and the system interface for the new block. Thefunction runs in Menus 5 and 6. The block generator subsequently generates the module bodyfor the HLL block.

Caution:

In this processing step, the block generator creates a new block.

If this processing step is selected for an existing block,

the existing block is deleted. You are prompted

to overwrite the block or cancel the operation.

4.6.1.2 Change Block Interface

You can use this function to modify the block interface for existing blocks. Menus 5 and 6 arealso used for this function. In contrast to the "Define Block Interface" processing step, thesource file of the HLL block is not created, it is only modified.

Changes to the block name or library number which you have entered in Menu 1 are activatedduring this processing step.

4.6.1.3 Create Block Program

You can edit the block with the installed editor (see the section entitled "Installation") bycalling it from the block generator.

4.6.1.4 Generate Block

In Menu 3 "Compile and Link HLL Block", you can define additional link modules with whichthe block is to be linked.

The block generator creates the assembler header for the function block and compiles the HLLsource file. Following error-free compilation of the block, the block is linked and located. Thehex code for the HLL block is subsequently generated from the resulting file.

4.6.1.5 Prepare Block for Transfer

In Menu 4 "Generate S5-DOS Block File" you can define which function blocks are to bestored together in a block file. The block generator then creates the S5-DOS block file which isused to transfer the blocks to the PLC (or initially to the programming device).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–11SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.6.1 Description of the Processing Steps

4.6.1.6 Check Block

The block generator checks the parameters of the HLL block calls in the current functionblock. This parameter check can only be performed on blocks which have been created in thePL/M language and compiled without errors. If the HLL block still contains errors, particularlyviolations of the block structure, the results of the parameter check will be purely arbitrary.

For the parameter check, the block generator must be able to access the source files of all theHLL blocks called in the PL/M block and all the Include files used. If the block generatorcannot find these files, it cancels the parameter check and outputs an error message.

During the parameter check, the block generator produces a cross-reference list of all HLLblocks called by the block being checked. This cross-reference list is stored in the listdirectory defined in Menu 1.1 "Define Directories". The file name differs from the source fileonly with respect to the file name extension. File names for cross-reference lists always havethe extension ".CRF".

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** SINUMERIK Block Generator S5-PL/M Version 2.2 Date 10.08.91 ** Directory of all blocks called from: FB 8 Page: 1 ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

BlockType Number Name

Called in Filename Line Parameters

FB 2 I/Q/F PFB008.PLM 99 NR : D KFNR1 : I BY

4–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.6.2 Function Keys in Menu 2

4.6.2 Function Keys in Menu 2

F1 Continue

The block generator executes the processing steps selected in Menu 2 in a logical sequence.Further menus and/or messages are displayed on the screen.

When all selected steps have been executed, Menu 1 reappears on the screen.

F8 Back

Menu 1 is displayed again. The selected processing steps are not executed, however theselections that you made in Menu 2 are retained.

, , , , Ret, PgUp, PgDn, Home, End

You can use these keys to select the desired input field. The page keys and the Home andEnd keys move the cursor to the first or last input field. You cannot exit an input field thatcontains illegal characters ("X" or the space character are legal).

Space bar

The Space bar can be used to set or cancel selections in the input fields. The Space bar actsas a toggle function.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–13SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.7 Define/Change Call Parameters (Menu 5)

4.7 Define/Change Call Parameters (Menu 5)

In Menu 5, you define the call parameters for the block. The function block is displayed as agraphical symbol in Menu 5; the inputs and outputs of the function block correspond to the callparameters.

Call parameters can be redefined in Menu 5, and parameters which are displayed can bemodified or deleted.

4.7.1 Block without Call Parameters

A new function block will initially have no call parameters. In Menu 5, a block withoutparameters is represented by an empty box. The block generator asks you whether callparameters are to be assigned to the block. In this case, Menu 5 will have the followingappearance:

Menu 5, Define/Change Call Parameters

PL/M Block: FX 004Block Name: TOOLVERW

Library Number: 9135

Assign parameters to this block?

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

No

a a a

a a a

a a a

a a a

a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Yes

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 5 Version 2.2

Use function keys F1 and F2 to define whether or not call parameters are to be assigned tothe block.

If you enter "No" with function key F2, Menu 6 "Define/Change System Interface" appearsand no call parameters are assigned to the function block.

If you press function key F1 for "Yes", you are prompted to enter a parameter name.

Note:

If you change the interface on existing blocks which do not have call parameters, the blockgenerator responds in the same way as with a new block.

4–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.7.2 Block with Call Parameters

4.7.2 Block with Call Parameters

In Menu 5, the call parameters are represented by terminals on a block symbol (similar to aSTEP 5 function chart). Each of these symbolic terminals is labelled with the parameter name,the parameter type and its data type. Inputs, constants, timers and counters which are used ascall parameters are displayed on the left of the block symbol and outputs are displayed on theright.

Example: HLL Block with Parameters in Menu 5

Q DWord STATQ Bit OK

INDX I ByteSRC I WordINP1 I BitINP I BitACTC CACTT T

4.7.2.1 Add Call Parameters

Enter parameter name

When the input field at the bottom left of the block symbol is displayed in inverse format, youcan add a new parameter to the existing ones. Select the input field with the End key. Theparameter name can be up to 4 characters in length. The input of the parameter name isaccepted when you enter the 4th character or press the Return key. During input of theparameter name, you can clear the input field by pressing the Escape key.

Define parameter type and data type

When you have entered the parameter name, use the function keys to define the callparameter type.

Menu 5, Define Type of Call Parameter

PL/M Block: FX 004Block Name: TOOLVERW

Library Number: 9135

inp1

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a

a a a

a a a

a a a

Q

a a a

a a a

a a a

a a a

I

a a a a

a a a a

a a a a

a a a a

D

a a a a

a a a a

a a a a

a a a a

T

a a a a

a a a a

a a a a

a a a a

C

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 5 Version 2.2

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–15SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.7.2 Block with Call Parameters

When you have defined the parameter type, the meaning of the function keys changes; nowyou can use them to enter the data type.

The following function keys are available for selecting the data type for input and outputparameters (parameter types I and Q):

Function Key Assignment in Menu 5 for Defining the Data Type (Parameter Type I/Q)

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Byte

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Word

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

DWord

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

Bit

When you use constants as the input parameter (parameter type D), the following functionkeys are available for selecting the data type:

Function Key Assignments in Menu for Defining the Data Type (Parameter Type D)

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

KH

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

KY

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

KC

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

KM

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

KF

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

KT

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

KZ

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

KG

When you use timer and counter information as input parameters (parameter types T and C),the format is fixed; the definition of the new parameter is complete when you have entered theparameter type.

The new call parameter is subsequently displayed as a terminal on the block symbol. If youname the first call parameter of your block INP1, as in the last example, and then press F1twice, your block in Menu 5 will look like this:

Representation of the Parameter on the Block Symbol

INP1 I Bit

4.7.2.2 Change Call Parameters

Select the call parameter you want to change with the cursor control keys or Tab key.

Change parameter name

Change the parameter name by overwriting the displayed parameter name. You must thendefine the parameter type and data type, as when you define a new call parameter.

Change parameter type and data type

If you only want to change the parameter type and data type, please press the Return keyonly. The name of the parameter remains unchanged. You can now change the parametertype and data type using the function keys.

4–16 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 4 Operation

4.7.3 Exit Menu 5

4.7.3 Exit Menu 5

You exit Menu 5 "Define/Change Call Parameters" automatically if you answer the blockgenerator prompt "Should the block have a parameter?" with F2 "No".

If the block has parameters, you can exit Menu 5 by pressing the Insert key or the Page Downkey. During subsequent processing, the block generator creates the declarations for the callparameters defined in Menu 5.

Menu 6, Define/Change System Interface always follows Menu 5.

4.7.4 Function Keys and Special Keys in Menu 5

The function keys in Menu 5 are only active in specific situations and are therefore not alwaysdisplayed (see previous sections).

The function keys in Menu 5 have multiple assignments. The meaning of the function keyschanges the first time you press a function key.

First level of function keys

The first level of function keys allows you to choose the type for the active call parameter.

Function key Parameter type

F1 I Input parameterF2 Q Output parameterF3 D Constant as input parameterF4 T Timer information as input parameterF5 C Counter information as input parameter

Second level of function keys

The second level of function keys identifies the data type.

The following function keys are available for parameter types I and Q:

Function key Parameter type

F1 Bit Byte with one significant bit, possibly with maskF2 Byte ByteF3 Word WordF4 DWord Doubleword

The following function keys are available for parameter type D:

Function key Parameter type

F1 KM Bit mapF2 KH Hexadecimal numberF3 KY Byte valueF4 KS ASCII valueF5 KF Fixed-point numberF6 KT Timer valueF7 KC Counter valueF8 KG Floating-point number

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–17SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.91

4.7.4 Function Keys and Special Keys in Menu 5

The data type is permanently assigned for timers and counters; no choice is thereforeprovided for these types of parameters.

Please refer also to the details of data format and data format conversion for call parameters inthe section entitled "Call Parameters of HLL Blocks".

The special keys in Menu 5 are only active when the function key assignment is not visible.

, , Tab

Use these keys to select the call parameter you want to edit. The cursor can only be movedvertically with the arrow keys. You can move to the call parameters on the opposite side of theblock symbol with the Tabulator key.

End

The End key moves you to the input field for new call parameters.

Ctrl-End

You can delete a parameter that you have already entered by pressing the Control key andEnd key simultaneously.

, , Del, BS

These keys are used to edit the parameter name.

Esc

The Escape key clears your present entry in the input field as long as the input of theparameter name has not been completed. (If input of the parameter name is complete, youmust also define the parameter type and data type. You can delete the complete definedparameter again by pressing Ctrl-End).

Ret

The Return key terminates input of a parameter name.

Ins, PgDn

These keys accept the parameters in Menu 5 and advance you to Menu 6 "Define SystemInterface".

4–18 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.8 Define/Change System Interface (Menu 6)

4.8 Define/Change System Interface (Menu 6)

In Menu 6, you define the scope of the system interface for the function block. All system dataof the PLC which can be accessed by HLL blocks are listed in Menu 6, together with allsystem routines which are available to the HLL blocks.

Menu 6, Define/Change System Interface

Call other HLL blocks NoCall resident function macros NoCall STEP 5 blocks YesBlock address list NoProcess data blocks YesBoundary addresses of user memory YesInterpreter data NoI/O address list (I/Q) NoProcess image (I/Q/F/T/C) NoSystem stop from HLL user program NoExtended I/O address list [I/Q] NoSemaphores (LIM, SIM) No

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

No

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Yes

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 6 Version 2.2

The interface options displayed depend on the PLC system set in Menu 1 and can vary.

The individual items in Menu 6 have the following meaning:

Call other...: Select this item if you want to call other HLL blocks.

Call resident...: Select this item if you want to call specific standard functionblocks (macros).

Call STEP 5...: Select this item if you want to call STEP 5 blocks.

Block address list: Select this item if you require the block address lists, e.g. tocheck whether a specific block exists.

Process...: Select this item if you want to open data blocks (DB/DX); thisalso provides you with the current data block length.

Boundary addresses...: Select this item if you want to query the start, end and assignedaddresses of the user memory.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–19SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.8 Define/Change System Interface (Menu 6)

Interpreter data: Select this item if you want to query the STEP 5 status bits forbinary and digital operations or the number of the current OB.

I/O address list...: Select this item if you require direct access to the I/O(corresponds to L PY, T PY in STEP 5).

Process image...: Select this item if you want to access the process image of theinputs, outputs, flags, timers and counters.

System stop from...: Select this item if you want to branch to the stop state from theHLL block in the event of an error.

Extended I/O...: Select this item if you want to access the extended I/O (only onsystems with ACOP).

Semaphores: Select this item if you want to set and clear the disableidentifiers (corresponds to the commands SIM and LIM in STEP5; only on systems with ACOP).

You will find more information on the individual items in the section entitled "Interfaces of theHLL block".

4.8.1 Function Keys and Special Keys in Menu 6

F1 YesF2 No

You use function keys F1 "Yes" and F2 "No" to specify for each option whether you want touse the option in the function block.

,

Use these keys to move the line cursor. The current line of the table is displayed in inverseformat.

Ins

The Insert key accepts your settings. The block generator now creates (or replaces) thedeclarations for the call parameters defined in Menu 5 and the system interface defined inMenu 6. The generated declarations are entered in the HLL block by the block generator. Anyexisting declarations for the block interface are replaced (please refer also to the sectionentitled "Format of the Module Header").

Any changes to the library number and the block name that you have made in Menu 1 are nowactivated.

4–20 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.9 Edit HLL Block

4.9 Edit HLL Block

If you have selected the step "Create Block Program" in Menu 2 "Select Processing Steps",the program editor which was set during the installation is called up. You can now edit the HLLblock.

The operating method depends on the editor you are using. If you have any queries, youshould consult the documentation of the editor.

When editing the block program, please remember that you may not change declarations,compiler commands and comments which have been created by the block generator (see alsothe section entitled "Format of the Module Header").

The block generator is reactivated when you exit the program editor.

4.10 Compile and Link HLL Block (Menu 3)

In Menu 3, you define the optimization level for the compiler and the objects which are to belinked to the block. The parameters produced by the block generator are generally sufficient. Ifthe need arises, however, these parameters can be extended or modified. You should notattempt to do this without accurate knowledge of the technical requirements (see notes). Thedefault settings for the assembler header and footer should never be changed.

Notes:

• Optimization level 0 should be set for testing the HLL block with the on-line or off-linedebugger. The tested block can subsequently be compiled with a higher optimization level.

• To ensure that the HLL block operates correctly if it has been compiled with a higheroptimization level, you should perform a test run with the optimized block.

• In addition to the default modules, you can link a further 5 object files or libraries to theblock. The number of individual object files or libraries is irrelevant, i.e. you can link 5object files to the block.

• You can use standard intel libraries or your own libraries (created with intel-LIB86). Pleasenote that the functions used may not access the hardware or operating system.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–21SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.10 Compile and Link HLL Block (Menu 3)

Menu 3, Compile and Link HLL Blocks

PL/M Function Block: >PFX004< Name: >TOOLVERW<Compile:

Optimization Level >0< for debugger

Link:Block Link Modules: > AFX004.OBJ< Assembler Header

> PFX004.OBJ< PL/M Block Body> . < Additional Object File> . < Additional Object File> . < Additional Object File> DAT_COM2.LOC< System Addresses> . < Additional Library> . < Additional Library> AFXEND.OBJ< Assembler Footer

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a

a a a

a a a

a a a

a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Continue

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 3 Version 2.2

4.10.1 Function Keys and Special Keys for Menu 3

F1 Continue

The entered data are accepted. The HLL source program is compiled, linked, located andconverted to hexadecimal format. The files which are generated during this process are storedin the appropriate directories (see the section on "Installation" and the description ofMenu 1.1).

If an error is encountered during compilation of the HLL source program, the block is notlinked; the following message appears:

Call up editor? [n]/y

If you answer n(o), the block generator calls up the "Select Processing Steps" menu. If youanswer y(es), the editor is called up and you can correct the source file with reference to theerror messages in the list file.

If you have selected several steps in Menu 2 "Select Processing Steps", the block generatormay run these steps before compiling and linking the block. Menu 3 is used for entering thedata required for compiling and linking; the associated actions are not necessarily performeddirectly after you exit the menu (other steps of the block generation may be performed first).

F8 Back

You exit Menu 3, but the data you have entered are retained. The block is not compiled orlinked.

4–22 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 4 Operation

4.11 Generate S5-DOS Block File (Menu 4)

4.11 Generate S5-DOS Block File (Menu 4)

In Menu 4, you can define which blocks are to be combined in an S5-DOS block file. The S5-DOS block file is the output medium of the block generator for completely processed HLLblocks; the latter can be transferred to the programming device in the S5-DOS block file.

The block generator also transfers all link files and program lists which it finds for the HLLblocks defined in Menu 4 to the destination directory for the S5-DOS block file.

Menu 4, Generate S5-DOS Block File

PL/M Function Block: >PFX004< Name: >TOOLVERW<

Name of the S5-DOS Block File: >@@@@@@ST.S5D<

Blocks to be Transferred

1. > PFX004< 8. > < 15. > <2. > < 9. > < 16. > <3. > < 10. > < 17. > <4. > < 11. > < 18. > <5. > < 12. > < 19. > <6. > < 13. > < 20. > <7. > < 14. > < 21. > <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a aa aa aa aa a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Backa a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Continue

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Block Generator Menu 4 Version 2.2

4.11.1 Define S5-DOS Block File Name and Block List

Name of the S5-DOS block file

Here you can enter the name and the extension for the S5-DOS block file in which the HLLblocks are to be transferred.

Blocks to be transferred

Enter the identifiers of the blocks you want to include in the S5-DOS block file in the fields inthe table.

The identifier for an HLL block is composed of 3 letters and a three-digit decimal number.

• The first letter indicates the language in which the block has been created.P stands for PL/MC stands for C

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–23SINUMERIK 840/880 Part 1 (PJ)

4 Operation 11.92

4.11.1 Define S5-DOS Block File Name and Block List

• The 2nd and 3rd letters indicate the block type.FB stands for an HLL function blockof type FBFX stands for an HLL function blockof type FX

• The three-digit decimal number identifies the number of the block; the value range is from000 to 255.

4.11.2 Function Keys and Special Keys in Menu 4

F1 Continue

The defined blocks are transferred to the S5-DOS block file. The S5-DOS block file is createdin the S5-DOS directory defined in Menu 1.1. All link files and program lists of the HLL blockstransferred to the S5-DOS block file are also copied into this directory. No warning is given ifprogram lists or link files are missing.

Note:

Pressing F1 "Continue" always creates a new block file. If a file of the same name alreadyexists in the destination directory, it is overwritten without warning.

F8 Back

You exit Menu 4 but the data you have entered are retained.

, , , , Ret, PgUp, PgDn, Home, End

You can use these keys to select the input field. The active input field is displayed in inverseformat.

, , Ins, Del, BS

These key functions are available for editing text in the input fields.

4–24 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 5 Interfaces of the HLL Block

5.1 Type and Scope of the Block Interfaces

5 Interfaces of the HLL Block

5.1 Type and Scope of the Block Interfaces

An HLL block can have the following interfaces:

• Call parameters• Interface to PLC system data• Interface to PLC system functions

These interfaces presented by the block generator offer enormous scope. You should notrequire all of the interface components provided.

The scope of the individual interfaces is defined interactively with the block generator. Theblock generator uses the data you enter in Menus 5 and 6 (see the section entitled"Operation") to generate the declarations for the interfaces required in the HLL block andpresent the corresponding external references.

The block generator records the current scope of the block interfaces in the header of the HLLsource code file. It uses a special syntax based on STEP 5 for this purpose. This syntax isdescribed in the section entitled "Format of the Module Header". Unlike earlier versions of theblock generator, you do not have to use this syntax yourself in Version 2.1. Please note,however, that the block generator deletes and overwrites certain areas in the source text of theblock when you make changes to the block interface.

5.2 STEP 5-Specific Data Format

All data are stored on the PLC in STEP 5 format. The STEP 5 format and the intel format usedwith PL/M and C are not compatible.

In the case of data fields which are stored in a word, the low byte and high byte in the STEP 5format are opposite to those in the intel data format. Similarly, the high word and low word indoublewords are also exchanged.

Examples:

• The same word is saved at different memory locations

If you write the value 1234H into a data word in STEP 5, the high byte (which contains12H) is stored in the byte at the lower address; the low byte (which contains 34H) isstored at the next higher address.

STEP 5 data format: 12H 34H

Address Address+1

© Seimens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–1SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.2 STEP 5-Specific Data Format

If you save the same value in the intel format used with PL/M and C, the higher-value byte(which contains 12H) is stored in the higher address in the word, while the lower byte(which contains 34H) is written to the lower address.

intel data format: 34H 12H

Address Address+1

• Reading the same stored doubleword produces different results

Memory contents:

34H ABH

Address Address+3

12H CDH

Address+2Address+1

The doubleword read access to this data array produces the value 0CDAB3412H in PL/Mand C (or 0xCDAB3412 in C notation).

The doubleword read access in STEP 5 returns the value 1234ABCDH.

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

Caution:

Please remember the different data formats

used in STEP 5 and PL/M and C when accessing data.

The PLC operating system can convert the call parameters of an HLL block to the intel dataformat. The conversion must be requested explicitly (see the section entitled "Conversion ofCall Parameters").

In addition to the opposite representations used for the high and low byte, differences alsoarise in the indexing of arrays. For example, the data word n in a STEP 5 data block isinterpreted by STEP 5 as consisting of the data bytes DL n and DR n. The data bytes in thedata word are thus addressed with the same index as the data word itself. PL/M and C,however, interpret data word n as consisting of data bytes 2n and 2n + 1.

You will find further examples of the different data formats in the sections entitled"Programming with PL/M", "Programming with C" and "Program Examples".

5–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 5 Interfaces of the HLL Block

5.3 Call Parameters of HLL Blocks

5.3 Call Parameters of HLL Blocks

5.3.1 Types of Call Parameters

An HLL function block can have input parameters and output parameters. Parameters whichare both input and output parameters, i.e. variable parameters, are not possible. They can,however, be simulated.

All parameters are passed via the stack (either the value or the address of the parameter).

The block generator distinguishes between the following types of call parameter:

Parameter type: STEP 5notation:

Passed to the stack:

Output parameters:BitByteWordDoubleword

Q BIQ BYQ WQ D

Pointer plus mask bytePointerPointerPointer

Input parameters:BitByteWordDoubleword

I BII BYI WI D

Data byte plus mask byteByteWordDoubleword

Constants:ASCII valueFixed-point numberFloating-point numberHexadecimal numberBit mapByte valueTimer valueCounter value

D KSD KFD KGD KHD KMD KYD KTD KC

WordWord, with leading signDoublewordWordWordWordWordWord

Timer T Word

Counter C Word

In this overview, the parameter types constant, timer and counter are treated as special typesof input parameter for HLL blocks.

Notes:

• Call parameters are passed to HLL blocks via the stack; please therefore refer also to theinformation on the stack loading in the section entitled "Information for the Use of theBlock Generator".

• Call parameters can be converted to the intel data format by the PLC operating system(see next section).

• Two variants can be used for passing bit parameters (see next section).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–3SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.3.2 Data Format Conversion for Call Parameters

5.3.2 Data Format Conversion for Call Parameters

Call parameters of HLL blocks can be converted by the PLC operating system. There are twoconversion functions:

• Convert input parameters from STEP 5 data format to intel data format• Pass bit (input) parameter as value

Both format conversions must be requested explicitly in the STEP 5 program calling the HLLblock. This is performed by enabling operating system data bits (in the followin gabbreviated asBS) BS 0.0 and BS 0.1.

Activate conversion to intel data format

BS 0.0 = 1: The input parameters are converted to the intel data format, i.e. the high andlow bytes or words are converted.

= 0: The input parameters are passed to the HLL block in the STEP 5 format.

Select format for bit transfer

Conversion of the bit parameters is only possible for input parameters. Bit parameters (inputparameters) consist of 2 bytes. One byte contains data, the other contains a mask.

BS 0.1 = 1: The value of the bit parameter (0 or 1) is specified directly in the byte whichrepresents the bit parameter. If the bit is enabled, the call parameter containsthe value 1; if the bit is disabled, the call parameter contains the value 0.

The mask byte for the bit call parameter is always 0 with this bit transfervariant.

BS 0.1 = 0: The bit parameter contains a byte value in which only one bit is significant.The accompanying mask byte is used to mask all of the irrelevant bits. In themask byte, one bit is enabled at the position of the relevant bit.

System data BS 0 is valid for all levels. For example, if BS 0.0 is set to "1" in OB 1 (= formatconversion from intel data format to STEP 5 format) and OB 1 is then interrupted by a higher-priority level (e.g. by a process interrupt), bit BS 0.0 is also set to "1" in OB 3 (which is nowactive). If you do not want the format conversion in OB 3, the bit must be reset explicitly.When you return to OB 1, the original value is reloaded in BS 0 (in this example BS 0.0 is setto "1" again).

Examples with bit parameters are provided in the program examples and in the sections onprogramming with PL/M and C.

5.4 PLC System Functions

Contained in the PLC operating system are special system functions which can be called fromHLL blocks. These system functions are used as a substitute for important STEP 5 commandswhich are difficult to reproduce in a high-level language. They also enable other programsections to be called from HLL blocks. The system function HLL_MACRO() can be used tocall up function macros of the PLC operating system.

5–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.4.1 Overview

5.4.1 Overview

The following system functions can currently be used in HLL blocks:

Name: Task:

HLL_ADB() Open data blockHLL_S5() Call STEP 5 blocksHLL_MACRO() Call function macrosHLL_HLL() Call HLL blocksHLL_LIM(), HLL_SIM() Disable/enable processing levelsHLL_STOP() Initiate PLC system stop from HLL block

The parentheses following the names of the system functions indicate that the systemfunctions have call parameters. System functions HLL_LIM() and HLL_SIM() are onlyavailable on PLC systems with ACOP.

The system functions and their parameters are described in the following sections.

5.4.2 HLL_ADB(), Open Data Blocks

HLL_ADB() is used to open a data block. The data segment of the HLL block is set to thedata segment of the opened data block in order to associate the data block declared in thedata segment of the HLL block with the opened data block.

The assignment of the data block declared in the HLL block to the opened data block remainsactive until a new data block is opened with HLL_ADB().

Each time HLL_ADB() is called, system data DB_Laenge passes the length of the openeddata block.

Parameters of system function HLL_ADB():

Parameter Type Value range Meaning

1 String constantLength: 2

'DB' or 'DX'(large case only)

Selects the type of thedata block to be opened

2 Word 0...255 Specifies the number ofthe data block to beopened

Example:

Open data block DB 100:

PL/M: call HLL_ADB ('DB', 100);C: HLL_ADB ('DB', 100);

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–5SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.4.3 HLL_S5(), Call STEP 5 Program Blocks

5.4.3 HLL_S5(), Call STEP 5 Program Blocks

System function HLL_S5() can be used to call STEP 5 blocks from the HLL block (e.g. forefficient bit processing). Permissible block types are PB (program blocks) and SB (stepblocks). You can program code to read the result of the external binary operations from thestatus bits in BIN_ERGA, DIG_ERGA or BIN_DIGA.

Parameters of system function HLL_S5()

Parameter Type Value range Meaning

1 String constantLength: 2

'PB' or 'SB'(large case only)

Selects the type of theSTEP 5 data block to beopened

2 Word 0 ... 255, numbers ofexisting STEP 5blocks only

Specifies the number of theSTEP 5 data block to beopened

Example:

Call program block PB 255:

PL/M: call HLL_S5('PB',255);C: HLL_S5('PB',255);

5.4.4 HLL_MACRO(), Call Function Macro

Function macros made available by the PLC operating system for use in application programscan be called with system function HLL_MACRO(). The parameters for the function macroare specified as call parameters of system function HLL_MACRO().

Parameters of system function HLL_MACRO():

The number of call parameters of HLL_MACRO() is variable and depends on the functionmacro to be called with HLL_MACRO(). The first parameter of HLL_MACRO() is always thelast parameter of the function macro; the other parameters of the macro follow in reverseorder. The number of the function macro is always specified in the last parameter ofHLL_MACRO().

5–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.4.4 HLL_MACRO(), Call Function Macro

Parameter Type Value range Meaning

1 Depends on function macro called Last call parameter of functionmacro

2 Depends on function macro called Second last call parameter offunction macro

(n - 1) Depends on function macro called First call parameter of functionmacro

n Byte Numbers of functionmacros permitted(see following table)

Number of function macro to becalled

You will find examples of the HLL_MACRO() function in the sections entitled "Brief Examplesin PL/M" or "Brief Examples in C".

5.4.4.1 Available Function Macros

The following function macros can presently be called with system function HLL_MACRO():

FB no. FB name Function

11 EINR-DB Set up data blocks

12 WDTRG Watchdog trigger

61 NCD-LESE Read NC data

62 NCD-SCHR Write NC data

65 M STACK Flag parameter flag stack

66 STACK M Flag stack flag parameter

72 T:NCK DB Transfer NC channel DB channel

73 T:DB NCK Transfer DB channel NC channel

74 T:SPI DB Transfer spindle DB spindle

75 T:DB SPI Transfer DB spindle spindle

76 T:ACH DB Transfer axis DB axis

77 T:DB ACH Transfer DB axis axis

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–7SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.4.4 HLL_MACRO(), Call Function Macro

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Separate documentation is obtainable for the function macros:"Function Macros" Configuring Guide

5.4.4.2 Passing Parameters to Function Macros

The procedure for passing parameters to function macros when calling them from an HLLblock is mainly identical to calling from a STEP 5 program. The following differences andspecial cases apply:

• When calling from an HLL block, the order of the parameters is opposite to the order inSTEP 5 calls. The last parameter for the function macro must be passed first when callingfrom an HLL block; the block number is specified as the last parameter.

• Variable passing of flag parameters to function blocks FB 11, FB 61 and FB 62 is notsupported in calls made from HLL blocks.

• In the case of FB 61 and FB 62, the parameter NSBY is a constant of type D KF.

• When using bit parameters as input parameters for function macros, the bit must alwaysbe passed as bit 0. The other bits are ignored.

• Parameters of type constant must always be passed in a word, since the function macrosalways evaluate these parameters as words.

Examples for the use of function macros can be found in the sections for programming withPL/M or C, and in the program examples.

5.4.5 HLL_HLL(), HLL Block Calls HLL Block

System function HLL_HLL() can be used to call other HLL blocks from an HLL block.Recursive calls of the same HLL block are not permitted.

Parameters of system function HLL_HLL():

The number of parameters of the system function HLL_HLL() is variable and depends on theHLL block to be called. The call parameters of the HLL block to be called, and the block typeand block number must be specified.

The call parameters for the called HLL block are specified in the same order as they appear inthat block.

Note:

String constants are not permitted as parameters when calling HLL_HLL() except to specifythe type of block called.

5–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 5 Interfaces of the HLL Block

5.4.5 HLL_HLL(), HLL Block Calls HLL Block

(n - 2) Depends on HLL block to be called Last parameter of HLL blockto be called

(n - 1) String 'FB' or 'FX'constant (upper case only)Length: 2

Type of HLL block to be called

n Byte Numbers ofexisting HLL blocks

Block number of HLL blockto be called

Parameter Type Value range Meaning

1 Depends on HLL block to be called First parameter of HLL blockto be called

2 Depends on HLL block to be called Second parameter of HLL blockto be called

Example:

Call HLL block FB 123 with 2 parameters:

PL/M: call HLL_HLL (start, end, 'FB', 123);C: HLL_HLL (start, end, 'FB', 123);

5.4.6 HLL_LIM(), HLL_SIM(), Disable and Enable OBs

System functions HLL_LIM() and HLL_SIM() correspond to the STEP 5 commands LIM andSIM; they are used to set and clear disable identifiers for the processing levels of the PLCprogram. The disabling of processing levels is intended to protect program sections frominterruption by higher-level processing levels (e.g. timed interrupt processing).

The disable identifiers are stored in a byte. The disable identifier byte is read with theHLL_LIM() function and written back with HLL_SIM(). The HLL program can change thedisable identifier between reading and writing the disable identifier byte.

Parameters of system functions HLL_LIM() and HLL_SIM():

Parameter Type Value range Meaning

1 Pointer See below Pointer to byte with disableidentifier for OB 2 to OB 7

Example:

Read disable identifiers:

PL/M: call HLL_LIM (@ dis_id_byte);C: HLL_LIM (& dis_id_byte);

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–9SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.4.6 HLL_LIM(), HLL_SIM(), Disable and Enable OBs

Structure of the disable identifier byte:

The disable identifiers for the processing levels are stored in a byte in which the numbers ofthe bits correspond to the assigned OB number:

Bit number: 7 6 5 4 3 2 1 0Processing level: OB 7 OB 6 OB 5 OB 4 OB 3 OB 2 --- ---

An enabled bit means that the processing level is disabled. A disabled bit means that theprocessing level is enabled.

Procedure for enabling and disabling processing levels

Read disable identifiers: Call HLL_LIM(), parameter: pointer to byte for storing disableidentifiers

Enable disable identifier(s): Set identifiers (bits) of OBs to be disabled by logical ORoperation with a mask

Write disable identifiers: Call HLL_SIM(), parameter: pointer to byte with the modifieddisable identifiers

... the protected program section begins at this point. Requests for the disabled OB or OBsare saved by the PLC operating system. Not more than one request is saved for each disabledOB. Further requests are lost, but are counted for diagnostics purposes (DB 1).

Read disable identifiers: Call HLL_LIM(), parameter: pointer to byte for storing disableidentifiers

Clear disable identifier(s): Clear identifiers (bits) of disabled OBs by logical ANDoperation with a mask

Write disable identifiers: Call HLL_SIM(), parameter: pointer to byte with the modifieddisable identifiers

... the protected program section ends at this point. The requests saved by the PLC operatingsystem for the disabled OBs are now processed. If required, you can read from diagnosticsdata block DB 1, DW 16...21 how many, if any, requests for the various OBs have been lost.

Notes:

• No processing level should be disabled for longer than absolutely necessary.

• When processing disable identifiers, only those identifiers should be modified which arerelevant for the protection of the program section. This applies both to setting andresetting of disable identifiers.

• Several disable identifiers can be set or cleared simultaneously.

• If a request for the OB was saved when the disable identifier was reset, the previouslydisabled processing level is processed before the HLL program is continued after thedisable identifiers are reset.

• The indication of lost requests in DB 1 may already have been changed by the previouslydisabled processing level before the HLL program evaluates the data stored there.

• Flag FB 6.1 indicates whether a request for an OB has been lost (group identifier for allOBs).

5–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 5 Interfaces of the HLL Block

5.4.7 HLL_STOP(), Initiate System Stop

5.4.7 HLL_STOP(), Initiate System Stop

System function HLL_STOP() is used to branch to the defined stop state of the PLCoperating system. When HLL_STOP() is called, an error number defined by the HLLprogrammer can be passed as a call parameter.

The fine error coding of the PLC can be queried at address 0F0000H. When a system stop isinitiated by HLL_STOP(), identifier 0DDH is stored there; the error number passed as aparameter to HLL_STOP() can be read out from address 0F0001H.

Parameter of system function HLL_STOP():

Parameter Type Value range Meaning

1 Word 0...65535 Error number defined by HLLprogrammer

Example:

System stop with error number 1234:

PL/M: call HLL_STOP (1234);C: HLL_STOP (1234);

5.5 PLC System Data

In the following sections, please note:

The names used in the description of the system data are the identifiers assigned to thesystem data by the block generator. Names beginning with X (e.g. XBINERG) identify pointers.

5.5.1 Overview

The following list provides an overview of the available system data. The specified names arereserved for the system interface to the PLC. They may not be used to declare other objects.

The HLL function blocks can presently access the following PLC system data:

Name: Task:

E_Byte Input areaA_Byte Output areaM_Byte Flag areaZeit STEP 5 timersZaehler STEP 5 counters

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–11SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.5.1 Overview

XAKOBNR Pointer to active OB no.Akt_OB_Nr Active OB no.

XDIGERG Pointer to status bitsXBINERG " " "Bin_DigA Status bits for PLC system with ACOPBin_ErgA " " " " COPDig_ErgA " " " " "

XDBLAEN Pointer to length array DB_LaengeDB_Laenge Length of opened DB

XDSPVER Pointer to memory management dataSp_Verw Structure with memory management dataPHANFGP Start address of user program memoryPHENDEP End address "PHANFGD Start address of user data memoryPHENDED End address "GREBESP Boundary address of assigned user program memoryGREBEOP " " " "GREBESD Boundary address of assigned user data memoryGREBEOD " " " "

DB_LST List with block addresses and identifiersDX_LST " " " " "PB_LST " " " " "SB_LST " " " " "FB_LST " " " " "FX_LST " " " " "OB_LST " " " " "

PeE I/O address listPeA "QeE Address list for extended I/OQeA " " "

5.5.2 I/Q/F/C/T Areas

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

The meaning of the I/Q/F areas is described

in the Configuring Guide "Interface Description Part 1, Signals".

You will find further information on counters and timers

in the "Configuring the PLC 135 WB" documentation.

5–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.5.2 I/Q/F/C/T Areas

5.5.2.1 Process Images

Input area, image of inputs

E_Byte: IB 0

IB 1

IB 127

Output area, image of outputs

A_Byte: QB 0

QB 1

QB 127

E_Byte, A_Byte: Byte arrays of defined size; for a description, please refer to theConfiguring Guide "Interface Description Part 1, Signals".

5.5.2.2 Flag Area and Extended Flag Area

Flag area

M_Byte: FB 0

FB 1

FB 255

M_Byte: Array with flag bytes FB 0 to FB 255.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–13SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.5.2 I/Q/F/C/T Areas

5.5.2.3 Timers and Counters

Timers

Timer T 0

T 1

T 127 (255)

Format of a timer:

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

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Timer value (0...999)

FMF: Edge flag for FT command

FMS: Edge flag for Sxt command

Time base: 00 =̂ 0.01 seconds01 =̂ 0.110 =̂ 1.011 =̂ 10.0

ZKS: Additional identifier for status generation0 = Timer not running1 = Timer running

ZWG: Identifier for "timer valid"

Note:

FT command: Input a timerSxT command: Start a timer

Timer: Array with timer data, one word long. The number of available timersdepends on the version of software on the PLC.

On PLC systems with ACOP, the timers cannot be started from HLLblocks.

5–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.5.2 I/Q/F/C/T Areas

Counters

Counters: C 0

C 1

C 127 (255)

Format of a counter:

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

0

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

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Counter value (0...999)

Counter value (0...999)

FMF: Edge flag for FZ command

FMS: Edge flag for SZ command

FMR: Edge flag for ZRZ command

FMV: Edge flag for ZVZ command

Counter status: 0 =̂ Contents 01 =̂ Contents > 0

Note:

FZ command: Enable counterSZ command: Set counterZRZ command: Counter countdownZVZ command: Counter count up

Counter: Array with counter data one word in length. The number of availablecounters depends on the version of software on the PLC.

On PLC systems with ACOP, the counters cannot be started from HLLblocks.

5.5.3 Interpreter Data

The interpreter data comprise the status bits for binary and digital operations as well as theactive OB number.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–15SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.5.3 Interpreter Data

5.5.3.1 Status Bits on PLC Systems with COP/ACOP

The format of the status bits is different on PLC systems with COP and PLC systems withACOP.

Status bits on PLC systems with COP:

ORFCRLO

Bit 7 ...... 2 1 0

XBINERG Bin_ErgA

XBINERG: Pointer to the status bits for binary operations

Bin_ErgA: Byte with status bits OR, FC, RLO; please refer to "Configuring thePLC 135 WB" for description

OVEROSCC1CC0

Bit 7 ... 3 2 1 0

XDIGERG Dig_ErgA

XDIGERG: Pointer to the status bits for digital operations

Dig_ErgA: Byte with status bits OVER, OS, CC0 and CC1; please refer to"Configuring the PLC 135 WB" for a description

5–16 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.5.3 Interpreter Data

Status bits on PLC systems with ACOP:

The status bits for binary and digital operations are combined in one word on PLC systemswith ACOP:

Bit 15 ... ... 8 7 6 5 4 3 2 1 0

OSOVERCC0 CC1

XBINERG Bin_DigA

ORFCRLO

XBINERG: Pointer to status bitsBin_DigA: Word with status bits for binary and digital operations

5.5.3.2 Active OB No.

XAKOBNR Akt_OB_Nr

XAKOBNR: Pointer to active OB no.

Akt_OB_Nr: Number of active organization block; corresponds to the processinglevel in which the HLL block has been called up.

5.5.4 Processing of Data Blocks

For data memory, the user can choose from data blocks of both types (DB and DX) up to alength of 2043 words each. Data blocks are also used as an interface to the variouscomponents of the numerical control and other PLC programs. The efficient processing of datablocks is a key factor in HLL programming.

When data blocks are accessed from HLL blocks, the PLC operating system is not capable ofperforming the usual STEP 5 checks for range violations. Particular care must therefore betaken in the HLL program to ensure that data are not read or written beyond the boundaries ofthe data block. Accesses to non-existent data blocks should also be avoided.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–17SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL BLock 11.92

5.5.4 Processing of Data Blocks

5.5.4.1 Global Declaration of Data Blocks

Data blocks must be declared in the data segment of the HLL block (i.e. global in PL/M; globalor static in C). Since only one data block can be active at a time, it is sufficient to reserveenough memory for the longest data block used. If several data blocks of different structuresare used, the memory reserved for the longest data block must be redefined by appropriatedeclarations.

The data block declared in the HLL block must be the only object declared in the datasegment of the HLL block. The data block must be located at the beginning of the datasegment; this is automatically the case if the data block is the only globally defined object andno ORG or similar instruction is used.

5.5.4.2 Opening Data Blocks

Each data block must be opened before the data are processed. System function HLL_ADB()is provided for opening data blocks. Opening a data block has the effect of associating thedata block declared globally in the HLL block with the opened data block. Accesses to the DBdeclared in the HLL block are then applied directly to the open DB.

Caution:

A DB must be opened before the first access to the DB declared in the HLL block. Datablocks using offsets in OB 180 (addressing of data words greater than 255) must be openedagain, since the size of the offset is not detected by the PLC system.

5.5.4.3 Length of the Active Data Block

DB_LaengeXDBLAEN

XDBLAEN: Pointer to a word in which the length of the opened data block isgiven. XDBLAEN is returned by system function HLL_ADB().

DB_Laenge: DB_Laenge specifies the number of the last data word in the openDB.

5–18 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL BLock

5.5.4 Processing of Data Blocks

5.5.4.4 Processing of Data Blocks with Pointers

Data blocks can also be processed using pointers. The required addresses are stored in theblock address lists DB_LST and DX_LST (see the section entitled "Block Address Lists").The advantage of processing data blocks with pointers is that you can access several datablocks simultaneously, since you do not have to open the data blocks.

Data blocks have a data block header before the first data word (DW 0). The length of the datablock can be read from the DB header. The length array, which is one word in length, is theword immediately before DW 0 of the data block.

You will find an example for processing data blocks with pointers in the section entitled"Programming with C". It is also possible to process data blocks using pointers in PL/M. Sincethe use of pointers in PL/M is restricted due to safety reasons, it is necessary to perform typeredefinitions on the pointers for convenient address calculation.

Note:

The reader is reminded that range checks should be included in the HLL block. It is theresponsibility of the programmer to ensure that the data block being processed actually existsand that no accesses are made beyond the boundaries of the block.

5.5.5 Memory Management

Certain key memory management data are made available to the HLL program by the PLC.The start and end addresses of the user program memory and the user data memory arestored in a table (structure Sp_Verw) along with the start address of the remaining freememory.

The start and end address parameters for memory management always refer to paragraphboundaries. An offset therefore does not have to be specified for these addresses. The offsetmust be added by the HLL program according to the method described below.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–19SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL BLock 11.91

5.5.5 Memory Management

The address parameters of the memory management are byte-oriented.

Start of the user program memory

End of the user program memory

Start of the user data memory

End of the user data memory

Boundary of the assigned user programmemory (segment, offset)

Boundary of the assigned user datamemory (segment and offset)

XDSPVER PHANFGP

PHENDEP

PHANFGD

PHENDED

GREBESP

GREBEOP

GREBESD

GREBEOD

The boundary addresses of the assigned user program and user data memory each indicatethe address of the first free byte. The individual entries (PHANFGP, ...) are addressed via thestructure Sp_Verw.

Format of the memory boundary addresses; offset to be added

Bit 19 4 3 0

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

F

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

0

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

F

Absolute start address of user data memory

PHANFGP

PHENDEP

PHANFGD

PHENDED

Absolute end address of user program memory

Absolute end address of user data memory

Absolute start address of user program memory

Bit 19 4

GREBESP Absol. address of assigned user progr. memory

GREBESD Absolute address of assigned user data memory

GREBEOP

Bit 3 0

Residual offset

Residual offset

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

0

GREBEOD

5–20 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 5 Interfaces of the HLL Block

5.5.6 Block and I/O Address Lists

5.5.6 Block and I/O Address Lists

5.5.6.1 Block Address Lists on PLC Systems with COP/ACOP

The following block address lists are provided:

DB_LST for data blocks of type DBDX_LST for data blocks of type DXSB_LST for STEP 5 step blocksPB_LST for STEP 5 program blocksFB_LST for function blocks of type FBFX_LST for function blocks of type FXOB_LST for organization blocks

The address parameters in the block address lists contain the start and jump addresses foreach of the blocks. The block number serves as an index in the table; each entry has thelength of a doubleword.

All block address lists have 256 entries numbered from 0 to 255. The format of the addressparameters in the block lists depends on the PLC system.

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

L

H

L

H

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Add. 4 MSB 0 0 0 0

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Address 16 LSBa a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Offset

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Segment

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

L

H

L

H

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

7 0

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

COP

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

ACOP

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

7 0a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

X X X X

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Distinction betweenhigh-level language/STEP 5 blocks00 = Step 5 block<> 0 = HLL blockSystem identifiers

Notes:

• If an address entry has the value 0 (e.g. the 16 LSB and the 4 MSB), the block does notexist.

• On PLC systems with ACOP, bits 0...11 must be masked in the segment part if theaddress is to be used.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–21SINUMERIK 840/880 Part 1 (PJ)

5 Interfaces of the HLL Block 11.92

5.5.6 Block and I/O Address Lists

5.5.6.2 I/O Address Lists on PLC Systems with COP/ACOP

The following I/O lists are provided:

PeE Address list for inputs of I/OPeA Address list for outputs of I/OQeE Address list for inputs of extended I/OQeA Address list for outputs of extended I/O

The address lists consist of 256 address entries for I/O bytes PY 0 to PY 255 (or QY 0 to QY255); a distinction is made between inputs and outputs. The lists QeE and QeA are onlyavailable on PLC systems with ACOP.

The format of the I/O address lists is, like the format of the block address lists, dependent onthe PLC system. In order to avoid having to make changes to the source code of existingprograms when changing to PLC systems with ACOP, allowance must be made for thedifferent format of the address lists (e.g. through conditional compilation).

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Address 16 LSBa a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

Offset

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a

Segment

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

L

H

L

H

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

7 0

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

COP

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

ACOP

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

7 0a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

L

H

L

H

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Add. 4 MSB 0 0 0 0

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

X X X X X X X

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Identifier for byte or wordaccess0 = Byte access only1 = Word access also

Notes:

• If an address entry has the value 0 (e.g. the 16 LSB and the 4 MSB), the I/O byte is notassigned, i.e. the I/O does not exist.

• On PLC systems with ACOP, bits 0...11 must be masked in the segment part if theaddress is to be used.

• The process image for the addressed I/O is updated on direct accesses to the I/O fromSTEP 5 programs. This is not the case on direct accesses made from HLL blocks. TheHLL program must update the process image explicitly.

5–22 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 6 Format of the Module Header

6.1 Task of the Module Header

6 Format of the Module Header

6.1 Task of the Module Header

The module header contains the following information for the block generator:

• Block type and block number• Block name and library number• PLC system• Names and types of call parameters for block

The parameters in the module header of the block can be edited by the user; in earlierversions of the block generator this was the only way of modifying the block interface.

Notes:

• It is not necessary to modify the module header for blocks created with Version 2.2 of theblock generator.

• Errors can arise in certain cases where blocks created with earlier versions of the blockgenerator are processed by the new block generator. Always create a backup copy of theblock before it is processed. Please refer also to the notes in the section entitled"Operation".

• You will find examples of module headers in the section entitled "Example Programs" andin the descriptions of the module bodies for PL/M and C.

• The interface of the HLL block to the system data and the system functions cannot bemodified by editing the source program.

• The compiler statements entered in the module body by the block generator may not bechanged.

6.2 Call Parameter Definitions in the Module Header

With effect from Version 2.1 of the block generator, it is no longer necessary to define callparameters by entering them directly in the module header, however it is still possible to dothis.

Changing the block key data

The following points should be considered when changing the block key data in the moduleheader:

• The texts "Type", "Number", "Name", "Lib. Number" and "PLC System" may not bechanged; the appended colon may not be deleted. No distinction is made between upperand lower case during evaluation of the fields. Permissible value ranges are:

– Block type: "FB" or "FX"– Block number: 0...255– Block name: Up to 8 characters of STEP 5 character set beginning with a

letter– Library number: 0...99999; if no library number is specified, 0 is used as the

default.

– PLC system: One of the following texts:"1 (PLC 135WB with COP)""2 (PLC 135WB with ACOP)"

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–1SINUMERIK 840/880 Part 1 (PJ)

6 Format of the Module Header 11.92

6.2 Call Parameter Definitions in the Module Header

Modification and addition of call parameters

When defining call parameters directly in the module header, please note:

• All call parameters must be defined in a contiguous block. Empty lines can, however, beinserted for greater clarity of presentation.

• Each parameter entry must be inserted between comment characters. The comment canextend over several lines; the parameter definition is terminated only with the end of thecomment. All characters between the parameter declaration and the end of the commentare treated as comments and are not evaluated.

• All comment entries which do not conform to the standard definition of a call parameter aredeleted during processing of the block interface in Menu 5 "Define/Change BlockInterface".

• The definition of call parameters within comment characters consists of the parametername, colon and parameter type (in that order). The name can be up to 4 characters inlength and must begin with a letter. All characters permitted in PL/M or C variabledeclarations may follow, with the exception of the underscore (_). Please note with C thata distinction is made between upper and lower case letters. The block generator createsparameter names in upper case letters.

Example:

/* INP1: I BI */

• The declaration of parameter type and data type must use the following identifiers:

QQQQ

BIBYDW

for outputfor outputfor outputfor output

BitByteDoublewordWord

DDDDDDDD

KSKFKGKHKMKTKYKC

for constantfor constantfor constantfor constantfor constantfor constantfor constantfor constant

ASCIIFixed pointFloating pointHexaBit mapTimer valueByteCounter value

IIII

BIBYDW

for inputfor inputfor inputfor input

BitByteDoublewordWord

T for timer

C for counter

• The block of the parameter definition is complete when– a comment does not contain a colon, or– an illegal parameter name is specified between the start of the comment and the colon

(e.g. longer than 4 characters) and an illegal data type follows the colon.

6–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 6 Format of the Module Header

6.2 Call Parameter Definitions in the Module Header

Examples of valid parameter definitions:

/* TYPE : FB *//* Number : 234 *//* Name : EXAMPLE */

/* emil : I BI Parameter 1 *//* q123 : T Time between a) event 1 and

b) event 2 *//* a$a : C */

/* TYPE : FX *//* Number : 234 *//* Name : N@n0n@N */

/* e : I BI *//* q123 : T Time between event 1 and event 2 *//* a$a : Z */

Examples of illegal parameter definitions:

/* TYPE FB */

/* Number : 234 */

/* Lib.Number : 1234 */

/* Name : N_n:n_N */

/* emil_1 : I BI Parameter 1 */

/* q123 : T Time between a) event 1 and */

b) event 2 */a$a : C */

/* e@aus : C */

/* kenn : Q Bit */

/* 1.par : D KS */

Missing colon, i.e. start of parameter block is not detected Incorrect syntax in identification text Incorrect sequence of parameters Illegal character in block name (_) Name too long Comment for parameter is terminated at the end of each line, i.e. the next line is

interpreted as the end of the parameter block No comment start, i.e. is not interpreted as parameter Illegal character in parameter name Incorrect parameter type Name does not begin with a letter

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–3SINUMERIK 840/880 Part 1 (PJ)

6 Format of the Module Header 11.92

6.3 Evaluation of the Module Header by the Block Generator

6.3 Evaluation of the Module Header by the Block Generator

6.3.1 Operating Situations in which the Module Header is Evaluated

The block generator interprets the entries in the module body in the following operatingsituations:

• When the block key data are entered in Menu 1 (block name, library number and PLCsystem)

• When the block interface is modified in Menu 5 "Define/Change Call Parameters", the callparameters in the module header are used to generate the block symbol. (When you exitMenu 5, a new block header is written).

• Before the block is compiled, the block header is interpreted and new declarations aregenerated for the call parameters.

• Before the program editor is called from the block generator, new declarations aregenerated for the call parameters on the basis of the parameters in the module header.

6.3.2 Criteria for Cancellation of Evaluation of the Module Header

The block generator terminates the evaluation of the module header if

• the block type, number, name, library number or PLC system contain errors

• comment lines contain illegal call parameter definitions

• it detects a line that is not a comment line.

6–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 7 Programming with PL/M

7.1 Language-Specific Features of PL/M

7 Programming with PL/M

7.1 Language-Specific Features of PL/M

This chapter describes the language-specific features of HLL block generation with the PL/M-86 programming language.

• The PL/M module body and its declarations are language-specific; the PL/M module bodyis created by the block generator as a starting basis for your PL/M block.

• The option of performing a parameter check when calling other HLL blocks is onlyavailable for PL/M.

• The "Example Programs" section contains a collection of small program excerpts.

• Notes are provided for the use of upper and lower case letters in PL/M blocks.

• The PL/M identifiers reserved by the block generator are listed.

You will find further information for the generation of HLL blocks in Chapter 5. This chaptercontains special information which is not dependent on the programming language used.

7.2 Format of the PL/M Module Body

The block generator creates a module body when generating a new PL/M function block. Thismodule is the starting basis for your PL/M block.

The components of the module body are described below. This description is followed by alisting of a PL/M module body containing declarations of all PLC system data and functionsand all parameter data types. The listing is based on a PL/M block intended for use on a PLCsystem with ACOP. Fewer system data and functions can be used on PLC systems with COP;certain other deviations also arise in the format of the status bits (see the section entitled"System Data").

The PL/M module body consists of the following components:

Module header

The block generator stores the block data in comment lines in the module header (see thesection entitled "Format of the Module Header").

Compiler statements

The compiler statements define the memory model required by the PL/M function block foroperation on the PLC 135 WB. A subsystem is also specified that contains the components ofthe interface to the PLC system data and functions. FAR references are generated to thesesystem interface components; NEAR references are used within the PL/M block.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–1SINUMERIK 840/880 Part 1 (PJ)

7 Programming with PL/M 11.92

7.2 Format of the PL/M Module Body

Label and module block

The PL/M block contains a label corresponding to the abbreviation for the block (see thedescription of Menu 4). The counterpart of the external DO block, which surrounds themodule, is the END statement in the last line of the block program. The block abbreviation isspecified again at this point.

Literally declarations

The literallies for the parameter types BIT, CHAR and MASK are declared here. User literalliescan also be declared here.

External declaration of the system functions and data

The system data and functions which you define in Menu 6 are declared here. The start andend of this component are indicated by comments:

/* S5HLL System Data START */

:

Declarations

:

/* S5HLL System Data END */

These comments are an essential part of the module body and may not be deleted ormodified.

When changes are made to the block interfaces, the block generator deletes the entire areabetween the two comments and generates a new one. If you have made changes in this area,the changes are deleted.

Constants

This component is used for the declaration of constants.

Procedure declaration for the main program

The main program for each PL/M block is called "function". The statement "END function" forthe procedure declaration can be found in the penultimate program line.

The procedure declaration contains the list of call parameters which you have defined in Menu5. Some of the parameters are passed to the stack in a different format than used in theprogram (for example, pointers are passed for output parameters).

The procedure has the attributes PUBLIC and REENTRANT. The PUBLIC attribute means thatthe main program of the PL/M block can be called from other programs. The procedure mustbe REENTRANT so that the local data of the procedure are stored in the stack instead of thedata segment. (The data segment of an HLL block is reserved solely for the processing of datablocks; please see the section entitled "Processing of Data Blocks").

Parameter declaration

The parameters of the parameter list are declared here. For output parameters, the appropriate"BASED" declaration for the passed pointer is included here for the parameter used in theprogram. The masks for bit parameters are also included at this point.

7–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 7 Programming with PL/M

7.2 Format of the PL/M Module Body

Local data

You can declare local data for your PL/M block after the declarations generated by the blockgenerator for the call parameters. Please remember that local data are not retentive, i.e. thecontent of local data is undefined every time the block is called. Data which are to retain theirvalue across multiple block calls (retentive data) must be stored in data blocks.

Main procedure statement part

The PL/M program text for the main program of the PL/M block begins at this point.

7.2.1 Module Body of a PL/M Block

Headings are inserted in the following listing for the purposes of clarity. The headings are not acomponent of the PL/M module body.

7.2.1.1 Module Header

/ * SIEMENS Block Generator S5-PL / M */

/ * Date: 27.03.91 Time: 19:52:19 * /

/ * Type : FB * /

/ * Number : 000 * /

/ * Name : TOOLVERW */

/ * Lib.number : 9135 * /

/ * PLC System : 2 (PLC 135WB with ACOP) * /

/ * IBI : I BI * /

/ * IBY : I BY * /

/ * IW : I W * /

/ * ID : I D * /

/ * DKH : D KH * /

/ * DKM : D KM * /

/ * DKF : D KF * /

/ * DKY : D KY * /

/ * DKS : D KS * /

/ * DKC : D KC * /

/ * DKT : D KT * /

/ * DKG : D KG * /

/ * T : T * /

/ * C : C * /

/ * QBI : Q BI * /

/ * QBY : Q BY * /

/ * QW : Q W */

/ * QD : Q D * /

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–3SINUMERIK 840/880 Part 1 (PJ)

7 Programming with PL/M 11.91

7.2.1 Module Body of a PL/M Block

7.2.1.2 Compiler Statements

$LARGE ( SUBS has DAT_COM; EXPORTS HLL_HLL, HLL_MACRO, HLL_S5,

$ DB_LST, SB_LST, PB_LST, FB_LST, OB_LST, DX_LST, FX_LST,

$ HLL_ADB, XDBLAEN, XDSPVER, XBINERG, XAKOBNR, PeE, PeA,

$ E_Byte, A_Byte, M_Byte, Zeit, Zaehler, HLL_STOP,

$ S_Merker, QeE, QeA, HLL_LIM, HLL_SIM)

$COMPACT ROM

$eject

7.2.1.3 Module Block and Literally Declarations

PFB000: DO;

/ *************************** /

/ * Literallies * /

/ *************************** /

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

7.2.1.4 External Declarations of System Data and Functions

/ ************************** /

/ * System Functions * /

/ * and * /

/ * System Data * /

/ ************************** /

/* S5HLL System Data START */

declare HLL_HLL pointer external;

declare HLL_MACRO pointer external;

declare HLL_S5 pointer external;

declare ( DB_LST, SB_LST, PB_LST, FB_LST,OB_LST, DX_LST, FX_LST ) (256) pointer

external;

declare XDBLAEN pointer external;

declare DB_Laenge based XDBLAEN word;

HLL_ADB: procedure (a,b) external;

declare a word;

declare b word;

end HLL_ADB;

7–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 7 Programming with PL/M

7.2.1 Module Body of a PL/M Block

declare XDSPVER pointer external;

declare Sp_Verw based XDSPVER structure

(PHANFGP word, PHENDEP word, PHANFGD word,

PHENDED word, GREBESP word, GREBEOP word,

GREBESD word, GREBEOD word);

declare (XBINERG, XAKOBNR) pointer external;

declare Bin_DigA based XBINERG word;

declare Akt_OB_Nr based XAKOBNR byte;

declare PeE (256) pointer external;

declare PeA (256) pointer external;

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (256) word external;

declare Zaehler (256) word external;

declare HLL_STOP pointer external;

declare S_Merker (4096) byte external;

declare QeE (256) pointer external;

declare QeA (256) pointer external;

declare HLL_LIM pointer external;

declare HLL_SIM pointer external;

/* S5HLL System Data END */

/ ************************** /

/ * Constants * /

/ ************************** /

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–5SINUMERIK 840/880 Part 1 (PJ)

7 Programming with PL/M 11.91

7.2.1 Module Body of a PL/M Block

7.2.1.5 Procedure Declaration of Main Program, Call Parameters

function:

PROCEDURE ( IBI,

IBI_MSK,

IBY,

IW,

ID,

DKH,

DKM,

DKF,

DKY,

DKS,

DKC,

DKT,

DKG,

T,

C,

QBI_ADR,

QBI_MSK,

QBY_ADR,

QW_ADR,

QD_ADR) PUBLIC REENTRANT;

DCL IBI BIT,

IBI_MSK MASK,

IBY BYTE,

IW WORD,

ID DWORD,

DKH WORD,

DKM WORD,

DKF WORD,

DKY WORD,

DKS WORD,

DKC WORD,

DKT WORD,

DKG DWORD,

T WORD,

C WORD,

QBI_ADR POINTER,

QBI BASED QBI_ADR BIT,

QBI_MSK MASK,

QBY_ADR POINTER,

QBY BASED QBY_ADR BYTE,

QW_ADR POINTER,

QW BASED QW_ADR WORD,

QD_ADR POINTER,

QD BASED QD_ADR DWORD;

7–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 7 Programming with PL/M

7.2.1 Module Body of a PL/M Block

7.2.1.6 Local Data and Statement Part

/ ************************** /

/ * Declaration of * /

/ * Local Data * /

/ ************************** /

/ ************************** /

/ * Statement Part * /

/ * Main Procedure * /

/ ************************** /

END function;

END PFB000;

7.3 Parameter Check for HLL Calls in PL/M

If required, the block generator can check whether the call parameters passed by the PL/Mblock when calling other PL/M blocks formally match the call parameters of the called block.

During the parameter check, the block generator calculates the number, sequence and type ofcall parameters passed from the PL/M block to system function HLL_HLL(). The blockgenerator compares these values with the comments stored in the module header of the calledPL/M block which describe the input and output parameters.

Only the PL/M data types of the PL/M variables or constants specified in the HLL_HLL() callare compared. If the called block is a C block, it is not possible to perform a parameter check.

During the parameter check, the block generator expands any existing literallies andincorporates include files.

When passing constants in the HLL_HLL() call, the block generator makes allowance for thefact that PL/M passes them as bytes, words or doublewords, according to their size, if noexplicit type conversion functions (LOW, HIGH, INT, etc.) are used.

String constants are illegal when calling HLL_HLL(), except to specify the type of block called.

7.3.1 Parameter Data Types Recognized in the Parameter Check

The parameter check can only be performed on single variables. In other words, theHLL_HLL() call may not contain expressions or other function calls (even literallies). The onlyexceptions to this rule are the following built-in functions:

DOUBLE, LOW, HIGH, ROL, ROR, SHL, SHR, SAL, SAR, BUILD$PTR, OFFSET$OF, SIZE,LAST, LENGTH, SIGNED, UNSIGN, INT, IBS

Any expressions, including function calls, can be entered at index positions (array index) orafter the address operator. The type of array elements or (in the case of an address operator)a pointer is returned as the variable type.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–7SINUMERIK 840/880 Part 1 (PJ)

7 Programming with PL/M 11.92

7.3.2 Cross-Reference List

7.3.2 Cross-Reference List

When the block generator checks the compatibility of the parameters in HLL_HLL() calls, itgenerates a list (cross-reference list) of the HLL function blocks which are invoked by thefunction block checked.

The directory in which the lists are stored then contains a file named PFX???.CRF orPFB???.CRF with the following structure:

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * ** ** SINUMERIK Block Generator S5-PL/M Version 2.2 Date 10.08.91 ** Directory of all blocks called from: FB 8 Page 1 ** ** * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

BlockType Number Name

Called inFile name Line Parameters

FB 2 I/Q/F PFB008.PLM 99 NR : D KFNR1 : I BY

7.4 Brief Examples for PL /M

Example 1: Differences in parameter formats

This example shows the effects of the different data formats in PL/M and STEP 5.

Logic operation:

All bits in DW 100 are to be masked, except for bit 14. The result is to be transferred to DW200.

STEP 5: L KH 4000L DW 100UWT DW 200

PL/M: DW(200) = DW(100) and 0040h;

(with corresponding PL/M declaration of IW as input word and IB as input byte)

Example 2: Evaluate bit parameter

This example shows the effect of bit parameter conversion on the formulation of queries.

Assumption: You have defined a binary input parameter INP1. You want to program a branchbased on the state of this input bit.

7–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 7 Programming with PL/M

7.4 Brief Examples for PL/M

With conversion of the input bit parameter (operating system data BS 0.1 = 1), the query is asfollows, for example:

:

if (INP1 = 1) then

:

else

:

Without conversion (BS 0.1 = 0)::

if (INP1_MSK = (INP1 and INP1_MSK)) then

:

else

:

Example 3: Indexing of data words in PL/M and STEP 5

Here again, the difference between Step 5 and PL/M relates to the addressing method.

STEP 5 PL/M

IW 5 =̂ IB5 IB6 IW(5) =̂ IB(10) IB(11)

ID 5 =̂ IB5 IB6 ID(5) =̂ IB(20) IB(21)IB7 IB8 IB(22) IB(23)

(with corresponding PL/M declaration of IW as an input word and IB as an input byte)

Example 4: Constant as word parameter for function macros

Call FB 61 from PL/M block:

Read in R parameter 50 from Channel 1 in DB 200, DW 250 and 251.Numeric format: Fixed pointInterface byte: No. 1 (DB 36/DL 0)Read signal: Flag 200.5

Direct specification of parameters in the call:

CALL HLL_MACRO ( 'DB', 250, 200, 'F0', 0, 50, 1, ' ', 'NC', 'RP', 1, 1,

SHR (M_BYTE (200), 5), 61);

Here, all numeric values (such as DW number 250) are passed as bytes; the high byte of theparameter is undefined. In certain circumstances, this can lead to error messages in FB 61.

The FB 61 call should therefore be programmed as follows:

DECLARE NSBY WORD DATA (1);

DECLARE ANZ WORD DATA (1);

DECLARE DTY1 WORD DATA ('RP');

DECLARE DTY2 WORD DATA ('NC');

DECLARE DTY3 WORD DATA (' ');

DECLARE WER1 WORD DATA (1);

DECLARE WER2 WORD DATA (50);

DECLARE WER3 WORD DATA (0);

DECLARE ZFPN WORD DATA ('F0');

DECLARE DBZI WORD DATA (200);

DECLARE DWZI WORD DATA (250);

DECLARE TYZI WORD DATA ('DB');

CALL HLL_MACRO ( TYZI, DWZI, DBZI, ZFPN, WER3, WER2, WER1, DTY3, DTY2, DTY1, ANZ, NSBY,

SHR (M_BYTE (200), 5), 61);

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–9SINUMERIK 840/880 Part 1 (PJ)

7 Programming with PL/M 11.92

7.4 Brief Examples for PL/M

Example 5: Use of the status bits after HLL_S5()

The example shows how to query the result of binary logic after a STEP 5 program or stepblock call.

:

if (bin_processing = 1) then

do;

call HLL_S5 ('PB', 122);

if ((Bin_ErgA and 01H) = 1) then / * RLO equal to 1 ? * /

do;

:

end;

end;

else

:

Example 6: System stop and passing of error number

In this case, an error number is passed on a user-initiated system stop.

DECLARE FEHL_COD_A LITERALLY 204

:

if (error_flag = 1) then

do:

call HLL_STOP (FEHL_COD_A):

:

7.5 Rules for Upper and Lower Case Notation

No distinction is made in PL/M between upper and lower case letters. There are twoexceptions, however. The block generator or PLC system expects the pseudoparameters 'DB'and 'DX' when a data block is opened, and 'FB' or 'FX' when an HLL block is called in uppercase letters.

7.6 Reserved Identifiers

In addition to the PL/M identifiers listed below, which are reserved either for the blockgenerator or PL/M itself, the names of PLC system data and functions may not be used in userdeclarations. The identifiers reserved by the system data and system functions are describedin the sections entitled "Overview of System Data" and "Overview of System Functions".

Please consult the compiler manual for information about identifiers reserved for the compiler.

Identifiers reserved for the block generator:

functionTypeNumberNameLib.numberBITCHARMASK

7–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 7 Programming with PL/M

7.6 Reserved Identifiers

Identifiers reserved for the PL/M compiler:

ABS ADJUSTRPL ADRESSINITIAL

AND AT BASED

BLOCKINPUT BLOCKINWORD BLOCKOUTPUT

BLOCKOUTWORD BUILDPTR BY

BYTE CALL CARRY

CASE CAUSEINTERRUPT CMPB

CMPW DATA DEC

DECLARE DISABLE DO

DOUBLE DWORD ELSE

ENABLE END EOF

EXTERNAL FINDB FINDRB

FINDRW FINDW FIX

FLAGS FLOAT GETREALERROR

GO GOTO HALT

HIGH IABS IF

INPUT INT INTEGER

INTERRUPT INTERRUPTR INTREALMATHUNIT

INWORDSETB LABEL LAST

LENGTH LITERALLY LOCKSET

LOW MEMORY MINUS

MOD MOVB MOVE

MOVRB MOVRW MOVW

NIL NOT OFFSETOF

OR OUTPUT OUTWORD

PARITY PLUS POINTER

PROCEDURE PUBLIC REAL

REENTRANT RESTOREREALSTATUS RETURN

ROL ROR SAL

SAR SAVEREALSTATUS SCL

SCR SELECTOR SELECTOROF

SETINTERRUPT SETW SHL

SHR SIGNED SIZE

SKIPB SKIPRB SKIPRW

SKIPW STACKBASE STACKPTR

STRUCTURE THEN TIME

TO UNSIGN WHILE

WORD XLAT XOR

ZERO

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–11SINUMERIK 840/880 Part 1 (PJ)

11.92 8 Programming with C

8.1 Language-Specific Features of C

8 Programming with C

8.1 Language-Specific Features of C

This chapter describes the language-specific features of HLL block generation with the Cprogramming language.

• The C module body and its declarations are language-specific; the C module body iscreated by the block generator as a starting basis for your C block.

• In contrast to PL/M, the option of performing a parameter check when calling other HLLblocks is not provided.

• The "Programming Examples" section contains a collection of small program excerpts.

• The chapter shows how various type of data blocks can be accessed from C blocks.

• A description is given of how C macros can be used to access data in STEP 5 format.

• Notes are provided for the use of upper and lower case letters in C blocks.

• The C identifiers reserved by the block generator are listed.

You will find further information for the generation of HLL blocks in Chapter 5. This chaptercontains special information which is not dependent on the programming language used.

8.2 Format of the C Module Body

The block generator creates a C module body when generating a new C function block. Thismodule is the starting basis for your C block.

The components of the module body are described below. This description is followed by alisting of a C module body containing declarations of all PLC system data and functions and allparameter data types. The listing is based on a C block intended for use on a PLC systemwith ACOP. Fewer system data and functions can be used on PLC systems with COP; certainother deviations also arise in the format of the status bits (see the section entitled "SystemData").

The C module body consists of the following components:

Module header

The block generator stores the block data in comment lines in the module header (see thesection entitled "Format of the Module Header").

Definition of types and constants

The parameter data types byte, mask, bit, word, sword and dword are defined here.

User constants and types can also be defined here.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–1SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.91

8.2 Format of the C Module Body

External declaration of the system functions and data

The system data and functions which you define in Menu 6 are declared here. The start andend of this component are indicated by comments:

/* S5HLL System Data START */

:

Declarations

:

/* S5HLL System Data END */

These comments are an essential part of the module body and may not be deleted ormodified.

When changes are made to the block interfaces, the block generator deletes the entire areabetween the two comments and generates a new one. If you have made changes in this area,the changes are deleted.

Procedure declaration for the main program

The main program for each HLL block is called "FUNCTION".

The procedure declaration contains the list of call parameters which you have defined in Menu5. Some of the parameters are passed to the stack in a different format than used in theprogram (for example, pointers are used for output parameters).

Parameter declaration

The parameters of the parameter list are declared here. The pointers for output parameters arealso declared here.

The masks for bit parameters are also included at this point.

Local data

You can declare local data for your C block after the declarations generated by the blockgenerator for the call parameters. Please remember that local data are not retentive, i.e. thecontent of local data is undefined every time the block is called. Data which are to retain theirvalue across multiple block calls (retentive data) must be stored in data blocks.

Main procedure statement part

The C program text for the main program of the C block begins at this point.

8.2.1 Module Body of a C Block

Headings are inserted in the following listing for the purposes of clarity. The headings are not acomponent of the C module body.

8–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 8 Programming with C

8.2.1 Module Body of a C Block

8.2.1.1 Module Header

/* SIEMENS Block Generator S5-C */

/* Date: 11.04.91 Time: 13:43:12 */

/* Type : FX */

/* Number : 000 */

/* Name : TOOLVERW */

/* Lib.number : 9136 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* IBI : I BI */

/* IBY : I BY */

/* IW : I W */

/* ID : I D */

/* DKH : D KH */

/* DKM : D KM */

/* DKF : D KF */

/* DKY : D KY */

/* DKS : D KS */

/* DKC : D KC */

/* DKT : D KT */

/* DKG : D KG */

/* T : T */

/* C : C */

/* QBI : Q BI */

/* QBY : Q BY */

/* QW : Q W */

/* QD : Q D */

8.2.1.2 Definition of Types of Constants

/******************************/

/* Typedef and Constants */

/******************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

8.2.1.3 External Declarations of System Data and Functions

/*************************/

/* System Functions */

/* and */

/* System Data */

/*************************/

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–3SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.91

8.2.1 Module Body of a C Block

/* S5HLL System Data START */

/* Call other HLL blocks */

extern far void (* far HLL_HLL) ();

/* Call resisdent function macros */

extern far void (* far HLL_MACRO) ();

/* Call STEP 5 blocks */

extern far void (* far HLL_S5) ();

/* Process data blocks */

extern far void HLL_ADB (unsigned short int, unsigned short int);

#define DB_Laenge XDBLAEN

extern unsigned short far * far DB_Laenge;

/* Block address list */

extern unsigned short int * far DB_LST[256];

extern unsigned short int * far SB_LST[256];

extern unsigned short int * far PB_LST[256];

extern unsigned short int * far FB_LST[256];

extern unsigned short int * far OB_LST[256];

extern unsigned short int * far DX_LST[256];

extern unsigned short int * far FX_LST[256];

/* Boundary addresses for user memory */

#define Sp_Verw XDSPVER

extern struct

{

unsigned short int PHANFGP;

unsigned short int PHENDEP;

unsigned short int PHANFGD;

unsigned short int PHENDED;

unsigned short int GREBESP;

unsigned short int GREBEOP;

unsigned short int GREBESD;

unsigned short int GREBEOD;

} * far Sp_Verw;

/* Interpreter data */

#define Bin_ErgA XBINERG

extern unsigned int far * far Bin_ErgA;

#define Akt_OB_Nr XAKOBNR

extern unsigned char far * far Akt_OB_Nr;

8–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 8 Programming with C

8.2.1 Module Body of a C Block

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned short int far Zeit [256];

extern unsigned short int far Zaehler [256];

/* I / O address list [I / Q] */

extern unsigned short int far * far PeE [256];

extern unsigned short int far * far PeA [256];

/* System stop from HLL user program */

extern far void (* far HLL_STOP) (unsigned short int);

/* Extended flag area */

extern unsigned char far S_Merker [512];

/* Extended I / O address list [I / Q] */

extern unsigned short int far * far QeE [256];

extern unsigned short int far * far QeA [256];

/* Semaphores (LIM, SIM) */

extern far void (* far HLL_LIM) (unsigned char *);

extern far void (* far HLL_SIM) (unsigned char *);

/* S5HLL System Data END */

8.2.1.4 Procedure Declaration of Main Program, Call Parameters

FUNCTION (IBI,

IBI_MSK,

IBY,

IW,

ID,

DKH,

DKM,

DKF,

DKY,

DKS,

DKC,

DKT,

DKG,

T,

C,

QBI_ADR,

QBI_MSK,

QBY_ADR,

QW_ADR,

QD_ADR)

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–5SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.92

8.2.1 Module Body of a C Block

bit IBI;

mask IBI_MSK;

byte IBY;

word IW;

dword ID;

word DKH;

word DKM;

word DKF;

word DKY;

word DKS;

word DKC;

word DKT;

dword DKG;

word T;

word C;

bit * QBI_ADR;

mask QBI_MSK;

byte * QBY_ADR;

word * QW_ADR;

dword * QD_ADR;

8.2.1.5 Local Data and Statement Part

{

/ ************************* /

/ * Declaration of * /

/ * Local Data * /

/ ************************* /

/ ************************* /

/ * Statement Part * /

/ * Main Procedure * /

/ ************************* /

}

8.3 Brief Examples for C

Example 1: Differences in parameter formats

This example shows the effects of the different data formats in C and STEP 5.

Logic operation:

All bits in DW 100 are to be masked, except for bit 14. The result is to be transferred to DW200.

STEP 5: L KH 4000L DW 100UWT DW 200

C: DW[200] = DW[100] & 0x40;

(with corresponding C declaration of IW as input word and IB as input byte)

8–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 8 Programming with C

8.3 Brief Examples for C

Example 2: Evaluate bit parameter

This example shows the effect of bit parameter conversion on the formulation of queries.

Assumption: You have defined a binary input parameter INP1. You want to program a branchbased on the state of this input bit.

With conversion of the input bit parameter (operating system data BS 0.1 = 1), the query is asfollows, for example:

:if (INP1 == 1){

:}else{

:}

:

Without conversion (BS 0.1=0):

:if (EIN1_MSK == (INP1 & INP1_MSK)) then{

:}else{

:}

:

Example 3: Indexing of data words in C and STEP 5

The difference between STEP 5 and C relates to the addressing method.

STEP 5 CIW 5 =̂ IB5 IB6 IW[5] =̂ IB[10] IB[11]ID 5 =̂ IB5 IB6 ID[5] =̂ IB[20] IB[21]

IB7 IB8 IB[22] IB[23]

(with corresponding C declaration of IW as an input word and IB as an input byte)

Example 4: Constant as word parameter for function macros

Constants used as call parameters for function macros must always be passed as a wordparameter. Constants are always passed as word parameters in C programs and thereforeproblems do not arise in this case. Two methods for calling function macros are shown below.

Call FB 61 from C block:

Read in R parameter 50 from Channel 1 in DB 200, DW 250 and 251.Numeric format: Fixed pointInterface byte: No. 1 (DB 36/DL 0)Read signal: Flag 200.5

Direct specification of parameters in the call:

HLL_MACRO ( 'DB', 250, 200, 'F0', 0, 50, 1, '', 'NC', 'RP', 1, 1,

(M_Byte[200] >> 5), 61);

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–7SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.92

8.3 Brief Examples for C

Define and pass parameters as constants:

#define NSBY 1

#define ANZ 1

#define DTY1 'RP'

#define DTY2 'NC'

#define DTY3 ''

#define WER1 1

#define WER2 50

#define WER3 0

#define ZFPN 'F0'

#define DBZI 200

#define DWZI 250

#define TYZI 'DB'

HLL_MACRO ( TYZI, DWZI, DBZI, ZFPN, WER3, WER2, WER1, DTY3, DTY2,

DTY1, ANZ, NSBY, (M_Byte[200] >> 5), 61);

The names of the STEP 5 application interface enhance the legibility of the program.

Example 5: Use of the status bits after HLL_S5()

The example shows how to query the result of binary logic after a STEP 5 program or stepblock call.

:

if (bin_processing == 1)

{

HLL_S5 ('PB', 122);

if ((Bin_ErgA & 0x01) == 1) /* RLO is equal to 1? */

{

:

}

}

:

Example 6: System stop and passing of error number

In this case, an error number is passed on a user-initiated system stop.

#define FEHL_COD_A 204

:

if (error_flag == 1)

{

HLL_STOP (FEHL_COD_A);

:

}

:

8–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 8 Programming with C

8.4 Processing of Data Blocks

8.4 Processing of Data Blocks

Data blocks are declared in the HLL block as a global data area. In C blocks, data blocks canalso be declared at procedure level; they must then be assigned the attribute "static".

There are various ways of declaring a data block in C:

• Declare data block as word array:

unsigned int dat_blk[300]; /* Declare global array */

/* with 300 words */

FUNCTION (...) /* Main procedure of C block */

:

:

HLL_ADB ('DB', 100); /* Open DB 100 */

for (i=0; i<50; i++)

dat_blk [i] = 0xff00; /* Process DB 100 */

:

HLL_ADB('DX', 200); /* Open DX 200 */

for (i=0; i<150; i++)

dat_blk [i] = 0xbcd; /* Process DX 200 */

:

• Declare data block as data structure:

struct {

unsigned int tool_no;

unsigned int tool_tech;

unsigned char tool_name[10];

unsigned int tool_station;

}dat_blk[140]; /* Declare global array */

/* with 140 structure elements */

FUNCTION(...) /* Main procedure of C block */

:

:

HLL_ADB('DB', 100); /* Open DB 100 */

for (i=0; i<140; i++)

dat_blk[i].tool_no = i; /* Process DB 100 */

:

• Declare data block with different data structures:

union {

unsigned int dat_arr[300]; /* Declare global array */

/* with 300 words */

struct {

unsigned int tool_no;

unsigned int tool_tech;

unsigned char tool_name[10];

unsigned int tool_station;

} dat_str[140]; /* Declare global array */

/* with 140 structure elements */

} dat_blk;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–9SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.92

8.4 Processing of Data Blocks

FUNCTION(...) /* Main procedure of C block */

:

HLL_ADB('DB', 100); /* Open DB 100 */

for (i=0; i<50; i++)

dat_blk.dat_arr[i]=0xff00; /* Process DB 100 */

:

:

HLL_ADB('DX', 200); /* Open DX 200 */

for (i=0; i<50; i++)

dat_blk.dat_str[i].wz_tech = i; /* Process DX 200 */

:

• Declare data block at procedure level:

FUNCTION(...) /* Main procedure of C block */

:

static unsigned int dat_blk[300]; /* Declare local array */

/* with 300 words */

:

HLL_ADB('DB', 100); /* Open DB 100 */

for (i=0; i<50; i++)

dat_blk[i] = 0xff00; /* Process DB 100 */

:

• Access data blocks via pointer:

:

#define NULL 0L

:

FUNCTION(...) /* Main procedure of C block */

:

unsigned short int * far ptr_db_A; /* Declare pointer for */

unsigned short int * far ptr_db_B; /* access to data blocks */

ptr_db_A = ptr_db_B = NULL; /* Initialize pointer */

ptr_db_A = DB_LST[100]; /* Pointer to DB 100 */

ptr_db_B = DX_LST[200]; /* Pointer to DX 200 */

if ((ptr_db_A == NULL) ¦¦ (ptr_db_B == NULL))

HLL_STOP(22); /* Data block does not exist */

for (i=0; i<200; i++) /* Copy data blocks */

*(ptr_db_A + i) = *(ptr_db_B + i);

Notes:

• The user program is responsible for checking the processed data blocks.

• When HL_ADB() is called, the number of the last data word of the opened DB is enteredin system data DB_Laenge. This system cell can be addressed for checking purposes.

• When processing data blocks via pointers, the length can be read from the block header.

• The "access data blocks via pointer" example can only be used in this form for PLCsystems with COP. Bits 0...11 of the segment part of the address must be masked on PLCsystems with ACOP.

8–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 8 Programming with C

8.5 Use of C Macros

8.5 Use of C Macros

By defining macros, it is possible in C to implement data accesses in STEP 5 format or tosupport conversion to the intel format. It is also possible to transfer the notation whenaccessing data from STEP 5.

The macros below are described together with examples for their use.

• Read and write in byte format:

#define EB(x) E_Byte[x]

#define AB(x) A_Byte[x]

#define MB(x) M_Byte[x]

• Read in word format:

#define EW(x) (((unsigned short int) E_Byte[x] << 8) ¦ E_Byte[(x)+1])

#define AW(x) (((unsigned short int) A_Byte[x] << 8) ¦ A_Byte[(x)+1])

#define EW(x) (((unsigned short int) M_Byte[x] << 8) ¦ M_Byte[(x)+1])

• Read timers and counters:

#define T(x) ((Zeit[x] << 8)¦((unsigned short int) Zeit[x] >> 8))

#define Z(x) ((Zaehler[x] << 8)¦((unsigned short int) Zaehler[x] >> 8))

• Read I/O bytes:

#define E_PY(x) ((unsigned char) *PeE[x])

#define A_PY(x) ((unsigned char) *PeA[x])

• Byte and word access to data blocks:

For these macros, the data block must be declared in the C block as a global word arrayDB.

#define DL(x) ((unsigned char) DB[x])

#define DR(x) ((unsigned char) ((unsigned short int) DB[x] >> 8))

#define DW(x) ((DB[x] << 8) ¦ ((unsigned short int) DB[x] >> 8))

• Doubleword access to inputs/outputs/flags/data blocks:

For these macros, the preceding macros must be declared in the C block.

#define ED(x) ((((long int) EW(x)) << 16)¦EW((x)+2))

#define AD(x) ((((long int) AW(x)) << 16)¦AW((x)+2))

#define MD(x) ((((long int) MW(x)) << 16)¦MW((x)+2))

#define DD(x) ((((long int) DW(x)) << 16)¦DW((x)+2))

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–11SINUMERIK 840/880 Part 1 (PJ)

8 Programming with C 11.91

8.5 Use of C Macros

• Wordwise write access to inputs/outputs/flags/timers/counters/data blocks:

For the last of these macros, the data block must be declared in the C block as a globalword array.

#define TBY(z) ((((unsigned short int) z) >> 8) ¦ ((z) << 8))

#define WEW(x,y) (*((unsigned short int far *) &(E_Byte[x])) = TBY(y))

#define WAW(x,y) (*((unsigned short int far *) &(A_Byte[x])) = TBY(y))

#define WMW(x,y) (*((unsigned short int far *) &(M_Byte[x])) = TBY(y))

#define WTW(x,y) (*((unsigned short int far *) &(Zeit[x])) = TBY(y))

#define WZW(x,y) (*((unsigned short int far *) &(Zaehler[x])) = TBY(y))

#define WDW(x,y) (*((unsigned short int far *) &(DB[x])) = TBY(y))

• Examples for the use of the macros:

:

const unsigned char LED_BY_AN = 0xFF, LED_BY_AUS = 0;

:

unsigned int var1, var2; /* Local variables */

unsigned char var3;

:

:

var1 = DW(3); /* Read third data word */

AB(6) = MB(8) + 1; /* Read flag byte and write output byte */

var2 = EW(8) + EW(20); /* Read input words and process */

DL(2) = 1; /* Assign left byte from data word 2 */

if (MB(200) & 0x10) /* Branch depending on bit in flag byte */

AB(8) = LED_BY_AN;

else

AB(8) = LED_BY_AUS;

var3 = E_PY(5); /* Read input I / O byte */

WDW(120, 0xAA55); /* Write constant to data word 120 */

WAW(10, DW(4)); /* Write data word 4 to output word */

8.6 Rules for Upper and Lower Case Notation

A distinction is made in C between upper and lower case letters.

The block generator creates the call parameters of an HLL block in upper case letters. Thisshould always be remembered when using the parameters in the C function block.

The block generator or PLC system expects the pseudoparameters 'DB' and 'DX' when a datablock is opened, and 'FB' or 'FX' when an HLL block is called in upper case letters.

8–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 8 Programming with C

8.7 Reserved Identifiers

8.7 Reserved Identifiers

In addition to the C identifiers listed below, which are reserved either for the block generator orC itself, the names of PLC system data and functions may not be used in user declarations.The identifiers reserved by the system data and system functions are described in the sectionsentitled "Overview of System Data" and "Overview of System Functions".

Please consult the compiler manual for information about identifiers reserved for the compiler.

Reserved for the block generator:

functionTypeNumberNameLib.Numberbytemaskbitwordsworddword

Reserved for the C compiler:

auto break case

char const continue

default do double

else enum extern

float for goto

if int long

register return short

signed sizeof static

struct switch typedef

union unsigned void

volatile while

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–13SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1 Examples in PL/M

9 Example Programs

This chapter contains examples of function blocks programmed in the high-level languagesPL/M and C. These examples illustrate the use of the system interfaces, but are not intendedfor user programs.

9.1 Examples in PL/M

9.1.1 FB 1, Access to Data Blocks

FB 1 shows how to access a data block from a PL/M block.

The data block is declared globally. The various redefinitions (... at(@dataword (0))) allow byte,word or doubleword-oriented access to the data block. Access in STEP 5 format is alsosupported.

The data block must be opened before the first access (system function HLL_ADB()).

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:18:29 */

/* Type : FB */

/* Number : 001 */

/* Name : DBZUGR */

/* Lib.number : 12345 */

/* PLC System : 1 (PLC 135WB with COP) */

/* DBNR: D KF */ /* Number of DB to be opened */

/* DNR : I BY */ /* Number of a DW in the DB */

/* DTYP: D KS */ /* Data block type (DB or DX) */

/* INHA: I BY */ /* Desired value of the DW in the DB */

/* ERR : Q BI */ /* Error bit for parameter errors */

$LARGE (SUBS has DAT_COM; EXPORTS DB_LST, SB_LST, PB_LST, FB_LST, OB_LST, DX_LST,

$ FX_LST, HLL_ADB, XDBLAEN, E_Byte, A_Byte, M_Byte, Zeit, Zaehler)

$COMPACT ROM

$eject

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–1SINUMERIK 840/880 Part 1 (PJ)

9 Program Exampels 11.91

9.1.1 FB 1, Access to Data Blocks

PFB001: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare ( DB_LST, SB_LST, PB_LST, FB_LST,

OB_LST, DX_LST, FX_LST ) (256) pointer external;

declare XDBLAEN pointer external;

declare DB_Laenge based XDBLAEN word;

HLL_ADB:procedure (a,b) external;

declare a word;

declare b word;

end HLL_ADB;

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (128) word external;

declare Zaehler (128) word external;

/* S5HLL System Data END */

/***********************************************************/

/* Definition of an array for addressing */

/* in in data blocks (max. size: 2043 words); */

/* refers to the currently open DB */

/***********************************************************/

dcl dataword (256) word;

9–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 9 Example Programs

9.1.1 FB 1, Access to Data Blocks

/**************************/

/* Constants */

/**************************/

function:

PROCEDURE (DBNR,

DNR,

DTYP,

INHA,

ERR_ADR,

ERR_MSK) PUBLIC REENTRANT;

DCL DBNR WORD,

DNR BYTE,

DTYP WORD,

INHA BYTE,

ERR_ADR POINTER,

ERR BASED ERR_ADR BIT,

ERR_MSK MASK;

/**************************/

/* Declaration */

/* of Local Data */

/**************************/

/* The following declarations can be used to address */

/* a data block after the block has been opened with */

/* HLL_ADB(). Byte, word and doubleword-oriented or */

/* structured accesses (data left, data right) are supported */

dcl data byte (512) byte at (@dataword (0));

dcl dw1 (256) structure (dataleft byte, dataright byte) at (@dataword(0));

dcl ddw (128) dword at (@dataword(0));

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–3SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.1 FB 1, Access to Data Blocks

/***************************/

/* Statement Part */

/* Main Procedure */

/**************************/

if ((dtyp = 'DB') and (DB_LST(dbnr) <> 0) or

(dtyp = 'DX') and (DX_LST(dbnr) <> 0)) then

do; /* DB type equals DB,DX and DB exists */

err = err and not err_msk; /* Clear error bit */

call HLL_ADB(dtyp,dbnr); /* Open data block */

/* Now the above declarations */

/* can be used to access the data */

/* of the open data block using */

/* various methods */

/****************************************************/

/* Examples for accessing data block */

/****************************************************/

dataword(dnr) = inha; /* Write parameter to DW */

databyte(9) = E_Byte(1); /* DR4 = contents of input byte */

dw1(10).dataleft = E_Byte(2); /* DL10 = input byte */

ddw(7) = 0abcd1234h; /* Write constant to doubleword */

databyte(8) = E_Byte(2) and 01h; /* A I 2.0 –> Data 8 */

/* If ddw(7) is assigned, as above, by the high-level language, */

/* the following applies to word-oriented access: */

/* Access from high-level language to dataword(14) and dataword(15): */

/* dataword(14) = 1234, dataword(15) = abcd */

/* */

/* Access from STEP5 side to dataword14 and dataword15: */

/* dataword14 = 3412, dataword15 = cdab */

/* Reason: different formats of STEP 5 / HLL */

/* */

/* STEP 5: High byte is stored at lower address in memory */

/* HLL: Low byte is stored at lower address in memory */

/* The high and low word are also exchanged */

/* with 32-bit variables. */

end;

9–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.1 FB 1, Access to Data Blocks

else do;

/* Set error bit if DTYP not DB or DX */

/* or DB, DX do not exist */

err = err or err_msk;

end;

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB001;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–5SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.2 FB 2, Access to Process Image

9.1.2 FB 2, Access to Process Image

Function block FB 2 shows how to access the process image (special inputs, outputs andflags) from a PL/M block.

It also illustrates how you can use various redefinitions (...at(@E_Byte(0))) to perform wordand doubleword-oriented accesses to the process image.

/* SIEMENS Block Generator S5-PL/M */

/* Date: 08.04.91 Time: 15:21:17 */

/* Type : FB */

/* Number : 002 */

/* Name : EAM */

/* Lib.number : 34343 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* NR : D KF */ /* Number of input byte */

/* NR1 : E BY */ /* Number of output byte */

$LARGE (SUBS has DAT_COM; EXPORTS E_Byte, A_Byte, M_Byte, Zeit, Zaehler)

$COMPACT ROM

$eject

PFB002: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

9–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.2 FB 2, Access to Process Image

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (256) word external;

declare Zaehler (256) word external;

/* S5HLL System Data END */

/**************************/

/* Constants */

/**************************/

function:

PROCEDURE (NR,

NR1) PUBLIC REENTRANT;

DCL NR WORD,

NR1 BYTE;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

/* Declarations for word and doubleword access */

dcl Inputword(64) word at(@E_Byte(0));

dcl Inputd_word(32) dword at(@E_Byte(0));

dcl Flagword(128) word at(@M_Byte(0));

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–7SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.2 FB 2, Access to Process Image

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

/*************************************************/

/* Examples of accesses to process image */

/*************************************************/

A_Byte(nr1) = E_Byte(nr); /* Copy input byte to */

/* output byte */

Flagword(100) = Inputword(0) /* Copy input word to */

/* flag word */

/* At STEP 5 level, */

/* flag word 200 is addressed */

Flagword(102) = Inputd_word(0); /* Copy input doubleword to */

/* two flag words and */

/* swap high and low words */

Flagword(103) = shr(Inputd_word(0),16); /* At STEP 5 level, */

/* flag words 204 and 206 */

/* are addressed */

/* Flag word (x) in PL / M = flag word (2*x) in STEP 5 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB002;

9–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.3 FB 4, Processing of Counters and Timers

9.1.3 FB 4, Processing of Counters and Timers

Function block FB 4 shows how to read counter and timer values from a PL/M block and howto start the counters and timers. The latter is only possible on PLC systems with COP.

FB 4 also illustrates word-oriented accesses to flags by redefinition (...at(@M_Byte(0))).

/* SIEMENS Block Generator S5-PL/M */

/* Date: 08.04.91 Time: 15:23:49 */

/* Type : FB */

/* Number : 004 */

/* Name : TZMB */

/* Lib.number : 12349 */

/* PLC System : 1 (PLC 135WB with COP) */

/* TNR : D KF */ /* Number of counter */

/* ZNR : D KF */ /* Number of timer cell */

/* MWT : D KF */ /* Number of flag word for counter value */

/* MWZ : D KF */ /* Number of flag word for timer */

$LARGE (SUBS has DAT_COM; EXPORTS E_Byte, A_Byte, M_Byte, Zeit, Zaehler)

$COMPACT ROM

$eject

PFB004: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–9SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.3 FB 4, Processing of Counters and Timers

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (128) word external;

declare Zaehler (128) word external;

/* S5HLL System Data END */

/**************************/

/* Constants */

/**************************/

function:

PROCEDURE (TNR,

ZNR,

MWT,

MWZ) PUBLIC REENTRANT;

DCL TNR WORD,

ZNR WORD,

MWT WORD,

MWZ WORD;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

dcl flagword (128) word at(@M_Byte(0)); /* Flag word structure for wordwise */

/* access */

dcl aux_var word; /* Auxiliary variable */

9–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.3 FB 4, Processing of Counters and Timers

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

flagword(mwz) = counter(cno) and 0ff03h; /* Read counter value, but caution: */

/* counter is an array with */

/* STEP 5 data; exchange high and */

/* low bytes; therefore only */

/* bits 0, 1, 8...15 relevant */

counter(cno + 1) = 06400h; /* Initialize counter(cno+1) */

/* with 100dec */

/* Caution here also: STEP 5 data */

flagword(mwt) = (timer(tno) and 0ff03h); /* Read timer value */

aux_var = (timer(1) and 0ff03h); /* Read timer value from cell 1 */

if ((E_Byte(0) and 01h) = 1) then

do;

timer(1) = 19A8h; /* Initialize timer(1) with */

/* 25 sec and start; */

/* Caution here also: STEP 5 data */

A_Byte(0) = (A_Byte(0) or 01h); /* Set Q0.0 = 1 */

end;

if (aux_var = 0) then

do;

A_Byte(0) = (A_Byte(0) and 0feh); /* If time expired, */

/* set Q0.0 = 0 */

end;

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB004;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–11SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.4 FB 6, Search in Data Block

9.1.4 FB 6, Search in Data Block

Function block FB 6 shows how you can search easily from a PL/M block for a defined valuein a data block.

Only the address of the block is required in order to access the data block. The address isread from the block address list. The block is opened (system function HLL_ADB()) in orderto access the length of the block.

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:27:04 */

/* Type : FB */

/* Number : 006 */

/* Name : SUCH */

/* Lib.number : 23456 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* DBNR: D KF */ /* Number of the DB in which

the search is to be performed */

/* MUST: I W */ /* Search criteria */

/* GEF : Q W */ /* Number of the data word found */

/* ERR : Q BI */ /* Error message if DB does not exist */

$LARGE ( SUBS has DAT_COM; EXPORTS DB_LST, SB_LST, PB_LST, FB_LST, OB_LST, DX_LST,

$ FX_LST, HLL_ADB, XDBLAEN)

$COMPACT ROM

$eject

PFB006: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

9–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.4 FB 6, Search in Data Block

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare ( DB_LST, SB_LST, PB_LST, FB_LST,

OB_LST, DX_LST, FX_LST ) (256) pointer external;

declare XDBLAEN pointer external;

declare DB_Laenge based XDBLAEN word;

HLL_ADB:procedure (a,b) external;

declare a word;

declare b word;

end HLL_ADB;

/* S5HLL System Data END */

/**************************/

/* Constants */

/**************************/

function:

PROCEDURE (DBNR,

MUST,

GEF_ADR,

ERR_ADR,

ERR_MSK) PUBLIC REENTRANT;

DCL DBNR WORD,

MUST WORD,

GEF_ADR POINTER,

GEF BASED GEF_ADR WORD,

ERR_ADR POINTER,

ERR BASED ERR_ADR BIT,

ERR_MSK MASK;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

dcl var word;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–13SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.92

9.1.4 FB 6, Search in Data Block

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

if DB_LST(dbnr) = 0 then

do;

err = err or err_msk; /* DB does not exist, set error bit */

end;

else do;

err = err and not err_msk; /* DB exists; clear error bit */

call HLL_ADB('DB', dbnr); /* Open data block */

var = db_laenge + 1; /* Determine DB length */

/* Search process is performed with a built-in function */

/* gef = no. of data word found */

/* gef = -1 search criteria not found in DB */

gef = findw(DB_LST(dbnr), must, var);

end;

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB006;

9–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.5 FB 8, Call Other HLL Procedures

9.1.5 FB 8, Call Other HLL Procedures

Function block FB 8 shows how to call other HLL function blocks from a PL/M block (systemfunction HLL_HLL()).

It also illustrates how to declare and call local procedures in a PL/M block.

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:30:55 */

/* Type : FB */

/* Number : 008 */

/* Name : PLM-PLM */

/* Lib.number : 32189 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* AUS : I BY */ /* Parameters which are passed to FB 2 */

/* NN : D KF */

/* BYTN: D KF */ /* Number of an output byte */

/* BITN: D KF */ /* Number of bit position */

/* WER1: D KF */ /* Condition for shift operation */

$LARGE (SUBS has DAT_COM; EXPORTS HLL_HLL, E_Byte, A_Byte, M_Byte, Zeit, Zaehler)

$COMPACT ROM

$eject

PFB008: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–15SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.5 FB 8, Call Other HLL Procedures

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare HLL_HLL pointer external;

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (256) word external;

declare Zaehler (256) word external;

/* S5HLL System DATA END */

/**************************/

/* Constants */

/**************************/

function:

PROCEDURE (AUS,

NN,

BYTN,

BITN,

WER1) PUBLIC REENTRANT;

DCL AUS BYTE,

NN WORD,

BYTN WORD,

BITN WORD,

WER1 WORD;

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

call HLL_HLL (nn, aus, 'FB', 2); /* Call FB 2 with parameters */

call BITMAN(BYTN, BITN, WER1); /* Call a local function */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

9–16 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.5 FB 8, Call Other HLL Procedures

/**************************/

/* Local */

/* Functions */

/**************************/

BITMAN:PROCEDURE (abnr, bitnr, value) REENTRANT;

DCL (abnr, bitnr, value) BYTE;

if value = 1 then

A_Byte(abnr) = (A_Byte(abnr) OR SHL(1h, bitnr));

else

A_Byte(abnr) = (A_Byte(abnr) AND ROL(0FEH, bitnr));

end BITMAN;

END PFB008;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–17SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.6 FB 10, FB 15, Use of Semaphores

9.1.6 FB 10, FB 15, Use of Semaphores

Function blocks FB 10 and FB 15 show how to set and clear the OB disable identifiers in PL/Mblocks.

The disable identifier for OB 5 is set in FB 10 and subsequently cleared again in FB 15.

System functions HLL_LIM() and HLL_SIM() are used.

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:36:01 */

/* Type : FB */

/* Number : 010 */

/* Name : SPERR0B5 */

/* Lib.number : 09131 */

/* PLC System : 2 (PLC 135WB with ACOP) */

$LARGE (SUBS has DAT_COM; EXPORTS HLL_LIM, HLL_SIM)

$COMPACT ROM

$eject

PFB010: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

9–18 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.6 FB 10, FB 15, Use of Semaphores

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare HLL_LIM pointer external;

declare HLL_SIM pointer external;

/* S5HLL System Data END */

/**************************/

/* Constants */

/**************************/

dcl disable_mask_OB5 byte data(20h); /* Disable identifier mask for OB 5*/

function:

PROCEDURE PUBLIC REENTRANT;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

dcl disable_id byte; /* OB disable identifier */

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

call HLL_LIM (@disable_id); /* Read current disable identifier */

disable_id = disable_id or

disable_mask_OB5; /* Set disable identifier for OB 5 */

call HLL_SIM (@disable_id); /* Disable OB 5 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB010;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–19SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.6 FB 10, FB 15, Use of Semaphores

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:37:02 */

/* Type : FB */

/* Number : 015 */

/* Name : FREIGOB5 */

/* Lib.number : 01936 */

/* PLC System : 2 (PLC 135WB with ACOP) */

$LARGE (SUBS has DAT_COM; EXPORTS HLL_LIM, HLL_SIM)

$COMPACT ROM

$eject

PFB015: DO;

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare HLL_LIM pointer external;

declare HLL_SIM pointer external;

/* S5HLL System Data END */

9–20 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 9 Example Programs

9.1.6 FB 10, FB 15, Use of Semaphores

/**************************/

/* Constants */

/**************************/

dcl enable_mask_OB5 byte data (0dfh); /* Disable identifier mask for OB 5 */

function:

PROCEDURE PUBLIC REENTRANT;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

dcl disable_id byte; /* OB disable identifier */

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

call HLL_LIM (@disable_id); /* Read current disable identifier */

disable_id = disable_id and

enable_mask_OB5; /* Clear disable identifier for OB 5 */

call HLL_SIM (@disable_id); /* Enable OB 5 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB015;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–21SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.7 FB 20, I/O Processing

9.1.7 FB 20, I/O Processing

FB 20 shows how to access the I/O directly from a PL/M block.

The access is performed via the I/O address list. The process image is not updatedautomatically, and this must be performed in the PL/M block.

The PL/M function block FB 20 copies a defined area of inputs into the outputs. The area isdefined by the call parameters.

It is assumed that the defined I/O area (inputs and outputs) exists and is contiguous.

/* SIEMENS Block Generator S5-PL / M */

/* Date: 08.04.91 Time: 15:33:49 */

/* Type : FB */

/* Number : 020 */

/* Name : PERI */

/* Lib.number : 20005 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* STRT : D KF */ /* Start of area to be copied */

/* END: D KF */ /* End of area to be copied */

$LARGE ( SUBS has DAT_COM; EXPORTS DB_LST, SB_LST, PB_LST, FB_LST, OB_LST, DX_LST,

$ FX_LST, HLL_ADB, XDBLAEN, PeE, PeA, E_Byte, A_Byte, M_Byte, Zeit, Zaehler)

$COMPACT ROM

$eject

PFB020: DO;

9–22 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.7 FB 20, I/O Processing

/**************************/

/* Literallies */

/**************************/

DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

declare ( DB_LST, SB_LST, PB_LST, FB_LST,

OB_LST, DX_LST, FX_LST ) (256) pointer external;

declare XDBLAEN pointer external;

declare DB_Laenge based XDBLAEN word;

HLL_ADB:procedure (a,b) external;

declare a word;

declare b word;

end HLL_ADB;

declare PeE (256) pointer external;

declare PeA (256) pointer external;

declare E_Byte (128) byte external;

declare A_Byte (128) byte external;

declare M_Byte (256) byte external;

declare Zeit (256) word external;

declare Zaehler (256) word external;

/* S5HLL System Data END */

dcl dataword (20) word; /* Structure for access to data blocks */

/**************************/

/* Constants */

/**************************/

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–23SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.1.7 FB 20, I/O Processing

function:

PROCEDURE (STRT,

END) PUBLIC REENTRANT;

DCL STRT WORD,

END WORD;

/* The following requirements must be met:

--- Inputs exist in contiguous form from STRT to END

--- Outputs exist in contiguous form from STRT to END

*/

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

/* Declaration of pointers for word and doubleword access */

dcl dd_inp dword at(@dataword(0));

dcl ptr_inp pointer at(@dataword(0));

dcl base_inp selector at(@dataword(1));

dcl offset_inp word at(@dataword(0));

dcl ptr_adr_inp pointer;

dcl proc_inp based ptr_adr_inp byte;

dcl dd_out dword at(@dataword(2));

dcl ptr_out pointer at(@dataword(2));

dcl base_out selector at(@dataword(3));

dcl offset_out word at(@dataword(2));

dcl ptr_adr_out pointer;

dcl n byte ;

9–24 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.1.7 FB 20, I/O Processing

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

call HLL_ADB('DB', 200); /* Open DB 200 */

do n = strt to end;

ptr_inp = PeE(n); /* Pass address of nth input byte */

/* to data block */

/* Offset in dataword(0), */

/* segment in dataword(1) */

dataword(1) = (dataword(1) and 0f000h); /* Clear bits 0 to 11 of segment */

ptr_adr_inp = buildptr(base_inp,

offset_inp); /* Create pointer */

/* to real address */

/* of the nth input byte */

ptr_out = PeA(n); /* Pass address of the nth output */

/* byte to data block */

/* Offset in dataword(2), */

/* segment in dataword(3) */

dataword(3) = (dataword(3) and 0f000h); /* Clear bits 0 to 11 of segment */

ptr_adr_out = buildptr(base_out,

offset_out); /* Create pointer */

/* to real address */

/* of the nth output byte */

call movb(ptr_adr_inp, ptr_adr_out, 1); /* Call built-in function */

/* The value of the nth input byte */

/* is passed to the nth output byte; */

/* the process image */

/* is circumnavigated */

A_Byte(n) = proc_inp; /* Correction to process image, as */

/* otherwise the transferred byte */

/* would be overwritten */

/* by the process image later */

end;

/**************************/

/* End of */

/* Main Procedure */

/**************************/

END function;

END PFB020;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–25SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2 Examples in C

9.2 Examples in C

9.2.1 FX 1, Access to Data Blocks

FX 1 shows how to access a data block from a C block.

The data block is declared here globally as a union. This enables byte, word or doubleword-oriented access to the data block. Access in STEP 5 format is also supported.

The data block must be opened before the first access (system function HLL_ADB()).

/* SIEMENS Block Generator S5-C */

/* Date: 03.04.91 Time: 15:16:12 */

/* Type : FX */

/* Number : 001 */

/* Name : DBZUGR */

/* Lib.number : 3491 */

/* PLC System : 1 (PLC 135WB with COP) */

/* DBNR: D KF */ /* Number of DB to be opened */

/* DNR : I BY */ /* Number of a DW in the DB */

/* DTYP: D KS */ /* Data block type (DB or DX) */

/* INHA: I BY */ /* Desired value of the DW in the DB */

/* ERR : Q BI */ /* Error bit for parameter errors */

/**************************/

/* Typedef and constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

/* S5HLL System Data START */

/* Process data blocks */

extern far void HLL_ADB (unsigned short int, unsigned short int);

#define DB_Laenge XDBLAEN

extern unsigned short far * far DB_Laenge;

9–26 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.1 FX 1, Access to Data Blocks

/* Block address list */

extern unsigned short int * far DB_LST[256];

extern unsigned short int * far SB_LST[256];

extern unsigned short int * far PB_LST[256];

extern unsigned short int * far FB_LST[256];

extern unsigned short int * far OB_LST[256];

extern unsigned short int * far DX_LST[256];

extern unsigned short int * far FX_LST[256];

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned short int far Zeit [128];

extern unsigned short int far Zaehler [128];

/* S5HLL System Data END */

/***********************************************************/

/* Definition of an array for addressing */

/* in data blocks (max. size: 2043 words); */

/* refers to the currently open DB */

/***********************************************************/

typedef struct { unsigned char dataleft;

unsigned char dataright;

} d_l_r;

union { unsigned char databyte [512];

unsigned int dataword [256];

unsigned long int ddw [128];

d_l_r dw1 [256];

} datablock;

/* The global declaration of the 'datablock' union can be used to address */

/* a data block after the block has been opened with */

/* HLL_ADB(). Byte, word and doubleword-oriented or */

/* structured accesses (dataleft, dataright) are supported */

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BBP0 9–27SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.1 FX 1, Access to Data Blocks

/**************************/

/* Constants */

/**************************/

#define not_exist 0l

FUNCTION (DBNR,

DNR,

DTYP,

INHA,

ERR_ADR,

ERR_MSK)

word DBNR;

byte DNR;

word DTYP;

byte INHA;

bit * ERR_ADR;

mask ERR_MSK;

{

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

if ((DType == 'DB') && (DB_LST[DBNR] != not_exist) ¦¦

(DType == 'DX') && (DX_LST[DBNR] != not_exist))

{ /* DB Type equal DB,DX and DB exist */

*ERR_ADR &= ~ERR_MSK; /* Clear error bit */

HLL_ADB(DTYP, DBNR); /* Open data block */

/* Now the global union */

/* declared above can be used */

/* to access the data of the */

/* open data block using */

/* various methods */

9–28 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 9 Example Programs

9.2.1 FX 1, Access to Data Blocks

/****************************************************/

/* Examples for accessing data block */

/****************************************************/

datablock.dataword[DNR] = INHA; /* Write parameter to DW */

datablock.databyte[9] = E_Byte[1]; /* DR4 = contents of input byte */

datablock.dw1[10].dataleft = E_Byte[2]; /* DL10 = input byte */

datablock.ddw[7] = 0xabcd1234; /* Write constant */

/* to doubleword */

datablock.databyte[8] = E_Byte[2] & 0x01; /* A I 2.0 - Data 8 */

/* If ddw(7) is assigned, as above, by the high-level language, */

/* the following applies to word-oriented access: */

/* Access from high-level language to dataword(14) and dataword(15): */

/* dataword(14) = 1234, dataword(15) = abcd */

/* */

/* Access from STEP5 side to dataword14 and dataword15: */

/* dataword14 = 3412, dataword15 = cdab */

/* Reason: different formats of STEP 5/HLL */

/* */

/* STEP 5: High byte is stored at lower address in memory */

/* HLL: Low byte is stored at lower address in memory */

/* The high and low word are also */

/* exchanged with 32-bit variables. */

}

else

{ /* Set error bit if DTYP not DB or DX */

/* or DB, DX do not exist*/

*ERR_ADR ¦= ERR_MSK;

}

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–29SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.2 FX 2, Access to Process Image

9.2.2 FX 2, Access to Process Image

Function block FX 2 shows how to access the process image (special inputs, outputs andflags) from a C block.

It also illustrates how you can use pointers and type redefinitions to perform word anddoubleword-oriented accesses to the process image.

/* SIEMENS Block Generator S5-C */

/* Date: 03.04.91 Time: 16:36:51 */

/* Type : FX */

/* Number : 002 */

/* Name : EAM */

/* Lib.number : 73737 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* NR : D KF */ /* Number of input byte */

/* NR1 : I BY */ /* Number of output byte */

/**************************/

/* Typedef and constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

9–30 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.2 FX 2, Access to Process Image

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned int far Zeit [256];

extern unsigned int far Zaehler [256];

/* S5HLL System Data END */

FUNCTION (NR,

NR1)

word NR;

byte NR1;

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

/* Definition of pointers for word and doubleword access */

int *Inputword;

long int *Inputd_word;

int *Flagword;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–31SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.2 FX 2, Access to Process Image

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

/* Initialize pointers */

Inputword = (int *)E_Byte;

Inputd_word = (long int *)E_Byte;

Flagword = (int *)M_Byte;

/*************************************************/

/* Examples of accesses to process image */

/*************************************************/

A_Byte[NR1] = E_Byte[NR]; /* Copy input byte */

/* to output byte */

Flagword[100] = Inputword[0]; /* Copy input word */

/* to flag word */

/* At STEP 5 level, flag */

/* word 200 is addressed */

Flagword[102] = Inputd_word[0]; /* Copy input doubleword */

/* to two flag words */

/* and swap high and */

/* low words */

Flagword[103] = Inputd_word[0] >> 16; /* At STEP 5 level, flag */

/* words 204 and 206 */

/* are addressed */

/* Flagword[x] in C = Flagword[2*x] in STEP 5! */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

9–32 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.3 FX 4, Processing of Counters and Timers

9.2.3 FX 4, Processing of Counters and Timers

Function block FX 4 shows how to read counter and timer values from a C block and how tostart the counters and timers. The latter is only possible on PLC systems with COP.

FX 4 also illustrates word-oriented accesses to flags using pointers and type redefinitions.

/* SIEMENS Block Generator S5-C */

/* Date: 04.04.91 Time: 17:04:59 */

/* Type : FX */

/* Number : 004 */

/* Name : TZMB */

/* Lib.number : 85344 */

/* PLC System : 1 (PLC 135WB with COP) */

/* TNR : D KF */ /* Number of counter */

/* ZNR : D KF */ /* Number of timer cell */

/* MWT : D KF */ /* Number of flag word for counter value */

/* MWZ : D KF */ /* Number of flag word for timer */

/**************************/

/* Typedef and constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–33SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.3 FX 4, Processing of Counters and Timers

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned short int far Zeit [128];

extern unsigned short int far Zaehler [128];

/* S5HLL System Data END */

FUNCTION (TNR,

ZNR,

MWT,

MWZ)

word TNR;

word ZNR;

word MWT;

word MWZ;

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

word aux_var;

word far *flagword; /* Pointer for word access */

9–34 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.3 FX 4, Processing of Counters and Timers

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

flagword = (word *)M_Byte; /* Initialize counter */

/* equiv. (word *)&M_Byte [0] */

flagword[MWZ] = counter[CNO] & 0xFF03; /* Read counter value, but caution:*/

/* counter is an array with */

/* STEP 5 data; exchange high and */

/* low bytes; therefore only */

/* bits 0, 1, 8...15 relevant */

counter[CNO+1] = 0x6400; /* Initialize counter (CNO+1) */

/* with 100dec */

/* Caution here also: STEP 5 data */

flagword[MWT] = (timer[TNO] & 0xFF03); /* Read timer value */

aux_var = timer[1] & 0xFF03; /* Read timer value from cell 1 */

if ((E_Byte[0] & 0x01) == 1)

{

timer[1] = 0x19A8; /* Initialize timer(1) with */

/* 25 sec and start; */

/* Caution here also: STEP 5 data */

A_Byte[0] ¦= 0x01; /* Set Q0.0 = 1 */

}

if (aux_var == 0)

A_Byte[0] &= 0xFE; /* If time expired, */

/* set Q0.0 = 0 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–35SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.4 FX 6, Search in Data Block

9.2.4 FX 6, Search in Data Block

Function block FX 6 shows how you can search easily from a C block for a defined value in adata block.

Only the address of the block is required in order to access the data block. It is thereforesufficient to declare the data block as an array with a length of 1.

The block must be opened (system function HLL_ADB()) before the first access.

/* SIEMENS Block Generator S5-C */

/* Date: 04.04.91 Time: 17:58:17 */

/* Type : FX */

/* Number : 006 */

/* Name : SUCH */

/* Lib.number : 23456 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* DBNR: D KF */ /* Number of the DB in which

the search is to be performed */

/* MUST: I W */ /* Search criteria */

/* GEF : Q W */ /* Number of the data word found */

/* ERR : Q BI */ /* Error message if DB does not exist */

Q

/**************************/

/* Typedef and Constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword ;

9–36 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.4 FX 6, Search in Data Block

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Process data blocks */

extern far void HLL_ADB (unsigned int, unsigned int);

#define DB_Laenge XDBLAEN

extern unsigned int far * far DB_Laenge;

/* Block address list */

extern unsigned int * far DB_LST[256];

extern unsigned int * far SB_LST[256];

extern unsigned int * far PB_LST[256];

extern unsigned int * far FB_LST[256];

extern unsigned int * far OB_LST[256];

extern unsigned int * far DX_LST[256];

extern unsigned int * far FX_LST[256];

/* S5HLL System Data END */

/* Data block declaration */

/* only important for the address of the DB */

word dataword[1];

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–37SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.92

9.2.4 FX 6, Search in Data Block

FUNCTION (DBNR,

MUST,

GEF_ADR,

ERR_ADR,

ERR_MSK)

word DBNR;

word MUST;

word * GEF_ADR;

bit * ERR_ADR;

mask ERR_MSK;

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

word max_limit; /* Number of last word in DB */

word position; /* Index for search in DB */

word far *search_array; /* Define pointer for word access */

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

if (DB_LST[DBNR] == 0)

{

*ERR_ADR ¦= ERR_MSK; /* DB does not exist; set error bit */

}

else

{

*ERR_ADR &= ~ERR_MSK; /* DB exists; clear error bit */

HLL_ADB('DB', DBNR); /* Open data block */

max_limit = *DB_Laenge; /* Determine last assigned position */

search_array = (word far *) dataword /* Address from which search is

to be performed */

9–38 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.4 FX 6, Search in Data Block

for (position = 0; position <= max_limit; position++)

{

if (search_array[position] == MUST)

{

*GEF_ADR = position; /* Pass index of data word */

break; /* Break loop */

}

else

{

*GEF_ADR = 0XFFFF; /* Pass identifier for not found */

}

} /* The loop could also be implemented */

/* by calling a standard */

/* C library function */

}

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–39SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.5 FX 8, Call Other HLL Procedures

9.2.5 FX 8, Call Other HLL Procedures

Function block FX 8 shows how to call other HLL function blocks from a C block (systemfunction HLL_HLL()).

It also illustrates how to declare and call local procedures in a C block.

/* SIEMENS Block Generator S5-C */

/* Date: 05.04.91 Time: 14:42:59 */

/* Type : FX */

/* Number : 008 */

/* Name : CC */

/* Lib.number : 32189 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* AUS : I BY */ /* Parameters which are passed to FB 2 */

/* NN : D KF */

/* BYTN: D KF */ /* Number of an output byte */

/* BITN: D KF */ /* Number of bit position 0 ... 7 */

/* WER1: D KF */ /* Condition for shift operation */

/**************************/

/* Typedef and Constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

9–40 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.5 FX 8, Call Other HLL Procedures

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Call other HLL blocks */

extern far void (* far HLL_HLL) ();

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned int far Zeit [256];

extern unsigned int far Zaehler [256];

/* S5HLL System Data END */

/* Standard ANSI Prototypes */

void BITMAN(sword abnr, sword bitnr, sword value);

byte ROL(byte num, sword digits);

FUNCTION (AUS,

NN,

BYTN,

BITN,

WER1)

byte AUS;

word NN;

word BYTN;

word BITN;

word WER1;

{

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

HLL_HLL(NN,AUS,'FB',2); /* Call FB 2 with parameters */

BITMAN(BYTN,BITN,WER1); /* Call a local function */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–41SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.5 FX 8, Call Other HLL Procedures

/**************************/

/* Local */

/* Procedures */

/**************************/

void BITMAN(sword abnr, sword bitnr, sword value) /* Standard ANSI declaration */

{

if (value == 1)

A_Byte[abnr] ¦= (0x01 << bitnr);

else

A_Byte[abnr] &= ROL(0xFE,bitnr);

}

byte ROL(byte num,sword digits) /* Standard ANSI declaration */

{

union { word _16_BIT;

byte _8_BIT[2];

} trickvariable;

trickvariable._16_BIT = (word)num;

trickvariable._16_BIT <<= digits;

return(trickvariable._8_BIT[0] ¦ trickvariable._8_BIT[1]);

}

9–42 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.6 FX 10, FX 15, Use of Semaphores

9.2.6 FX 10, FX 15, Use of Semaphores

Function blocks FX 10 and FX 15 show how to set and clear the OB disable identifiers in Cblocks.

The disable identifier for OB 5 is set in FX 10 and subsequently cleared again in FX 15.

System functions HLL_LIM() and HLL_SIM() are used.

/* SIEMENS Block Generator S5-C */

/* Date: 05.04.91 Time: 16:15:31 */

/* Type : FX */

/* Number : 010 */

/* Name : SPERROB5 */

/* Lib.number : 0911 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/**************************/

/* Typedef and Constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Semaphores (LIM, SIM) */

extern far void (* far HLL_LIM) (unsigned char *);

extern far void (* far HLL_SIM) (unsigned char *);

/* S5HLL System Data END */

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–43SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.6 FX 10, FX 15, Use of Semaphores

FUNCTION ( )

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

byte disable_id; /* OB disable identifier */

#define disable_mask_OB5 0x20; /* Disable identifier mask for OB 5 */

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

HLL_LIM (&disable_id); /* Read current disable identifier */

disable_id ¦= disable_mask_OB5; /* Set disable identifier for OB 5 */

HLL_SIM (&disable_id); /* Disable OB 5 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

9–44 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.6 FX 10, FX 15, Use of Semaphores

/* SIEMENS Block Generator S5-C */

/* Date: 05.04.91 Time: 16:20:45 */

/* Type : FX */

/* Number : 015 */

/* Name : FREIGOB5 */

/* Lib.number : 0912 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/**************************/

/* Typedef and Constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Semaphores (LIM, SIM) */

extern far void (* far HLL_LIM) (unsigned char *);

extern far void (* far HLL_SIM) (unsigned char *);

/* S5HLL System Data END */

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–45SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.6 FX 10, FX 15, Use of Semaphores

FUNCTION ( )

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

byte disable_id; /* OB disable identifier */

#define enable_mask_OB5 0xDF; /* Disable identifier mask for OB 5 */

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

HLL_LIM (&disable_id); /* Read current disable identifier */

disable_id &= enable_mask_OB5; /* Clear disable identifier for OB 5 */

HLL_SIM (&disable_id); /* Enable OB 5 */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

9–46 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.91 9 Example Programs

9.2.7 FX 20, I/O Processing

9.2.7 FX 20, I/O Processing

FX 20 shows how to access the I/O directly from a C block.

The access is performed via the I/O address list. The process image is not updatedautomatically, and this must be performed in the C block.

The C function block FX 20 copies a defined area of inputs into the outputs. The area isdefined by the call parameters.

It is assumed that the defined I/O area (inputs and outputs) exists and is contiguous.

/* SIEMENS Block Generator S5-C */

/* Date: 05.04.91 Time: 15:35:23 */

/* Type : FX */

/* Number : 020 */

/* Name : PERI */

/* Lib.number : 20005 */

/* PLC System : 2 (PLC 135WB with ACOP) */

/* STRT: D KF */ /* Start of area to be copied */

/* END: D KF */ /* End of area to be copied */

/**************************/

/* Typedef and Constants */

/**************************/

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–47SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.7 FX 20, I/O Processing

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

/* Process data blocks */

extern far void HLL_ADB (unsigned int, unsigned int);

#define DB_Laenge XDBLAEN

extern unsigned int far * far DB_Laenge;

/* Block address list */

extern unsigned int * far DB_LST[256];

extern unsigned int * far SB_LST[256];

extern unsigned int * far PB_LST[256];

extern unsigned int * far FB_LST[256];

extern unsigned int * far OB_LST[256];

extern unsigned int * far DX_LST[256];

extern unsigned int * far FX_LST[256];

/* Process image [I / Q/ F/ T/ C] */

extern unsigned char far E_Byte [128];

extern unsigned char far A_Byte [128];

extern unsigned char far M_Byte [256];

extern unsigned int far Zeit [256];

extern unsigned int far Zaehler [256];

/* I / O address list [I / Q] */

extern unsigned char far * far PeE [256];

extern unsigned char far * far PeA [256];

/* S5HLL System Data END */

#define MSB_mask 0xF000 /* Mask for the 4 MSB */

int dataword[20]; /* Global declaration of a DB */

9–48 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 9 Example Programs

9.2.7 FX 20, I/O Processing

FUNCTION (STRT,

END)

word STRT;

word END;

/* The following requirements must be met:

--- Inputs exist in contiguous form from STRT to END

--- Outputs exist in contiguous form from STRT to END

*/

{

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

int n; /* loop counter */

/* Declaration of pointers for word and doubleword access */

dword far *ptr_inp;

dword far *ptr_out;

word far *segment_inp;

word far *offset_inp;

word far *segment_out;

word far *offset_out;

byte far *ptr_adr_inp;

byte far *ptr_adr_out;

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

HLL_ADB ('DB', 200); /* Open data block */

/* Pointer initialization */

ptr_inp = (dword far *)&dataword[0]; /* Pointer to dataword[0] and */

/* and dataword[1] */

segment_inp = (word far *)&dataword[1]; /* Pointer to segment part */

offset_inp = (word far *)&dataword[0]; /* Pointer to offset part */

ptr_out = (dword far *)&dataword[2]; /* Pointer to dataword[2] and */

/* dataword[3] */

segment_out = (word far *)&dataword[3]; /* Pointer to segment part */

offset_out = (word far *)&dataword[2]; /* Pointer to offset part */

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 9–49SINUMERIK 840/880 Part 1 (PJ)

9 Example Programs 11.91

9.2.7 FX 20, I/O Processing

for(n = STRT; n <= END ; n++)

{

*ptr_inp = (dword)PeE[n]; /* Pass address of nth input byte */

/* to data block */

/* Offset in dataword[0], */

/* segment in dataword[1] */

*segment_inp &= MSB_mask; /* Clear bits 0 to 11 of segment */

/* Create pointer to real address */

/* of the nth input byte */

ptr_adr_inp = (byte far *)(((dword)*segment_inp << 16) ¦ *offset_inp);

*ptr_out = (dword)PeA[n]; /* Pass address of the nth output */

/* byte to data block */

/* Offset in dataword[2], */

/* segment in dataword[3] */

*segment_out &= MSB_mask /* Clear bits 0 to 11 of segment */

/* Create pointer to real address */

/* of the nth output byte */

ptr_adr_out = (byte far *)(((dword)*segment_out << 16) ¦ *offset_out);

*ptr_adr_out = *ptr_adr_inp; /* The value of the nth input byte */

/* is passed to the nth output byte; */

/* the process image is circumnavigated */

A_Byte[n] = (unsigned short int)*ptr_adr_inp;

/* Correction to process image, as */

/* otherwise the transferred byte would be */

/* overwritten by the process image later */

}; /* End of for-loop */

/**************************/

/* End of */

/* Main Procedure */

/**************************/

}

9–50 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 10 Information for the Use of the Block Generator

10.1 Information for the Use of HLL Programs on the Programmable Controller

10 Information for the Use of the BlockGenerator

This chapter contains important information about

• the use of HLL programs on the programmable controller

• restrictions which occur with the use of the block generator on the development computer,and

• restrictions which should be considered when programming HLL blocks.

10.1 Information for the Use of HLL Programs on the ProgrammableController

The block generator creates HLL programs for use on the programmable controller PLC 135WB. The user should exercise the greatest care in the development of these programs.

The use of operating system data allows the user to access memory areas and systemprograms. The manufacturer cannot accept any liability for damages resulting from the misuseof system data or programs.

The responsibility for the generated programs and the resulting impact on the running processlies with the user, who must implement quality assurance measures to ensure the correctdevelopment of the programs.

It is therefore recommended

• not to modify the defined system variables, but to process them in read-only accesses tothe largest possible extent

• to call system programs in the described form only

• always to make sure that the destination address (the address of the pointer) is correct inindirect data accesses or program branches (which use pointers)

• to remember that cross-segment program branches (FAR CALL) may not be performed,and

• to remember that HLL blocks always run in special mode, irrespective of the setting in themachine data.

Calling non-existent blocks in HLL 1)

On an attempt to open a missing data block with the function HLL_ADB or call a missingprogram block with the function HLL_S5, the system program calls organization block OB 19(if it exists). The value 0B000hex is also assigned to the DS data segment if you attempt toopen a data block that does not exist. A hardware write-protect feature is provided for thisarea, with the result that a timeout is generated on access to data of a non-existent block, andthe PLC switches to the stop state with error message '9B' ( timeout when processing high-level language). The supplementary message parameter F0004 indicates with the value0001hex that no data block has been opened.

_______1) GA2, SW 1 and higher (SINUMERIK 880) or SW 2 and higher (SINUMERIK 840)

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 10–1SINUMERIK 840/880 Part 1 (PJ)

10 Information for the Use of the Block Generator 11.92

10.1 Information for the Use of HLL Programs on the Programmable Controller

If non-existent blocks are called up with the functions HLL_HLL and HLL_MACRO, the PLCalways switches to the stop state with an error message. In this case, the program cannotcontinue because of the unknown number of passed parameters; OB 19 is not called.

For further information, please refer to the "PLC 135 WB Configuring Guide".

10.2 Restrictions for the Use of the Block Generator

Memory requirements

A large number of tables of the block generator must be processed in the main memory of thedevelopment computer. For this reason, the available memory should be as large as possible.

If the free memory is not sufficient, part of the tables have to be stored on the hard disk. Thisreduces the processing speed considerably (especially with large programs).

At least 1 MB free memory must be available on the hard disk for the output files and storeddata.

Number of open files

When the block generator creates an HLL block, it accesses several files on the hard disk. Inthe worst case (when performing a parameter check), ten files may be open at the same time.

The MS-DOS operating system limits the number of files which can be opened simultaneously.You can define the limit in the FILES statement in the CONFIG.SYS file; a suitably high settingshould be chosen.

10.3 Restrictions for Programming

10.3.1 General Restrictions

The following restrictions should be observed when implementing PL/M and C blocks.

Stack requirements

The stack area available to HLL blocks is limited to:

• 2 K words on the cyclic level• 0.5 K words on the further processing levels

As the user, you must ensure that the stack requirements of your HLL block do not exceedthis limit. If a stack overflow does occur, the PLC branches to a defined stop state, howeverthe cause of the error cannot be detected or displayed.

Following compilation, you can calculate the stack requirements of an HLL block from theprogram listing, according to the following factors:

• All variables declared in the "Declaration of Local Data" section are stored on the stack.Larger data arrays should therefore be stored in data blocks.

10–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

11.92 10 Information for the Use of the Block Generator

10.3.1 General Restrictions

• In system calls, the call parameters are passed to the stack. This also applies toparameters passed to other blocks (HLL_HLL(), HLL_MACRO()).

Procedures

• Local procedures in PL/M blocks must be declared with the attribute REENTRANT,otherwise processing errors may occur.

• Procedures in C blocks are always reentrant; the attribute does not have to be specified.

• The implementation of interrupt procedures is not permitted.

• With the exception of system functions, no external procedures may be called; i.e. "FARCALLS" are not permitted.

Data declarations

• The declarations created by the block generator may not be modified.

• The declaration of global data in a HLL data block is only allowed for components whichrefer to data blocks. This also applies to the declaration of "static" data in C blocks.

Recursion

Recursive calls are not permitted in HLL blocks.

Memory model

HLL blocks may only be compiled in the compact model.

Libraries

You link standard intel libraries or your own libraries (created with intel LIB86) to your HLLblock. Please remember, however, that the functions used may not access the hardware orthe operating system.

Block size

The block generator restricts HLL blocks to a code size of 8 Kbytes.

10.3.2 Further Restrictions for C Blocks

Further restrictions must be observed for the implementation of C blocks, in addition to therestrictions described above.

Parameter check

It is not possible to perform a parameter check for C blocks on the block generator.

Definitions ("#define")

"#define" statements may not exceed 255 characters in length. This applies especially to thedefinition of macros.

Line length

A line in the source program of a C block may not exceed 255 characters in length.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 10–3SINUMERIK 840/880 Part 1 (PJ)

11.92 11 Error Messages and Warnings

11.1 Error Messages from the HLL Block

11 Error Messages and Warnings

Both the block generator and the generated block output error messages. The block generatoralso issues warnings.

11.1 Error Messages from the HLL Block

If serious errors occur when an HLL block is running, the PLC branches to the stop state(system stop). An identifier is entered in the fine error coding section (memory cells in the PLCfor error codes). The identifier indicates the cause of the error. The following listing shows theevents for which errors can be detected, together with the error codes and their meaning.

Error on loading HLL block:

53: Illegal PL/M block in user program memory (option not enabled)54: Illegal C block in user program memory (option not enabled)

Error on calling HLL block from STEP 5:

D0: Unknown type identifier in parameter declaration of called blockD1: Illegal type identifier in HLL blockD2: Current input parameter in calling FB incorrectD3: Current output parameter in calling FB incorrect

Error in HLL_HLL() procedure:

D4: Unknown pseudoparameter on stackD5: HLL block does not existD6: HLL block paragraphs not alignedD7: Called block is not an HLL block

Error in HLL_ADB() procedure:

D8: Incorrect pseudoparameter ('DB' or 'DX' permitted)D9: DB/DX to be opened does not existDA: DB/DX to be opened paragraphs not aligned

Error in HLL_MACRO() procedure:

DC: Called function macro does not exist or not permitted for HLL

Error in HLL_STOP() procedure:

DD: System stop by HLL block; user error identifier in supplementary error parameter

Error in HLL_S5() procedure:

DE: Unknown pseudoparameter on stack or illegal block type parameterDF: Called STEP 5 block does not existE0: Called STEP 5 block paragraphs not alignedE1: Called block is not a STEP 5 block

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 11–1SINUMERIK 840/880 Part 1 (PJ)

11 Error Messages and Warnings 11.92

11.2 Error Messages of Block Generator

11.2 Error Messages of Block Generator

In the event of an error where the input cannot be detected and/or where a suitable responsefrom the block generator is not possible, the execution of the block generator is cancelledfollowing output of an appropriate error message.

In the event of an error which can be detected at the time of input, an error message is outputand the corresponding input screen is called up again. When the input error has beencorrected, the block generator continues to run.

In the event of an error which cannot be detected at the time of input, but where the blockgenerator can continue running, an error message is written to an error file (file S5HLL.ERR).A corresponding error message is also output in the last input screen if possible. The blockgenerator subsequently continues to run.

The block generator outputs the following error messages:

• Declaration of too many literallies; a maximum of 1000 literallies (defines) can be declared.

• Nesting levels of include files too deep; the compiler supports a maximum of 5 levels forthe nesting of include statements.

• Nesting level for literallies too deep; literallies (defines) may be nested in up to 5 levels.

11.3 Warnings of Block Generator

Warnings are output, where possible, in the last input screen. The warnings are also written toan error file. Execution of the block generator is not cancelled on the output of warnings.

The block generator outputs the following warnings:

• Literallies stored on disk

Up to approximately 200 literallies (defines) can be held in memory (depending on theamount of main memory available). If further literallies are defined above this limit, they arestored in a file on the hard disk. This can result in a substantial increase in the processingtime. A total maximum of 1000 literallies can be stored.

• Identifiers stored on disk

Depending on the memory expansion of the development computer, up to approximately2000 identifiers can be stored directly in main memory (on the heap). Identifiers whichcannot be managed on the heap are stored in a file on the hard disk. The maximumnumber of identifiers is determined by the upper limit of the compiler or the free hard diskcapacity. The processing time can be substantially increased, however, by too many harddisk accesses.

• Function block has no name• Function block has no parameters• Integer variable passed in HLL_HLL procedure call• Literally or identifier not found• Literally declared twice• Link file not found

Warning 66, "START ADDRESS NOT SPECIFIED IN OUTPUT MODULE", always appearswhen a block is being prepared and does not inhibit correct operation.

11–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 1 (PJ)

SINUMERIK 840/840CSINUMERIK 880/880 GA2

Part 2: HLL Data Generator

Planning Guide

Manufacturer Documentation

Introduction 1

Requirements for the Operation of the HLL DataGenerator 2

Installation 3

Preparations for Off-Line Testing of an HLL FunctionBlock 4

Operation 5

Error Messages 6

Contents

Page

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1

1.1 Embedding in the HLL System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–11.2 Functionality of the HLL Data Generator . . . . . . . . . . . . . . . . . . . . . . . 1–11.3 High-Level Language Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2

2 Requirements for the Operation of the HLL Data Generator . . . . . . 2–1

2.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–12.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1

3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1

3.1 Installation on the Hard Disk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13.1.1 Supplied Diskette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13.1.2 Installation Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–43.1.3 Configuration of the HLL Data Generator . . . . . . . . . . . . . . . . . . . . . . 3–63.2 Installation in Working Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–83.2.1 Loading the HLL Data Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–83.2.2 Creating the Data Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–103.3 Clearing the HLL Data Generator from Memory . . . . . . . . . . . . . . . . . . 3–11

4 Preparations for Off-Line Testing of an HLL Function Block . . . . . 4–1

4.1 Necessary User Actions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14.1.1 Loading and Unloading the HLL Data Generator . . . . . . . . . . . . . . . . . 4–14.1.2 Creating the Test Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–24.1.2.1 Including Libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–24.1.2.2 Using PLC System Functions in the Test . . . . . . . . . . . . . . . . . . . . . . 4–34.1.2.3 Starting the Off-Line Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–44.2 Background Information on the Test Frame . . . . . . . . . . . . . . . . . . . . . 4–5

5 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–1

5.1 Starting the Off-Line Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–15.1.1 Starting the High-Level Language Debugger . . . . . . . . . . . . . . . . . . . . 5–15.1.2 Calling the Function Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–25.1.3 Simulation of the PLC Cycle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–25.2 Calling the HLL Data Generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–35.3 General Information for the Operation of the HLL Data Generator . . . . . 5–45.3.1 Screen Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–45.3.2 Function Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–65.3.3 Help Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–6

5.4 Displaying the System Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–75.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–75.4.2 Menu 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–85.4.3 "Select Representation Format" Submenu . . . . . . . . . . . . . . . . . . . . . 5–95.4.4 "Select Data Type" Submenu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–125.4.5 "Select Numeric Format" Submenu . . . . . . . . . . . . . . . . . . . . . . . . . . 5–125.4.6 Menu 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–145.4.7 Non-Displayed System Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–185.5 Modifying the System Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–185.5.1 Modifying the System Data in the HLL Function Block . . . . . . . . . . . . . 5–195.5.2 Modifying the System Data in the HLL Data Generator . . . . . . . . . . . . . 5–205.6 Editing Data Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–225.7 Loading and Saving the System Data . . . . . . . . . . . . . . . . . . . . . . . . . 5–245.7.1 "Load/Save System Data" Submenus . . . . . . . . . . . . . . . . . . . . . . . . 5–245.8 Simulation of System Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5–27

6 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1

6.1 Error Messages During Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–16.2 Error Messages During Checking of the Configuration File . . . . . . . . . . 6–26.3 Error Messages During Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–3

11.92 1 Introduction

1.1 Embedding in the HLL System

1 Introduction

The HLL data generator is part of the HLL system. You can use the system to generate andtest function blocks for the PLC 135 WB in high-level languages.

1.1 Embedding in the HLL System

You can use the S5-HLL block generator to create function blocks for the PLC in the high-levellanguages PL/M and C. Executable blocks are stored in an S5-DOS file and can be transferredto the PLC.

The transferred HLL function blocks can be tested on the PG 750, 730 or 685 programmingdevices with the aid of the HLL on-line debugger. This test is comparable with the S5 function"STATUS BLOCK". The test can only be performed if the block can run in cyclic mode on thePLC.

The HLL data generator is used in combination with a standard high-level language debuggerto test the block initially on the development computer (off-line test). The test simulates thePLC system data and provides a convenient user interface for displaying and manipulatingthese system data.

The off-line test has the following advantages:

• It is easier to check that the algorithms which are implemented are correct.

• The generation and testing of the blocks are performed on the same unit. This reduces thetime taken to make modifications.

• A SINUMERIK control is not required for the off-line test and there is no consequent loadon the capacity of your controls.

• Blocks which cannot yet be included in cyclic mode can only be tested off-line.

1.2 Functionality of the HLL Data Generator

The functionality of the HLL data generator is divided into two main parts:

• The HLL data generator uses a memory area in the working memory of the developmentcomputer to simulate the PLC system data. A convenient user interface is provided for thedisplay and manipulation of the system data.

• The HLL data generator provides a test frame in which the HLL function blocks under testare combined. It performs the following tasks:

– It enables cyclic calling of the function block

– It provides a data interface which the function block can use to access the simulatedsystem data.

– It allows the function block to be tested with a high-level language debugger.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 1–1SINUMERIK 840/880 Part 2 (PJ)

1 Introduction 11.91

1.2 Functionality of the HLL Data Generator

Structure of the test frame

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Test framea a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Data interface

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Calling of HLL functionblock

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aHLL function block

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Memory for systemdata

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

HLL data generator

1.3 High-Level Language Debugger

The HLL data generator is used as a tool for the off-line test. A standard high-level languagedebugger is required for the actual test.

It is recommended to use the intel debugger DB86. The batch files supplied with the HLL datagenerator are configured for use with the DB86.

All information in this documentation which refers to the high-level language debugger are validfor the DB86.

In this documentation, it is assumed that you are familiar with the operation of the DB86.Reference is made to the operation of the DB86 only where it serves specifically to explain asituation more clearly.

1–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 2 Requirements for the Operation of the HLL Data Generator

2.1 Hardware Requirements

2 Requirements for the Operation of the HLLData Generator

2.1 Hardware Requirements

Computer

A PC 16-20, a PG 750/730 or another IBM-compatible PC is required for the operation of theHLL data generator.

Graphics cards

The HLL data generator supports all standard monochrome and color graphics cards(Hercules, EGA, CGA, VGA or compatible graphics cards). The configuration is entered in thefile DG.CFG.

Target hardware

The target hardware for the HLL function blocks is the PLC 135 WB. The HLL data generatorcan only be used to test function blocks which have been created for the PLC 135 WB systemwith ACOP .

2.2 Software Requirements

Operating system

The HLL data generator runs under the MS-DOS operating system (Versions 3.0 or higher).

Software components

The following software components, which are also required for the operation of the blockgenerator, must be installed:

• ASM86 for DOS (intel, Version 2.1)• PL/M-86 for DOS (intel, Version 2.7) • iC-86 for DOS (intel, Version 4.1)• LINK86 for DOS (intel, Version 2.7)• LOC86 for DOS (intel, Version 2.5)• Program editor (e.g. Aedit, Word, ...)

A high-level language debugger is also required for the off-line test. The following debugger isused here:• DB86 for DOS (intel, Version 1.0)

Compatible versions can also be used.

Memory requirements

The HLL data generator is loaded as a memory-resident program and uses approximately 160KB of working memory.

Interrupts

The HLL data generator uses interrupt vector 49H. This should not be modified after theinstallation of the memory-resident program.

The keyboard interrupt (9H) and the interrupt for diskette accesses (13H) are also used.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 2–1SINUMERIK 840/880 Part 2 (PJ)

11.92 3 Installation

3.1 Installation on the Hard Disk

3 Installation

This chapter describes the steps required to install the HLL data generator on your computer.

There are two parts to installation:

• The first part of the installation procedure only has to be performed once (see the sectionentitled "Installation on the Hard Disk").

• The second part of the installation is required every time you boot the computer (see thesection entitled "Installation in Working Memory".

3.1 Installation on the Hard Disk

This section describes the steps which only have to be performed once in order to install theHLL data generator on the hard disk.

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

Before you start the installation, you should createa back-up copy of the supplied diskette.

3.1.1 Supplied Diskette

The HLL data generator is supplied to you on a diskette. If you insert the diskette in Drive A: ofyour computer, you will see it has the following directory structure:

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

A:\

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

DG1_1

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

SOURCE

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

OBJECT

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a

LIST

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–1SINUMERIK 840/880 Part2 (PJ)

3 Installation 11.92

3.1.1 Supplied Diskette

The following files are stored in the individual directories:

A:\ The files required for the installation are stored in this directory. Also stored here aretemplates for batch files which are adapted to the selected directory structure during theinstallation, before being copied.

INSTALL.EXE Installation program

INST.BAT Batch file for installation; is called by the installation program

GEN_SYS.EXE Program for adapting the batch files *S.BAT; is called by theinstallation program

PCADRGES.BAT Template for batch file PCADRGEN; is adapted byGEN_SYS.EXE and used by ADRERZ (see directoryDG1_1).

LILOCS.BAT Template for batch file LILOC; this generates an executableprogram for off-line testing of a C block; it is adapted byGEN_SYS.EXE

LILOPS.BAT Template for batch file LILOP; this generates an executableprogram for off-line testing of a PL/M block; it is adapted byGEN_SYS.EXE

TRYITS.BAT Template for batch file TRYIT; this calls up debugger DB86;it is adapted by GEN_SYS.EXE

COMCS.BAT Template for batch file COMC; this is used to compile the Ctest frame; it is adapted by GEN_SYS.EXE

COMPS.BAT Template for batch file COMP; this is used to compile thePL/M test frame; it is adapted by GEN_SYS.EXE

README.TXT Information about late modifications (may not always exist)

DG1_1 <DIR>

DG1_1: DG1_1: The system data and programs for the HLL data generator are stored inthis directory.

DG1_1.EXE HLL data generator

DGINST.BAT Batch file for loading the memory-resident program DG1_1

DGDEL.BAT Batch file for deleting the memory-resident program DG1_1

DG1.CFG Configuration file for monochrome monitors

DG2.CFG Configuration file for color monitors

ADRERZ.EXE Program for generating the data interface between the datagenerator and the function block to be tested

C.OBJ Start files for calling function blocks under MS-DOSCSTART.OBJCNOFLTC.OBJ

3–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 3 Installation

3.1 Supplied Diskette

GETPARC.EXE Program and help files for generating the C test frameMAINS0.C according to the call parametersMAINS1.CMAINS2.C

GETPARP.EXE Program and help files for generating the PL/M test frameMAINS0.PLM according to the call parametersMAINS1.PLMMAINS2.PLMMAINS3.PLMMAINS4.PLM

SOURCE <DIR>OBJECT <DIR>LIST <DIR>

SOURCE: CFB255.C Example blockHLL_FKT1.C System functionsHLL_ADB.SRC System functions

OBJECT: HLL_FKT1.OBJ System functionsHLL_ADB.OBJ System functions

LIST: HLL_FKT1.LST System functionsHLL_ADB.LST System functions

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–3SINUMERIK 840/880 Part 2 (PJ)

3 Installation 11.92

3.1.2 Installation Program

3.1.2 Installation Program

On the supplied diskette, you will find the installation program INSTALL.EXE for installing theHLL data generator on the hard disk. Insert the diskette in a drive on your computer andchange to this drive. To start the program, enter the following command in the command line:

INSTALL

When you press the Return key, the following menu appears on the screen:

Installation Menu

Welcome to theinstallation program

for the data generator

• To begin, define your individual path environment with function key F1.• Then start the installation by pressing function key F2.• Press function key F8 to exit the installation.

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Copy

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

End

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Paths

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Installation Program Data Generator Menu 1 Version 1.1

3–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 3 Installation

3.1.2 Installation Program

When you press function key F1, a menu appears in which you can create the directorystructure to be used during the installation.

Defining the Directories for the Installation

Data GeneratorSystem Program Data : > C:\DG <

Block Generator

System Programs : > C:\PLM <

System Data : > C:\PLM <

Source Data : > C:\PLM\SOURCE <

Object Files : > C:\PLM\OBJECT <

Program Lists : > C:\PLM\LIST <

Standard Debugger DB86

System Program Data : > C:\DB86 <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Copy

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Installation Program Data Generator Menu 1 Version 1.1

The default settings suggested for the directories are either the standard installation for thedata generator or the directories used in the installation of the block generator.

The following files are stored or are expected to be found in the individual directories:

Data generator:

System program data This directory contains the system data and programs for thedata generator.

Block Generator:

System programs All intel tools (compiler, linker, etc.) and all libraries which areto be included are stored here.

System data All relevant data of the block generator are stored here.

Source data This is where the C or PL/M source files are stored.

Object files The compiled, linked and located HLL blocks are stored here.

Program lists The program lists and MAP files of the HLL blocks are storedhere.

Standard debugger DB86:

System program data The system programs of the standard debugger (intel DB86)are stored here.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–5SINUMERIK 840/880 Part 2 (PJ)

3 Installation 11.92

3.1.2 Installation Program

The conventional editing keys are available for changing the default directories: Ins, Del, BS,Home, End, Ret and the cursor control keys. When you have changed the name of adirectory, you can restore the old name by pressing the Escape key as long as the cursor isstill positioned in the field.

When you have specified all the directories, start the installation by pressing function key F2.

The installation then proceeds as follows:

• The specified directories are created.

• The DG.CFG configuration file is selected. This file defines the screen representation forthe data generator.

The data generator can operate in monochrome mode (DG1.CFG) or in color mode(DG2.CFG). The installation program detects the currently active video mode andgenerates the DG.CFG file accordingly. You will find information on how to change theconfiguration in the section entitled "Configuration of the HLL Data Generator".

• The batch file INST.BAT is then started. This file copies the standard files of the datagenerator to the individual directories.

• Finally, the program GEN_SYS.EXE is started. This program creates the files LILOC.BAT,LILOP.BAT, TRYIT.BAT, PCADRGEN.BAT, COMPC.BAT and COMP.BAT and copiesthese files to the appropriate directories.

When all the files have been copied, you can exit the installation program by pressing functionkey F8.

3.1.3 Configuration of the HLL Data Generator

The configuration of the HLL data generator is defined by the file DG.CFG. Two variants ofthis file are supplied on the installation diskette:

• DG1.CFG Configuration for monochrome monitors (80 lines)• DG2.CFG Configuration for color monitors (80 lines)

You can determine the configuration manually by renaming one of these files DG.CFG. The fileDG.CFG must be stored in the same directory as the HLL data generator (C:\DG in thestandard installation).

The installation program uses the video mode set in the installation to determine the correctconfiguration file for your graphics card, and copies this to the directory of the data generatorwith the name DG.CFG. (The data generator directory is C:\DG in the standard installation).

The following information is only relevant if you want to modify the configuration file manually.

The following settings are entered in the configuration file:

• Text mode for adapting the HLL data generator to the graphics card

• Foreground and background color of the individual windows for display of the various dataareas

• Data type, numeric format (base) and data format of the values in the individual windows(default settings)

3–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 3 Installation

3.1.3 Configuration of the HLL Data Generator

• Access paths for loading and saving the following:

– Process image– Data blocks– Address lists

You can modify the configuration file to meet your needs with the aid of the program editor.Each line of the configuration file has the following structure:

Identifier = value; /* Comment */

Example:

INPUT-TYPE=1; /* byte = 1, word = 2, doubleword = 4 */

This structure may not be changed. Neither can you add or delete lines. When you load theHLL data generator in memory, the contents of the file are checked (see the section entitled"Loading the HLL Data Generator").

Descriptions and information on the permissible values are provided in the comment for eachline.

• The following values can be defined for text mode :

-1 Accept previous text mode 2 Monochrome, 80 lines 3 Color, 80 lines 7 Monochrome, 80 lines for monochrome adapters or Hercules cards

Example:

TEXTMODE=3; /* (MONO) Monochrome = 7, (C80) Color = 3, (BW80) = 2 */

• The following values can be defined for the data types :

1 Byte2 Word3 Doubleword

Example:

OUTPUT-TYPE=2; /* byte = 1, word = 2, doubleword = 4 */

• The following values can be defined for the numeric formats (base):

0 Hexadecimal format1 Decimal format2 BCD format3 ASCII format

Example:

OUTPUT-BASE=0; /* hex = 0, dec = 1, bcd = 2, ascii = 3 */

Note:

Please note that certain combinations are not permitted when defining the data type andnumeric format:

Data type word or doubleword and ASCII numeric formatData byte and BCD numeric format

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–7SINUMERIK 840/880 Part 2 (PJ)

3 Installation 11.91

3.1.3 Configuration of the HLL Data Generator

• You can define the following values for the data format :

0 STEP 5 data format1 intel data format

Example:

OUTPUT-FORMAT=1; /* S5 = 0, Intel = 1 */

• The DOS conventions should be observed when entering the access paths . Please takecare to define existing paths only.

• The parameters for the foreground and background colors are selected such that thevarious HLL programs (block generator, data generator, on-line debugger) all have astandard appearance. They should therefore not be modified.

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

Please take care not to change the structureof the individual lines in the file.

In order to ensure that you always keep a valid version of theconfiguration file, you should only modify the file DG.CFG. The files

DG1.CFG and DG2. CFG then remain intact as correct templates.

3.2 Installation in Working Memory

This section describes the steps required to install the HLL data generator in the workingmemory of your computer.

These steps should always be performed at the start of an off-line test, i.e. when you switchon the computer or when you have cleared the HLL data generator from the working memory.

If you always want to use the HLL data generator, you can include the call for loading the HLLdata generator in the AUTOEXEC.BAT file. Please remember, however that this will use upmemory capacity.

You will also find a summary of the steps required to install the HLL data generator in workingmemory in the section entitled "Loading and Unloading the HLL Data Generator". If you arenot interested in the details at this point, you can therefore skip the rest of Chapter 3.

3.2.1 Loading the HLL Data Generator

The HLL data generator is loaded as a resident program in the working memory. To load theHLL data generator, call the program DG1_1 with the command line parameter INST(directory C:\DG in the standard installation).

Enter the following in the DOS command line:

DG1_1 INST

3–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 3 Installation

3.2.1 Loading the HLL Data Generator

When you press Return, the following actions are performed:

• The system first checks whether the HLL data generator is already loaded. If this is thecase, the program is aborted with the following error message:

****** Installation error ******

Installation not possible, since data

generator is already installed!!!

Please press a key ...

• Then the configuration file DG.CFG is checked. If this check detects an error, an errormessage appears with information about the relevant identifier and the cause of the error,e.g.:

****** Error in CFG file ******

TEXTMODE

cannot find the ';'

Please press a key ...

The program is loaded in spite of the error. The line in the configuration file which containsthe error is ignored. A default value is used for the relevant identifier.

• Finally, the HLL data generator is loaded into memory. The following last messageappears:

****** Installation ******

Data generator is now installed.

Call up with SHIFT_LEFT & SHIFT_RIGHT(simultaneously)

Please press a key ...

When the HLL data generator is resident in memory, it can be called up from any runningprogram by pressing the left and right shift keys simultaneously. The high-level language inteldebugger DB86 is used for the off-line test. It is not possible to call the program up from theDOS command line.

Notes:

• The batch file DGINST.BAT can also be used to load the HLL data generator. Thisperforms the above call automatically and subsequently calls the program ADRERZ.EXE,which creates the data interface between the HLL data generator and the function blocksto be tested (see the section entitled "Creating the Data Interface".

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–9SINUMERIK 840/880 Part 2 (PJ)

3 Installation 11.92

3.2.1 Loading the HLL Data Generator

• The HLL data generator should always be the last memory-resident program to be loaded,otherwise it can no longer be cleared from the memory (except by rebooting the computer;see the section entitled "Clearing the HLL data generator from Memory").

• The DOS environment area of the computer should not be changed after the HLL datagenerator has been loaded in the working memory (DOS commands SET, PATH, etc.).

3.2.2 Creating the Data Interface

When the HLL data generator is resident in memory, the addresses for the data interface tothe function blocks have to be determined.

When you load the HLL data generator, memory is reserved for the simulation of the PLCsystem data. The start address of this memory area and the size of the individual system dataareas provides a unique indication of the start addresses of the system data areas.

For off-line testing of an HLL function block it is necessary for the block to access thesesystem data areas. The data interface is created for this purpose.

The data interface is a file in which the start addresses of the various system data areas aredefined. This file is generated initially in assembler code (DAT_ADR.SRC).

To generate this file, enter the following call in the DOS command line:

ADRERZ PCADRGEN

When you press Return, the ADRERZ.EXE program generates the file DAT_ADR.SRC. Thecommand line parameter PCADRGEN causes the batch file PCADRGEN.BAT to be executedimmediately afterwards.

This batch file contains the calls that are necessary to assemble (ASM86), link (LINK86) andlocate (LOC86) the file DAT_ADR.SRC.

When this batch file has been executed, the data interface exists in the form of the fileDAT_ADR.LOC. This file must be combined with the function block for the off-line test (seeSection 4).

The DAT_ADR.* files are stored in the C:\DG directory (in the standard installation).

Notes:

• The addresses at which the data areas are stored in memory depend on the DOSenvironment configuration on your computer. This means that the data interface only hasto be regenerated if you change the environment area (with the DOS commands SET,PATH, etc.) or if other memory-resident programs are loaded afterwards.

• If you want to ensure that the correct addresses are always used, you should generate anew data interface each time you load the HLL data generator.

The batch file DGINST.BAT is provided for this purpose. This file performs the calls forloading the HLL data generator and creating the data interface. If you always want to usethe HLL data generator on your computer, you can integrate this file in the AUTOEXE.BATfile; the calls are then performed automatically during runup of the computer.

3–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 3 Installation

3.3 Clearing the HLL Data Generator from Memory

3.3 Clearing the HLL Data Generator from Memory

The HLL data generator is loaded in working memory as a resident program. If you need tofree the memory capacity used by this program, you must clear the program from the memory.

The batch file DGDEL.BAT is provided for this purpose. This file calls the programDG1_1.EXE with the parameter DEL. Enter the following in the DOS command line:

DGDEL

When you press Return, the HLL data generator is cleared from the memory.

This procedure is only successful if the HLL data generator was the last memory-residentprogram to be loaded. If this is not the case, the following error message appears:

****** Deinstallation error ******

Deinstallation is not possible, since

the data generator is not the last TSR program

Please press a key ...

In this case, the HLL data generator continues to be resident in memory and can only becleared by rebooting the computer.

If the HLL data generator has been successfully cleared from the memory, the following finalmessage appears:

****** Deinstallation ******

Data generator has been cleared from memory.

To reinstall: <DG1_1 inst>

Please press a key ...

If the HLL data generator has not been installed and you attempt to clear it from memory, thefollowing message appears:

****** Deinstallation error ******

Deinstallation not possible.

Data generator not yet installed!!!

Please press a key ...

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–11SINUMERIK 840/880 Part 2 (PJ)

11.92 4 Preparations for Off-Line Testing of an HLL Function Block

4.1 Necessary User Actions

4 Preparations for Off-Line Testing of an HLLFunction Block

The following requirements must be met in order to test a function block with the aid of theHLL data generator:

• The HLL data generator and the DB86 high-level language debugger has beensuccessfully installed on the hard disk of your computer.

• The function block to be tested has been created with the S5-HLL block generator and canbe compiled without errors.

• The function block has been created for PLC system PLC 135 WB with ACOP.

When these requirements have been met, you can start the preparations for the off-line test.

The section entitled "Necessary User Actions" describes all the steps that you have toperform before you start the test. It also describes how to clear the data generator from thememory again. This section repeats the important operating information given in Chapter 3.

The section entitled "Background Information on the Test Frame" contains detailed informationintended to help the reader understand the procedures. This information is not necessarilyrequired for the actual operation of the data generator.

4.1 Necessary User Actions

4.1.1 Loading and Unloading the HLL Data Generator

Before you can start the off-line test, the HLL data generator must be resident in the workingmemory of your computer. This is performed by entering the following command in thecommand line:

DGINST

When you press the Return key, the data generator is loaded and the data interface betweenthe data generator and the HLL function block is created.

If you want to terminate the test and free the storage capacity in the working memory used bythe program, you must clear the data generator from the memory. You can do this by enteringthe following command in the command line:

DGDEL

When you press the Return key, the data generator is cleared from the memory.

A more detailed description of this procedure and possible error messages is provided inChapter 3, together with addition information about the installation options.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–1SINUMERIK 840/880 Part 2 (PJ)

4 Preparations for Off-Line Testing of an HLL Function Block 11.92

4.1.2 Creating the Test Frame

4.1.2 Creating the Test Frame

This section describes the steps which must be performed in order to test a specific block. Ifyou have already tested a block and would like to test another block, you must perform thesteps again.

The off-line test is started and the preparatory actions are performed mainly by calling thefollowing batch files (see the section entitled "Starting the Off-Line Test"):

• LILOC.BAT for C function blocks• LILOP.BAT for PL/M function blocks

In certain cases, these batch files or your HLL block file must be modified first. The necessarysteps are describes in the sections entitled "Including Libraries" and "Using PLC SystemFunctions in the Test".

4.1.2.1 Including Libraries

The following intel libraries are normally included in the batch files LILOC.BAT (for C blocks)and LILOP.BAT (for PL/M blocks):

• CLIBC.LIB• CDOSC.LIB• PLM86.LIB (only for PL/M blocks)

If you use functions from other libraries in your HLL block, these libraries must be included. Todo this, extend the file LILOC.BAT (or LILOP.BAT) as follows:

REM Link and locate block

ECHO ************************************************

ECHO *** Link and locate block ***

ECHO ************************************************

REM Create input redirection file

ECHO C:\ DG\ C.OBJ, & > LLL

ECHO C:\ DB86\ MAIN.OBJ, & >> LLL

ECHO C:\ DG\ HLL_FKT1.OBJ, & >> LLL

ECHO C:\ DG\ HLL_ADB.OBJ, & >> LLL

ECHO C:\ DG\ CNOFLTC.OBJ, & >> LLL

ECHO C:\ PLM\ CLIBC.LIB, & >> LLL

ECHO C:\ PLM\ CDOSC.LIB, & >> LLL

ECHO ************************************************

ECHO *** Insert further libraries here ***

ECHO ************************************************

ECHO C:\PLM\BIBLI.LIB, & >> LLL

The line printed in bold is an example for linking another library.

4–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 4 Preparations for Off-Line Testing of an HLL Function Block

4.1.2 Creating the Test Frame

Notes:

• All standard libraries must be stored in the directory that contains the intel tools (blockgenerator: path system programs; see also the section entitled "Installation Program").

• You can also link libraries from which you do not use functions to your block. The size ofthe link file is not greater, since only the functions from the libraries that are actually usedare included. This way, you don't have to modify the batch files LILOC.BAT or LILOP.BAToften.

4.1.2.2 Using PLC System Functions in the Test

The following system functions can be called from an HLL function block:

• HLL_HLL() Call other HLL function blocks• HLL_S5() Call STEP 5 blocks• HLL_MACRO() Call function macros• HLL_ADB() Open data blocks• HLL_STOP() Initiate a system stop• HLL_LIM() Load OB disable identifiers• HLL_SIM() Set OB disable identifiers

Please refer to the description of the S5 HLL block generator for details of the call parametersfor the individual system functions.

The functions HLL_ADB() and HLL_STOP() are simulated for the off-line test. You will findinformation on the operating principle of these functions in Chapter 5.

The remaining functions can be called from HLL function blocks, but do not perform anyactions. If the program processes results of these functions, these results must be input withthe aid of the HLL data generator.

The system functions are made available by the files HLL_FKT.OBJ and HLL_ADB.OBJ.These are linked to the HLL function block to be tested.

Notes:

• The functions HLL_HLL() and HLL_MACRO() are called with a variable number ofparameters. A stack correction cannot therefore be performed in the simulation for the off-line test when the functions are terminated.

If you call up these functions several times, a stack overflow will probably occur. This willlead to incorrect processing of the program. In this case, you should reload the functionblock or the high-level language debugger.

In order to prevent this occurrence, you can either correct the stack manually during thetest with the aid of DB86 or comment out the corresponding calls in the function blockbefore the test.

• It is not possible to combine multiple HLL function blocks for the off-line test. If this isabsolutely necessary for the test, you will have to change the source programs of therelevant HLL function blocks.

The procedure names of the called function blocks (FUNCTION)() must be changed. Thecalling function block must call these procedures directly (not with HLL_HLL()).

However, a function block which has been modified in this way cannot be executed on thePLC.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–3SINUMERIK 840/880 Part 2 (PJ)

4 Preparations for Off-Line Testing of an HLL Function Block 11.92

4.1.2 Creating the Test Frame

4.1.2.3 Starting the Off-Line Test

When you have installed the HLL data generator and modified the batch files and your blockfile (if necessary), you can start the off-line test.

To do this, change to the directory of the data generator (C:\ in the standard installation) andcall up the batch file LILOC.BAT (for C blocks) or LILOP.BAT (for PL/M blocks). The commandline parameter which you should enter is the name of the source file of the function block tobe tested (without the file name extension).

For example, to start the test for PL/M function block FB 11, enter the following in thecommand line:

LILOP PFB011

When you press the Return key, the block is compiled, the test frame is generated (fileMAIN.C or MAIN.PLM) and the required files are linked.

If errors occur during compilation of the block, the batch file is aborted with the following errormessage:

************************************************

*** Sorry, I have to abort ***

*** batch file !!! ***

************************************************

If this happens, please correct the errors with the aid of the S5-HLL block generator. The blockmust be free of errors for the test.

When the block has been compiled and linked without errors, the high-level languagedebugger DB86 is started. This loads the test frame, inserts a break point before the functionblock call (INI_PAR label) and executes the program up to this point.

If the function block has call parameters, these can be assigned with the DB86.

For input parameters, enter the desired value; for output parameters, enter the desired addressof a system or user data, e.g.:

INP1 = 10OUT1_ADR = . A_Byte [3]

The function block test can now begin. The program runs in an infinite loop in order to call thefunction block repeatedly (simulation of the PLC cycle).

As long as you do not change the call parameters (manually or in the program), these areassigned the values which you entered at the start of the test every time the function block iscalled.

You will find more detailed information about the procedures described here and the test framein the section entitled "Background Information on the Test Frame".

4–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 4 Preparations for Off-Line Testing of an HLL Function Block

4.2 Background Information on the Test Frame

4.2 Background Information on the Test Frame

This section contains background information about the structure of the test frame and theprocesses which create it using the files LILOC.BAT and LILOP.BAT.

This information will help you to understand the procedure more clearly, but is not absolutelynecessary for the operation of the HLL data generator.

Tasks of the test frame

The test frame has four main tasks:

• It provides an environment for testing with the high-level language debugger DB86.

• It provides a main program which calls the tested function blocks cyclically (simulates thePLC cycle)

• It integrates the data interface for the HLL data generator

• It simulates the system functions for the test.

Generation of the test frame

The generation of the test frame is controlled by the batch file LILOC.BAT (or LILOP.BAT).The rough procedure of the batch files is described below:

• The block to be tested is compiled at the start of the batch file.

• The test frame is subsequently adapted (file MAIN.C or MAIN.PLM) to your block. Theprogram GETPARC.EXE (or GETPARP.EXE) is called up for this purpose.

This program uses the source file of your block to determine the call parameters requiredand stores these in the file MAINC?.C (or MAINP?.PLM). The file MAINS?.C (orMAINS?.PLM) is subsequently used to generate the file MAIN.C (or MAIN.PLM). This file isthen compiled.

Example:

For a C function block with 2 input parameters (type word and type bit) and one outputparameter (type byte), the file MAIN.C could have the following structure:

/************************************* /

/* Typedef and constants */

/************************************* /

typedef unsigned char byte;

typedef unsigned char mask;

typedef unsigned char bit;

typedef unsigned int word;

typedef int sword;

typedef unsigned long int dword;

far void (* far HLL_STOP)(unsigned int);

far void (* far HLL_HLL)();

far void (* far HLL_MACRO)();

far void (* far HLL_S5)(unsigned int, unsigned int);

far void (* far HLL_LIM)(unsigned char *);

far void (* far HLL_SIM)(unsigned char *);

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–5SINUMERIK 840/880 Part 2 (PJ)

4 Preparations for Off-Line Testing of an HLL Function Block 11.92

4.2 Background Information on the Test Frame

extern far void HLL_STOP(unsigned int);

extern far void HLL_HLL();

extern far void HLL_MACRO();

extern far void HLL_S5(unsigned int, unsigned int);

extern far void HLL_ADB(unsigned int, unsigned int);

extern far void HLL_LIM(unsigned char *);

extern far void HLL_SIM(unsigned char *);

main()

{

word INP1;

bit INP2;

mask INP2_MSK;

byte * OUT1_ADR

HLL_STOP = HLL_STOP; /** Pointer initialization **/

HLL_HLL = HLL_HLL;

HLL_MACRO = HLL_MACRO;

HLL_S5= HLL_S5;

HLL_LIM = HLL_LIM;

HLL_SIM = HLL_SIM;

while(1) {

INI_PAR:

FUNCTION ( INP1,

INP2,

INP2_MASK

OUT1_ADR);

}

}

The type definitions are followed by the declaration of the system functions. The mainprocedure (main) defines the block-dependent parameters and initializes the pointers tosome of the system functions. Finally, the infinite loop, in which the function block(FUNCTION) is called, is performed.

• When the test frame has been compiled, the files are linked together. The source and listfiles required for the display are then copied to the directory of the DB86.

• The file BAUSTEIN.MAC is then generated, in order to initialize the DB86. TRYIT.BAT isfinally called in order to start the DB86. The function block to be tested (including the testframe) is loaded on the basis of the file BAUSTEIN.MAC and the program is executed upto the INI_PAR label in main.

4–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.1 Starting the Off-Line Test

5 Operation

This chapter contains the instructions for the operation of the HLL data generator.

Before you can start work with the HLL data generator, the program must be successfullyinstalled (see Chapter 3) and the HLL function block to be tested must be prepared for the off-line test (see Chapter 4).

The HLL data generator is best used in combination with a standard high-level languagedebugger. It is recommended to use the intel debugger DB86. All information in this chapterrelating to the high-level language debugger refers to the DB86.

For information on the operation of the high-level language debugger, please refer to thedebugger manual.

5.1 Starting the Off-Line Test

5.1.1 Starting the High-Level Language Debugger

The high-level language debugger DB86 is used for the off-line test of the function block.

When you have generated the test frame for your HLL function block with the aid of the fileLILOC.BAT (or LILOP.BAT, see Chapter 4), the batch file TRYIT.BAT is called upautomatically. This batch file calls the DB86. Two call parameters (DB86 controls) are passed:

• swap This parameter defines the use of the screen pages by thedebugger. It must be specified so that the system can switchto the HLL data generator from the DB86.

• macro (baustein.mac) This parameter defines a file (BAUSTEIN.MAC) whichcontains the DB86 commands to be executed when thedebugger is started.

The file BAUSTEIN.MAC contains DB86 commands which are executed when the debugger isstarted. This file is generated automatically (see Chapter 4) when you prepare the HLLfunction blocks for the off-line test with the aid of the batch file LILOC.BAT (C function blocks)or LILOP.BAT (PL/M function blocks).

The program for testing the HLL function block is loaded automatically. If the program cannotbe loaded or only the assembler listing appears in the debugger, please check the file namesand access paths which have been specified.

If you exit the DB86 again and would now like to continue the test for the same block, you cancall up the batch file TRYIT.BAT directly.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–1SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.91

5.1.2 Calling the Function Block

5.1.2 Calling the Function Block

When the high-level language debugger has been started, the program is positioned before thecall of the function block to be tested (INI_PAR label). A break point has been inserted at thispoint.

You can now start the test. The full function set of the high-level language debugger isavailable for this purpose. If the function block to be tested has call parameters, you canassign these using the DB86. For input parameters, enter the desired value; for outputparameters, enter the desired address of a system or user data, e.g.:

INP1 = 10OUT1_ADR = . A_Byte [3]

The program runs in an infinite loop which simulates the PLC cycle. If you want the program torun until the function block call, press function key F5 "Go Til Breakpoint" (DB86).

5.1.3 Simulation of the PLC Cycle

The PLC cycle is simulated by an infinite loop for the off-line test. The function block to betested is called repeatedly by this loop.

When the program is loaded in the debugger, a break point is inserted before the functionblock call. This halts the program execution at the function block call in each cycle.

Simulation of the I/O

The PLC scans the existing I/O modules on start-up and enters the address for each I/Omodule in the appropriate list.

The entire I/O area is simulated as a memory area for the off-line test. The HLL data generatorinitializes the complete I/O address lists with the addresses of the individual bytes in thismemory area.

In order to simulate I/Os which are not installed, you must delete the entries from the addresslists. You should not change the values in the address lists except in this case.

5–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 5 Operation

5.2 Calling the HLL Data Generator

5.2 Calling the HLL Data Generator

When the program has been loaded in the high-level language debugger, you can start testingthe function block. The full function set of the high-level language debugger is available for thispurpose.

You can run through the program step-by-step or define breaks at any point in the program.You can also output and change the contents of variables used in the program.

The PLC system data (inputs, outputs, flags, etc.) are usually key factors in the programexecution of a function block. By calling the HLL data generator, you can gain a rapid overviewof these data, or modify the data in order to control the execution of the program.

The HLL data generator is activated by pressing the left and right Shift keys simultaneously.The program execution in the high-level language debugger should be interrupted (byactivating single-step mode or break points) before calling up the HLL data generator.

Keys for Selecting the HLL Data Generator

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

When you activate the HLL data generator for the first time, the main menu (Menu 1) appears.If you now press the two Shift keys again, you return to the high-level language debugger.

If you switch back and forth between the high-level language debugger and the HLL datagenerator during the test, the HLL data generator always displays the menu which was lastactive.

If there is no response when you press the two Shift keys, please check that you haveinstalled the HLL data generator correctly (see Chapter 3).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–3SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.91

5.2 Calling the HLL Data Generator

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

Press the left and right Shift keys to switch between the high-level

language debugger and the HLL data generator. Please only press the

two keys for a short time. Keeping the keys depressed continuously can

produce uncontrollable effects which may cause the computer to crash.

5.3 General Information for the Operation of the HLL Data Generator

Before the features for the display and representation of the individual PLC system data areasare described in more detail in the next chapters, here is some general information for theoperation of the HLL data generator.

5.3.1 Screen Layout

Two base menus (Menu 1 and Menu 2) are provided in the HLL data generator for the displayof system data. The screen layout in the two menus is similar.

Screen Layout

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX word >>NR 0000: 00 00 00 00 00 00 00 00 NR 0000: 0000 0000 0000 0000NR 0008: 00 00 00 00 00 00 00 00 NR 0004: 0000 0000 0000 0000NR 0016: 00 00 00 00 00 00 00 00 NR 0008: 0000 0000 0000 0000

FLAGS: << INTEL HEX Dword >>NR 0000: 00000000 00000000 00000000 00000000NR 0004: 00000000 00000000 00000000 00000000NR 0008: 00000000 00000000 00000000 00000000

DATA BLOCK: D???? << INTEL HEX word >> NR 0000:NR 0008:NR 0016:NR 0024:

>> Enter digit or 'BS', 'CR' or 'ESC'

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Outputs

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Menu 2

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Inputs

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Flags

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Dblk

a aa aa aa aa a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Load

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Save

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 1 Version 1.1

Active window Inactive window Message line Function key assignments

5–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 5 Operation

5.3.1 Screen Layout

Windows

The individual system data areas are displayed in various windows. Windows are provided for:

• Inputs• Outputs• Flags• A data block• Counters• Timers• I/O address lists• Block address lists• Interpreter data

The system data areas are displayed in tables in various windows. For example:

INPUTS: << INTEL HEX byte >> NR 0000: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

The current representation format ("INTEL HEX byte" in the example) is entered beside thedata identifier. You can select the representation format with the function keys. Thedescriptions of the individual formats are included in the description of the submenus for theselection of representation format, data type and numeric format. The first column in the tablecontains the numbers of the first items for the individual lines. The number of items per linedepends on the representation format selected.

The HLL convention should be observed in the numbering of items. For example:

Input word 4 consists of input bytes 8 and 9

Activating a window

In both main menus of the HLL data generator, the system data are combined in windows (forinputs, outputs, etc.). In order to manipulate the system data in one of these windows (i.e. tochange the values or the numeric format, or to initialize or delete the values), you must firstactivate the window by pressing one of the function keys (e.g. F1 "Inputs").

The active window is highlighted in color. A cursor is provided for modifying the values withinthe active window. The cursor points to one of the elements, and this element is highlighted ina different color.

Only a section of the data area is ever displayed in the windows. You can scroll this windowpane across the entire data area with the following keys:

, Scroll through active windowPgUp, PgDn Page through active window

Message line

Error messages and operating information are displayed in the message line. These messagescan generally be deleted again by pressing any key.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–5SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.3.2 Function Keys

5.3.2 Function Keys

Function keys F1 to F8 are mainly used to operate the HLL data generator. The currentmeaning of the function keys is indicated by the function key identifiers in the bottom line ofthe screen.

There are three groups of function key identifier:

• Empty identifier The function key is not used in the active menu

• Identifier in angle brackets You can perform an action directly by pressingthis function key (e.g. HEX: switch tohexadecimal notation)

• Identifiers without angle brackets Pressing this key calls up a submenu (e.g. Dtype calls up the submenu for selection of thedata type)

Function key F8

Function key F8 has a similar response in all the menus:

• In submenus, you can return to the next higher menu by pressing F8.

• In the main menus, you can switch between Menu 1 and Menu 2 by pressing F8.

5.3.3 Help Function

In addition to function keys F1 to F8, F10 also has a special meaning. You can display a helpscreen in any menu of the HLL data generator by pressing this key.

This help screen provides information on the current meaning of the function keys and otherpossible inputs. The help-function is context-sensitive, i.e. only information relevant to theactive menu is displayed.

You can clear the help screen again by pressing any key.

5–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.3.2 Function Keys

Help Screen in Main Menu 1

EINRNRNR

MENRNRNR

DANRNR

NR 0016:NR 0024:

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Outputs

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Menu 2

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Inputs

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Flags

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Dblk

a aa aa aa aa a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Load

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Save

FUNCTION KEY CONTROL << Menu 1 >>===============

F1 : Activate data area for inputsF2 : Activate data area for outputsF3 : Activate data area for flagsF4 : Activate data area for data blocks (Dblk)F6 : Load data for specified data areas (from diskette)F7 : Save data from specified data areas (to diskette)F8 : Select second page of data generatorF10 : Call help page

Please press any key ...

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 1 Version 1.1

5.4 Displaying the System Data

5.4.1 Overview

The following PLC system and user data can be displayed using the HLL data generator (themenu in which the data are displayed is specified in parentheses):

• Process image

– Inputs (Menu 1)– Outputs (Menu 1)– Flags (Menu 1)– Timers (Menu 2)– Counters (Menu 2)

• Block address lists (Menu 2)

List of the start addresses of

– Data blocks (DB/DX)– Function blocks (FB/FX)– Step blocks (SB)– Program blocks (PB)– Organization blocks (OB)

• I/O address lists (Menu 2)

Lists of the addresses of

– Inputs (PeE)– Outputs (PeA)

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–7SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.4.1 Overview

• Extended I/O address lists (Menu 2)

Lists of addresses of

– Inputs (QeE)– Outputs (QeA)

• Interpreter data (Menu 2)

– Status bits (binary and digital)– Number of active organization block

• Data block

Contents (Menu 1) and length (Menu 2) of a data block

Two main menus (Menu 1 and Menu 2) are available for the display of these data. Varioussubmenus are included in each main menu. These differ from the main menus solely withrespect to the function key assignments and input possibilities.

5.4.2 Menu 1

Menu 1

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX word >>NR 0000: 00 00 00 00 00 00 00 00 NR 0000: 0000 0000 0000 0000 NR 0008: 00 00 00 00 00 00 00 00 NR 0004: 0000 0000 0000 0000 NR 0016: 00 00 00 00 00 00 00 00 NR 0008: 0000 0000 0000 0000 FLAG: << INTEL HEX Dword >>NR 0000: 00000000 00000000 00000000 00000000 NR 0004: 00000000 00000000 00000000 00000000 NR 0008: 00000000 00000000 00000000 00000000

DATA BLOCK: D???? << INTEL HEX word >> NR 0000:NR 0008NR 0016:NR 0024:

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Outputs

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Menu 2

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Inputs

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Flags

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Dblk

a aa aa aa aa a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Load

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Save

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 1 Version 1.1

5–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 5 Operation

5.4.2 Menu 1

The following system data are displayed in Menu 1:

• Inputs (input bytes 0...127)• Outputs (output bytes 0...127)• Flags (flag bytes 0...255)• A data block (data words 0...2042)

Activating the windows

The individual windows can be activated by pressing the function keys. The following functionkeys are available in Menu 1:

F1 InputsF2 OutputsF3 FlagsF4 Dblk (data block)

You can activate a window by pressing one of these function keys, in order to select thesubmenu for selection of the representation format. The window is highlighted in color and acursor appears (see also the section entitled "Modifying the System Data)".

Further function keys in the main menu

F6 Load See "Loading and Saving" sectionF7 Save See "Loading and Saving" sectionF8 Menu 2 Selects Menu 2

5.4.3 "Select Representation Format" Submenu

In this submenu you can select the representation format for the active window and initialize ordelete the data in the active window. The following function keys are available:

F1 D Type Data typeF2 D Base Numeric format (base of numeric representation)F3 <S5> STEP 5 data formatF4 <INTEL> intel data formatF5 Init Initialize data in active window

F7 <Delete> Delete selected data areaF8 <Back> Return to main menu

F1 D Type

Pressing this function key calls up a submenu for selection of the data type (byte, word, etc.).

F2 D Base

Pressing this function key calls up a submenu for selection of the numeric format(hexadecimal, decimal, ASCII, etc.).

F3 <S5>

Press the key to select the STEP 5 data format. This action is only performed when the datatype "word" or "doubleword" is selected.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–9SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.91

5.4.3 "Select Representation Format" Submenu

Bytes n...n + 3 are then combined as follows:

Word: and n+2 n+3n n+1

Doubleword: n n+1 n+2 n+3

F4 <INTEL>

Press this function key to select the intel data format. This action is only performed when thedata type "word" or "doubleword" is selected.

Bytes n...n + 3 are then combined as follows:

Word: and n+3 n+2n+1 n

Doubleword: n+3 n+2 n+1 n

Example:

INPUTS: << INTEL HEX byte >>NR 0000: 11 22 33 44 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00NR 0016: 00 00 00 00 00 00 00 00

INPUTS: << INTEL HEX word >>NR 0000: 2211 4433 0000 0000NR 0004: 0000 0000 0000 0000NR 0008: 0000 0000 0000 0000

INPUTS: << S5 HEX word >>NR 0000: 1122 3344 0000 0000NR 0004: 0000 0000 0000 0000NR 0008: 0000 0000 0000 0000

5–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.4.3 "Select Representation Format" Submenu

F5 Init

Pressing this function key activates a function for initializing the data in the active window. Thefollowing screen appears:

Data Initialization

Ini Value: word HEX

Repetitions: DEC

The following input fields are available in this window:

• Ini Value:

Here you enter the value with which the data in the active window are to be initialized. Thedata type set in the active window (byte, word or doubleword) is used and displayed in thescreen (word in the example). The value should always be entered in hexadecimal format.

• Repetitions

Here you enter the repetition factor which determines how often the value is to be entered.The initialization starts with the item on which the cursor is positioned in the activewindow. The number should always be entered in decimal format.

The inputs in the field are always terminated by pressing the Return key.

Example:

Data Initialization

Ini Value: word ABCD HEX

Repetitions: 100 DEC

100 items are initialized with the hex value ABCD starting from the cursor position in the activewindow.

F7 <Delete>

You can clear all the data from the active window by pressing this function key. A safetyprompt appears first in the message line:

>>> Really delete data area ? (y/n)

The data are only deleted if you answer y(es). The cursor then moves to the first item in theactive window.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–11SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.4.4 "Select Data Type" Submenu

5.4.4 "Select Data Type" Submenu

You can call up the submenu for selection of the data type by pressing the function key

F1 D Type

in the submenu for selecting the representation format. Here, you can define the data typeused to represent the data in the active window. The following are available:

F1 <Byte> Representation as byte (8 bits)F2 <Word> Representation as word (16 bits)F3 <Dword> Representation as doubleword (32 bits)

F8 <Back> Returns you to the submenu for selecting the representation format

The representation options following are as follows:

INPUTS: << INTEL HEX byte >>NR 0000: 00 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00NR 0016: 00 00 00 00 00 00 00 00

INPUTS: << INTEL HEX word >>NR 0000: 0000 0000 0000 0000NR 0004: 0000 0000 0000 0000NR 0008: 0000 0000 0000 0000

INPUTS: << INTEL HEX Dword >>NR 0000: 0000 0000 0000 0000NR 0002: 0000 0000 0000 0000NR 0004: 0000 0000 0000 0000

Note:

The selection options for the data type can be restricted by the numeric format selected. If thenumeric format "BCD" is active, the data type "byte" cannot be selected. If the numericformat "ASCII" is active, the data types "word" and "doubleword" cannot be selected.

5.4.5 "Select Numeric Format" Submenu

You can call up the submenu for selection of the numeric format by pressing the function key

F2 D Base

in the submenu for selecting the representation format. Here, you can define the numericformat used to display the data in the active window. The following function keys are available:

F1 <HEX> Numbers in hexadecimal formatF2 <DEC> Numbers in decimal formatF3 <ASCII> ASCII representationF4 <BCD> Numbers in BCD format

5–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 5 Operation

5.4.4 "Select Numeric Format" Submenu

If the data type "byte" is active, for example, the following options are available:

INPUTS: << INTEL HEX byte >>NR 0000: 48 4C 4C 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

INPUTS: << INTEL DEC byte >>NR 0000: +72 +76 +76 +0NR 0004: +0 +0 +0 +0NR 0008: +0 +0 +0 +0

INPUTS: << INTEL ASCII byte >>NR 0000: H L L . . . . .NR 0008: . . . . . . . .NR 0016: . . . . . . . .

If the data type "word" is active, option of BCD representation is also available:

INPUTS: << INTEL HEX word >>NR 0000: 1111 2222 3333 AAAANR 0004: 0000 0000 0000 0000NR 0008: 0000 0000 0000 0000

INPUTS: << INTEL BCD word >>NR 0000: 1111 2222 3333 ....NR 0004: 0000 0000 0000 0000NR 0008: 0000 0000 0000 0000

Notes on ASCII representation:

• The data are interpreted according to the extended ASCII character set and displayed onthe screen in alphanumeric format. Non-representable characters are shown as a ".".

• ASCII representation is only possible if the data type "byte" is active.

Notes on BCD representation:

• The data are interpreted and displayed as BCD (Binary Coded Decimal) numbers. 4 bitsare evaluated for each decimal digit. If the value of any of these bit groups is too large(greater than 9), the entire item is displayed as "....".

• BCD representation is only possible if the data type "byte" is not active.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–13SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.4.6 Menu 2

5.4.6 Menu 2

You can call up Menu 2 by pressing function key F8 in Main Menu 1.

Menu 2

COUNTERS: << S5 BCD word >> TIMERS: << S5 BCD word >> NR 0000: 0000 0000 0000 0000 NR 0000: 0000 0000 0000 0000 NR 0004: 0000 0000 0000 0000 NR 0004: 0000 0000 0000 0000 NR 0008: 0000 0000 0000 0000 NR 0008: 0000 0000 0000 0000

I/O ADDRESS LIST: PeA BLOCK ADDERSS LIST: DB NR 0000: 0000:0000 0000:0000 NR 0000: 0000:0000 0000:0000 NR 0002: 0000:0000 0000:0000 NR 0002: 0000:0000 0000:0000 NR 0004: 0000:0000 0000:0000 NR 0004: 0000:0000 0000:0000 NR 0006: 0000:0000 0000:0000 NR 0006: 0000:0000 0000:0000 NR 0008: 0000:0000 0000:0000 NR 0008: 0000:0000 0000:0000

ANZ1 ANZ0 OV OS OR ERAB VKE Bin_ErgA / Dig_ErgA: 0 0 0 0 0 0 0 Akt_OB_Nr: 1 Akt_DB_Länge: 0

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Timers

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Counters

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

I/O List

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Blk List

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Bin Dig Aa a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Load

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Save

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 2 Version 1.1

This menu includes the windows for displaying the counters and timers and the window fordisplaying the length of the current data block and the interpreter data (binary and digital statusbits and number of the active organization block). You can also display the various I/O andblock address lists. The individual windows can be activated using the following function keys:

F1 CountersF2 TimersF3 I/O List (I/O address lists)F4 Blk List (block address lists)F5 Bin Dig A (interpreter data)

You can activate a window by pressing one of these function keys. The window is highlightedin color and a cursor appears (see the section entitled "Modifying the System Data").

F1 Counters

Pressing this function key activates the window for displaying the counters (0...255) and callup a submenu.

The counters are always interpreted as words in the STEP 5 format and displayed in BCDformat. This matches the convention used for the counters in the STEP 5 programminglanguage.

The current value of the counter is therefore displayed in the three least significant digits. Thefourth digit contains the status information for the counter.

5–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.4.6 Menu 2

The counter functionality is not simulated for the off-line test. If you use counters in theprogram, you must therefore set them in this window.

Only the following function keys are available in the selected submenu:

F7 <Delete>F8 <Back> (return to Main Menu 2)

F7 <Delete>

You can clear all the data from the active window by pressing this function key. Asafety prompt appears first in the message line:

>>> Really delete data area ? (y/n)

The data are only deleted if you answer y(es). The cursor then moves to the firstitem in the active window.

F1 Timers

Pressing this function key activates the window for displaying the timers (0...255) and calls upa submenu.

The timers are always interpreted as words in the STEP 5 format and displayed in BCDformat. This matches the convention used for the timers in the STEP 5 programminglanguage.

The current value of a timer cell is therefore displayed in the three least significant digits. Thefourth digit contains the status information for the timer.

The timer functionality is not simulated for the off-line test. If you use timers in the program,you must therefore set them in this window.

Only the following function keys are available in the selected submenu:

F7 <Delete>F8 <Back> (return to Main Menu 2)

F7 <Delete>

You can clear all the data from the active window by pressing this function key. Asafety prompt appears first in the message line:

>>> Really delete data area ? (y/n)

The data are only deleted if you answer y(es). The cursor then moves to the firstitem in the active window.

F3 I/O List

Pressing this function key activates the window for displaying the I/O address lists and calls upa submenu. In this submenu, you can select an address list to be displayed:

F1 <PeE> Address list for inputs (0...255)F2 <PeA> Address list for outputs (0...255)F3 <QeE> Extended address list for inputs (0...255)F4 <QeA> Extended address list for outputs (0...255)

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–15SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.4.6 Menu 2

You can recognize the currently displayed list from the identification letters displayed; e.g.address list for inputs:

I/O ADDRESS LIST: PeENR 0000: 0000:0000 0000:0000NR 0002: 0000:0000 0000:0000::

The addresses are always specified in the following format:

Segment:Offset

The values for segment and offset are displayed in hexadecimal format.

For the exact structure of the addresses, please refer to the description of the block generatorin this manual.

In addition to the function keys for selecting the address lists (F1 to F4), function keys F7 andF8 are also available:

F7 <Delete> (delete current address list; see above)F8 <Back> (return to Main Menu 2)

Note:

• The PLC scans the existing I/O modules on start-up and enters the address for each I/Omodule in the appropriate list.

The entire I/O area is simulated as a memory area for the off-line test. The HLL datagenerator initializes the complete I/O address lists with the addresses of the individualbytes in this memory area.

In order to simulate I/Os which are not installed, you must delete the entries from theaddress lists.

F4 Blk List

Pressing this function key activates the window for displaying the block address lists and callsup a submenu. In this submenu, you can select an address list to be displayed:

F1 <DB> Address list for data blocks (type DB)Shift F1 <DX> Address list for data blocks (type DX)

F2 <FB> Address list for function blocks (type FB)Shift F2 <DX> Address list for function blocks (type FX)

F3 <SB> Address list for step blocksF4 <PB> Address list for program blocksF5 <OB> Address list for organization blocks

Address lists 0 ... 255 each

5–16 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.4.6 Menu 2

You can recognize the currently displayed list from the identification letters displayed; e.g.address list for the step blocks:

BLOCK ADDRESS LIST: SBNR 0000: 0000:0000 0000:0000NR 0002: 0000:0000 0000:0000::

The addresses are always specified in the following format:

Segment:Offset

The values for segment and offset are displayed in hexadecimal format.

For the exact structure of the addresses, please refer to the description of the block generatorin this manual.

In addition to the function keys for selecting the address lists (F1 to F4), function keys F7 andF8 are also available:

F7 <Delete> (delete current address list; see above)F8 <Back> (return to Main Menu 2)

F5 Bin Dig A

Pressing this key activates the window for displaying the interpreter data and the length of theactive data block.

Meaning of the individual fields:

• Akt_OB_Nr Number of the active organization block; the default is always 1. Ifyou use the number in the program, you can enter other valueshere.

• Akt_DB_Länge Length of the active data block; if you use a data block, this lengthis updated automatically by the HLL data generator; the valuecannot be changed manually.

• Bin_ErgA /Dig_ErgA Binary and digital status bits

The following individual bits can be displayed:– CC1 Coded status bit– CC0 Coded status bit– OV Overflow in arithmetic operations– OS Overflow in arithmetic operations (retentive)– OR AND before OR– FC First check– RLO Result of logic operation

Please refer to the "PLC 135 WB Configuring Guide" for a detailed description of themeanings of the individual status bits.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–17SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.4.6 Menu 2

Only one function key is available in this submenu:

F8 <Back> Return to Main Menu 2

Notes:

• The status bits are not updated in HLL function blocks.

• If you query a status bit in the program (e.g. by calling a STEP 5 block), you must set theindividual bits in the HLL data generator).

5.4.7 Non-Displayed System Data

Some system data areas cannot be displayed or modified with the HLL data generator:

• Extended flag area HLL symbol "S_flag"

• Cells for PLC memory assignment HLL symbols "XDSPVER", ”Sp_Verw”,"PHANFGP", "PHENDEP","PHANFGD", "PHENDED","GREBESP", "GREBEOP","GREBESD", "GREBEOD"

These system data are initialized with 0 for the off-line test. They can be displayed and/ormodified with the high-level language debugger.

5.5 Modifying the System Data

During the off-line test, there are two basic ways of modifying the system data:

• in the HLL function block or the high-level language debugger• in the HLL data generator

The options and points to note are described in the next sections.

5–18 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.91 5 Operation

5.5.1 Modifying the System Data in the HLL Function Block

5.5.1 Modifying the System Data in the HLL Function Block

When the HLL function block access and modifies system data, this has a direct effect on thedata displayed by the HLL data generator.

Example:

C program::

if (E_Byte[0] == 1)A_Byte[0] = 1; /* then branch */

else

A_Byte[0] = 2; /* else branch */::

Display in HLL data generator:

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX byte >>NR 0000: 00 00 00 00 00 00 00 00 NR 0000: 00 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00NR 0016: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

If you now run the program in single-step mode (DB86: F8 "Step Execution"), the "else"branch is executed. The assignment is performed on the next single step. Output byte 0then has the value 2.

Now switch to the data generator. You will see the following display in Menu 1:

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX byte >> NR 0000: 00 00 00 00 00 00 00 00 NR 0000: 02 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

The system data is updated automatically when you switch between

the high-level language debugger and the HLL status generator.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–19SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.5.2 Modifying the System Data in the HLL Data Generator

5.5.2 Modifying the System Data in the HLL Data Generator

The HLL data generator allows you to modify the system data in order to control the programexecution of the HLL function block.

You can modify all the system data displayed in the HLL data generator with one exception:the display of the data block length cannot be modified.

In order to change an item of data, activate the appropriate window by pressing one of thefunction keys (e.g. F1 "Inputs").

The window is activated and a cursor appears. The cursor is positioned initially on the firstitem in the window. If you move the cursor to another item and deactivate the window, thecursor is positioned on this item the next time you activate the window.

The blinking part of the cursor marks the point where the input is entered.

Cursor control

The following keys can be used to move the cursor within the active window:

These keys move the cursor between the individual items in a line. At theend or start of a line, the cursor jumps to the start of the next line or endof the last line.

These keys move the cursor between the lines of the active window. Youcan use them to scroll the contents of the window.

PgUp, PgDn These keys are used to page through the active window.

To change an entry in the active window, move the cursor to the desired position and enterthe data.

When you enter the first character, the old entry is cleared from the display. You cannot editthe old entry; you can only overwrite it.

The following message appears in the message line:

>>> Enter digit or 'BS', 'CR', or 'ESC'

This indicates the keys you can use for input:

Digit Input value (see table)

'BS' Backspace key: Deletes the character to the left of the blinking cursor.

'CR' Return key: Completes the input; the entered value is accepted and the cursorjumps to the next item.

'ESC' Escape key: Cancels input; the entered value is not accepted. The old value isdisplayed again and the cursor jumps to the next item.

5–20 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.5.2 Modifying the System Data in the HLL Data Generator

Permissible input

The numeric format should be observed when entering the data. The entered values arechecked and illegal entries are not accepted.

Permissible Input for Various Numeric Formats

HEX 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, A, B, C, D, E, F

DEC 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

ASCII No input possible

BCD 0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Notes:

• It is not possible to enter ASCII characters directly. If you want to enter ASCII characters,select another numeric format (HEX or DEC) and enter the ASCII code for the character.

• Timers and counters should always be entered in BCD format.

• Entries in the address lists are expected to be hexadecimal numbers with the format

Segment:Offset

You must always enter all of the digits (including leading zeroes).

• The PLC scans the existing I/O modules on start-up and enters the address for each I/Omodule in the appropriate list.

The entire I/O area is simulated as a memory area for the off-line test. The HLL datagenerator initializes the complete I/O address lists with the addresses of the individualbytes in this memory area.

In order to simulate I/Os which are not installed, you must delete the entries from theaddress lists.

• When entering values in the address lists, please note that the specified memory area willnot be available automatically if you enter the address.

Example:

C program::

if (E_Byte[0] == 1)A_Byte[0] = 1; /* then branch */

elseA_Byte[0] = 2; /* else branch */

::

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–21SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.5.2 Modifying the System Data in the HLL Data Generator

Display in HLL data generator:

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX byte >>NR 0000: 00 00 00 00 00 00 00 00 NR 0000: 00 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00NR 0016: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

To run through the "then" branch of the program, set input byte 0 to 1. To do this,activate the window for display of the inputs, move the cursor to the first item, enter thevalue 1 and press the Return key to accept the entry. The following display appears:

INPUTS: << INTEL HEX byte >> OUTPUTS: << INTEL HEX byte >>NR 0000: 01 00 00 00 00 00 00 00 NR 0000: 00 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00NR 0016: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

Now switch to the high-level language debugger. If you now run the program in single-stepmode (DB86: F8 "Step Execution"), the "then" branch is executed. The assignment isperformed on the next single step. Output byte 0 then has the value 1.

Now switch to the data generator. You will see the following display:

INPUTS: << INTEL HEX byte >> OUTPUTS: <<INTEL HEX byte>>NR 0000: 01 00 00 00 00 00 00 00 NR 0000: 01 00 00 00 00 00 00 00NR 0008: 00 00 00 00 00 00 00 00 NR 0008: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00 NR 0016: 00 00 00 00 00 00 00 00

5.6 Editing Data Blocks

The HLL data generator allows you to display, modify, save and reload a data block.

The length of the current data block is displayed in Menu 2 (Akt_DB_Laenge). The numberof words of the block, not including the block header, is displayed. The words are numberedstarting with the value 0. If a data block has two data words, therefore, the length 1 isdisplayed.

The length is always updated by the HLL data generator. It is not possible to enter the lengthmanually.

Open the data block in the HLL function block with the function HLL_ADB(). This function issimulated in the off-line test.

The access to a data block can be implemented in the HLL function block using any variable(arrays, structures, etc.) This variable must be the first declaration in the data segment(module-global or "static"). The variable used to access a data block must thus always bestored at offset 0 in the data segment.

If this requirement has been met, the contents of a data block edited by an HLL function blockare displayed by the HLL data generator and can be modified.

In the off-line test, the opening of a data block is simulated by loading and saving the datablock.

5–22 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.6 Editing Data Blocks

To load or save a data block, you must specify the type (DB/DX) and the number of the block.This determines the file name for the data block. The type and name of the block are thendisplayed in the HLL data generator, indicating that the block is open.

If you execute the HLL_ADB() function in the high-level language debugger (DB86: F10 "Stepover Procedure"), you are prompted to change to the HLL data generator and load therelevant data block.

Display on execution of the HLL_ADB() function

**************************************************

* Please change to the data generator *

* and load DB2 *

* by selecting LOAD DB!!! *

**************************************************

------ Please press a key ------

If you have already worked on this data block earlier and have saved it on the hard disk, youcan reload the data block into memory (see the section entitled "Loading and Saving").

When you have loaded the data block and pressed function key F8 "Back", the type (DB/DX)and number of the block are displayed, e.g.:

DATA BLOCK: DB001 << INTEL HEX byte >>NR 0000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00NR 0016: 00 ...

The memory address for the current block is also entered in the block address list.

If you now switch the high-level language debugger, you will see the above display again.Press a key to continue debugging.

If you have not yet saved the data block or do not want to load it, omit the above steps.

The HLL function block can still access the data block, however the contents of the data blockare only displayed in the HLL data generator when a data block has been opened (by loadingor saving it).

Note:

Please remember that an existing file for the same data block is overwritten every time yousave a data block. In order to create different files for the same block, you must save them indifferent directories (see the section entitled "'Define Path' Screen").

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–23SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.7 Loading and Saving the System Data

5.7 Loading and Saving the System Data

During off-line testing of an HLL function block, you can use the data generator to definevalues for the PLC system data, in order to generate a particular environment for programexecution.

If you want to use these values in subsequent tests, you have the option of saving the systemdata on the hard disk or a diskette.

The following function keys are provided for this purpose in the two main menus:

F6 LoadF7 Save

Pressing one of these keys calls up the submenu for loading or saving the system data.

5.7.1 "Load/Save System Data" Submenus

If you press one of the function keys

F6 LoadF7 Save

in a main menu (Menu 1 or Menu 2), the submenu is called up. You can load or save variousdata areas from the submenu. The procedure for loading and saving is more or less identical.This submenus are therefore described together.

The individual data areas are selected by the following function keys:

F1 <PAA> Process image (I/Q/F/T/C)F2 <DB> Data blockF3 <I/O List> I/O address listsF4 <Blk List> Block address lists

The following function key is also available:

F8 <Back> Return to main menu

To load or save a data area, press one of the function keys described above. The examplebelow describes how to load or save the process image. The steps required to load or savethe other data areas are similar; special reference is made to differences.

Press F1 to load or save the process image. Depending on whether you have selected Load orSave, one of the following screens appears:

5–24 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.7.1 "Load/Save System Data" Submenus

Screen for Loading Process Image

COUNTERS: << S5 BCD- word>> TIMERS: << S5 BCD word >>NR 0000: 0000 0000 0000 0000 NR 0004: 0000 000 Laden des Prozessabbildes: 00 0000 0000 NR 0008: 0000 000 00 0000 0000

I/O ADDRESS LIST: PeA BLOCK ADDRESS LIST: DB NR 0000: 4440:6D7 0000:0000 NR 0000: 0000:0000 0000:0000 NR 0002: 4440:6D7 0000:0000 NR 0002: 0000:0000 0000:0000 NR 0004: 4440:6D8 0000:0000 NR 0004: 0000:0000 0000:0000NR 0006: 4440:6D8 0000:0000 NR 0006: 0000:0000 0000:0000NR 0008: 4440:6D84 4440:6D85 NR 0008: 0000:0000 0000:0000

CC1 CC0 OV OS OR FC RLOBin_ErgA / Dig_ErgA: 0 0 0 0 0 0 0 Akt_OB_Nr: 1 Akt_DB_Länge: 0

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

<DB>

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

<Back>

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

<PAA>

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

<I/O List>

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

<Blk List>

Load process image:

Screen for file name 'PAAxxx.DAT'xxx stands for any three-digit number

<PAA .DAT>

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 2 Version 1.1

Screen for Saving Process Image

COUNTERS: << S5 BCD word >> TIMERS: << S5 BCD word >> NR 0000: 0000 0000 0000 0000 NR 0000: 0000 0000 0000 0000 NR 0004: 0000 0000 0000 0000 NR 0004: 0000 0000 0000 0000 NR 0008: 0000 0000 0000 0000 NR 0008: 0000 0000 0000 0000

I/O ADDRESS LIST: PeA BLOCK ADDRESS LIST: DB NR 0000: 4440:6D7 0000:0000 NR 0000: 0000:0000 0000:0000 NR 0002: 4440:6D7 0000:0000 NR 0002: 0000:0000 0000:0000 NR 0004: 4440:6D8 0000:0000 NR 0004: 0000:0000 0000:0000 NR 0006: 4440:6D8 0000:0000 NR 0006: 0000:0000 0000:0000 NR 0008: 4440:6D84 4440:6D85 NR 0008: 0000:0000 0000:0000

CC1 CC0 OV OS OR FC RLOBin_ErgA / Dig_ErgA: 0 0 0 0 0 0 0 Akt_OB_Nr: 1 Akt_DB_Länge: 0

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Timers

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

<Back>

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Counters

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

I/O List

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Blk List

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

a a a a a a a a a a a a a

Bin Dig A

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Load

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Save

Load process image:

Screen for file name 'PAAxxx.DAT'xxx stands for any three-digit number

<PAA .DAT>

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL Data Generator Menu 2 Version 1.1

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–25SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.7.1 "Load/Save System Data" Submenus

In both cases, you must specify the file name under which the process image is already savedor is to be saved.

The file name has the following structure:

PAAxxx.DAT

You can enter any three-digit number (with leading zeroes) in place of the "x".

You can use the cursor control keys to correct your entries by overwriting them. You cancancel the input with the Escape key and complete the input with the Return key.

When you press Return, the system attempts to load or save the file.

If the file has been successfully loaded or saved, the following message appears in themessage line:

Everything OK!! Press F8 to return ...

When you press function key F8, the most recently selected main menu appears. If you pressany other key, the "Load/Save" submenus remain active.

If the specified file cannot be read or written, one of the following messages appears:

• Error, can't open file !!! Please press a key ...The file could not be opened. The file is not stored in the specified directory.

• Can't load complete PAA !!! Please press a key ...or

• Can't save complete PAA !!! Please press a key ...The file is stored in the specified directory, but is not complete. This may occur if there isinsufficient free storage capacity.

You should not continue to work on an incomplete file.

You can press any key to acknowledge these messages. Then check whether the paths aredefined correctly and whether there is sufficient free storage capacity on the specified drive.

Special information for loading and saving I/O address lists:

• When the I/O address lists are loaded and saved, the memory area which simulates theI/O for the off-line test is also transferred.

• Saved I/O address lists are linked to the memory addresses at which the lists were storedin memory.

When you change the environment of your computer, these addresses also change (seealso Chapter 3). In this case, you can no longer load the saved I/O address lists.

5–26 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 5 Operation

5.7.1 "Load/Save System Data" Submenus

Special information for loading and saving data blocks:

• If a data block is already open in the HLL data generator when you load a data block, thefollowing prompt appears:

A data block is already loaded. Overwrite ? (y/n):

If you answer y(es), the screen for loading a data block appears. The old data block isoverwritten on loading.

If you want to save the old data block, answer n(o) and then save the data block.

• When you load or save data blocks, the type of block (B or X for DB or DX) and the blocknumber (0...255) must be specified when you enter the file name.

If the block number entered is too large, the following error message appears:

Please enter only DB000 - DB255 or DX000 - DX255!

Press any key to acknowledge this message. You can then enter a correct file name orcancel the operation with the Escape key.

File names:

The names of the files in which the various data areas are saved have the following format:

• PAAxxx.DAT Process images• DBxxx.DAT Data blocks (type DB)• DXxxx.DAT Data blocks (type DX)• PERIxxx.DAT I/O address lists• BSTxxx.DAT Block address lists

When you save files, existing files are overwritten without a prompt. If you want to save severalfiles with the same name, you can store them in different directories. The directories aredetermined by the entries in the DG.CFG configuration file (see the section entitled"Configuration of the HLL Data Generator").

5.8 Simulation of System Functions

The following system functions can be called up in HLL function blocks:

• HLL_HLL() Call other HLL function blocks• HLL_S5() Call STEP 5 blocks• HLL_MACRO() Call function macros• HLL_ADB() Open data blocks• HLL_STOP() Initiate a system stop• HLL_LIM() Read OB disable identifiers• HLL_SIM() Write OB disable identifiers

The functions HLL_ADB() and HLL_STOP() are simulated for the off-line test.

HLL_ADB()

This function is used to open a data block in an HLL function block. During the off-line test,you must open this data block manually with the aid of the HLL data generator (see thesection entitled "Editing Data Blocks").

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–27SINUMERIK 840/880 Part 2 (PJ)

5 Operation 11.92

5.8 Simulation of System Functions

HLL_STOP()

This function call triggers a system stop. An error number is passed in order to identify thecause of the error.

During the off-line test, a screen appears with the error number.

Display on Execution of Function HLL_STOP()

**********************************

* Error number: 11 *

**********************************

-------- Please press a key ... --------

The remaining functions can be called from the HLL function block, but do not perform anyactions. If the program processes the results of these functions, the results must be enteredusing the HLL data generator.

Notes:

• The functions HLL_HLL() and HLL_MACRO() are called with a variable number ofparameters. A stack correction cannot therefore be performed in the simulation for the off-line test when the functions are terminated. If you call up these functions several times, astack overflow will probably occur. If you do not correct the stack with the DB86, theprogram may not run correctly. If an error occurs, you should reload the function block orthe high-level language debugger.

• You should always skip the system functions in the high-level language debugger (DB86:F10 "Step over Procedure"). Since no list or source files exist for the system functions,the assembler code can only be displayed for these functions.

5–28 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 6 Error Messages

6.1 Error Messages During Installation

6 Error Messages

This chapter contains brief descriptions of the error messages in the HLL status generator.

The HLL data generator outputs operating messages in addition to these error messages.These, and the messages of the batch files, are self-explanatory.

For information on the error messages of the compiler, linker, etc., please refer to theappropriate manual.

The error messages of the HLL data generator are divided into three groups:

• Error messages during installation• Error messages during checking of the configuration file• Error messages during operation

6.1 Error Messages During Installation

This section contains the error messages which can be output during the installation of theHLL status generator or on clearing the HLL data generator from the working memory.

The error messages are displayed in a separate window, e.g.:

****** Installation error ******

Installation not possible, since

data generator is already installed!!!

Please press a key ...

Installation error:

Installation not possible, since data generator is already installed!!!

You have attempted to load the HLL data generator into memory twice. This is not possible.The HLL data generator can only be loaded once.

If you want to reload the HLL data generator, you should clear it from the memory first (seethe section entitled "Clearing the HLL Data Generator from Memory").

Deinstallation error:

Deinstallation not possible, since data generator is not yet installed!!!

The HLL data generator can only be cleared from the memory if it has been loaded first.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–1SINUMERIK 840/880 Part 2 (PJ)

6 Error Messages 11.92

6.1 Error Messages During Installation

Deinstallation not possible, since data generator is not last TSR program!!!

If you install another terminate-and-stay-resident (TSR) program after you load the datagenerator into the working memory, it is possible that the HLL data generator can no longer becleared from the working memory.

In this case, the HLL data generator can only be deinstalled by rebooting the computer.

6.2 Error Messages During Checking of the Configuration File

When you load the HLL data generator into the working memory, the configuration fileDG.CFG is checked. If errors are detected, an error message appears in a separate windowon the screen, e.g.:

****** Error in CFG file ******

TEXTMODE

cannot find the ';'!!!

Please press a key ...

These error messages specify the identifier in which an error has been detected (TEXTMODEin the example). The type of error is also indicated.

The HLL data generator is loaded in spite of the error. Default values are used for the relevantidentifier.

You will find information about the individual identifiers in the section entitled "Configuration ofthe HLL Data Generator" and in the comments in the configuration file.

Information on the type of error is provided below.

The CFG file is not in the correct directory!!!

The configuration file DG.CFG must always be stored in the directory that contains theexecutable program of the HLL data generator (file DG1_1.EXE).

Can't find '='!!!

The individual lines in the configuration file always has the following structure:

Identifier = value; /* comment */

The equal sign is missing from the line for the specified identifier.

Can't find identifier!!!

The line for the specified identifier is missing from the configuration file.

You should not delete or add lines from the configuration file!

6–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

11.92 6 Error Messages

6.2 Error Messages During Checking of the Configuration File

Can't find ';'!!!

The individual lines of the configuration file always have the following structure:

Identifier = value; /* comment */

The semicolon is missing from the line for the specified identifier.

Incorrect path after identifier!!!

The DOS conventions must be observed when defining the search path.

Value incorrect after identifier!!!

Only certain inputs are permitted when specifying the values for the individual identifiers.

Please refer to the section entitled "Configuration of the HLL Status Generator" and thecomments in the configuration file.

6.3 Error Messages During Operation

During operation of the HLL data generator, error messages are output in the message line onthe screen. The messages can generally be acknowledged by pressing any key.

Please enter only DB000 - DB255 or DX000 - DX255!

You can only enter the numbers 0 to 255 when loading or saving data blocks (DB/DX).

>>> Enter digit or 'BS', 'CR' or 'ESC'

Only legal digits can be entered when editing values in the active window. You can use theBackspace key ('BS) to correct an individual digit.

Press the Return key ('CR) to save the input or the Escape key ('ESC') to cancel.

Error, can't open file!!! Please press a key ...

The specified file could not be opened when loading or saving an individual data area.

Possible causes:

• The file is not stored in the specified directory (Load)• There is no free capacity on the specified drive (Save)

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–3SINUMERIK 840/880 Part 2 (PJ)

6 Error Messages 11.91

6.3 Error Messages During Operation

Can't load complete DB/X!!! Please press a key ...

The data block could not be loaded correctly. The specified file is not complete. You shouldnot continue to work with this file.

Can't load complete LST!!! Please press a key ...

The block lists could not be loaded correctly. The specified file is not complete. You shouldnot continue to work with this file.

Can't load complete PAA!!! Please press a key ...

The process image could not be loaded correctly. The specified file is not complete. Youshould not continue to work with this file.

Can't save complete DB/X!!! Please press a key ...

The data block could not be saved completely in the specified directory. There is insufficientfree storage capacity.

Can't save complete LST!!! Please press a key ...

The block lists could not be saved completely in the specified directory. There is insufficientfree storage capacity.

Can't save complete PAA!!! Please press a key ...

The process image could not be saved completely in the specified directory. There isinsufficient free storage capacity.

6–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 2 (PJ)

SINUMERIK 840/840CSINUMERIK 880/880 GA2

Part 3: HLL On-Line Debugger

Planning Guide

Manufacturer Documentation

Introduction 1

Requirements for the Operation of the HLL On-LineDebugger

2

Installation 3

Preparations for On-Line Testing of an HLL FunctionBlock

4

Operating Principle of the HLL Status Function 5

Operation 6

Error Messages 7

Example Programs 8

Contents

Page

1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–1

1.1 Embedding in the HLL System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–11.2 Functionality of the HLL On-Line Debugger . . . . . . . . . . . . . . . . . . . . . 1–11.3 Test Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1–2

2 Requirements for the Operation of the HLL On-Line Debugger . . . 2–1

2.1 Hardware Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–12.2 Software Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2–1

3 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–1

3.1 Supplied Diskette . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–13.2 Submit Files for Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–23.3 Installation Test . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3–2

4 Preparations for On-Line Testing of an HLL Function Block . . . . . 4–1

4.1 Block Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14.2 Working Files of the Debugger . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–14.3 Loading the Block Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4–2

5 Operating Principle of the HLL Status Function . . . . . . . . . . . . . . . 5–1

6 Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–1

6.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–16.2 Calling and Terminating the On-Line Debugger . . . . . . . . . . . . . . . . . . 6–16.3 Selecting a Block and Status Window (Menu 1) . . . . . . . . . . . . . . . . . 6–36.3.1 Selecting a Block . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–36.3.1.1 "Block" Input Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–36.3.1.2 Loading and Saving User Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–46.3.1.3 Checksum Calculation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–56.3.2 Defining the Status Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–66.3.3 Modifying the Status Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–66.3.4 Function Keys in Menu 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–86.4 Selection of the Entries in the Status Window (Menu 2) . . . . . . . . . . . . 6–106.4.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–106.4.2 "Symbol" Input Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–126.4.2.1 Symbols and Data Types in PL/M . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–126.4.2.2 Symbols and Data Types in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–166.4.3 "Block" Input Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–196.4.4 "Format" Input Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–216.4.5 "Line Number" Output Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–22

6.4.6 "Type" Output Field . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–226.4.7 Scope and Service Life of HLL Data . . . . . . . . . . . . . . . . . . . . . . . . . . 6–226.4.8 Special Keys and Function Keys in Menu 2 . . . . . . . . . . . . . . . . . . . . . 6–246.5 Status Function (Menu 3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–266.5.1 Structure of the Status Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–266.5.2 Starting the Status Function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–276.5.3 Variable Symbol Display in the Status Window . . . . . . . . . . . . . . . . . . 6–286.5.4 Function Keys in Menu 3 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6–28

7 Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7–1

8 Example Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8–1

11.91 1 Introduction

1.1 Embedding in the HLL System

1 Introduction

The HLL on-line debugger is part of the HLL system. You can use the system to generate andtest function blocks for the PLC 135 WB in high-level languages.

1.1 Embedding in the HLL System

You can use the S5-HLL block generator to create function blocks for the PLC in the high-levellanguages PL/M and C. Executable blocks are stored in an S5-DOS file and can be transferredto the PLC.

The HLL data generator is used in combination with a standard high-level language debuggerto test the block directly on the development computer without connection to a SINUMERIKcontrol (off-line test). The test simulates the PLC system data and provides a convenient userinterface for displaying and manipulating these system data.

The transferred HLL function blocks can be tested on the PG 750, 730 or 685 programmingdevices with the aid of the HLL on-line debugger . This test is comparable with the S5function "STATUS BLOCK". The test can only be performed if the block can run in cyclicmode on the PLC.

1.2 Functionality of the HLL On-Line Debugger

The on-line test on the PLC runs in a real-time environment . This means that genuineprogram breaks cannot be performed.

Most high-level language debuggers can only output the contents of variables in "halt" mode,i.e. only if a break point has been set which stops the program. This is not possible in a real-time environment.

The HLL on-line debugger provides you with a status function which operates on the sameprinciple as the S5 test function "STATUS BLOCK". You can select a section of your programin which you can monitor the execution of the individual statements (status windows).

The status window can display up to 20 program lines. You can assign a symbol to eachprogram line in the status window. This symbol is displayed before the line is executed.

This enables you to monitor in the status window whether the individual lines are processedare not (an invaluable feature for conditional statements). You can also see changes in thecontents of variables.

This is a real-time monitoring function, i.e. program execution does not have to be halted foroutput of the variables.

At the end of each debugging session, the data which you have entered for the selection ofthe status window are stored. The next time you start the debugger, the data are reloaded andyou can continue the test immediately.

A convenient user interface is provided for the input and modification of data for the selectionof the status window.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 1–1SINUMERIK 840/880 Part 3 (PJ)

1 Introduction 11.91

1.3 Test Environment

1.3 Test Environment

During testing with the HLL on-line debugger, the block program runs directly on the PLC 135WB in a SINUMERIK control.

The debugger itself runs on a programming device (see the section entitled "HardwareRequirements"). Communication between the programming device and the control takes placeover RS-232 (V.24) interfaces.

This documentation assumes that your are familiar with the following:

• Generation of HLL blocks with the S5-HLL block generator• Operation of the programming device (PCP/M operating system)• Communication between the programming device and the control (on-line mode)• Loading of blocks on the PLC using the S5 user interface

You will find information on the above in the manuals for the compiler, programming device,control and the STEP 5 programming language.

1–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 2 Requirements for the Operation of the HLL On-Line Debugger

2.1 Hardware Requirements

2 Requirements for the Operation of the HLLOn-Line Debugger

2.1 Hardware Requirements

The HLL on-line debugger runs on all programming devices of the following types:

• PG 685• PG 730• PG 750

The target hardware for the HLL function blocks (and therefore the test environment for theHLL on-line debugger) is the following hardware systems:

• PLC 135 WB with COP• PLC 135 WB with ACOP

This hardware can be used in the following controls:

• SINUMERIK 880/880 GA2• SINUMERIK 840/840C

2.2 Software Requirements

The HLL on-line debugger runs on the PCP/M operating system.

The following S5 files must be installed for User 0:

• S5WX000H.CMD S5 toolbox driver• S5WX100X.CMD S5 toolbox tools

These files are a component of the standard STEP 5 package. The usual S5 programs arerequired for loading the HLL blocks.

The following software versions can be used on the controls:

• SINUMERIK 880– Software version 4 or higher with PL/M option bit– Software version 6 or higher with PL/M and/or C option bit(s)– On the GA2, software version 1 or higher with option bit(s) PL/M and/or C

• SINUMERIK 840– Software version 1 or higher with option bit(s) PL/M and/or C– On the 840C, software version 1 or higher with option bit(s) PL/M and/or C

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 2–1SINUMERIK 840/880 Part 3 (PJ)

11.92 3 Installation

3.1 Supplied Diskette

3 Installation

3.1 Supplied Diskette

The debugger should be installed exclusively on the existing PCP/M partition (drive B:) of theprogramming device. It is supplied on a CP/M diskette and includes the following files:

User 0: Installation

685INST.SUB Dir Installation submit file for PG685730INST.SUB Dir Installation submit file for PG730750INST.SUB Dir Installation submit file for PG750

User 3: PG730 Same as User 7

User 6: PG685 Same as User 7

User 7: PG750

HLLDEB.CMD Sys Main program of debuggerHLLDEB.000 Sys 1st overlay file of debuggerHLLDEB.001 Sys 2nd overlay file of debuggerHLLDEB.002 Sys 3rd overlay file of debuggerHLLDEB.003 Sys 4th overlay file of debuggerHLLDEB.004 Sys 5th overlay file of debuggerHLLDEB.005 Sys 6th overlay file of debuggerHLLDEB.006 Sys 7th overlay file of debuggerHLLDEB.007 Sys 8th overlay file of debuggerHLLDEB.008 Sys 9th overlay file of debuggerTRACE.OVR Sys S5 toolbox driverLADE.SUB Sys Submit file for copying link and list files

INSTALL.SUB Dir Submit file for installation

Example: PL/M blockPFX123.LST Dir Example: List filePFX123.LNK Dir Example: Link filePFX123ST.S5D Dir Example: S5 filePFX123.DAT Dir Example: Input file FX123HLLINI.DAT Dir Example: Current input file

Example: C blockCFB255.LST Dir Example: List fileCFB255.LNK Dir Example: Link fileCFB255ST.S5D Dir Example: S5 fileCFB255.DAT Dir Example: Input file FB255

Dir = File has the DIR attribute (see CP/M-86 description)Sys= File has the SYS attribute (see CP/M-86 description)

The debugger expects to find the following S5 files on User 0 (drive B:):

• S5WX000H.CMD S5 toolbox driver• S5WX100H.CMD S5 toolbox tools

These are a component of the standard STEP 5 package supplied by GWK.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–1SINUMERIK 840/880 Part 3 (PJ)

3 Installation 11.92

3.2 Submit Files for Installation

3.2 Submit Files for Installation

The submit files for the installation of the on-line debugger on programming devices PG 685,PG 730 and PG 750 are stored on User 0.

Before the installation can be performed, the programming device must be ready for operationand must output the ready signal "A>".

The submit files for the individual programming devices are called up as follows:

SUBMIT 685INST <user number> (for PG 685)SUBMIT 730INST <user number> (for PG 730)SUBMIT 750INST <user number> (for PG 750)

The number of the user to which the example files are to be copied must be specified in thecall.

Example:

SUBMIT 750INST 15

When you press Return, the files are copied from the diskette to the hard disk.

All files with the SYS attribute are saved on User 0 as system files. The on-line debugger canthen be called from any user, however the block-dependent files (*.LNK, *.LST and *.DAT)must always be stored on the user from which you call up the debugger.

In the above example, the block-dependent files for the example blocks (PFX123 and CFB255)are copied to User 15.

The S5 files for the examples (PFX123ST.S5D and CFB255ST.S5D) are not required by thedebugger. They should be treated as regular S5 files, and therefore are not copied to thespecified user, like the other example files, but are copied to User 0.

The submit file LADE.SUB is also saved on User 0 as a system file. You can use this submitfile later to copy all the files required for the block test onto the appropriate user.

3.3 Installation Test

When the installation is complete, you can use the PL/M example block (PFX123) to checkwhether all the files have been copied correctly.

To do this, first start the S5 program and copy PL/M block FX 123, data block DB 200 andorganization block OB 1onto the PLC 135 WB using the supplied S5 file PFX123ST.S5D. Thenterminate the S5 program.

Then change to the user specified in the installation and switch the control to on-line mode.

Now start the debugger by entering:

HLLDEB

When you press the Return key, Menu 1 of the on-line debugger appears after a short time.

3–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 3 Installation

3.3 Installation Test

The cursor is positioned in the "Block" input field. Enter the name of the block to be testedhere (PFX123).

Now press the F6 key. The debugger attempts to set up the connection to the PLC (on-linecheck). If no connection can be established, the following error message appears:

ERROR

PLC not on-line

In this case, please check that the cable between the programming device and the PLC isplugged in and that the control is switched to on-line mode. Then press the F6 key again. Ifthe on-line check is successful, the text "On-Line" appears in the menu bar under F6.

Now press the F4 key followed by the F1 key.

Press the F1 key again to call up Menu 3.

Now, all the preparations have been made for starting the status function. Start the statusfunction by pressing F1. A display similar to the one below appears:

Installation Test

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

CS:IPa aa a

a a a a a a a

a a a a a a a

Line00035 L1 32 Bit unsigned 00000005 H00036 DB ? void 009C D00037 DATUM 16 Bit unsigned 1234 H00038 SAME 8 Bit unsigned 67 H00039 L2 16 Bit unsigned 009C H00040 DATENWORT(0) 16 Bit unsigned00041 DATENWORT(1) 16 Bit unsigned00042 DATENWORT(0) 16 Bit unsigned 0000000000100000 B00043 DATENWORT(0) 16 Bit unsigned00044 M_BYTE(0) 8 Bit unsigned00055 START Label short00056 DATENWORT(1) 16 Bit unsigned00057 DATENWORT(1) 16 Bit unsigned00058 M_BYTE(0) 8 Bit unsigned00060 K1 (4) 8 Bit unsigned 008 D00061 *XAKOBNR 32 Bit Pointer 00010001 H00062 DATENWORT(44) 16 Bit unsigned 0000 H00064 DB_LAENGE 16 Bit unsigned00065 XDBLAEN 32 Bit Pointer00066 *XDBLAEN 32 Bit Pointer

a a a a a a a a a

a a a a a a a a a

Symbol Type

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

List on

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Stop

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 3 Version 2.1

Contents

You can interrupt the status function by pressing F8. Pressing the F8 key twice returns you toMenu 1.

To end the debugger session, press the F8 key again and answer the safety prompt with "Y".

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 3–3SINUMERIK 840/880 Part 3 (PJ)

3 Installation 11.91

3.3 Installation Test

Now you have made sure that the installation has been successfully completed and havegained a first impression of the operation of the on-line debugger. You will find more detailedinformation on the operation of the on-line debugger in Chapter 6.

A C block is also included on the supplied diskette in addition to the PL/M block (CFB255). Ifyou want to load and test the C block, please first deactivate the PL/M block in order toprevent clashes.

3–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 4 Preparations for On-Line Testing of an HLL Function Block

4.1 Block Generation

4 Preparations for On-Line Testing of an HLLFunction Block

This chapter describes the steps required to test an HLL function block directly on the PLC(on-line).

4.1 Block Generation

The S5-HLL block generator is required for the creation of a high-level language block. Thiscreates a module body in which all the global PLC system data and the parameters passed tothe block are defined.

You use this module body to develop your block program. The block generator compiles, linksand locates the program and generates a block which conforms to the conventions for S5blocks.

Now, the block generator creates an S5 file in which the block is stored. A DOS-CP/Mconversion program (such as SuperCopy) is used to copy the S5 file and the link and list filesof the block to the CP/M-formatted diskette.

4.2 Working Files of the Debugger

The block generator creates 3 files for each block:

• S5 file (HLL block; *.S5D)• Link file (linked HLL block; *.LNK)• List file (program listing of block; *.LST)

These files are stored on a CP/M-formatted diskette.

The S5 file contains the executable code for the block. You can use this file to load your HLLblock onto the control with the aid of the S5 program (like regular STEP 5 blocks).

The link file is the working file of the on-line debugger. It provides all the information requiredfor the test, such as symbol names, types and addresses, line numbers, block structure, etc.

To make testing easier, it is possible to display the program listing in the debugger. The list fileshould therefore also be copied onto the programming device. The program listing is notabsolutely necessary for the operation of the debugger, but is an invaluable tool which youshould use.

File names

The block generator assigns specific file names to the link and list files. The block number, theblock type and the programming language in which you have developed the block are derivedfrom these names. For example:

PFX123.LNK PL/M function block FX 123CFB001.LNK C function block FB 1

The on-line debugger uses these names and they should therefore not be changed.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–1SINUMERIK 840/880 Part 3 (PJ)

4 Preparations for On-Line Testing of an HLL Function Block 11.92

4.2 Working Files of the Debugger

Block number

For testing with the on-line debugger, it is necessary to load the function block in the PLCusing the number which you have specified during the generation of the block.

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

Please make sure that the versions of the link file

and the block on the control are always both up to date;

mismatches can cause the system to crash.

Always load the block to be tested using the number on the PLC

that you have specified during generation.

User

The on-line debugger is stored as a system file on User 0 on drive B:. You can therefore startit from all users. All working files (*.LNK, *.LST and *.DAT) are expected to be found on driveB: on the selected user. If you start the on-line debugger on User 5, for example, it onlysearches for the working files on User 5.

It is therefore advisable to set up one or more users where only HLL blocks are stored.

4.3 Loading the Block Files

In order to facilitate the copying of the block files from the CP/M diskette to the hard disk ofthe programming device, the submit file LADE.SUB is copied as a system file to User 0 duringthe installation. This means it can be called up from all users. 2 parameters must be specifiedin the call:

SUBMIT LADE <Block> <User number>

When you press Return, the S5 file for the block is copied to User 0. The link and list files forthe block are copied to the user which you have specified in the call.

The submit file subsequently starts the S5 program automatically. Now, load the block onto thePLC and then exit the S5 program again. The debugger starts automatically and you canproceed with the test.

Example:

SUBMIT LADE PFX123 15

The following files are copied to the specified user:

• PFX123ST.S5D S5 file to User 0• PFX123.LNK Link file to User 15• PFX123.LST List file to User 15

4–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 4 Preparations for On-Line Testing of an HLL Function Block

4.3 Loading the Block Files

Notes:

• The names of the link and list files are assigned by the block generator and may not bechanged. The name of the S5 file can be assigned by the user. If you want to work withthe submit file LADE.SUB, the name must be chosen according to the above rules.

• If you do not want to use the submit file LADE.SUB, you can copy the files in the usualway:

PIP B:[G0]=A:<S5 file>[G0]PIP B:[<User number>]=A:<Block>.*[G0]

Example:

PIP B:[G0]=A:PFX123ST.S5D[G0]PIP B:[G15]=A:PFX123.*[G0]

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 4–3SINUMERIK 840/880 Part 3 (PJ)

11.91 5 Operating Principle of the HLL Status Function

5 Operating Principle of the HLL StatusFunction

This chapter provides a brief description of the operating principle of the status function.

The on-line debugger performs the same task for HLL function blocks as the S5 test function"STATUS BLOCK" does for STEP 5 blocks. You can select a section of your program inwhich you want to monitor the individual statements (status window).

Status window

In the status window you can monitor, for example, whether or not a statement is processed(conditional statements).

You can also assign a symbol to each program line in the status window. The contents of thesymbol are then output when the line is executed. A relationship must exist between thesymbol and the program line.

Please note that each symbol is read before the statement in the corresponding line isexecuted. For example, if the value Y is assigned to the symbol X in line n, the assignmentcan only be evaluated in the status window with effect from line n + 1.

Chapter 6 describes how to define the status window and enter the symbols.

Status function

When you have defined the status window and selected the symbols, start the status function.

The on-line debugger requires the link file of your block. It references the relative addresses ofthe lines and symbols and the types of symbols in this file.

The block address lists are then used on the PLC to determine the absolute addresses of thelines. The addresses are transferred to the programming devices and displayed in the statuswindow.

Communication between the programming device and the control takes place over RS-232(V.24) interfaces.

The on-line test on the PLC runs in a real-time environment. This means that it is not possibleto halt the program for the test. Instead, break points in the form of software interrupts are setat the absolute addresses of the lines in the status window.

The execution of the block program is only interrupted for a short time at each break point,and an interrupt routine is initiated. This routine evaluates the symbol specified for the line andwrites the value to a buffer.

This process is repeated for each line in the status window. The contents of the buffer aretransferred to the programming device several times per second.

Display in the status window

The on-line debugger reads and displays the current contents of the symbols from the buffer;the buffer also indicates whether or not a line has been processed.

You can output most of the symbols with the proper type with the aid of the type informationfrom the link file. The output format (binary, decimal or hexadecimal) can be defined when youenter the symbol in the debugger.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 5–1SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.1 Overview

6 Operation

6.1 Overview

Three menus are available for the operation of the HLL on-line debugger:

• Menu 1 Here you select the block to be tested and define a section of the blockprogram to be monitored during the test (status window).

• Menu 2 Here you can specify a symbol for each line in the status window. The symbolis output before the statement in this line is executed. The number of thesesymbols determines the size of the status window.

• Menu 3 Here you can start the status function and monitor the contents of the symbolsand the program execution in the status window.

The size of the status window is limited to 20 lines due for technical reasons.

In each menu, you can display a window with the list file for your block. This can only takeplace if the list file is stored on the user from which you started the on-line debugger.

If you want to change the block being tested, Menu 1 offers the option of deleting all thesymbols in the status window.

6.2 Calling and Terminating the On-Line Debugger

To start the on-line debugger, enter

HLLDEB

in the command line. When you press the Return key, an overlay driver (TRACE.OVR) isloaded initially. This loads the device-dependent drivers and tools (S5WX000H.CMD andS5WX100X.CMD) as resident in memory.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–1SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.2 Calling and Terminating the On-Line Debugger

Menu 1 appears:

Menu 1

Block : > <Status as from Line No. : > <

Block Type : > <Block No. : > <Library No. : > <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Listing

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Entries

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Delete

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

Old Block

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Static

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Off-Line

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Color

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 1 Version 2.1

When you start the debugger, it is automatically initialized with the data you entered in the lastdebugger session. These data are taken from the file HLLINI.DAT, which is updated every timeyou exit the debugger.

If the HLLINI.DAT file does not exist, or if you no longer want to examine the block currentlyloaded, select a new block in the "Block" input field (see the section entitled "Selecting aBlock").

To exit the on-line debugger, press function key F8 "Back".

Notes:

• The on-line debugger can be started from any user, as long as the block-dependent files(*.LNK, *.LST and *.DAT) are stored on that user.

• If you use the submit file LADE.SUB to copy the block files, the on-line debugger is startedautomatically (see the section entitled "Loading the Block Files").

6–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 6 Operation

6.3 Selecting a Block and Status Window (Menu 1)

6.3 Selecting a Block and Status Window (Menu 1)

You select the block to be tested and define the status window in Menu 1. Variables and theexecution of the program are displayed in the status window (Menu 3).

6.3.1 Selecting a Block

6.3.1.1 "Block" Input Field

The "Block" input field is used to select the HLL function block to be tested. The followingdiagram shows the syntax rules for input:

"Block" Input Field

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Block : > <Status as from Line No. :

Block type :Block No. :Library No. :

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Listing

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Entries

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

Loeschen

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Alter Bst

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Statisch

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Offlinea a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Farbe

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Block numberBlock type(FB, FX)Language IdentifierC CP PL/M

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 1 Version 2.1

Examples:

PFB100 PL/M block FB 100CFX255 C block FX 255

When the input is complete, the debugger searches for the link file of the block. This fileincludes the following data:

• Block type• Block number• Library number

If the file exists on the active user, the data are displayed in the bottom half of the screen.(The numbers are output in decimal format).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–3SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.3.1 Selecting a Block

Menu 1: Initialized Block Data

Block : >PFX123<Status as from Line No. : >00 <

Block Type : >FX <Block No. : >123 <Library No. : >123456 <

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Listing

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Entries

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Delete

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

a a a a a a a a a a a a a a

Old Blocka a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Static

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

Off-Line

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Color

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 1 Version 2.1

If the link file is not found on the active user, the debugger outputs the following errormessage:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Block does not exist

You can reselect the last valid block by pressing the Return key.

6.3.1.2 Loading and Saving User Data

All the data that you enter during a debugging session, or which the debugger determines fromthe link file, are stored in initialization files when you exit the debugger.

The data are loaded again the next time you start the debugger.

6–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.3.1 Selecting a Block

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

A distinction is made between two initialization files:

HLLINI.DAT and?F????.DAT

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Block number (0...255)

Block type (B, X)

Programming language (P, C)

HLLINI.DAT is the current block-independent file and is loaded when the debugger is started. Itinitializes the debugger such that you can continue the test without the need for time-consuming data input.

?F????.DAT is block-dependent and is used if you change the block in Menu 1. A separate fileexists for every block which is tested. The name of the file is composed of the programminglanguage, the block type and the block number.

The checksum of the corresponding link file is stored in each of the files (see the sectionentitled "Checksum Calculation").

In Menu 1, you can enter the last set of valid of data by pressing function key F4 "Old Block".The debugger determines the current status data required for the status function from thesedata and from the link file of the block currently being processed.

The data can only be accepted if the checksums of the link file and initialization file match.Otherwise, the data are declared invalid, since they refer to another link file and thus toanother program source.

The data are still retained, however, and can be updated and entered individually in Menu 2using the new link file.

6.3.1.3 Checksum Calculation

The on-line debugger has a checksum calculation feature that ensures that all the data are up-to-date.

The block generator uses a simple algorithm to calculate a checksum from the link file andenters this checksum in the block.

When Menu 2 (F1 "Entries") is activated, the debugger compares the checksum with achecksum calculated according to the same algorithm and outputs the following error messageif the two calculations produce a different result:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Block checksum error: PLC PG

This message indicates that either the link file, which the debugger is using as a working file,or the block on the PLC is out of date. In either case, both blocks have different programsources.

If this error message appears, you should generate a new S5 file using the block generatorand load it onto the PLC with the S5 program. Transfer the copied link file to the debuggeruser and restart the debugger.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–5SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.3.2 Defining the Status Window

6.3.2 Defining the Status Window

When a block has been selected, you can define the status window. To do this, select a linenumber from the program listing of your HLL block, in order to define where the status windowis to start. Enter this line number in the field "Status as from Line Number".

The line numbers are entered in the first column of the program listing. Only numbers whichpoint to a program statement may be entered, otherwise the following error message appears:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Line number does not exist.

Statements before this line number cannot be monitored without moving the status window.You should therefore position the status window at the start of the block when testing theblock for the first time.

In Menu 2, you can assign an output variable to each of the program lines after the start of thestatus window (see the section entitled "Selecting the Entries in the Status Window(Menu 2)").

The size of the status window is determined by the number of variables to be output. It islimited to 20 lines for technical reasons.

6.3.3 Modifying the Status Window

This section describes how to enlarge, move or reduce the status window after it has beencreated.

Enlarge status window

In Menu 2, you can select and edit the entries with the cursor control keys. You can alsoappend entries to the end of the status window using this method.

Move status window

If you want to append one or more entries at the start of an existing status list, the start of thestatus window must not be positioned at the first statement in the block.

There are two basic methods of appending an entry at the start of the status list:

1. Dynamic append2. Static append

In both cases, you select a new line number in Menu 1. The new line number should besmaller than the current setting.

The dynamic append reformats the link between the symbols and the line numbers.

6–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.3.3 Modifying the Status Window

Example :

Before a dynamic append:

Line number Symbol50 DATAWORD(44) 1st entry52 L1 2nd entry55 L2 3rd entry56 L3 4th entry

After a dynamic append: new start line number = 47

Line number Symbol47 DATAWORD(44) 1st entry49 L1 2nd entry50 L2 3rd entry52 L3 4th entry

In contrast to the dynamic append, the static append defines a permanent link between thesymbol and line number. A static append is activated by entering the new line number in Menu1 and then pressing function key F5 "Static". You will hear a beep tone if the operation hasbeen performed correctly.

Then press function key F1 "Entries". Menu 2 appears with the 1st entry and the new linenumber. A symbol must now be selected for every new statement. When the first oldstatement is reached, a beep tone is output. You cannot exit the menu while the additionalitems are being entered. If you attempt to do so, the following error message appears:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Append must be terminated.

Example:

Before static append:

Line number Symbol50 DATAWORD(44) 1st entry52 L1 2nd entry55 L2 3rd entry56 L3 4th entry

After static append: new start line number = 47

Line number Symbol47 L4 1st entry (new)49 L5 2nd entry (new)50 Dataword (44) 3rd entry52 L1 4th entry55 L2 5th entry56 L3 6th entry

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–7SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.3.3 Modifying the Status Window

Reduce status window

In order to reduce the size of the status window, you can delete entries at the start and end ofthe status window. To do this, activate Menu 2 and select the first or last entry (using the pagekeys).

If you now delete the entry in the "Symbol" input field with the Delete key or Backspace key, itdisappears from the status window.

6.3.4 Function Keys in Menu 1

F1 Entries

You can activate Menu 2 with this key. This is only possible, however, if all the initializationdata were successfully processed.

When you switch menus, the debugger performs an on-line check on the connection betweenthe PLC and the programming device. If the on-line test is successful, the text "On-Line"appears in the menu bar below F6.

Once the connection has been set up, the checksum calculation is activated, in order tocompare your working files and the block to be tested on the PLC (see the section entitled"Checksum Calculation").

F2 Listing

Function key F2 opens a window in which you can monitor the program listing of the selectedblock. If the window cannot be opened, the listing is either not stored on the hard disk, or isnot stored on the user searched by the debugger (see the section entitled "Working Files ofthe Debugger").

You can select any section from the listing with the cursor control keys:

Scroll one line up Scroll one line downPgUp Page upPgDn Page Down

This degree of control greatly enhances the manipulation of program listings. You can activatethe window in any menu. The current section is stored when you close the window. The pagelast displayed reappears the next time you open the window. You can close the window againwith F2.

When you change blocks, the correct listing is loaded automatically.

Note:

The existence of a listing is not required for operation of the debugger, however you shouldalways use the listing, as it makes testing much easier.

F3 Delete

Function key F3 in Menu 1 deletes all the entries which were made in Menu 2. You should thiskey to test a block which has no initialization file (*.DAT) and for which the current entries areirrelevant.

You can also use function key F3 when changing the status window if completely differentsymbols are required.

Since you can't see the function running in the first menu, an acoustic signal is output whenthe function has been successfully completed.

6–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 6 Operation

6.3.4 Function Keys in Menu 1

F4 Old Block

This function key can be used to enter the data used during the last debugger session. This issubject to the condition that the block to be tested has not been modified since the lastsession. If you are not sure whether or not this is the case, you should not activate thefunction, since this could cause the control to crash if the integrated checksum calculationshould not take effect (see also the section entitled "Loading and Saving User Data").

F5 Static

You can use this function to append new entries to the start of the status window withoutchanging the existing link between entries and line numbers. This function can only be used ifthe start of the status window is not positioned at the first statement in the block (see also thesection entitled "Modifying the Status Window").

F6 Offline/Online

The text under function key F6 is variable. It indicates whether a connection exists betweenthe programming device and PLC.

If no connection exists ("off-line") and you press the F6 key, an attempt is made to set up theconnection. If the connection cannot be established, the debugger outputs the following errormessage:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

PLC not on-line

If the connection exists ("on-line") and you press the F6 key, the connection is interrupted atthe debugger end. The checksum calculation can thus be inhibited on a change from Menu 1to Menu 2.

It is not possible to activate test mode (Menu 3) if the on-line check is unsuccessful, becausethe debugger performs several test routines involving checksums, and these must beprocessed in off-line mode.

F7 Color/LCD

The text under function key F7 is variable and indicates the active screen type.

The standard version of the PG 730 is equipped with an LCD screen. It is possible to connectan EGA screen to the programming device, however. By activating function key F7, you canmake the debugger output compatible with this type of screen.

The standard version of the PG 750 is equipped with a color monitor. It is possible to connectan LCD screen to the programming device, however. By activating function key F7, you canmake the debugger output compatible with this type of screen.

The function key has no effect with the PG 685.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–9SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.3.4 Function Keys in Menu 1

F8 Back

To exit the debugger, press function key F8.

The following message appears:

ATTENTION

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Really exit function (Y/N)?

If you press "Y", the relevant debugger data are stored on the disk, the screen is cleared andthe system returns to operating system level.

If you did not mean to exit the debugger, press "N" to return to Menu 1.

6.4 Selection of the Entries in the Status Window (Menu 2)

In Menu 2, you select the entries in the status window, i.e. you define which variables are tobe displayed in the status window during execution of the individual program lines.

The following sections describe:

• how to select the entries in the status window

• various ways of specifying the entries in the status window more accurately

• which data types are supported by the on-line debugger in the individual programminglanguages (PL/M, C)

• which variables can be monitored in which parts of the program (scope and service life)

6.4.1 Overview

When you have defined the block to be tested and the start of the status window in Menu 1,you can specify in Menu 2 which variables are to be displayed in the status window during theexecution of the individual program lines.

The list file of the block appears in the bottom region of the window to facilitate selection of thevariables.

You can specify one variable for each line number in the status window. When you enter thevariable for a line, the debugger automatically increments the line number.

The window is limited to 20 entries for technical reasons.

The following diagram shows the window for selecting the entries in the status window (entrywindow).

6–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.1 Overview

Menu 2

PL/M-86 COMPILER PFB100

DOS 3.3 (038-N) PL/M-86 V3.1 COMPILATION OF MODULE PFB100OBJECT MODULE PLACED IN C:\PLM\OBJECT\PFB100.OBJCOMPILER INVOKED BY: C:\PLM\PLM86.EXE C:\PLM\SOURCE\PFB100.PLM DEBUG

PR(C:PLM\OJ(C:PLM\OBJECT\PFB100.OBJ)

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Listing

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Start

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Act. DB

a aa aa aa aa a

a aa aa aa aa a

a aa aa aa aa a

a aa aa aa aa a

Symbol: > <Block: > <Format: >H<

Line Number: > <Type: > <

Entry Number >001<

PFB100.LST

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 1 Version 2.1

When Menu 2 is called up, entry number 001 is displayed initially. The "Line Number" outputfield indicates the number you defined in Menu 1 for the start of the status window.

Enter the name of the variable to be output during execution of the line in the "Symbol" inputfield.

If a symbol with the same name is used several times (e.g. in different subroutines), you canuse the "Block" input field to produce a "search template" that selects the desired programsection.

Finally, you can select the output format for the symbol in the "Format" input field.

The individual input and output fields are described in more detail in the following sections,together with important information about the input rules.

When you have filled in all the fields for an entry, you can complete the entry by pressing theReturn key in the "Format" field. If you do not want to fill in all the fields, you can complete theinput in the "Symbol" or "Block" fields by pressing the PgDn key.

The entries are then checked. If any errors are detected, an error message is output. You willfind a list of the error messages in Chapter 7.

When you press function key F1 "Start", the input is terminated and you can start the statusfunction (Menu 3).

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–11SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.4.1 Overview

Notes:

• If you want to monitor data from data blocks in the status window, please remember thatthe data block must be opened before the program line in which the first item of data fromthe block is displayed.

Failure to observe this rule can cause a system crash if the incorrect data areas areaccessed.

• All of the examples in this documentation are included in blocks PFX123 and CFB255. Youwill find the accompanying program listings in the section entitled "Example Programs".

These examples assist you to understand the following operations in practice. You do notneed to connect a control if you only want to practise entering the data.

6.4.2 "Symbol" Input Field

Symbol Input

Entry number>001<

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Symbol: > <Block: > <Format > <

Line Number: > <Type: > <

This section describes how to access the various symbol types . All of the data typesintegrated in PL/M and C are described below (except for the REAL data type, which is notincluded in the HLL system).

The characteristic features of the individual data types are not described in this documentation.Please refer to the high-level language manual for more information.

Basically, all of the symbols are entered in the debugger in the same way as they areaddressed in PL/M and C. The time spent learning the system is thus kept to a minimum.

6.4.2.1 Symbols and Data Types in PL/M

Special characters in PL/M

In PL/M, the dollar sign ("$") can be inserted in any name as a dummy character. Thecompiler ignores this character. This characteristic is simulated by the on-line debugger.

Example:

Switch$4 is the same as Switch4

6–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.2 "Symbol" Input Field

Scalars

Scalars, in this context, are basic symbol types that do not point to other symbols orstatements, unlike pointers and labels.

PL/M recognizes the following scalars:

Data typeType definition in

debuggerBit Leading sign Value range

BYTEWORDINTEGERDWORDREAL

8-bit unsigned16-bit unsigned16-bit signed32-bit unsigned

816163232

withoutwithout

withwithout

with

0 to 2550 to 65535

–32768 to 327670 to 2147483647

All scalars are addressed by the name with which they were declared.

Examples:

Symbol: > L1 <Symbol: > L2 <Symbol: > L4 <

(See the "Example Programs" section for the declarations)

Arrays and vectors

In PL/M, an array or a vector is a structured data type with a number of components (thenumber is defined by the user) all of the same type. Each component can be accessed by anindex. An index is an expression entered in parentheses after the name.

The numbering of the individual elements in the debugger uses the same conventions asPL/M, i.e. an array with n components is numbered from 0 to n-1 and can only be addressedwithin these limits, otherwise the following error message appears:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Array index too large or missing

Example:

PL/M declaration: DECLARE DATAWORD (256) WORD

Symbol: >DATAWORD (0) <Symbol: >DATAWORD (123) <Symbol: >DATAWORD (255) <Symbol: >DATAWORD (256) < illegal

Note:

You can use square brackets instead of parentheses:

Symbol: >DATAWORD [126] <

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–13SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.4.2 "Symbol" Input Field

Pointers and dereferencing

A pointer is a variable whose value is an address.

Unlike a variable, a pointer does not consist of address and contents, but is composed of thefollowing components:

1. Address of the pointer2. Contents of the pointer (address to which the pointer points)3. Contents of the address to which the pointer points.

To observe the address of a pointer in the debugger, the "&" operator should be inserted infront of the name.

To observe the contents of the pointer, specify the name of the pointer only.

To observe the contents of the address to which the pointer points, enter the "*" operator infront of the name. PL/M in this case outputs the contents as a doubleword without leadingsign, since there is no convenient pointer system in PL/M.

Example:

PL/M declaration: DECLARE XDBLAEN POINTER EXTERNAL;Memory org.: Base OFFSET SYMBOL CONTENT

0000H 380CH XDBLAEN 0000:04D7

Symbol: >&XDBLAEN <

The debugger outputs the address of the pointer, i.e. 0000:380C.

Symbol: >XDBLAEN <

The debugger outputs the contents of the pointer, i.e. 04D7.

If you want to access the contents of memory cell 0000:04D7, the pointer must bedereferenced using the "*" operator. The resulting value is output in PL/M as a doublewordwithout leading sign.

Symbol: >*XDBLAEN <

Structures

A structure is a data array which consists of several combined symbols (structure elements)connected by a master symbol (structure name).

Each structure element, and the structure name itself, can also be declared as an array. InPL/M Versions 3.1 and higher, a structure element may also be of type STRUCTURE, so thatnested structure declarations are possible.

The "." operator is used in the debugger to access the structure. The structure name isentered, followed by the "." operator and the structure element. The names of nestedstructures are each separated by a period.

6–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.2 "Symbol" Input Field

Examples:

PL/M decl.: DECLARE L7 STRUCTURE (ARRAY1 INTEGER, ARRAY2 BYTE)

Symbol: >L7.ARRAY1 <Symbol: >L7.ARRAY2 <

PL/M decl.: DECLARE L8 (2) STRUCTURE(A BYTE,B (3) WORD,C (2) STRUCTURE

(C1 INTEGER,C2 (3) BYTE,C3 POINTERC4 STRUCTURE

(C41 WORDC42 (2) INTEGER,C43 (3) POINTER)

C5 INTEGER,C6 (3) WORD),

D (4) INTEGER;E SELECTOR);

Symbol: >L8 (0) . A <Symbol: >L8 (0) . B (2) <Symbol: >L8 (0) . C (0) . C1 <Symbol: >L8 (0) . C (0) . C2 (1) <Symbol: >L8 (0) . C (0) . C4 . C41 <Symbol: >L8 (0) . C (0) . C4 . C42 (1) <Symbol: >L8 (0) . D (2) <Symbol: >L8 (1) . B (0) <Symbol: >L8 (1) . C (1) . C2 (0) <Symbol: >L8 (1) . E <

Pointers to program labels

A program label is a symbol that points to a statement. It is used as a reference point for jumpstatements. Unlike all other symbols, a label must not be defined in the declaration section, butcan be entered directly in front of a program statement.

With the data type LABEL SHORT , the debugger returns the offset of the line number towhich the label points. With the data type LABEL LONG , the code segment (CS) is alsooutput.

Example:

PL/M decl.: START: CALL HLL–ADB (...)

Symbol: >START <

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–15SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.4.2 "Symbol" Input Field

6.4.2.2 Symbols and Data Types in C

Upper and lower case in C programs

A distinction is always made in C between upper and lower case letters. This means that thedeclarations

int UPPERlower;int upperLOWER;

declare two different variables.

When the programs are linked (LINK86), the symbols are stored in lists. The names are onlyentered in upper case letters in these lists, however.

When the on-line debugger references these lists, it cannot recognize different symbols,because it cannot distinguish between upper and lower case notation.

You should therefore avoid using symbol definitions with the same name in the same block(see the section entitled "Block" Input Field).

Scalars

The following table shows all the elementary data types supported by C. The floating-pointdata types (float, double) are not included in the HLL system.

Data typeType definition in

debuggerBit

Leadingsign

Value range

charsigned charinsignedcharintunsignedlongsigned longfloatdoublevoid

8-bit unsigned8-bit signed

16-bit unsigned16-bit signed32-bit unsigned32-bit signed

––

void

88

161632323264–

withoutwith

withoutwith

withoutwithwithwith

0 to 255–128 to +127

0 to 65535–32768 to 32767

0 to 4294967295–2147483647 to 2147483647

±1E–37 to ±1E+38±1E–307 to ±1E+308

In the debugger, all scalars are addressed with the name defined in the HLL block.

Examples:

Symbol: >l1 <Symbol: >l2 <Symbol: >l4 <

(See the "Example Programs" section for the declarations)

Arrays and vectors

An array or a vector is a structured data type with a number of components (the number isdefined by the user) all of the same type. Each component can be accessed by an index.

6–16 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.2 "Symbol" Input Field

An index is an expression entered in square brackets after the name.

C also supports multi-dimensional vectors. These can be treated as elements in the debugger.

The individual elements are numbered individually in the debugger, i.e. an array with ncomponents is numbered from 0 to n-1 and can only be addressed within these limits,otherwise the following error message appears:

ERROR

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Array index too large or missing

Example:

C declaration: unsigned int DATAWORD [256]

Symbol: >DATAWORD [0] <Symbol: >DATAWORD [123] <Symbol: >DATAWORD [255] <Symbol: >DATAWORD [256] < illegal

Note:

You can use parentheses instead of square brackets:

Symbol: >DATAWORD (123) <

Pointers and dereferencing

A pointer is a variable whose value is an address . C has a convenient pointer system whichenables elegant and efficient programming. The greatest care is required, however, whenusing the pointer system.

Unlike a variable, a pointer does not consist of address and contents, but is composed of thefollowing components:

1. Address of the pointer2. Contents of the pointer (address to which the pointer points)3. Contents of the address to which the pointer points.

To observe the address of a pointer in the debugger, the "&" operator should be inserted infront of the name.

To observe the contents of the pointer, specify the name of the pointer only.

To observe the contents of the address to which the pointer points, enter the "*" operator infront of the name.

Type-specified pointers are generally used in C, i.e. the type of the contents of the address isknown. The debugger can therefore output the contents in the correct data type.

The "&" operator can also be used for variables. It returns the address of the variable.

Symbol: >&dataword[126] <

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–17SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.4.2 "Symbol" Input Field

Structures

A structure is a data array which consists of several combined symbols (structure elements)connected by a master symbol (structure name). Each structure element, and the structurename itself, can also be declared as an array.

The "." operator is used in the debugger to access the structure. The structure name isentered, followed by the "." operator and the structure element. The names of nestedstructures are each separated by a period.

Restrictions

1. The "->" operator normally used in C cannot be used.2. For runtime reasons, it is not possible to observe structures with pointers within the

structure.3. It is not necessary to enclose structure elements in parentheses for dereferencing. The "*"

operator always refers to the following name.

Examples:

C decl.: struct l7– {int array1;int array2;

}l7;

Symbol: > l7. array1 <Symbol: > l7. array2 <

C decl.: struct l8– {int a;char b;struct c– {

int c1;char c2;

}c;char d;long int e;

}l8;

Symbol: > l8.a <Symbol: > l8.c.c2 <

C decl.: struct l9– {int array1;char array2;

}*l9;

Symbol: >*l9.array2 <

6–18 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.2 "Symbol" Input Field

Pointers to program labels

A program label is a symbol that points to a statement. It is used as a reference point for jumpstatements. Unlike all other symbols, a label must not be defined in the declaration section, butcan be entered directly in front of a program statement.

The compiler declares a label as 8 bit unsigned , and not LABEL SHORT or LABEL LONG ,i.e. you can only output the address of the label by entering the "&" operator before the nameof the label. The debugger outputs a 32-bit pointer (code segment and offset).

6.4.3 "Block" Input Field

If you use subroutines in your HLL block, or if you link different modules in a block, it ispossible to declare symbols of the same name in the different areas (e.g. local data). Localdata are only valid within the subroutine or module in which they are declared.

You will find more information on the structure of the HLL blocks in the description of the S5-HLL block generator.

The on-line debugger allows you to display symbols of the same name from differentsubroutines or modules. The search template, which you can enter in the "Block" input field,is used for this purpose.

Entering the Search Template

Entry Number >001<

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aSymbol: > <Block: > <Format > <

Line Number: > <Type: > <

To inform the debugger which of the symbols of the same name it is to process, enter thename of the subroutine in which the variable is declared in the "Block" input field.

If your block consists of several modules and a symbol name is declared in several modules,you should also enter the name of the module. The module name is terminated with the "."operator.

You do not need to enter a search template for symbols which only appear once. You can exitthe "Block" input field by pressing the Return key or one of the cursor control keys.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–19SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.4.3 "Block" Input Field

Examples:

PL/M decl.: Subroutine:PROCEDURE (DATUM) REENTRANT

DCL DATUM WORD;DCL SAME BYTE;DCL L1 DWORD;DCL L2 WORD;

SUBSTART:L1= K1 (0);DATAWORD (44)= 0ABCDH;SAME=DATAWORD (44);

END Subroutine;::function:

PROCEDURE (KARL,KARL_MSK,TIME,ORFF_ADR,RAUS_ADR) PUBLIC REENTRANT;

DCL KARL BIT,KARL_MSK MASK,TIME WORD,ORFF_ADR POINTER,ORFF BASED ORFF_ADR WORD,RAUS_ADR POINTER,RAUS BASED RAUS_ADR DWORD ;

/****************************************************//* Declaration of *//* Local Data *//****************************************************/

DCL SAME WORD;

C decl.: SUBROUTINE (unsigned int datum)

{char same ;long unsigned l1unsigned int l2;

SUBSTART:l1=K1[0];dataword [44]=datum;datum=0x67;l2=dataword [44];

}::

FUNCTION (){unsigned int same;char raus;::

6–20 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.3 "Block" Input Field

Symbol: >SAME <Block: >SUBROUTINE <orBlock: >PFX123.SUBROUTINE < (for PL/M)

The declaration "DCL SAME BYTE;" (PL/M) or "char same;" (C) is selected with the searchtemplate "SUBROUTINE".

Symbol: >SAME <Block: >FUNCTION <orBlock: >PFX123.FUNCTION < (for PL/M)

The declaration "DCL SAME WORD;" (PL/M) or "unsigned int same;" (C) is selected with thesearch template "FUNCTION".

Symbol: >RAUS <Block: > <

The symbol "RAUS" is only declared once. A search template is therefore not required.

Note:

If several symbols with the same name exist and you want to access the first symbol declaredin the program, you do not need to produce a search template.

All system data which are programmed at the start of the main module do not require a searchtemplate.

6.4.4 "Format" Input Field

Entering the Output Format

Entry Number>001<

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

Symbol: > <Block: > <Format > <

Line Number: > <Type: > <

You can define the output format for the symbol in the "Format" input field. The followingformats are available:

>H< hexadecimal notation>D< decimal notation>B< binary notation

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–21SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.4.4 "Format" Input Field

The default is hexadecimal notation. If you do not select another format, the value of thevariable is output in hexadecimal notation.

Symbols of the type POINTER are always output in hexadecimal format.

The on-line debugger allows you to output even variables with leading signs in all threeformats. The twos complement form is generated before the output of negative numbers. Thisapplies not only to decimal notation, but also to binary and hexadecimal notation; each symbolis output according to its type.

6.4.5 "Line Number" Output Field

This field outputs the line number to which the entered symbol is allocated.

When Menu 2 is called up, the line number you defined in Menu 1 for the start of the statuswindow appears.

The line number is automatically incremented when you enter the individual items.

6.4.6 "Type" Output Field

When the three entries for an item have been entered, and you have pressed the Return orPgDn key to complete the entry, the debugger searches for the selected symbol in the symbollist in the link file.

If the symbol is in the list, the type is entered in the output field and the next item is selected.

You can call up the type of the last item by selecting the previous item with the PgDn key (e.g.to check declarations of the same name).

6.4.7 Scope and Service Life of HLL Data

When you select the symbols which are to be displayed in the status window, you should notethe scope and service life of the variables.

Most of the symbols have a limited scope. Some symbols are invalidated and cannot bereconstructed when you move beyond the boundaries of their scope. These symbols are saidto have a limited service life.

You can continue to observe these symbols outside the boundaries of their scope, but thedisplayed values are purely arbitrary in this case.

The following section contains details of the scope and service life of the individual HLL data.

Please refer to the high-level language manual for general information on this subject.

6–22 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 6 Operation

6.4.7 Scope and Service Life of HLL Data

System data and process image

The system data are defined in the module DAT_COM1 or DAT_COM2 with the attributePUBLIC. In the main module (e.g. PFX123), they differ from other declarations in that theyhave the PL/M attribute EXTERNAL (extern in C) or an indirect declaration of a pointer definedin DAT_COM1/2.

All system data are global throughout the module and can be accessed from any point, i.e.their scope is always active and they have an unlimited service life.

Constants

The compiler directive "ROM" stores constants in the code segment. They are only known inthe module in which they are defined. They have an unlimited service life.

Symbols in data blocks

A data block is accessed via the data segment (DS register). Before the contents of a datablock can be displayed in the debugger, the block must be opened (HLL_ADB()). The DSregister is initialized accordingly.

If the contents of a data block are displayed in the debugger, although the data block has notyet been opened, arbitrary values are displayed. In extreme cases, the control may incur asystem crash.

If, after opening a data block, no other data block is opened, the data are valid up to the end ofthe HLL block; their service life is unlimited.

Parameters

Parameters can be passed when an HLL block is called. These parameters are accessed viathe stack segment (SS register). They are thus valid only within the main program of the block(FUNCTION).

This means that if you use the on-line debugger to observe the parameters outside the mainprocedure, arbitrary values are displayed. The parameters are only active in the lines followingthe declaration of the main procedure.

The scope and service life of parameters is thus limited to the main procedure of the block.Reference parameters are also valid in the calling procedure, however.

The above also applies to parameters passed to local procedures within the HLL block.

Local data

The stack segment is also used to access local data. Their scope is therefore limited to theprocedure in which they are declared. When you exit the procedure, the data can no longer bereconstructed.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–23SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.4.8 Special Keys and Function Keys in Menu 2

6.4.8 Special Keys and Function Keys in Menu 2

Special keys

The following keys can be used to move the cursor in the item window in Menu 2.

Move the cursor one line up Move the cursor one line down Move the cursor one column to the right Move the cursor one column to the leftHome Move the cursor to the start of the lineEnd Move the cursor to the end of the line

The following keys can be used to correct an input:

BS Deletes the character to the left of the cursorDel Deletes the character to the right of the cursorIns Toggles between insert and overwrite mode

You can use the following keys to change the item number:

PgUp Calls up the previous item windowPgDn Calls up the next item window

Press the Return key to complete an input in one of the input fields ("Symbol", "Block" or"Format") The cursor then jumps to the next input field.

If you press the Return key in the "Format" input field, the input is checked and the next itemwindow is activated. If the input is correct, the item is entered in the status window, otherwisean error message appears.

The same response is generated if you press the "PgDn" key in any of the fields. You canskip the remaining input fields with this key.

If you call up the previous item window during input by pressing the "PgUp" key, the entries inthe current item window are not checked and are not entered in the status window. However,if you page to this item window again later, the entries are still available.

Notes:

• You will find a list of error messages in Chapter 7.• The various key assignments are listed in the Appendix.

Function keys in Menu 2

F1 Start

Pressing the F1 key terminates input of the items and calls up Menu 3. This menu contains alist of all the entries. This provides you with an overview of all the data entered.

To start the status function, press the F1 key again.

6–24 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.4.8 Special Keys and Function Keys in Menu 2

F2 Listing

The bottom half of the screen contains a window with the program listing of the block. Tomove the window, press function key F2.

The item window is darkened and you can move the listing section with the cursor controlkeys.

Scroll one line up Scroll one line downPgUp Page upPgDn Page down

Press the F2 key again to switch back to the item window.

F3 Act. DB

You can use the F3 function key in the item window to observe the data block open at thecurrently active line number. The following pseudovariable appears in the symbol line:

Symbol: >DB_? <

The item window automatically switches to the next item.

In on-line mode, the type and number of the data block are displayed (e.g. "DB 255"). Theblock number is output in decimal format, but can also be output in hexadecimal or binaryformat.

F8 Back

You can return to Menu 1 with function key F8. All the data entered in Menu 2 are stored. Youshould press F8 if you want to define a new status window or test a new block.

To terminate the debugger session, press the F8 key twice.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–25SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.91

6.5 Status Function (Menu 3)

6.5 Status Function (Menu 3)

6.5.1 Structure of the Status Window

Menu 3: Inactive Status Function

CS:IPa aa a

a a a a a a a

a a a a a a aLine00035 L1 DWord H00036 DATUM Word/Address H00037 DATUM Word/Address H00038 SAME Byte H00039 L2 Word/Address H00040 DATAWORD(0) Word/Address B00041 DATAWORD(1) Word/Address D00042 DATAWORD(0) Word/Address B00043 DATAWORD(0) Word/Address B00044 M_BYTE(0) Byte H00055 START Label short H00056 DATAWORD(1) Word/Address D00057 DATAWORD(1) Word/Address D00058 M_BYTE(0) Byte B00060 K1 (4) Byte D00061 *XAKOBNR 32 Bit Pointer H00062 DATAWORD(44) Word/Address H00064 DB_LAENGE Word/Address H00065 XDBLAEN 32 Bit Pointer H00066 *XDBLAEN 32 Bit Pointer H

a a a a a a a a a

a a a a a a a a a

Symbol Typea a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a

Contentsa a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Start

a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Back

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 3 Version 2.1

Menu 3 presents the status window. All of the items you have entered (apart from the searchtemplate) are output line by line.

You can press function key F1 "Start" to activate the status function ("status active" mode).

The first column contains the line numbers allocated to the entries.

The next columns contain the symbols, the assigned types and, finally, the contents of thesymbols. The column at the far right contains the format in which the symbol is output.

In "status active" mode, the absolute addresses of the individual lines are output in the"CS:IP" column. The "contents" column displays the contents of the variables when the line isexecuted.

6–26 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.92 6 Operation

6.5.2 Starting the Status Function

6.5.2 Starting the Status Function

Press function key F1 "Start" to activate the status function ("status active" mode).

Menu 3: Active Status Function

CS:IPa aa a

Line00035 L1 32 Bit unsigned 00000005 H00036 DB ? void 009C D00037 DATUM 16 Bit unsigned 1234 H00038 SAME 8 Bit unsigned 67 H00039 L2 16 Bit unsigned 009C H00040 DATAWORD(0) 16 Bit unsigned00041 DATAWORD(1) 16 Bit unsigned00042 DATAWORD(0) 16 Bit unsigned 0000000000100000 B00043 DATAWORD(0) 16 Bit unsigned00044 M_BYTE(0) 8 Bit unsigned00055 START Label short00056 DATAWORD(1) 16 Bit unsigned00057 DATAWORD(1) 16 Bit unsigned00058 M_BYTE(0) 8 Bit unsigned00060 K1 (4) 8 Bit unsigned 008 D00061 *XAKOBNR 32 Bit Pointer 00010001 H00062 DATAWORD(44) 16 Bit unsigned 0000 H00064 DB_LAENGE 16 Bit unsigned00065 XDBLAEN 32 Bit Pointer00066 *XDBLAEN 32 Bit Pointer

Symbol Type

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a

Contents

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a aa a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

List on

a a a a a a

a a a a a a

a a a a a a

a a a a a a

Halt

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a a

SINUMERIK S5-HLL On-Line Debugger Status Menu 3 Version 2.1

In "status active" mode, the absolute addresses of the individual lines are selected on the PLCand transmitted to the programming device via the RS-232 (V.24) interface. These addressesare displayed in the "CS:IP" column.

At each of these addresses, the program execution is interrupted briefly and the contents ofthe symbol allocated to the line is recorded. The value is transmitted to the programmingdevice and displayed in the appropriate output format.

The status function is therefore program-dependent , not cycle-synchronous. This has thefollowing advantages:

• You can observe whether a value changes between two lines in the program and, if so,how.

• You can observe whether a statement is executed.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 6–27SINUMERIK 840/880 Part 3 (PJ)

6 Operation 11.92

6.5.3 Variable Symbol Display in the Status Window

6.5.3 Variable Symbol Display in the Status Window

You can determine whether a program line has been executed in the present cycle byexamining the way in which a symbol is displayed. The possibilities are as follows:

• The statement is not executed. The line is displayed as follows:

– PG 685 white on black (normal)– PG 750 red on blue– PG 730 black on white (normal)

• The statement is executed once. The line is displayed as follows:

– PG 685 black on white (inverse)– PG 750 white on blue– PG 730 white on black (inverse)

• The statement is executed more than once. The line is displayed as follows:

– PG 685 black on white (inverse)– PG 750 white on cyan– PG 730 white on black (inverse)

6.5.4 Function Keys in Menu 3

F1 Start

Press this key to activate the status function ("status active" mode).

F2 Listing

You can use this key to display the list file of the block in a window. If the window cannot beopened, the file is not stored on the active user.

You can select any section of the listing with the cursor control keys:

Scroll one line up Scroll one line downPgUp Page upPgDn Page down

Press the F2 key again to switch back to the item window.

You can move the window using the following function keys:

F3: Move window one line upF4: Move window one line downF5: Move window to start of screenF6: Move window to end of screen

This enables you to observe status values which were previously beyond the visible area ofthe window.

F8 Halt/Back

You can deactivate the status function with this key in "status active" mode.

If the status function is inactive, this key returns you to Menu 2.

6–28 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 7 Error Messages

7 Error Messages

This chapter provides an alphabetical list of the error messages which are output duringoperation of the on-line debugger.

PLC not on-line

The connection between PLC and programming device cannot be established. Possiblecauses:Cable defective or not connectedInterface on the control not activated

PLC <-> PG interface deactivated

The connection between PLC and programming device has been interrupted during an on-linetest. This has caused an irregular function cancelation of the status function. The block on thePLC still contains the break points for the test, however.

To delete these break points, perform a power-on reset.

PLC software out of date

The software of the debugger and the software of the PLC are incompatible.

Version 2.1 of the debugger contains the C status function in addition to the PL/M statusfunction. The C status function was not integrated in Version 1.0. Your PLC software is onlycompatible with the PL/M status function (see the section entitled "Software Requirements").

Block F???? does not exist on PLC

You have attempted to test a block which is not loaded on the PLC. You must load the blockonto the PLC before starting the status function.

Block not found

The debugger cannot find its working files for the block. Possible causes are:

• The files are not stored on the active user• You have specified the wrong block for the test

Block checksum error: PLC <-> PG

The checksum calculation has detected that the checksum of the HLL block on the PLC doesnot match that of the link file. You have probably modified the block and forgotten to reload iton the PLC (see the section entitled "Checksum Calculation").

Block does not exist

The search template (subroutine, module) which you have entered in Menu 2 does not exist.You have probably entered the wrong name (see the section entitled "'Block' Input Field").

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–1SINUMERIK 840/880 Part 3 (PJ)

7 Error Messages 11.91

Append must be terminated

In a static append, you refine the start of the status window in Menu 1. You must then enternew items for all lines between the new and the old starting points of the status window inMenu 2. The error message appears if you press the F1 "Start" key before doing this (see thesection entitled "Modifying the Status Window).

Illegal input: Array index not a number

When attempting to enter an array as a symbol in Menu 2, you have not entered a number forthe index (see the section entitled "Symbols and Data Types in PL/M" or "Symbols and DataTypes in C").

Illegal input: Syntax error

You have used special characters which are not permitted in the input.

Array index too large or missing

When attempting to enter an array as a symbol in Menu 2, you have entered an illegal index.The permissible value range is determined by the array declaration (see the section entitled"Symbols and Data Types in PL/M" or "Symbols and Data Types in C").

Unknown function

The status function is not integrated in your PLC software version (see the section entitled"Software Requirements".

"Act. DB" function not implemented on PLC

The "Act. DB" function returns the active data block. If this error message appears, thefunction is not implemented on your PLC software version.

Modified LNK file: F4 key ignored

You have pressed the F4 key "Old Block", although you have modified the block since the lastdebugger session. This error message causes the debugger to declare all items in the statuswindow invalid. If you want to continue working with these items, you must confirm each itemindividually in Menu 2.

Only H (hex), B ( binary) and D (decimal) allowed

Only the letters H, B and D are allowed for the format input in Menu 2 (see the section entitled"'Format' Input Field").

Checksum error in LNK file

A checksum is generated for each record in a link file. This checksum is no longer correct (acommunication error may have occurred when copying the link file). You should copy the linkfile again or create it and copy it again.

Status denied: no checksum comparison

You have attempted to start the status function in Menu 3 without switching to on-line mode.The necessary checksum comparison could not be performed. Please return to Menu 1 andpress the F6 key (on-line/off-line selector).

7–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 7 Error Messages

Dereferencing error in main structure name

The structure which you want to address is accessed via one or more pointers. You mustdereference the main name of the structure completely with the "*" operator (see the sectionentitled "Symbols and Data Types in C").

Symbol outside block

The variable which you want to observe is not defined in the block which you have specified.You have either specified an incorrect symbol or an incorrect block (see the sections"'Symbol' Input Field" and "'Block' Input Field").

Symbol type not implemented

In PL/M blocks, the debugger can access all data types except for REAL. This type is notimplemented on the HLL system (see the section entitled "Symbols and Data Types in PL/M").

In C blocks, it is not possible to access structures which contain pointers (see the sectionentitled "Symbols and Data Types in C").

Variable not found

The symbol (or variable) which you have entered does not exist in the block program. Pleasecheck your entry against the program listing.

Defined block type/number different than actual block type/number

The block type or number which you have defined does not match the data in the link file. Thelink file or list file has been renamed.

Line number does not exist

You have specified a line number in Menu 1 which does not exist in the link file. Not every linein the program listing is included in the link file. The line numbers you enter must always pointto the start of a statement (see the section entitled "Defining the Status Window").

Too many dereferences

You have dereferenced a pointer variable (in C) too many times ("*" operator, see the sectionentitled "Data Types in C").

.LNK file is located

You have copied the located file (*.LOC) instead of the link file (*.LNK) and changed the filename extension. Please copy the link file.

.LNK file not in OMF format

The link file which you have used is corrupt or has not been generated by an intel compiler orlinker.

.LNK file: Type list missing

The block was not created using the block generator. On compilation or linking, the attributeswhich invoke the generation of a type list were not specified. The generated link file cannot beused for the on-line debugger.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 7–3SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

8 Example Programs

This chapter includes the program listings for the example function blocks:

• PFX123• CFB255

These function blocks are also stored on the installation diskette.

The examples are intended to demonstrate the operating principle of the HLL on-line debuggerand assist in the operation of the debugger. They are not intended for actual use on thecontrol.

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–1SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

DOS 5.0 (038-N) PL/M-86 V3.1 COMPILATION OF MODULE PFX123

OBJECT MODULE PLACED IN PFX123.OBJ

COMPILER INVOKED BY: C:\PLM\PLM86.EXE PFX123.PLM DEBUG MOD186 PR(PFX123.LST)

OJ(PFX123.OBJ) OPTIMIZE(0)

/* SIEMENS Block Generator S5-PL/M */

/* Date: 29.04.91 Time: 10:15:01 */

/* Type : FX */

/* Number : 123 */

/* Name : PUCCINI */

/* Lib.number : 11111 */

/* PLC system : 2 (PLC 135WB with ACOP) */

$LARGE ( SUBS has DAT_COM; EXPORTS HLL_HLL, HLL_MACRO, HLL_S5,

$ DB_LST, SB_LST, PB_LST, FB_LST, OB_LST, DX_LST, FX_LST,

$ HLL_ADB, XDBLAEN, XDSPVER, XBINERG, XAKOBNR, PeE, PeA,

$ E_Byte, A_Byte, M_Byte, Zeit, Zaehler, HLL_STOP, S_Merker,

$ QeE,QeA, HLL_LIM, HLL_SIM)

$COMPACT ROM

$eject

1 PFX123: DO;

/**************************/

/* Literallies */

/**************************/

2 1 DECLARE DCL LITERALLY 'DECLARE',

LIT LITERALLY 'LITERALLY';

3 1 DCL BIT LIT 'BYTE',

CHAR LIT 'BYTE',

MASK LIT 'BYTE';

$EJECT

/**************************/

/* System Functions */

/* and */

/* System Data */

/**************************/

/* S5HLL System Data START */

8–2 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

4 1 declare HLL_HLL pointer external;

5 1 declare HLL_MACRO pointer external;

6 1 declare HLL_S5 pointer external;

7 1 declare ( DB_LST, SB_LST, PB_LST, FB_LST,

OB_LST, DX_LST, FX_LST ) (256) pointer external;

8 1 declare XDBLAEN pointer external;

9 1 declare DB_Laenge based XDBLAEN word;

10 1 HLL_ADB: procedure (a,b) external;

11 2 declare a word;

12 2 declare b word;

13 2 end HLL_ADB;

14 1 declare XDSPVERpointer external;

15 1 declare Sp_Verw based XDSPVER structure

( PHANFGP word, PHENDP word, PHANFGD word,

PHENDD word, GREBESP word, GREBEOP word,

GREBESD word, GREBEOD word);

16 1 declare (XBINERG, XAKOBNR) pointer external;

17 1 declare Bin_DigA based XBINERG word;

18 1 declare Akt_OB_Nr based XAKOBNR byte;

19 1 declare PeE (256) pointer external;

20 1 declare PeA (256) pointer external;

21 1 declare E_Byte (128) byte external;

22 1 declare A_Byte (128) byte external;

23 1 declare M_Byte (256) byte external;

24 1 declare Zeit (256) word external;

25 1 declare Zaehler (256) word external;

26 1 declare HLL_STOP pointer external;

27 1 declare S_Merker(4096) byte external;

28 1 declare QeE (256) pointer external;

29 1 declare QeA (256) pointer external;

30 1 declare HLL_LIM pointer external;

31 1 declare HLL_SIM pointer external;

/* S5HLL System Data END */

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–3SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

32 1 declare dataword(256) word;

33 1 declare DW(256) STRUCTURE (DL BYTE, DR BYTE) at (@dataword(0));

/**************************/

/* Constants */

/**************************/

34 1 DECLARE K1(9) BYTE DATA (5,9,3,2,8,4,1,7,6);

/*****************************************************************************/

35 1 SUBROUTINE:

PROCEDURE (DATUM) REENTRANT;

/* This example can be used to practise the creation of the search template.

All of the following local data are also declared in the 'FUNCTION'

subroutine, using a different type which permits easy identification of

the correct access.

/*

36 2 DCL DATUM WORD;

37 2 DCL SAME BYTE;

38 2 DCL L1 DWORD;

39 2 DCL L2 WORD;

40 2 SUBSTART:

L1 = K1(0);

41 2 dataword(44) = DATUM;

42 2 DATUM = 1234H;

43 2 SAME = 67H;

44 2 L2 = dataword(44);

45 2 END SUBROUTINE;

/*****************************************************************************/

46 1 Shift:

PROCEDURE REENTRANT;

/* The subroutine presented here is activated cyclically by the 'FUNCTION'

subroutine. In 'FUNCTION', dataword(1) is incremented on every pass. The

following subroutine now shifts dataword(0) 1 bit to the left on every 128

cycles. This example provides a simple method of detecting whether a

statement has been executed one or more times or not at all.

Red on blue: statement executed 0 times PG 685: normal

White on blue: statement executed 1 time PG 685: inverse

White on cyan; statement executed several times PG 685: inverse

/*

8–4 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

47 2 IF (dataword(1) AND 007FH) = 0 THEN

48 2 dataword(0) = ROL(dataword(0),1);

49 2 END Shift;

/*****************************************************************************/

50 1 function:

PROCEDURE PUBLIC REENTRANT;

/**************************/

/* Declaration of */

/* Local Data */

/**************************/

51 2 DCL SAME WORD;

52 2 DCL L1 BYTE;

53 2 DCL L2 WORD;

54 2 DCL L3 POINTER;

55 2 DCL L4 DWORD;

56 2 DCL L5 INTEGER;

57 2 DCL L6 SELECTOR;

58 2 DCL L7 STRUCTURE (Array1 INTEGER, Array2 BYTE);

59 2 DCL L8(2) STRUCTURE

(A BYTE,

B(3) WORD,

C(2) STRUCTURE

(C1 INTEGER,

C2(3) BYTE,

C3 POINTER,

C4 STRUCTURE

(C41 WORD,

C42(2) INTEGER,

C43(3) POINTER),

C5 INTEGER,

C6(3) WORD),

D(4) INTEGER,

E SELECTOR);

/**************************/

/* Statement Part */

/* Main Procedure */

/**************************/

60 2 START:

CALL HLL_ADB('DB',200); /* Open data block DB 200 */

61 2 dataword(1) = dataword(1) + 1; /* Increment counter */

62 2 CALL Shift; /* Cyclic call */

63 2 IF ((M_Byte(0) AND 10000000B) = 80H) THEN

64 2 DO;

65 3 L1 = K1(4); /* BYTE */

66 3 dataword(44) = 7734H; /* ARRAY OF WORD */

67 3 CALL SUBROUTINE (L2);

68 3 END;

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–5SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

69 2 dataword(2) = Sp_Verw.PHENDP;

70 2 dataword(3) = DB_Laenge;

71 2 dataword(4) = Bin_DigA;

72 2 dataword(5) = Akt_OB_Nr;

73 2 dataword(44) = 5676H;

74 2 DW(2).DL = K1(1);

75 2 DW(2).DR = K1(2);

76 2 SAME = 6789H; /* WORD */

77 2 L1 = K1(5); /* BYTE */

78 2 L2 = 12345; /* WORD */

79 2 L3 = 5678H; /* POINTER */

80 2 L4 = 12345678H; /* DWORD */

81 2 L5 = -1000; /* INTEGER */

82 2 L6 = 8FFFH; /* SELECTOR */

83 2 L8(0).A = 88H; /* STRUCTURE: BYTE */

84 2 L8(0).B(2) = 5675; /* STRUCTURE: WORD */

85 2 L8(0).C(0).C1 = -6786; /* STRUCTURE: INTEGER */

86 2 L8(0).C(0).C2(1) = 67H; /* STRUCTURE: BYTE */

87 2 L8(0).C(0).C4.C41 = 5675; /* STRUCTURE: WORD */

88 2 L8(0).C(0).C4.C42(1) = -4565; /* STRUCTURE: INTEGER */

89 2 L8(0).D(2) = -567; /* STRUCTURE: INTEGER */

90 2 L8(1).A = 56H; /* STRUCTURE: BYTE */

91 2 L8(1).B(0) = 6785; /* STRUCTURE: WORD */

92 2 L8(1).C(1).C1 = -2343; /* STRUCTURE: INTEGER */

93 2 L8(1).C(1).C2(0) = 73H; /* STRUCTURE: BYTE */

94 2 L8(1).C(1).C4.C41 = 9758; /* STRUCTURE: WORD */

95 2 L8(1).C(1).C4.C42(1) = -2355; /* STRUCTURE: INTEGER */

96 2 L8(1).D(3) = -974; /* STRUCTURE: INTEGER */

97 2 L8(1).E = 4948H; /* STRUCTURE: SELECTOR */

98 2 END function;

99 1 END PFX123;

MODULE INFORMATION:

CODE AREA SIZE = 0163H 355D

CONSTANT AREA SIZE = 001DH 29D

VARIABLE AREA SIZE = 0200H 512D

MAXIMUM STACK SIZE = 00D2H 210D

246 LINES READ

0 PROGRAM WARNINGS

0 PROGRAM ERRORS

DICTIONARY SUMMARY:

182KB MEMORY AVAILABLE

8KB MEMORY USED (4%)

0KB DISK SPACE USED

END OF PL/M-86 COMPILATION

8–6 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

DOS 5.0 (045-N) iC-86 COMPILER V4.1, COMPILATION OF MODULE CFB255

OBJECT MODULE PLACED IN CFB255.obj

COMPILER INVOKED BY: C:\PLM\IC86.EXE CFB255.C debug mod186 compact rom type co ex fp

pr(CFB255.lst) oj(CFB255.obj) optim

-ize(0)

line level incl

1

2 /* SIEMENS Block Generator S5-C */

3 /* Date: 29.04.91 Time: 10:20:47 */

4

5

6

7 /* Type : FB */

8 /* Number : 255 */

9

10 /* Name : VIVALDI */

11 /* Lib.number : */

12

13 /* PLC system : 2 (PLC 135WB with ACOP) */

14

15

16

17

18

19 /**************************/

20 /* Typedef and Constants */

21 /**************************/

22

23

24

25 typedef unsigned char byte;

26 typedef unsigned char mask;

27 typedef unsigned char bit;

28 typedef unsigned int word;

29 typedef int sword;

30 typedef unsigned long int dword;

31

32

33

34 /**************************/

35 /* System Functions */

36 /* and */

37 /* System Data */

38 /**************************/

39

40

41 /* S5HLL System Data START */

42

43 /* Call other HLL blocks */

44

45 extern far void (* far HLL_HLL) ();

46

47

48

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–7SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

49

50

51 /* Call resident function macros */

52

53 extern far void (* far HLL_MACRO) ();

54

55

56

57 /* Call STEP 5 blocks */

58

59 extern far void (* far HLL_S5) ();

60

61

62

63 /* Process data blocks */

64

65 extern far void HLL_ADB (unsigned int, unsigned int);

66

67 #define DB_Laenge XDBLAEN

68 extern unsigned int far * far DB_Laenge;

69

70

71

72 /* Block address list */

73

74 extern unsigned int * far DB_LST[256];

75 extern unsigned int * far SB_LST[256];

76 extern unsigned int * far PB_LST[256];

77 extern unsigned int * far FB_LST[256];

78 extern unsigned int * far OB_LST[256];

79 extern unsigned int * far DX_LST[256];

80 extern unsigned int * far FX_LST[256];

81

82

83

84 /* Boundary addresses for user memory */

85

86 #define Sp_Verw XDSPVER

87 extern struct

88 {

89 unsigned int PHANFGP;

90 unsigned int PHENDP;

91 unsigned int PHANFGD;

92 unsigned int PHENDD;

93 unsigned int GREBESP;

94 unsigned int GREBEOP;

95 unsigned int GREBESD;

96 unsigned int GREBEOD;

97 } * far Sp_Verw;

98

99

8–8 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

100

101 /* Interpreter data */

102

103 #define Bin_DigA XBINERG

104 extern unsigned int far * far Bin_DigA;

105 #define Akt_OB_Nr XAKOBNR

106 extern unsigned char far * far Akt_OB_Nr;

107

108

109

110 /* Process image [I / Q/ F/ T/ C] */

111

112 extern unsigned char far E_Byte [128];

113 extern unsigned char far A_Byte [128];

114 extern unsigned char far M_Byte [256];

115 extern unsigned int far Zeit [256];

116 extern unsigned int far Zaehler [256];

117

118

119

120 /* I / O address list [I/Q] */

121

122 extern unsigned char far * far PeE [256];

123 extern unsigned char far * far PeA [256];

124

125

126

127 /* System stop from HLL user program */

128

129 extern far void (* far HLL_STOP) (unsigned int);

130

131

132

133 /* Extended flag area */

134

135 extern unsigned char far S_Merker[4096];

136

137

138

139 /* Extended I / O address list [I / Q] */

140

141 extern unsigned char far * far QeE [256];

142 extern unsigned char far * far QeA [256];

143

144

145

146 /* Semaphores (LIM, SIM) */

147

148 extern far void (* far HLL_LIM) (unsigned char *);

149 extern far void (* far HLL_SIM) (unsigned char *);

150

151

152

153

154 /* S5HLL System Data END */

155

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–9SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

156

157

158 unsigned int dataword[256];

159

160 const unsigned char k1[9] = { 5,9,3,2,8,4,1,7,6 };

161

162

163

164

165

166

167

168 SUBROUTINE (unsigned int datum)

169

170 /* This example can be used to practise the creation of the search

template. All of the following local data are also declared in the

'FUNCTION' subroutine, using a different type which permits easy

identification of the correct access.

175 */

176

177 {

178 1 char same;

179 1 long unsigned l1;

180 1 unsigned int l2;

181 1

182 1 SUBSTART:

183 1

184 1 l1 = k1[0];

185 1 dataword[44] = datum;

186 1 datum = 0x1234;

187 1 same = 0x67;

188 1 l2 = dataword[44];

189 1 }

190

191 extern near unsigned int ROL_(unsigned int);

192

193

194 void Shift ()

195

196 /* The subroutine presented here is activated cyclically by the

'FUNCTION' subroutine. In 'FUNCTION', dataword(1) is incremented on

every pass. The following subroutine now shifts dataword(0) 1 bit

to the left on every 128 cycles. This example provides a simple

method of detecting whether a statement has been executed one or

more times or not at all.

203

204 Red on blue: statement executed 0 times PG 685: normal

205 White on blue: statement executed 1 time PG 685: inverse

206 White on cyan; statement executed several times PG 685: inverse

207 */

8–10 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

208

209

210 {

211 1

212 1 if ((dataword[1] & 0x007F) == 0)

213 1 dataword[0] = ROL_(dataword[0]);

214 1

215 1 }

216

217

218

219

220

221

222 FUNCTION ( )

223 {

224 1 /**************************/

225 1 /* Declaration of */

226 1 /* Local Data */

227 1 /**************************/

228 1

229 1 unsigned int same;

230 1 char raus;

231 1 char l1;

232 1 unsigned int l2;

233 1 void *l3;

234 1 long unsigned int l4;

235 1 int l5;

236 1

237 1 struct l7_ { int array1; char array2; } l7;

238 1

239 1 struct l8_

240 1 {

241 1 int a;

242 1 char b;

243 1

244 1 struct c_

245 1 {

246 1 int c1;

247 1 char c2;

248 1 } c;

249 1

250 1 char d;

251 1 long int e;

252 1 } l8;

253 1

254 1 struct l9_ { int array1; char array2; } *l9;

255 1

256 1

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–11SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

257 1 /**************************/

258 1 /* Statement Part */

259 1 /* Main Procedure */

260 1 /**************************/

261 1

262 1 START:

263 1 HLL_ADB('DB',200); /* Open data block DB 200 */

264 1

265 1 dataword[1] = dataword[1] + 1; /* Increment counter */

266 1

267 1 Shift (); /* Cyclic call */

268 1

269 1 if ((M_Byte[0] & 0x80) == 0x80)

270 1 {

271 2 l1 = k1[4];

272 2 dataword[44] = 0x7734;

273 2 SUBROUTINE (l2);

274 2 }

275 1

276 1 dataword[2] = (*Sp_Verw).PHENDP;

277 1 dataword[3] = *DB_Laenge;

278 1 dataword[4] = *Bin_DigA;

279 1 dataword[5] = *Akt_OB_Nr;

280 1 dataword[4] = 0x5676;

281 1 same = 0x6789;

282 1 l1 = k1[5];

283 1 dataword[44] = 0x5676;

284 1 l2 = 12345;

285 1 l3 = &dataword;

286 1 l4 = 0x12345678;

287 1 l5 = -1000;

288 1 l8.a = 0x1234;

289 1 l8.b = 0x12;

290 1 l8.c.c2 = 0xAB;

291 1 l8.e = 0x12345678;

292 1 (*l9).array2 = 0xCD;

293 1

294 1 }

8–12 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

; STATEMENT # 177

SUBROUTINE PROC NEAR

001E C8080000 ENTER 8H,0H

@1:

; STATEMENT # 182

SUBSTART:

; STATEMENT # 184

0022 2E8A061400 MOV AL,CS:k1

0027 B400 MOV AH,0H

0029 99 CWD

002A 8946FC MOV [BP].l1,AX

002D 8956FE MOV [BP].l1+2H,DX

; STATEMENT # 185

0030 8B4604 MOV AX,[BP].datum

0033 89065800 MOV dataword+58H,AX

; STATEMENT # 186

0037 C746043412 MOV [BP].datum,1234H

; STATEMENT # 187

003C C646F967 MOV [BP].same,67H

; STATEMENT # 188

0040 8B065800 MOV AX,dataword+58H

0044 8946FA MOV [BP].l2,AX

; STATEMENT # 189

0047 C9 LEAVE

0048 C20200 RET 2H

SUBROUTINE ENDP

; STATEMENT # 210

Shift PROC NEAR

004C 55 PUSH BP

004D 8BEC MOV BP,SP

@2:

; STATEMENT # 212

004F F70602007F00 TEST dataword+2H,7FH

0055 7403 JZ $+5H

0057 E90B00 JMP @3

; STATEMENT # 213

005A FF360000 PUSH dataword; 1

005E E80000 CALL ROL_

0061 89060000 MOV dataword,AX

; STATEMENT # 215

@3:

0065 5D POP BP

0066 C3 RET

Shift ENDP

; STATEMENT # 223

FUNCTION PROC NEAR

0068 C8260000 ENTER 26H,0H

@4:

; STATEMENT # 262

START:

; STATEMENT # 263

006C 684244 PUSH 4442H

006F 68C800 PUSH 0C8H

0072 9A00000000 CALL HLL_ADB

; STATEMENT # 265

0077 8B060200 MOV AX,dataword+2H

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–13SINUMERIK 840/880 Part 3 (PJ)

8 Example Programs 11.91

007B 40 INC AX

007C 89060200 MOV dataword+2H,AX

; STATEMENT # 267

0080 E8C9FF CALL Shift

; STATEMENT # 269

0083 2EC41E1000 LES BX,CS:@M_Byte

0088 268A07 MOV AL,ES:M_Byte[BX]

008B 80E080 AND AL,80H

008E 80F880 CMP AL,80H

0091 7403 JZ $+5H

0093 E91400 JMP @5

; STATEMENT # 271

0096 2E8A061800 MOV AL,CS:k1+4H

009B 8846DA MOV [BP].l1,AL

; STATEMENT # 272

009E C70658003477 MOV dataword+58H,7734H

; STATEMENT # 273

00A4 FF76FC PUSH [BP].l2 ; 1

00A7 E874FF CALL SUBROUTINE

; STATEMENT # 276

@5:

00AA 2EC41E0400 LES BX,CS:@XDSPVER

00AF 26C41F LES BX,ES:XDSPVER[BX]

00B2 268B4702 MOV AX,ES:[BX+2H]

00B6 89060400 MOV dataword+4H,AX

; STATEMENT # 277

00BA 2EC41E0000 LES BX,CS:@XDBLAEN

00BF 26C41F LES BX,ES:XDBLAEN[BX]

00C2 268B07 MOV AX,ES:[BX]

00C5 89060600 MOV dataword+6H,AX

; STATEMENT # 278

00C9 2EC41E0800 LES BX,CS:@XBINERG

00CE 26C41F LES BX,ES:XBINERG[BX]

00D1 268B07 MOV AX,ES:[BX]

00D4 89060800 MOV dataword+8H,AX

; STATEMENT # 279

00D8 2EC41E0C00 LES BX,CS:@XAKOBNR

00DD 26C41F LES BX,ES:XAKOBNR[BX]

00E0 268A07 MOV AL,ES:[BX]

00E3 B400 MOV AH,0H

00E5 89060A00 MOV dataword+0AH,AX

; STATEMENT # 280

00E9 C70608007656 MOV dataword+8H,5676H

; STATEMENT # 281

00EF C746FE8967 MOV [BP].same,6789H

; STATEMENT # 282

00F4 2E8A061900 MOV AL,CS:k1+5H

00F9 8846DA MOV [BP].l1,AL

; STATEMENT # 283

00FC C70658007656 MOV dataword+58H,5676H

; STATEMENT # 284

0102 C746FC3930 MOV [BP].l2,3039H

; STATEMENT # 285

0107 B80000 MOV AX,OFFSET(dataword)

010A 8946F8 MOV [BP].l3,AX

010D 8C5EFA MOV [BP].l3+2H,DS

8–14 © Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0

SINUMERIK 840/880 Part 3 (PJ)

11.91 8 Example Programs

; STATEMENT # 286

0110 C746F47856 MOV [BP].l4,5678H

0115 C746F63412 MOV [BP].l4+2H,1234H

; STATEMENT # 287

011A C746F218FC MOV [BP].l5,0FC18H

; STATEMENT # 288

011F C746E03412 MOV [BP].l8,1234H

; STATEMENT # 289

0124 C646E212 MOV [BP].l8+2H,12H

; STATEMENT # 290

0128 C646E6AB MOV [BP].l8+6H,0ABH

; STATEMENT # 291

012C C746EA7856 MOV [BP].l8+0AH,5678H

0131 C746EC3412 MOV [BP].l8+0CH,1234H

; STATEMENT # 292

0136 C45EDC LES BX,[BP].l9

0139 26C64702CD MOV ES:l9_[BX+2H],0CDH

; STATEMENT # 294

013E C9 LEAVE

013F C3 RET

FUNCTION ENDP

MODULE INFORMATION:

CODE AREA SIZE = 0123H 291D

CONSTANT AREA SIZE = 001DH 29D

DATA AREA SIZE = 0200H 512D

MAXIMUM STACK SIZE = 0036H 54D

iC-86 COMPILATION COMPLETE. 0 WARNINGS, 0 ERRORS

© Siemens AG 1990 All Rights Reserved 6FC5197-0AC00-0BP0 8–15SINUMERIK 840/880 Part 3 (PJ)

11.92 Terms and Abbreviations

Terms and Abbreviations

ACOP Coprocessor for bit processing in STEP 5 with extended functionalitycompared with preceding model COP

Assembling Translation of an assembler source program into machine code

Batch file Batch processing file under MS-DOS

Block type The STEP 5 control language is block-oriented. Blocks of the same typeare differentiated by a number (e.g. FB 11). The following types of blockexist:OB Organization block (master program block)PB Program block (no parameters)FB Function block of the FB class (parameters allowed)FX Function block of the FX class (parameter allowed)SB Step blockDB Data block of class DBDX Data block of class DX

C High-level programming language

Call parameter Input or output parameter of the HLL block which must be specified whenthe block is called

Compiler Software tool for compiling (see also compiling)

Compiling Translation of a source program text from the high-level programminglanguage to machine language

COP Coprocessor for bit processing in STEP 5 (see also ACOP)

Cycle A PLC cycle corresponds to one pass of the execution level of OB 1 (seealso "Configuring the PLC 135 WB")

Data block Block of data and/or signals. The data blocks are numbered. There are twoequal-priority classes of data block: DB and DX (see also "Configuring thePLC 135 WB ")

Data format Memory model used to store data; the STEP 5 data format and the inteldata format are different

Data type Type of data array, e.g. bit, byte, word, doubleword

DB Abbreviation for data block

Directory DOS directory

Environment Set of ASCII strings presented by the MS-DOS operating system; theenvironment is used to transfer paths and global system variables toprograms (see the MS-DOS Technical Reference Manual)

Terms and Abbreviations 11.92

Function block A program block of the PLC program which accepts parameters. Inaddition to FBs which the user can create himself, preprogrammed FBsare also supplied which are either integrated as function macros in thePLC operating system or which can be loaded from FB packages. All HLLblocks are function blocks.

Function macro Function block which is integrated in the PLC operating system; separatedocumentation is supplied for the function macros.

HLL Abbreviation for high-level language

HLL block Function block of the class FB or FX which is written in a high-levelprogramming language (PL/M or C)

HLL symbols Identifiers used by the S5-HLL block generator

High-level lan- Test aid for programs written in a high-level programming languageguage debugger (PL/M or C)

Link file A file containing program code processed by the linker

List file A file containing a compiler, linker, locator, cross-reference or error list.The list files are identified by their file name extension:Compiler list: *.LSTLinker list: *.MP1Locator list: *.MP2Cross-reference list: *.CRFError list: *.ERR

LSB Abbreviation for least significant bit

Mask byte Byte with initial binary value for masking irrelevant bits in a correspondingdata byte

Menu Screen display

Module header Comment section at the start of the source file of an HLL block; it iscreated by the S5-HLL block generator and contains information about theblock and its call parameters.

Module body Frame for the program source text of an HLL block; it is created by theS5-HLL block generator and contains the module header, the declarationof the required system data/functions and the declaration of the blockfunction (FUNCTION) and its call parameters

MSB Abbreviation for most significant bit

Numeric format A method of interpreting the value in a memory cell, e.g. hexadecimal,decimal, binary, BCD or ASCII

Off-line test Testing of an HLL block on an AT-compatible computer; the HLL datagenerator simulates the PLC environment during the test

On-line test Testing of an HLL block on the PLC with the aid of the HLL on-linedebugger and a programming device

11.92 Terms and Abbreviations

I/Os In this case, machine signals which are captured with I/O modules. TheI/Os can be addressed from HLL blocks via the process images or I/Oaddress lists

Path DOS path to directories on the diskette or hard disk of the computer

PLC Abbreviation for programmable logic controller

PLC system One of the versions of the PLC 135 WB (with COP or with ACOP)

PLC system data Data of the PLC which can be accessed from high-level language blocks

PL/M High-level programming language for computers equipped with processorsof the intel 80x86 range or compatible processors

Process image Image of the machine signals in the bit-addressable I/O area of the PLC

S5 Abbreviation for SIMATIC 5; generic term for programmable logiccontroller, STEP 5 and development environment; context-dependent

Status bits Indicators in bit format which show the result of STEP 5 operations; thestatus bits are set by the STEP 5 interpreter. Caution: please note thedifferences on PLC systems with COP and ACOP

STEP 5 Programming language for programmable logic controllers

System data See PLC system data

System functions Service programs which the PLC makes available to the HLL blocks, e.g.for opening a data block in the HLL block

11.92 Key Names

Key Names

The key symbols and abbreviations for key names used in this documentation are listed below,together with their meaning:

Single keys:

Move cursor to right Move cursor to left Move cursor up Move cursor downPgDn Page downPgUp Page upEnd Jump to end of screen (End key)Home Jump to start of screen (Home key)Ret Return keyDel Delete character under cursor (Delete key)BS Delete character to left of cursor (Backspace key)Ins Insert modeShift Shift keyCtrl Control keyEsc Cancel a function (Escape key)Tab Tabulator keyF1...F12 Function keys F1 to F12

Key combinations:

If several single keys have to be pressed simultaneously, the key names are connected by ahyphen, e.g.:

Ctrl-End Press Control and End keys simultaneously

Keyboard Layout on PG 685

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Shift

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a

a a a a

a a a a

a a a a

a a a a

PgUp

a a a a

a a a a

a a a a

a a a a

a a a a

PgDn

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Ins

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Ctrl

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

BS

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

Shift

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a

a a a a a a a a

a a a a a a a a

Ret

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Del

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a a a a a a a a a a a

a a a a a a

a a a a a a

a a a a a a

F1 a a a a a a

a a a a a a

a a a a a a

F2 a a a a a a a

a a a a a a a

a a a a a a a

F3 a a a a a a

a a a a a a

a a a a a a

F4 a a a a a a a

a a a a a a a

a a a a a a a

F5 a a a a a a a

a a a a a a a

a a a a a a a

F6 a a a a a a

a a a a a a

a a a a a a

F7 a a a a a a a

a a a a a a a

a a a a a a a

F8

Key Names 11.92

Keyboard Layout on PG 730/750

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F12

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F11

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F10

a a a a a a

a a a a a a

a a a a a a

a a a a a a

F9

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F8

a a a a a a

a a a a a a

a a a a a a

a a a a a a

F7

a a a a a a

a a a a a a

a a a a a a

a a a a a a

F6

a a a a a a

a a a a a a

a a a a a a

a a a a a a

F5

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F4

a a a a a a

a a a a a a

a a a a a a

a a a a a a

F3a a a a a a

a a a a a a

a a a a a a

a a a a a a

F2

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

F1a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a

a a a a a

a a a a a

Esc

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a aa a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a aa a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Shift

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

a a a a a a a a a a

Shift

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a aa aa aa aa a

a a a

a a a

a a a

a a a

a a a

a a a a a

a a a a a

a a a a a

End

a a a a a

a a a a a

a a a a a

a a a a a

Ctrl

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Ins

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

a a a a a a a a a a a

Tab

a a a a

a a a a

a a a a

a a a a

a a a a

a a a a

PgUp

a a a a

a a a a

a a a a

a a a a

a a a a

PgDn

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

a a a a a a a a a a a a

BS

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a a

Hom

a a a a a a a

a a a a a a a

a a a a a a a

Del

a a a a a a a

a a a a a a a

a a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

a a a a a a

Ret