Sunteți pe pagina 1din 57

ProgHBUserTechfKRS5.1 04.02.

00 en
1 of 55
SOFTWARE
KR C...
UserTech
Programming Handbook
SystemTech (KRS) V5.1
2 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
e Copyright KUKA Roboter GmbH
This documentation or excerpts therefrom may not be reproduced or disclosed to third parties without the express permission of the publishers.
Other functions not described in this documentation may be operable in the controller. The user has no claim to these functions, however, in
the case of a replacement or service work.
We have checked the content of this documentation for conformity with the hardware and software described. Nevertheless, discrepancies
cannot be precluded, for which reason we are not able to guarantee total conformity. The information in this documentation is checked on a
regular basis, however, and necessary corrections will be incorporated in subsequent editions.
Subject to technical alterations without an effect on the function.
PD Interleaf
3 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
Contents
1 Installation / uninstallation / update 7 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2 UserTech 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 Introduction 8 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 User technologies 9 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 Reference section 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 Overview of language elements 10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 Reinitializing UserTech and BOF 11 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 Defining technologies 12 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3.1 Areas of validity of the objects and variables in a technology 13 . . . . . . . . . . . . . . . . . . . . . . . . .
3.4 Inline forms 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.1 FOCUS 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.2 FOLD 13 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.3 PARAM 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4 STYLE 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.1 WYSIWYG 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.2 SUB 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.3 DSUB 14 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.4 FCT 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.5 DFCT 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.6 ASS 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.4.7 ASSAGG 15 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.5 ONACCEPT 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.6 ONTOUCHUP 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.4.7 ONOPEN 16 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5 Input, display and list boxes 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.1 SHORTNAME 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.2 SHORTCUT 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.3 UNIT 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.4 ENABLE 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.5 USERMODE 17 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6 VALUE FieldDescription 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.1 The type {static: } 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.2 The type {free: } 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.3 The type {name: } 18 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.4 The type {number: } 19 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.5 The type {real: } 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.5.6.6 The type {list:} 20 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.6 FOLDS 23 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7 Status keys 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1 Creating new status keys 24 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.1 TOPTEXT 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.2 CENTERTEXT 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.3 BOTTOMTEXT 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.4 PICTURE 25 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UserTech
4 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7.1.5 KEYDOWN_PICTURE 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.6 KEYDOWNMINUS_PICTURE 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.7 ENABLE 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.8 NEED_SAFETYSWITCH 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.9 NEED_DRIVESOK 26 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.10 NEED_MODEOP 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.11 NEED_PROSTATE0 27 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.12 NEED_PROSTATE 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.13 USERMODE 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.14 STYLE 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.15 ONKEYDOWN 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.16 ONKEYUP 28 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.17 ONKEYSHOW 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.18 ONKEYDOWNMINUS 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.19 ONKEYUPMINUS 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.20 ONKEYREPEAT 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.21 ONKEYREPEATMINUS 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.1.22 NEXT 29 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.2 Reassigning status keys that have already been declared 29 . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.3 Creating a status key bar 30 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.7.4 Reassigning status key bars that have already been declared 30 . . . . . . . . . . . . . . . . . . . . . . . .
3.8 Scripts 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.1 SETVAR 31 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.2 SHOWVAR 32 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.3 REDECL 33 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.4 DO 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.5 SET 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.6 MESSAGE 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.7 SWITCH...CASE(ELSE)...ENDSWITCH 34 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.8 SWITCH DIALOG...CASE...ENDSWITCH 35 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.9 Predefined scripts 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.9.1 ACCEPTINLINEFORM 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.9.2 CANCELINLINEFORM 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.9.3 END 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.8.9.4 NOTHING 36 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 Integrating technologies in the graphical user interface (GUI) 37 . . . . . . .
4.1 Creating a submenu in the menu bar 37 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 Examples of integration of a technology in a menu 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.1 Simple submenu 38 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.2 Submenu with popup menu 40 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2.3 Example of integration of a technology via a status key 41 . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 File storage in a structured directory 42 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5 Programming examples 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1 Programming status keys 43 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 Programming inline forms 47 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 Starting scripts by means of events 49 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3.1 Case 1: Execute script when an inline form is opened or closed 49 . . . . . . . . . . . . . . . . . . . . . .
5.3.2 Case 2: Execute script when an inline form is created or modified 50 . . . . . . . . . . . . . . . . . . . .
5.3.3 Case 3: Execute script on toggling between inline forms within a technology 51 . . . . . . . . . . .
5 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
6 Appendix 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 Typographical conventions 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 Parameters and parameter reference placeholders 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1 Predefined parameter reference placeholders in KRL 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1.1 %TP 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1.2 %INLINEFORM 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2.1.3 %MODULE 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 Data types 53 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4 Names 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5 String 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6 Special characters 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.1 ; 54 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.2 _ 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.3 / 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6.4 % 55 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
UserTech
6 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
7 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
1 Installation / uninstallation / update
From system software version 5.1 onwards, technology packages are offered exclusively as
addon software modules. These are available on CDROM. Should you be interested in
purchasing further modules, please contact KUKA Support.
The installation procedure is the same for all technology packages and is described in a
separate documentation module.
The installation, uninstallation, reinstallation and update of technology packages
are described in detail in the documentation Installation/Uninstallation/Update of
Tech Packages.
UserTech
8 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
2 UserTech
2.1 Introduction
KUKA technology packages contain the most important functions for normal robot
applications. Special functions are programmed directly by the user in KRL, KUKA Robot
Language.
In order to offer the advantages of a graphically oriented user interface here also, the
USERTech package has been integrated. Using language elements from the KUKA Form
Description Language, or KFDL for short, it is easy to add graphic elements to your
customized technology packages.
USERTech
Menu
entry
Status
key bar
Event
Scripts
Kernel system
Status
key
Event
Inline
form
KRL program
section
Softkey Message
window
T
e
c
h
n
o
l
o
g
y
Menu entries are used to call status key bars or inline forms. Data entered in the inline form
input boxes are later used in the generated KRL program section. You can use the status
keys to select options which define the further execution of the program. The execution of
program sections created by the user, which can exchange data with the kernel system, is
dependent on subsequent operator actions, i.e. it is eventcontrolled.
9 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
2.2 User technologies
User technologies are defined in files with the extension KFD. Any text editor can be used
to create them. The name of the file can be freely selected within the confines of the operating
system conventions and does not, itself, appear in the technology package.
KFD files are saved by default in the directory C:\KRC\ROBOTER\TEMPLATE. Further
options are available for advanced users; these are described in the chapter Integrating
technologies in the graphical user interface (GUI).
Each KFD file can contain one or more technologies. The name of a technology may only,
however, appear once.
T
1
T
2
T
3 T
4
T
6
T
5
f
i
l
e
_
1
.
k
f
d
f
i
l
e
_
2
.
k
f
d
UserTech
10 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3 Reference section
3.1 Overview of language elements
Relating to the technology:
DEFTP
...
ENDTP
Designates the beginning and end of a technology
Relating to inline forms:
DECL INLINEFORM Defines an inline form
DECL PARAM Defines the input boxes in an inline form
DECL FOLD Defines a KRL Fold
Relating to status keys:
DECL STATKEYBAR Declaration of a status key bar
DECL STATKEY Declaration of a status key
SET The new assignment of an existing status key bar or status key
Relating to scripts:
DEFSCRIPT
...
ENDSCRIPT
Designates the beginning and end of a script
CASE,
CASE ELSE
Designates a branch in the control structure SWITCH...ENDSWITCH
DO Command for executing a script
MESSAGE Generates text in the message window
REDECL Creates a KRL variable in the kernel system or overwrites it
SETVAR Writes a value in a KRL variable in the kernel system
SHOWVAR Reads the value of a KRL variable in the kernel system
SWITCH
...
ENDSWITCH
Designates the beginning and end of a control structure
SWITCH DIALOG
...
ENDSWITCH
Designates the beginning and end of a control structure which communi-
cates with the user via the message window and softkey bar.
11 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.2 Reinitializing UserTech and BOF
In order for changes to take effect in KFD files with the controller running, the function
USERTech reinitialize must be executed.
Modifications to INI files only take effect when BOF Reinitialization is executed.
These functions are available in the user group Expert or higher.
UserTech
12 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.3 Defining technologies
A *.KFD file is created for every user technology and saved in the directory
C:\KRC\ROBOTER\TEMPLATE. Any editor can be used to edit KFD files. The file must
be saved in ASCII format.
The definition of a user technology must be initiated within the KFD file using the statement:
DEFTP Name= {SOC Bool,SOT Bool}
and terminated using the statement:
ENDTP
If no additional parameters are entered, the basic settings in bold type are valid.
SOC
TRUE Command selection possible via list box
SOC
FALSE Command selection not possible via list box
SOT
TRUE Technology selection possible via list box
SOT
FALSE Technology selection not possible via list box
The statements:
DEFTP MyTech
ENDTP
DEFTP OtherTech
ENDTP
generate the following inline form:
It is possible to switch between the technologies using the +/ status key (at the bottom right
of the display):
The statements:
DEFTP MyTech={SOT FALSE}
ENDTP
DEFTP OtherTech
ENDTP
generate this inline form:
It is not possible to switch between the technologies in this example. They must be integrated
individually by means of menu entries in the file MenueKeyUser.INI in the directory
C:\KRC\ROBOTER\INIT. (See also Chapter 4)
13 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.3.1 Areas of validity of the objects and variables in a technology
Objects and variables inserted between DEFTP and ENDTP are valid locally, i.e. only within
the technology. If objects and variables need to be valid globally, i.e. in every technology
contained in the KFD file, they must be inserted outside the statements (DEFTP, ENDTP).
Globally defined inline forms appear as separate entries in the list box.
3.4 Inline forms
The inline form (ILF) is a screen form for entering parameters that are required by USERTech
for generating KRL program code.
Syntax
DECL INLINEFORM Name =
{FOCUS Int,
FOLD[1] Name,...,FOLD[n] Name,
PARAM[1] Name,...,PARAM[n] Name,
STYLE WYSIWYG|SUB|DSUB|FCT|DFCT|ASS|ASSAGG,
ONACCEPT Name,
ONTOUCHUP Name,
ONOPEN Name }
3.4.1 FOCUS
Number of the input box (see Section 3.5) that should be activated (when the inline
form first appears).
3.4.2 FOLD
Assigned KRL Fold(s). Folds must be defined before they can be used. For
information on the definition of Folds see Section 3.6.
If no Fold is assigned to the inline form, the form contents will be inserted into the KRL
program with the format defined by the setting in STYLE.
UserTech
14 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.4.3 PARAM
Input boxes in the inline form. Input boxes must be defined before they can be used.
For information on the definition of input boxes see Section 3.5.
3.4.4 STYLE
The options specified here influence the appearance of the inserted KRL program
section as follows:
3.4.4.1 WYSIWYG
The default setting. The KRL program line to be inserted is formatted in such a way
that it exactly matches the text in the inline form.
Resulting KRL program text:
3.4.4.2 SUB
Formatting is carried out in the form of a KRL subprogram call. The parameters are
reduced to the contents of the input boxes, separated by commas and contained
within brackets. The dot separating the name of the technology and the name of
the inline form is suppressed.
Resulting KRL program text:
3.4.4.3 DSUB
Formatting is carried out in the form of a KRL subprogram call. The parameters are
reduced to the contents of the input boxes, separated by commas and contained
within brackets. The dot separating the name of the technology and the name of
the inline form is suppressed.
Additionally, a parameter description is tagged on as a comment.
Resulting KRL program text:
15 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.4.4.4 FCT
Formatting is carried out in the form of a KRL function call. Irrespective of its format,
the value of the first box (PARAM[1]) is presented as a fixed text and used as the
name of the function. The other parameters are reduced to the contents of the input
boxes, separated by commas and contained within brackets. The dot separating
the name of the technology and the name of the inline form is suppressed. An
equals sign is inserted between the form name and the function name.
Resulting KRL program text:
3.4.4.5 DFCT
Formatting is carried out in the form of a KRL function call. Irrespective of its format,
the value of the first box (PARAM[1]) is presented as a fixed text and used as the
name of the function. The other parameters are reduced to the contents of the input
boxes, separated by commas and contained within brackets. The dot separating
the name of the technology and the name of the inline form is suppressed. An
equals sign is inserted between the form name and the function name.
Additionally, a parameter description is tagged on as a comment.
Resulting KRL program text:
3.4.4.6 ASS
Formatting is carried out in the form of an assignment. The parameters are reduced
to the contents of the input boxes and separated by commas. An equals sign is
inserted between the form name and the parameter list. The dot separating the
name of the technology and the name of the inline form is suppressed.
Resulting KRL program text:
3.4.4.7 ASSAGG
Formatting is carried out in the form of an aggregate assignment. The parameters
are reduced to the contents of the input boxes, preceded by the text entered under
SHORTNAME[], separated by commas and contained within braces. An equals
sign is inserted between the name of the inline form and the parameter block.
UserTech
16 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
Example
DEFTP SEARCH
DECL PARAM XDir={Shortname[] X=, Value {Number: },Unit[] mm}
DECL PARAM YDir={Shortname[] Y=, Value {Number: },Unit[] mm}
DECL PARAM ZDir={Shortname[] Z=, Value {Number: },Unit[] mm}
DECL InlineForm Direction={PARAM[1] XDir ,PARAM[2] YDir,PARAM[3] ZDir,STYLE _
ASSAGG}
ENDTP
The above inline form corresponds to command line 5:
3.4.5 ONACCEPT
An inline form event. The name of the script that is to be executed after pressing the
Enter key or the softkey Cmd Ok can be entered here.
3.4.6 ONTOUCHUP
An inline form event. The name of the script that is to be executed after pressing the
softkey TouchUp can be entered here.
3.4.7 ONOPEN
An inline form event. The name of the script that is to be executed after the inline form
is opened can be entered here.
17 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.5 Input, display and list boxes
Input, display and list boxes in inline forms are defined as follows:
Syntax
DECL PARAM Name={ SHORTNAME[] String,
SHORTCUT[] String,
UNIT[] String,
ENABLE Bool,
USERMODE Int,
VALUE FieldDescription }
3.5.1 SHORTNAME
Text entered here appears in front of the input box.
In the example: Distance=.
3.5.2 SHORTCUT
Text entered here appears on the +/ status key (at the bottom right of the display).
In the example: DIST.
If no text is entered here, the text entered under SHORTNAME appears on the status
key.
3.5.3 UNIT
Text entered here appears behind the input box.
In the example: mm.
3.5.4 ENABLE
This property activates or deactivates the box.
3.5.5 USERMODE
Not implemented.
UserTech
18 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.5.6 VALUE FieldDescription
Description of the input box to be displayed in terms of type and other characteristics.
The following options are available:
3.5.6.1 The type {static: }
Static text which cannot be edited by the user.
The correct syntax is:
{STATIC: DEFAULT[] String}
String contains the text that is displayed.
Example
decl param field_sta ={value _
{static: default[] This cant be changed}}
generates this output box in the inline form:
The text that is displayed cannot be altered.
3.5.6.2 The type {free: }
Input box for text that can be entered freely and edited using the ASCII keypad.
The correct syntax is:
{FREE: DEFAULT[] String }
By default, the input box contains the entry String.
Example
decl param field_fre ={shortname[] Programmer: , _
{free: default[] Alfred E. Neumann }}
generates this input box in the inline form:
The default text can be altered. Entering a text is optional.
3.5.6.3 The type {name: }
Text representing a valid KRL variable name. It can be edited using the ASCII keypad. If the
last character entered is a digit (0 to 9), this can be incremented and decremented using the
plus/minus key.
The correct syntax is:
{NAME: DEFAULT[] Name}
By default, the input box contains the entry Name.
19 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
Example
decl param field_nam ={
shortname[] Weldingpointnr.: , _
shortcut[] WPT, value _
{name: default[] WPT1}}
generates this input box in the inline form:
The preset KRL variable name can be altered.
The +/ status key here bears the label WPT specified in shortcut[].
Pressing this status key, the first digit from the right can be incremented or
decremented. This is useful when designating points.
3.5.6.4 The type {number: }
Integer value with optional upper and lower limits and increment. It can be edited using either
the numeric keypad or the plus/minus key.
The correct syntax is:
{NUMBER: MIN Int,MAX Int,STEP Int,DEFAULT Int,
AUTOLIMIT Bool }
MIN Minimum value
MAX Maximum value
STEP Amount by which the value is incremented and decremented using the
plus/minus key. The default value is 1.
DEFAULT Default entry in the input box. The default value is 0.
AUTOLIMIT This automatically sets an incorrectly entered value to the minimum or
maximum value. The default value is TRUE.
Example
decl param field_num ={
shortname[] Distance: , _
shortcut[] DIST, _
unit[] mm, _
value _
{number: min 0, max 100, step 2, default 50,}}
generates this numeric box in the inline form:
The +/ status key here bears the label NUM specified in shortcut[]. A value
between 0 and 100 can be entered in this numeric box (50 appears as the default
value). Pressing the +/ status key increases or decreases this value in increments
of 2.
UserTech
20 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.5.6.5 The type {real: }
Floating point value with optional upper and lower limits and increment. It can be edited using
either the numeric keypad or the plus/minus key.
The correct syntax is:
{REAL: MIN Real,MAX Real,STEP Real,DEFAULT Real,
AUTOLIMIT Bool }
MIN Minimum value
MAX Maximum value
STEP Amount by which the value is incremented and decremented using the
plus/minus key. The default value is 0.1.
DEFAULT Default entry in the input box. The default value is 0.
AUTOLIMIT This automatically sets an incorrectly entered value to the minimum or
maximum value. The default value is TRUE.
Example
decl param field_rea ={
shortname[] Delay: , _
shortcut[] DELAY, _
unit[] secs, _
value _
{real: min 0.5, max 5,step 0.5, default 2}}
generates this input box in the inline form:
The +/ status key here bears the label DELAY specified in shortcut[]. A value
between 0.5 and 5 can be entered in this box (5 appears as the default value). Pressing
the +/ status key increases or decreases this value in increments of 0.5.
3.5.6.6 The type {list:}
List of static texts which cannot be edited. List entries can be selected using the plus/minus
key.
The correct syntax is:
{LIST: DEFAULT[] String,
POS Int,
ITEM[1] ItemDescription,
ITEM[2] ItemDescription,
...,
ITEM[n] ItemDescription }
DEFAULT Specification of the string that is to appear by default in the list window.
The string must correspond to a defined ItemDescription string.
DEFAULT is an alternative to POS.
21 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
POS Number of the list entry that is to appear by default in the list window.
ITEM[n] Description of list entry n.
ItemDescription (list entry)
The complete syntax is:
{ITEM: VALUE[] String , DISP[] String }
You can use the parameter disp to distinguish between displayed text and text that
is actually processed in the program. This enables you to process a text other than
the one displayed. The actual value is entered after value[ ] while the displayed value
is entered after disp[ ]. By default: disp[ ] = value[ ].
Example 1:
decl param field_lis ={
shortname[] Weave pattern: , _
shortcut[] PATT,value _
{list: pos 1, _
item[1] _
{item: value[] Triangle}, _
item[2] _
{item: value[] Trapezoid}, _
item[3] _
{item: value[] Sinus}}}
generates this list box in the inline form:
The +/ status key here bears the label PATT specified in shortcut[].
This list box can be used to select one of the preset options (the first item in the
list, Triangle, appears as the default value). Pressing the +/ status key
switches between the preset items in the list box.
UserTech
22 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
Example 2:
Using the disp[ ] option: a distinction is made between the values displayed in the list
box and the actual processed values.
deftp MyTech={ SOC true}
decl param field_lis ={ shortname[] Weave pattern: , shortcut[] PATT, _
value {LIST: _
item[1] {item: value[] 3,disp[] Triangle}, _
item[2] {item: value[] Trapezoid}, _
item[3] {item: value[] Sinus}}}
decl fold MyFold[1]
MyFold[1]= Hugo=%field_lis
decl InlineForm MyCmd={ FOLD[1] MyFold , param[1] field_lis}
endtp
The following inline form is obtained:
The text Triangle appears in the resulting KRL command line while the value 3 is assigned
to the Fold of the global variable Hugo:
23 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.6 FOLDS
The KUKA user interface uses a special technique to display a KRL program clearly.
Instructions in the form of KRL comments make it possible to suppress parts of the program.
In this way the program is subdivided into meaningful sections, called FOLDS due to their
folderlike nature.
USERTech is able to generate such FOLDS, according to your specifications,
independently. To do this, the framework of the FOLD in which your data are to be entered
must be defined as follows:
Syntax
DECL FOLD NAME[n]
NAME[1]=String
...
NAME[n]=String
n Number of KRL lines
Each element of this array represents one line in the contents of the future FOLD. All
parameter reference placeholders (%Name) in the character sequence String are replaced
by the current values, or the values you have entered, in the inline form. The predefined
parameters application program name (%MODULE), technology name (%TP) and inline
form name (%INLINEFORM) can be used for the generation of KRL Folds.
Example
DECL FOLD MyFold[2]
MyFold[1]=Laser(#%INLINEFORM , %DataSet ,%Pattern )
MyFold[2]=TRIGGER WHEN DISTANCE=%DistanceWay DELAY=0 DO _
LASER_ON=TRUE
Result:
(if DataSet=DataSet6; DistanceWay=210; Pattern=STEP; Inlineform=ON)

Laser(#ON,DatSet6,STEP)
TRIGGER WHEN DISTANCE=210 DELAY=0 DO LASER_ON=TRUE
UserTech
24 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7 Status keys
UserTech allows the free assignment of four status keys on the KCP.
1
2
3
4
This is done in several steps:
G Labeling of the individual status key(s)
G Labeling of the entire status key bar
G Programming of the scripts which are combined with operator actions in the status
keys
3.7.1 Creating new status keys
DECL STATKEY Name= {TOPTEXT[] String,
CENTERTEXT[] String,
BOTTOMTEXT[] String,
PICTURE[] String,
KEYDOWN_PICTURE[] String,
KEYDOWNMINUS_PICTURE[] String,
ENABLE Bool,
(NEED_SAFETYSWITCH Bool,
NEED_DRIVESOK Bool,
NEED_PROSTATE0 Int,
NEED_PROSTATE Int,
NEED_MODEOP Int,
25 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
USERMODE Int,
STYLE #SWITCH|#TOGGLE,
ONKEYDOWN Name,
ONKEYUP Name,
ONKEYSHOW Name,
ONKEYDOWNMINUS Name,
ONKEYUPMINUS Name,
ONKEYREPEAT Name,
ONKEYREPEATMINUS Name,
NEXT Name }
3.7.1.1 TOPTEXT
Text entered here appears horizontally centered in the upper part of the status key.
3.7.1.2 CENTERTEXT
Text entered here appears horizontally centered in the middle part of the status key.
3.7.1.3 BOTTOMTEXT
Text entered here appears horizontally centered in the lower part of the status key.
3.7.1.4 PICTURE
Specification of the path for the bitmapped picture
1)
to be displayed on the status key.
A 34 48 pixel bit map is required for a single softkey, and a 34 128 pixel bit map
for a double softkey.
To create the pictures, you can use MS Paint which comes as part of the Windows 95
operating system.
1)
It is better to use icons ( *.ico ) in order to avoid undesired effects when fading out a status
key.
UserTech
26 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7.1.5 KEYDOWN_PICTURE
Specification of the path for the bitmapped picture
1)
to be displayed on the pressed
Plus status key.
A 34 48 pixel bit map is required for a single softkey, and a 34 128 pixel bit map
for a double softkey.
To create the pictures, you can use MS Paint which comes as part of the Windows 95
operating system.
If no bit map is entered for KEYDOWN_PICTURE, the bit map entered under
PICTURE is displayed.
1)
It is better to use icons ( *.ico ) in order to avoid undesired effects when fading out a status
key.
3.7.1.6 KEYDOWNMINUS_PICTURE
Specification of the path for the bitmapped picture
1)
to be displayed on the pressed
Minus status key.
A 34 48 pixel bit map is required for a single softkey, and a 34 128 pixel bit map
for a double softkey.
To create the pictures, you can use MS Paint which comes as part of the Windows 95
operating system.
If no bit map is entered for KEYDOWNMINUS_PICTURE, the bit map entered under
PICTURE is displayed.
1)
It is better to use icons ( *.ico ) in order to avoid undesired effects when fading out a status
key.
3.7.1.7 ENABLE
This property activates or deactivates the status key. This is also dependent on the
values of the parameters NEED_SAFETYSWITCH, NEED_MODEOP,
NEED_DRIVESOK, NEED_PROSTATE0 and NEED_PROSTATE.
3.7.1.8 NEED_SAFETYSWITCH
This parameter makes operator control of the status key dependent on the enabling
switch (on the rear of the KCP) being pressed.
The default setting is the value FALSE.
3.7.1.9 NEED_DRIVESOK
This parameter makes operator control of the status key dependent on the drives
being switched on.
The default setting is the value FALSE.
27 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7.1.10 NEED_MODEOP
This parameter makes operator control of the status key dependent on the selected
operating mode.
The integer value represents a bit sequence:
Operating mode
E
x
t
e
r
n
a
l
A
u
t
o
m
a
t
i
c
T
2

m
o
d
e
T
1

m
o
d
e
Bit number 3 2 1 0
Binary value (default) 0 I I I
Decimal value 7
For bit number n and corresponding binary value 1, the decimal value is 2
n
.
In the example:
The default value 7 means that the status key is available in operating modes
T1, T2 and Automatic.
The value 3 restricts availability of the status key to operating modes T1 and T2.
3.7.1.11 NEED_PROSTATE0
This parameter makes operator control of the status key dependent on the operating
state of the Submit interpreter.
The integer value represents a bit sequence:
Operating mode
A
C
T
I
V
E
E
N
D
R
E
S
E
T
S
T
O
P
F
R
E
E
U
N
K
N
O
W
N
Bit number 5 4 3 2 1 0
Binary value (default) I 0 0 0 0 0
Decimal value 32
For bit number n and corresponding binary value 1, the decimal value is 2
n
.
In the example:
The value 32 means that the status key is available only when the Submit
interpreter is running.
The default setting is the value 32.
UserTech
28 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7.1.12 NEED_PROSTATE
This parameter makes operator control of the status key dependent on the operating
state of the robot interpreter.
The integer value represents a bit sequence:
Operating
mode
A
C
T
I
V
E
E
N
D
R
E
S
E
T
S
T
O
P
F
R
E
E
U
N
K
N
O
W
N
Bit number 5 4 3 2 1 0
Binary value (default) 0 I I I I 0
Decimal value 30
For bit number n and corresponding binary value 1, the decimal value is 2
n
.
In the example:
The value 30 means that the status key is available only when the Start key is
released.
The default setting is the value 30.
3.7.1.13 USERMODE
Identification number of the lowest user level at which this status key can be used.
More detailed information about user levels can be found in the documentation
[Configuring the system].
The default value is 0. This means that the status key can be used at every user level.
3.7.1.14 STYLE
The options specified here influence the appearance of the status key.
#SWITCH
The default setting. The KCP key on the lefthand side is assigned to the status
key.
#TOGGLE
The status key is represented as a double key. The upper KCP key is considered
as the Plus key, and the lower KCP key as the Minus key.
3.7.1.15 ONKEYDOWN
A status key event. The name of the script that is to be executed after pressing the
Plus key can be entered here.
3.7.1.16 ONKEYUP
A status key event. The name of the script that is to be executed after releasing the
Plus key can be entered here.
29 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.7.1.17 ONKEYSHOW
A status key event. The name of the script that is to be executed after the appearance
of the status key can be entered here.
3.7.1.18 ONKEYDOWNMINUS
A status key event. The name of the script that is to be executed after pressing the
Minus key can be entered here.
3.7.1.19 ONKEYUPMINUS
A status key event. The name of the script that is to be executed after releasing the
Minus key can be entered here.
3.7.1.20 ONKEYREPEAT
A status key event. The name of the script that is to be executed after holding down
the Plus key can be entered here. This event is repeatedly triggered until the key is
released. The interval between repetitions becomes shorter and shorter.
3.7.1.21 ONKEYREPEATMINUS
A status key event. The name of the script that is to be executed after holding down
the Minus key can be entered here. This event is repeatedly triggered until the key
is released. The interval between repetitions becomes shorter and shorter.
3.7.1.22 NEXT
Name of the following status key or status key bar.
3.7.2 Reassigning status keys that have already been declared
SET Name = {TOPTEXT[] String,
CENTERTEXT[] String,
BOTTOMTEXT[] String,
PICTURE[] String,
KEYDOWN_PICTURE[] String,
KEYDOWNMINUS_PICTURE[] String,
ENABLE Bool,
NEED_SAFETYSWITCH Bool,
NEED_DRIVESOK Bool,
NEED_PROSTATE0 Int,
UserTech
30 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
NEED_PROSTATE Int,
NEED_MODEOP Int,
USERMODE Int,
STYLE #SWITCH|#TOGGLE,
ONKEYDOWN Name,
ONKEYUP Name,
ONKEYSHOW Name,
ONKEYDOWNMINUS Name,
ONKEYUPMINUS Name,
ONKEYREPEAT Name,
ONKEYREPEATMINUS Name,
NEXT Name }
This instruction can be used within or outside scripts. When used within scripts, placeholders
which received their value assignment before execution of the script (e.g. %INLINEFORM)
can also be used.
3.7.3 Creating a status key bar
DECL STATKEYBAR Name = {STATKEY[1] Name,
STATKEY[2] Name,
STATKEY[3] Name,
STATKEY[4] Name }
STATKEY [n]
Name of the status key to be displayed at position [n] of the status key bar.
3.7.4 Reassigning status key bars that have already been declared
SET Name = {STATKEY[1] Name,
STATKEY[2] Name,
STATKEY[3] Name,
STATKEY[4] Name }
31 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.8 Scripts
Scripts are programs with special functions for communicating with the kernel system.
The definition of a script must be initiated within the KFD file using the statement:
DEFSCRIPT Name
and terminated using the statement:
ENDSCRIPT
Scripts cannot be nested. Only the keywords listed below can be used.
3.8.1 SETVAR
Sets or writes a value to a KRL variable in the kernel system.
Syntax
SETVAR (FULLPATH[] String, VALUE[] String)
FULLPATH
Variable name of the variable to be written or set.
All parameter reference placeholders (e.g. %Placeholder) in the
character string are replaced by their current values. The resulting
character string is interpreted as a variable name with path specification.
VALUE
Value to be assigned to the variable.
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a target value.
If the specified variable or reference does not exist, or if the target value is incompatible
with the variable type, the script is cancelled and an error message is generated in the
message window.
Example
DEFTP MyTech
DEFSCRIPT Example
SETVAR( FULLPATH[] $OUT[20] , VALUE[] TRUE)
ENDSCRIPT
ENDTP
Once the script Example has been executed, the following applies:
$OUT[20]==TRUE.
UserTech
32 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.8.2 SHOWVAR
Reads a KRL variable from the kernel system.
Syntax
SHOWVAR (FULLPATH[] String, PARAM Name)
FULLPATH
Variable name of the variable to be read.
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a variable name with path specification.
PARAM
Name of the parameter into which the value found under FULLPATH[]
is written.
If the specified variable or reference does not exist, or if the target value is incompatible
with the variable type, the script is cancelled and an error message is generated in the
message window.
Example
DEFTP MyTech
DECL PARAM MyParam ={VALUE {FREE: DEFAULT[] }}
DEFSCRIPT Example
SHOWVAR( FULLPATH[] $MODE_OP , PARAM MyParam)
MESSAGE $MODE_OP=%MyParam
ENDSCRIPT
ENDTP
If the script Example is executed when the program Test.src is open or selected in T1
mode, the following display appears in the message window:
33 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.8.3 REDECL
Creates or overwrites a KRL variable in the kernel system.
Syntax:
REDECL (PATH[] String, DECLARATION[] String)
PATH
Path name of the new variable.
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a variable name with path specification.
DECLARATION
Declaration of the new variable.
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a target value.
If the specified variable already exists, but is of a different type, or the declaration section
is incorrectly programmed or is incompatible with the variable type of the parameter, the
script is cancelled and an error message is generated in the message window.
Example
DEFTP MyTech
DEFSCRIPT Example
REDECL( PATH[] %MODULE , _
DECLARATION[] DECL AXIS HOME={A1 0, A2 90, A3 90, A4 0, A5 0, A6 0 })
ENDSCRIPT
ENDTP
Once the script Example has been executed with the program Test.src open or selected,
the variable HOME is created in the .dat file if the file Test.dat exists.
UserTech
34 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
3.8.4 DO
Calls a script.
Syntax:
DO Name
Name Name of the script to be executed
If an error occurs while this script is being executed, the calling script is also
cancelled.
3.8.5 SET
Redefining status keys and status key bars already declared. The syntax is described
in the chapter Status keys.
3.8.6 MESSAGE
Generates a oneline text in the message window.
Syntax:
MESSAGE String
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The character string
is then used as a key for the language database. In order to be able to
access this database successfully, it must contain a module with the
name of the technology package in which the script was defined. In the
case of global scripts, the module KUKATPUSERGlobal is accessed. If
access to the language database fails, the key itself is displayed in the
message window. The name of the technology which contains the script
currently being executed is displayed in the column Source.
In the case of parameterized outputs, the parameters must be tagged on
to the key, separated by the | character.
3.8.7 SWITCH...CASE(ELSE)...ENDSWITCH
Control structure for the conditional calling of scripts. After the keyword SWITCH, the
name of a variable is specified which is interrogated on entering the control structure.
Depending on the result of this interrogation, one of the prepared branches is
automatically selected. If no prepared branch is found, the CASE ELSE branch is
automatically selected. Nesting of SWITCH...CASE(ELSE)..ENDSWITCH blocks is
not possible.
Syntax:
SWITCH InterrogationString
CASE ResultString DO Name
...
CASE ELSE DO Name
ENDSWITCH
35 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
InterrogationString
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a variable name with path specification.
Two predefined keywords can also be used for InterrogationString:
ISCHANGE is TRUE if an inline form has been changed.
DOALWAYS is TRUE if toggling between 2 inline forms has occurred.
Application examples can be found in the chapter Programming
examples.
ResultString
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is interpreted as a variable name with path specification.
Name
Name of the script to be executed.
If an error occurs during execution, the calling script is also cancelled.
3.8.8 SWITCH DIALOG...CASE...ENDSWITCH
Generates a user dialog in the message window and calls a script according to the
response to the dialog.
Between two and seven branches must be programmed within this structure,
corresponding to the softkeys in the lower bar from right to left.
Syntax:
SWITCH DIALOG QuestionString
CASE AnswerString1 DO Name1
CASE AnswerString2 DO Name2
CASE AnswerString3 DO Name3
CASE AnswerString4 DO Name4
CASE AnswerString5 DO Name5
CASE AnswerString6 DO Name6
CASE AnswerString7 DO Name
ENDSWITCH
QuestionString
All parameter reference placeholders (e.g. %PLACEHOLDER) in the
character string are replaced by their current values. The resulting
character string is displayed as a dialog text in the message window.
If a language database key with the same name exists, QuestionString
is translated into the active language before being displayed.
UserTech
36 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
AnswerString
The label for the corresponding softkey. The character string is then used
as a key for the language database. If access to the language database
fails, the key itself is displayed in the message window. To generate a
blank softkey, simply leave this specification out.
Name
Name of the script to be executed.
If specified, the script Name is executed when the corresponding
softkey is pressed by the user. Script execution is then resumed after
ENDSWITCH.
If Name is not specified, script execution is again resumed after
ENDSWITCH.
If an error occurs during execution, the calling script is also cancelled.
Only CASE and DO statements are permissible within the SWITCH DIALOG ENDSWITCH
block. The SWITCH DIALOG ENDSWITCH block cannot be nested.
QuestionString and AnswerString are both translated into the currently active language by
means of language database keys. In order to do this, a module with the name of the
technology package in which the script was defined must be created in the language
database. If the script is defined globally, an attempt is made to access the language
database module KUKATPUSERGlobal.
The answer softkeys are translated individually. This means that the corresponding key must
be created in the database for each individual softkey.
If access to the language database fails, the dialog or softkey is not translated and is
displayed unchanged.
In the case of parameterized translations, all parameters must be tagged on to the actual key,
separated by the | character. The translated text and the parameters are then combined
in the language database.
3.8.9 Predefined scripts
3.8.9.1 ACCEPTINLINEFORM
This script closes the open inline form, accepts the modified parameters and inserts
or replaces the KRL program section.
3.8.9.2 CANCELINLINEFORM
This script closes the open inline form, but does not accept the modified parameters
and does not insert any KRL program section.
3.8.9.3 END
This script serves to abort or terminate a script that is running.
3.8.9.4 NOTHING
This script is blank and cancels the original assignment of a script.
37 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
4 Integrating technologies in the graphical user interface (GUI)
The integration of user technologies is carried out by means of entries in the file
MenueKeyUser.INI in the directory C:\Krc\Roboter\Init.
New softkeys and menus can be defined in the section [SOFTKEYS].
Syntax:
skName = dbKey, ProcId, ProcName, ProcParam, NextLineType, NextLineId, UserLevel
skName: Softkey identifier, programmers name for the technology
dbKey: Language database key for the softkey label
ProcId: Function number
ProcName: Name of the function module using the following syntax:
KUKATPUSER; TP; Command
TP: Name of the technology package
Command: Technology package command displayed by default
ProcParam: Parameter string without quotation marks
NextLineType: Type of the next softkey bar:
NOLINE: There is no following softkey line. This is the default setting
POPUP: A popup menu is next
NextLineId: Name of the popup menu
UserLevel: Identification number of the lowest user level at which this softkey is available
4.1 Creating a submenu in the menu bar
To generate a submenu in the menu bar, carry out the following steps in the order given:
G Add your entry to the file section [SOFTKEYS] using the following format:
Submenu_name = Label,,,,POPUP,List_of_entries
G Define the entry list in the file section [MENU]:
List_of_entries=First_Option, Second_Option, Third_Option
G Enter the menu options in the file section [SOFTKEYS]:
a) Call inline form
To call an inline form using this submenu entry
First_Option = Label,11,TECHPACK,KUKATPUSER;_
Technology_Name;Inline_Form_Name
b) Call status key bar
To call a status key bar using this submenu entry
First_Option = Label,11,USERSTATKEYBAROCX;_
KUKATPUSER;Technology_Name.Status_Key_Bar_Name
c) Call status key
To call a status key using this submenu entry
UserTech
38 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
First_Option = Label,11,USERSTATKEYBAROCX,_
KUKATPUSER;Technology_Name.Status_Key_Name;Position
G The main menu in which the new menu item is to appear is specified in the section
[MOVE]:
a) Insert in Technology menu:
Submenu_Name = ,MENU#mTechnology,x
x represents the position of the new menu item in the main menu, 0 being the
uppermost position.
a) Insert in Status keys menu:
Submenu_Name = ,MENU#mTechstatuskeys,x
x represents the position of the new menu item in the main menu, 0 being the
uppermost position.
The new submenu item is available once the altered file has been saved and the GUI has
been reinitialized.
4.2 Examples of integration of a technology in a menu
4.2.1 Simple submenu
The technology TWINKLE is to be inserted into the Technology menu using the menu
item BLINKTech. By default, the technology package TWINKLE is to offer the function
TWICE.
For this, the following entries must be made in the file
C:\Krc\Roboter\Init\MenueKeyUser.ini:
[SOFTKEYS]
Flash_light=BLINKTech,,TECHPACK,KUKATPUSER;TWINKLE;TWICE,,,20
[MOVE]
Flash_light=,MENU#mTechnology,1
Explanations:
Flash_light:Programmers name for the technology
BLINKTech:The technology package is identified by this name in the pulldown menu
TWINKLE: Name of the technology package in the KFD file
TWICE: Technology package command that is to appear by default in the inline form
20: Lowest user level at which the technology package command is available
MENU#mTechnology: The new menu entry is to be tagged onto the Technology menu
1: Position of the entry in the pulldown menu (0 = uppermost position)
39 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
The menu selection above generates the following inline form:
The technology TWINKLE is defined as follows and must be stored in a KFD file in the
template directory:
DEFTP Twinkle
decl fold once[5]
once[1]=/;flash once
once[2]=$out[5]=true
once[3]=wait sec 1.5
once[4]=$out[5]=false
once[5]=wait sec 1.5
decl fold twice[9]
twice[1]=/;flash twice
twice[2]=$out[5]=true
twice[3]=wait sec 1.5
twice[4]=$out[5]=false
twice[5]=wait sec 1.5
twice[6]=$out[5]=true
twice[7]=wait sec 1.5
twice[8]=$out[5]=false
twice[9]=wait sec 1.5
decl inlineform once = {fold[1] once}
decl inlineform twice = {fold[1] twice}
decl inlineform triple = {fold[1] once, fold[2] twice}
ENDTP
UserTech
40 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
4.2.2 Submenu with popup menu
A new submenu item with the name Submenu is required in the Technology menu.
When this is selected, a popup menu is to appear with the options One, Two and
Three available for selection. This menu will then be used for calling the 3 TWINKLE
technology inline forms.
When the file C:\Krc\Roboter\Init\MenueKeyUser.ini is opened, the system looks for the end
of the section [SOFTKEYS]. The following entries are made here:
[SOFTKEYS]
first_entry = One,2010,TECHPACK,KUKATPUSER;TWINKLE;ONCE
second_entry = Two,2010,TECHPACK,KUKATPUSER;TWINKLE;TWICE
third_entry = Three,2010,TECHPACK,KUKATPUSER;TWINKLE;TRIPLE
new_submenu = Submenu, , , ,POPUP,list_of_entries
The following entry is made at the beginning of the section [MENU]:
[MENU]
list_of_entries = first_entry, second_entry, third_entry
The following entry is then added to the section [MOVE]:
[MOVE]
new_submenu = ,MENU#mTechnology,6
This entry inserts the menu Submenu into the Technology menu in the seventh position.
The new submenu item is available once the altered INI file has been saved and the GUI has
been reinitialized:
The menu selection above generates the following inline form:
41 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
4.2.3 Example of integration of a technology via a status key
The technology Purge is to be integrated. It is to be possible to call this technology via a
status key. The KFD file has the following appearance:
Deftp PURGE_ADHESIVE
Decl statkey key4={TopText[] Purge,BottomText[] ON, _
picture[] c:\krc\roboter\template\bitmaps\Purge1.bmp, _
need_prostate0 63 }
DefScript sc_KeyUp
SetVar(fullpath[] $OUT[2], Value[] FALSE)
Set Key4={Picture[] c:\krc\roboter\template\bitmaps\Purge1.bmp, BottomText[]
ON }
EndScript
DefScript sc_KeyDown
SetVar(fullpath[] $OUT[2], Value[] TRUE)
Set Key4={Picture[] c:\krc\roboter\template\bitmaps\Purge2.bmp, BottomText[]
OFF }
EndScript
Set key4={OnKeyDown sc_KeyDown, OnKeyUp sc_KeyUp}
Decl statkeybar bar4
Set bar4 ={statkey[4] key4}
Endtp
The file MenueKeyUser.ini must contain the following entries:
[SOFTKEYS]
userstat4=PURGE,11,USERSTATKEYBAROCX,KUKATPUSER;PURGE_ADHESIVE.bar
4
[MOVE]
userstat4=,MENU#mTechstatuskeys,0
Explanations:
userstat4: Programmers name for the technology
PURGE: The technology package is identified by this name in the pulldown menu
11: Function number of the status bar (always 11)
PURGE_ADHESIVE: Name of the technology package in the KFD file
bar4: Name of the status key bar for this technology
MENU#mTechstatuskeys: The new menu entry is to be tagged onto the Status keys
menu
0: Position of the entry in the pulldown menu (0 = uppermost position)
Once the INI file has been saved and the GUI has been reinitialized, the status key Purge
can be activated via the menu Status keys. It then appears in the bottom lefthand corner
of the GUI. Output 2 is set to TRUE while this status key is pressed.
UserTech
42 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
4.3 File storage in a structured directory
By default, all KFD files are saved in the directory C:\KRC\ROBOTER\TEMPLATE. With more
complex applications, this can result in a loss of structure and clarity. For this reason, it is
optionally possible to store all the files belonging to a single technology in the directory
C:\KRC\TP\(TPName)\TEMPLATE\.
If you wish to do this, the following entry is required in the Windows registry.
Open the registry editor. In the section:
\HKEY_Local_Machine\Software\KUKARoboterGmbH\Options\KFD
the additional key: %InstallationDir%\TP\(TPName)\Template
must be added.
Example:
File path C:\KRC\TP\TestTech\Template\Test.KFD
Entry required in the registry:
Name TestTech
Value %InstallationDir%\TP\TestTech\Template
43 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
5 Programming examples
5.1 Programming status keys
The purpose of this program is to be able to set the brightness and contrast of the KCP
display using status keys. In order to do this, the system variables $PHGBRIGHT and
$PHGCONT must be altered.
A technology file must first be created and then saved in the directory
c:\krc\roboter\template. It is given the file name DISP_SET.KFD.
The technology itself should also be named DISP_SET.
DEFTP disp_set
ENDTP
Next it is necessary to define which status keys are to make up the status key bar:
DEFTP disp_set
DECL STATKEYBAR bar = { STATKEY[1] brightness,
STATKEY[3] contrast }
ENDTP
The status keys themselves must be defined before the status key bar:
DEFTP disp_set
DECL STATKEY brightness = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\phgbright.bmp,_
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN bright_hi, _
ONKEYDOWNMINUS bright_lo}
DECL STATKEY contrast = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\phgcont.bmp, _
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN cont_hi, _
ONKEYDOWNMINUS cont_lo}
DECL STATKEYBAR bar = { STATKEY[1] brightness,
STATKEY[3] contrast }
ENDTP
Before the status keys and status key bar are defined, the scripts which are called by the
events ONKEYDOWN and ONKEYDOWNMINUS must be defined:
DEFTP disp_set
DEFSCRIPT bright_hi
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SETVAR(FULLPATH[] $PHGBRIGHT, VALUE[] %bright +1)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
UserTech
44 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT bright_lo
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SETVAR(FULLPATH[] $PHGBRIGHT, VALUE[] %bright 1)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT cont_hi
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SETVAR(FULLPATH[] $PHGCONT, VALUE[] %cont +1)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT cont_lo
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SETVAR(FULLPATH[] $PHGCONT, VALUE[] %cont 1)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DECL STATKEY brightness = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\ _
phgbright.bmp, _
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN bright_hi, _
ONKEYDOWNMINUS bright_lo}
DECL STATKEY contrast = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\phgcont.bmp, _
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN cont_hi, _
ONKEYDOWNMINUS cont_lo}
45 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
DECL STATKEYBAR bar = { STATKEY[1] brightness,
STATKEY[3] contrast }
ENDTP
Finally, the parameters used in the scripts must be defined before the scripts:
DEFTP disp_set
DECL PARAM bright = {VALUE {NUMBER:}}
DECL PARAM cont = {VALUE {NUMBER:}}
DECL PARAM temp = {VALUE {NUMBER:}}
DEFSCRIPT bright_hi
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SETVAR(FULLPATH[] $PHGBRIGHT, VALUE[] %bright +1)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT bright_lo
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SETVAR(FULLPATH[] $PHGBRIGHT, VALUE[] %bright 1)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT cont_hi
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SETVAR(FULLPATH[] $PHGCONT, VALUE[] %cont +1)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DEFSCRIPT cont_lo
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SETVAR(FULLPATH[] $PHGCONT, VALUE[] %cont 1)
SHOWVAR(FULLPATH[] $PHGCONT, PARAM cont)
SHOWVAR(FULLPATH[] $PHGBRIGHT, PARAM bright)
SHOWVAR(FULLPATH[] $PHGTEMP, PARAM temp)
UserTech
46 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
MESSAGE brightness level: %bright contrast level: _
%cont display temperature: %temp C
ENDSCRIPT
DECL STATKEY brightness = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\phgbright.bmp,_
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN bright_hi, _
ONKEYDOWNMINUS bright_lo}
DECL STATKEY contrast = { PICTURE[] c:\krc\roboter\ _
template\bitmaps\phgcont.bmp, _
ENABLE TRUE, _
USERMODE 10, _
STYLE #TOGGLE, _
ONKEYDOWN cont_hi, _
ONKEYDOWNMINUS cont_lo}
DECL STATKEYBAR bar = { STATKEY[1] brightness, _
STATKEY[3] contrast }
ENDTP
The following additions must be made in the file MenuKeyUser.ini in the directory
C:\Krc\Roboter\Init:
[SOFTKEYS]
DISPSET = DisplaySettings, 11, USERSTATKEYBAROCX,
KUKATPUSER;disp_set.bar; 1
[MOVE]
DISPSET=,MENU#mTechstatuskeys,0
This menu is available once the GUI has been reinitialized:
47 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
5.2 Programming inline forms
Program text
DEFTP LASER
DECL PARAM DataSet={SHORTNAME[] WeldingDataSet=, _
VALUE {NAME: DEFAULT[] DataSet1}, _
SHORTCUT[] DATA}
DECL PARAM DistanceWay={ SHORTNAME[] Distance=, _
VALUE {NUMBER: DEFAULT 200, MIN 0, MAX 500, _
STEP 10}, _
SHORTCUT[] DIST, UNIT[] mm}
DECL PARAM DelayTime={ SHORTNAME[] Delay=, _
VALUE {REAL:DEFAULT 0.8, MIN 0, MAX 20.3, _
STEP 0.3}, _
UNIT[] ms,SHORTCUT[] DLY}
DECL PARAM Pattern={ SHORTNAME[] WeavePattern=, _
VALUE {LIST: _
ITEM[1] {ITEM: VALUE[] PULSE}, _
ITEM[2] {ITEM: VALUE[] STEP}, _
ITEM[3] {ITEM: VALUE[] CONT} _
}, SHORTCUT[] WPTN}
DECL FOLD LasOn[2]
LasOn[1]=Laser(#ON,%DataSet ,%Pattern )
LasOn[2]=TRIGGER WHEN DISTANCE=%DistanceWay _
DELAY=0 DO LASER_ON=TRUE
DECL FOLD LasOff[2]
LasOff[1]=Laser(#OFF)
LasOff[2]=TRIGGER WHEN DISTANCE=0 _
DELAY=%DelayTime _
DO LASER_ON=FALSE
DECL InlineForm On={PARAM[1] DataSet ,PARAM[2] _
DistanceWay, PARAM[3] Pattern, FOLD[1] LasOn}
DECL InlineForm Off={PARAM[1] DelayTime, FOLD[1] LasOff}
ENDTP
UserTech
48 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
This produces the following inline forms:
49 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
5.3 Starting scripts by means of events
When defining an inline form, it is possible to specify the name of a script that is to be
executed if certain events occur, e.g. the opening or closing of an inline form.
Three examples are given below:
5.3.1 Case 1: Execute script when an inline form is opened or closed
The text Fired when ILF is opened! is to be displayed in the message window when an inline
form is opened and the text Fired when ILF is closed! is to be displayed following
confirmation by means of the Enter key or OK key:
Entries in MenueKeyUser.ini:
[SOFTKEYS]
Flash_lig=Tech,,TECHPACK,KUKATPUSER;test;TestILF,,,10
[MOVE]
Flash_lig=,MENU#mTechnology,1
Entries in the KFD file:
DEFTP test
;
; Scripts
;
DEFSCRIPT op_test
MESSAGE Fired when ILF is opened !
ENDSCRIPT
DEFSCRIPT cl_test
MESSAGE Fired when ILF is closed !
DO ACCEPTINLINEFORM
ENDSCRIPT
;
; FOLDs
;
DECL FOLD TestFold[1]
TestFold[1]=/;only for testing ONOPENevent
;
; INLINEFORMs
;
DECL INLINEFORM TestILF={FOLD[1] TestFold, ONOPEN op_test, ONACCEPT
cl_test}
ENDTP
UserTech
50 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
The result:
5.3.2 Case 2: Execute script when an inline form is created or modified
The ONOPEN event is always triggered by default when an inline form is opened by means
of the CHANGE command.
If the user wants a certain script to be started only if a new inline form is inserted or if an
existing inline form is modified, he can use the SWITCH CASE statement with the keyword
ISCHANGE:
DEFTP test
;
; Scripts
;
DEFSCRIPT ch_test
MESSAGE Fired only when ILF is changed !
ENDSCRIPT
DEFSCRIPT new_test
MESSAGE Fired only when ILF is created !
ENDSCRIPT
DEFSCRIPT op_test
SWITCH ISCHANGE
CASE TRUE DO ch_test
51 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
CASE FALSE DO new_test
ENDSWITCH
ENDSCRIPT
DEFSCRIPT cl_test
MESSAGE Fired when ILF is closed !
DO ACCEPTINLINEFORM
ENDSCRIPT
;
; FOLDs
;
DECL FOLD TestFold[1]
TestFold[1]=/;only for testing ONOPENevent
;
; INLINEFORMs
;
DECL INLINEFORM TestILF={FOLD[1] TestFold, ONOPEN op_test, ONACCEPT
cl_test}
ENDTP
5.3.3 Case 3: Execute script on toggling between inline forms within a technology
The ONOPEN event is triggered once by default on toggling between the different inline
forms within a technology.
If a script is to be started every time the user toggles between inline forms, this can be
achieved by means of the keyword DOALWAYS in a SWITCH CASE statement:
DEFTP test
;
; Scripts
;
DEFSCRIPT test_1
MESSAGE Fired only once !
ENDSCRIPT
DEFSCRIPT al_test
MESSAGE Fired always !
ENDSCRIPT
DEFSCRIPT test_2
SWITCH DOALWAYS
CASE TRUE DO al_test
ENDSWITCH
ENDSCRIPT
;
; FOLDs
;
DECL FOLD TestFold[1]
UserTech
52 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
TestFold[1]=/;only for testing ONOPENevent
;
; INLINEFORMs
;
DECL INLINEFORM TestILF_1={FOLD[1] TestFold, ONOPEN test_1}
DECL INLINEFORM TestILF_2={FOLD[1] TestFold, ONOPEN test_2}
ENDTP
53 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
6 Appendix
6.1 Typographical conventions
Example Explanation
DEFTP
Static syntax elements and keywords are printed as
uppercase characters in bold type. They must be used
without modification.
Name
Terms printed in italics must be replaced by userspecific
information.
Elements in angle brackets are optional.
|
The OR sign is used to separate mutually exclusive
options.
6.2 Parameters and parameter reference placeholders
The instruction DECL PARAM Name = ... is used to declare a parameter. If the user wants
the value of such a parameter to be displayed in a string, a special character is required
indicating that it is the value of the parameter that is to be displayed and not the text name
of the parameter. The percent sign % is used for this. An expression consisting of a percent
sign and a parameter name is referred to as a parameter reference placeholder.
6.2.1 Predefined parameter reference placeholders in KRL
6.2.1.1 %TP
The currently selected technology package, first parameter in every inline form.
6.2.1.2 %INLINEFORM
Name of the currently selected inline form, second parameter in every inline form.
6.2.1.3 %MODULE
Name of the application program currently loaded in the editor.
6.3 Data types
Data type Keyword Meaning Range of values
Integer INT Integer 2
31
1 ... 2
31
1
Real REAL Floatingpoint
number
1.1E38...3.4E+38
Boolean BOOL Logic state TRUE, FALSE
Character CHAR Character ASCII character
UserTech
54 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
6.4 Names
The following restrictions apply when selecting a name:
G It can have a maximum length of 24 characters.
G It can consist of letters (AZ), numbers (09) and the signs _ and $.
G It must not begin with a number.
G It must not be a keyword.
The first digit from the right can be altered while the program is running using the status key
+/. This is useful when designating points.
The use of reserved KRL keywords is not permitted and prompts an error message.
A list of reserved KRL keywords can be found in [KRL Reference Guide].
Examples of syntactically correct expressions:
A
Hallo
D47g11
6.5 String
This term is used to describe a string of alphanumeric characters.
Commas and line breaks are not permitted and prompt an error message or malfunction.
Examples of syntactically correct expressions:
A
Hallo
D47g11
1aBc

6.6 Special characters
6.6.1 ;
; identifies the rest of the program line as a comment.
e.g.
;This is a comment
55 of 55
ProgHBUserTechfKRS5.1 04.02.00 en
6.6.2 _
_ continues the program line despite a line break. There must be a space between the
preceding program line and the _ character.
e.g.
decl _
int _
number
corresponds to:
decl int number
6.6.3 /
/ cancels the special function of a subsequent character.
The / character itself is suppressed in the resultant character string.
Application examples:
Comment line in a technology package
End of a parameter reference placeholder
Path specifications for SETVAR, SHOWVAR or REDECL
e.g.
/%
in order to be able to enter the character %, which has a special function.
6.6.4 %
% designates a parameter reference placeholder. The parameter reference placeholder
must be terminated by means of a / or a space. If a space is used, this must be followed
by a second space to separate the parameter from the following character or expression.
A space used to terminate a reference is suppressed in the resultant character string.
e.g.
%INLINEFORM
or
%INLINEFORM/
1
Index
Index i
Symbols
;, 54
#SWITCH, 28
#TOGGLE, 28
%, 55
/, 55
_, 55
A
ACCEPTINLINEFORM, 36
Appendix, 53
Areas of validity, 13
ASS, 15
ASSAGG, 15
AUTOLIMIT, 19, 20
B
BOF Reinitialization, 11
BOOL, 53
Boolean, 53
BOTTOMTEXT, 25
C
CANCELINLINEFORM, 36
CENTERTEXT, 25
CHAR, 53
Character, 53
D
Data types, 53
DEFSCRIPT, 31
DEFTP, 12
DFCT, 15
DO, 34
DOALWAYS, 51
DSUB, 14
E
ENABLE, 17, 26
END, 36
ENDSCRIPT, 31
ENDSWITCH, 34
ENDTP, 12
F
FCT, 15
FOCUS, 13
FOLD, 13, 23
G
Global, 13
I
Icons, 25, 26
Inline form, 47
INLINEFORM, 13
INT, 53
Integer, 53
ISCHANGE, 50
K
KEYDOWN_PICTURE, 26
KEYDOWNMINUS_PICTURE, 26
KFDL, 8
KRL, 8
L
Local, 13
M
MESSAGE, 34
N
Names, 54
NEED_DRIVESOK, 26
NEED_MODEOP, 27
NEED_PROSTATE, 28
NEED_PROSTATE0, 27
NEED_SAFETYSWITCH, 26
NEXT, 29
NOTHING, 36
Index
Index ii
O
ONACCEPT, 16
ONKEYDOWN, 28
ONKEYDOWNMINUS, 29
ONKEYREPEAT, 29
ONKEYREPEATMINUS, 29
ONKEYSHOW, 29
ONKEYUP, 28
ONKEYUPMINUS, 29
ONOPEN, 16
ONTOUCHUP, 16
Overview, 10
P
PARAM, 14, 17
PICTURE, 25
R
REAL, 53
Real, 53
REDECL, 33
S
Scripts, 31
SET, 34
SETVAR, 31
SHORTCUT, 17
SHORTNAME, 17
SHOWVAR, 32
SOC, 12
SOT, 12
Special characters, 54
STATKEY [n], 30
STATKEYBAR, 30
Status keys, 24
String, 54
STYLE, 14, 28
SUB, 14
SWITCH DIALOG...CASE, 35
SWITCH...CASE, 34
T
Technologies, 37
TOPTEXT, 25
Type {free: }, 18
Type {list:}, 20
Type {name: }, 18
Type {number: }, 19
Type {real: }, 20
Type {static: }, 18
U
UNIT, 17
USERMODE, 17, 28
USERTech reinitialize, 11
V
VALUE, 18
W
WYSIWYG, 14

S-ar putea să vă placă și