KST UserTech 31 En

81
KUKA System Technology KUKA.UserTech 3.1 For KUKA System Software 8.2 KUKA Roboter GmbH Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

description

User tech to make messages

Transcript of KST UserTech 31 En

  • KUKA System Technology

    KUKA.UserTech 3.1

    For KUKA System Software 8.2

    KUKA Roboter GmbH

    Issued: 13.12.2010

    Version: KST UserTech 3.1 V1 en

  • KUKA.UserTech 3.1

    2 / 81 Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

    Copyright 2010

    KUKA Roboter GmbHZugspitzstrae 140D-86165 AugsburgGermany

    This documentation or excerpts therefrom may not be reproduced or disclosed to third parties without the express permission of KUKA Roboter GmbH.

    Other functions not described in this documentation may be operable in the controller. The user has no claims 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, how-ever, and necessary corrections will be incorporated in the subsequent edition.

    Subject to technical alterations without an effect on the function.

    Translation of the original documentation

    KIM-PS5-DOC

    Publication: Pub KST UserTech 3.1 enBookstructure: KST UserTech 3.1 V1.1Label: KST UserTech 3.1 V1 en

  • Contents1 Introduction .................................................................................................. 7

    1.1 Target group .............................................................................................................. 71.2 Industrial robot documentation ................................................................................... 71.3 Representation of warnings and notes ...................................................................... 71.4 Terms used ................................................................................................................ 81.5 Trademarks ................................................................................................................ 8

    2 Product description ..................................................................................... 9

    2.1 Overview of UserTech ............................................................................................... 9

    3 Safety ............................................................................................................ 11

    4 Installation ................................................................................................... 13

    4.1 System requirements ................................................................................................. 134.2 Installing or updating UserTech ................................................................................. 134.3 Uninstalling UserTech ................................................................................................ 13

    5 Operation ...................................................................................................... 15

    5.1 Refreshing UserTech ................................................................................................. 15

    6 Programming ............................................................................................... 17

    6.1 Overview of KFD syntax ............................................................................................ 176.2 Symbols and fonts ..................................................................................................... 176.3 Important KFD terms .................................................................................................. 186.3.1 Special characters ................................................................................................ 186.3.2 Strings ................................................................................................................... 196.3.3 Parameter reference placeholder ......................................................................... 196.3.4 Naming conventions and keywords ...................................................................... 206.3.5 Simple data types ................................................................................................. 206.3.6 Areas of validity .................................................................................................... 206.4 Programming a technology package ......................................................................... 216.4.1 Designing the technology ..................................................................................... 216.4.2 Creating a KFD file ............................................................................................... 226.4.3 DEFTP ... ENDTP ................................................................................................. 226.4.4 DECL PARAM ...................................................................................................... 236.4.5 Field types ............................................................................................................ 246.4.5.1 Static field type ..................................................................................................... 246.4.5.2 Free field type ....................................................................................................... 246.4.5.3 Field type Name .................................................................................................... 246.4.5.4 Field type Number ................................................................................................ 256.4.5.5 Field type REAL .................................................................................................... 266.4.5.6 Field type List ........................................................................................................ 276.4.5.7 Field type BOOL ................................................................................................... 296.4.6 DECL FOLD .......................................................................................................... 306.4.7 Generating KRL code ........................................................................................... 316.4.8 DECL INLINEFORM ............................................................................................. 316.4.9 Format types ......................................................................................................... 32

    Contents3 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

    6.4.9.1 Format type WYSIWYG ........................................................................................ 32

  • 4 / 81

    KUKA.UserTech 3.16.4.9.2 Format type SUB .................................................................................................. 336.4.9.3 Format type DSUB ............................................................................................... 336.4.9.4 Format type FCT .................................................................................................. 346.4.9.5 Format type DFCT ................................................................................................ 356.4.9.6 Format type ASS .................................................................................................. 356.4.9.7 Format type ASSAGG .......................................................................................... 366.5 Programming parameter lists .................................................................................... 366.5.1 DECL PARAM PL_ ............................................................................................... 376.5.2 Defining the structure data type ............................................................................ 376.5.3 DECL PLIST ......................................................................................................... 386.6 Programming technology keys .................................................................................. 396.6.1 Designing the technology keys ............................................................................. 396.6.2 DECL STATKEY ................................................................................................... 396.6.2.1 Required image sizes ........................................................................................... 426.6.2.2 Determining the decimal value for activation options ........................................... 436.6.3 DECL STATKEYBAR ........................................................................................... 446.6.4 SET ...................................................................................................................... 446.7 Programming scripts .................................................................................................. 456.7.1 DEFSCRIPT ENDSCRIPT ............................................................................... 456.7.2 SETVAR ............................................................................................................... 456.7.3 SHOWVAR ........................................................................................................... 456.7.4 REDECL ............................................................................................................... 466.7.5 DO ........................................................................................................................ 466.7.6 MESSAGE ............................................................................................................ 476.7.7 SWITCH CASE (ELSE) ENDSWITCH ........................................................ 476.7.8 SWITCH DIALOG CASE ENDSWITCH ...................................................... 486.7.9 Predefined scripts ................................................................................................. 496.7.10 Language system keys for messages and buttons .............................................. 496.8 Integrating a technology into KUKA smartHMI .......................................................... 496.8.1 Configuration file SmartHMI.User.Config ............................................................. 506.8.2 Defining menu elements ....................................................................................... 51

    7 Archiving ...................................................................................................... 53

    7.1 Archiving files ............................................................................................................ 537.2 Restoring files ............................................................................................................ 53

    8 Examples ...................................................................................................... 55

    8.1 LASER technology .................................................................................................... 558.2 Example program for a parameter list ....................................................................... 568.3 Calling scripts via actions .......................................................................................... 598.3.1 Script call after the inline form is opened and closed ........................................... 608.3.2 Script call after the inline form is modified and created ........................................ 618.3.3 Script call after switching to an inline form ........................................................... 628.4 Examples of integration of technology packages ...................................................... 638.4.1 TWINKLE technology ........................................................................................... 638.4.1.1 Integrating the TWINKLE technology in a menu .................................................. 638.4.1.2 Integrating the TWINKLE technology in a submenu ............................................. 648.4.2 GLUE technologie ................................................................................................ 668.4.2.1 Integrating the GLUE technology in a menu ......................................................... 66Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • Contents8.4.3 DISPSET technology ............................................................................................ 688.4.3.1 Integrating the DISPSET technology in a menu ................................................... 69

    9 KUKA Service .............................................................................................. 71

    9.1 Requesting support .................................................................................................... 719.2 KUKA Customer Support ........................................................................................... 71

    Index ............................................................................................................. 795 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 1 Introduction1 Introduction

    1.1 Target group

    This documentation is aimed at users with the following knowledge and skills:

    Advanced knowledge of the robot controller system Advanced KRL programming skills

    1.2 Industrial robot documentation

    The industrial robot documentation consists of the following parts:

    Documentation for the manipulator Documentation for the robot controller Operating and programming instructions for the KUKA System Software Documentation relating to options and accessories Parts catalog on storage medium

    Each of these sets of instructions is a separate document.

    1.3 Representation of warnings and notes

    Safety Warnings marked with this pictogram are relevant to safety and must be ob-served.

    Notes Notes marked with this pictogram contain tips to make your work easier or ref-erences to further information.

    For optimal use of our products, we recommend that our customers take part in a course of training at KUKA College. Information about the training pro-gram can be found at www.kuka.com or can be obtained directly from our subsidiaries.

    Danger!This warning means that death, severe physical injury or substantial material damage will occur, if no precautions are taken.

    Warning!This warning means that death, severe physical injury or substantial material damage may occur, if no precautions are taken.

    Caution!This warning means that minor physical injuries or minor material damage may occur, if no precautions are taken.

    Tips to make your work easier or references to further information.7 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 8 / 81

    KUKA.UserTech 3.11.4 Terms used

    1.5 Trademarks

    Windows is a trademark of Microsoft Corporation.

    Term DescriptionKFD

    KFD file

    KUKA form description

    File format used to describe technologiesKRL KUKA Robot Language

    KUKA robot programming languageKUKA smartHMI Smart human-machine interface

    User interface of the KUKA System SoftwareKUKA smart-PAD

    Teach pendant for the industrial robotIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 2 Product description2 Product description

    2.1 Overview of UserTech

    Functions UserTech is an add-on technology package with the following functions:

    Definition of user-specific inline forms Definition of user-specific messages Definition of user-specific technology keys and buttons Definition of user-specific scripts for inline forms and technology keys Definition of user-specific folds for inline forms Integration of user-defined inline forms and technology keys into the KUKA

    smartHMI user interface9 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 10 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 3 Safety3 Safety

    This documentation contains safety instructions which refer specifically to the software described here.

    The fundamental safety information for the industrial robot can be found in the Safety chapter of the Operating and Programming Instructions for System In-tegrators or the Operating and Programming Instructions for End Users.

    Warning!The Safety chapter in the operating and programming instructions must be observed. Death to persons, severe physical injuries or considerable dam-age to property may otherwise result.11 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 12 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 4 Installation4 Installation

    4.1 System requirements

    Hardware KR C4 robot controller

    Software KUKA System Software 8.2

    4.2 Installing or updating UserTech

    Preparation Copy software from CD to KUKA USB stick

    Precondition Expert user group

    Procedure 1. Connect the KUKA USB stick.2. Select Start-up > Install additional software in the main menu.3. Press New software. If a software package on the USB stick is not dis-

    played, press Refresh.4. Select the entry UserTech and press Install. Reply to the request for con-

    firmation with Yes. The files are copied onto the hard drive.5. Repeat step 4 if another software package is to be installed from this stick.6. Remove the KUKA USB stick.7. It may be necessary to reboot the controller, depending on the additional

    software. In this case, a corresponding prompt is displayed. Confirm with OK and reboot the robot controller. Installation is resumed and completed.

    LOG file A LOG file is created under C:\KRC\ROBOTER\LOG.

    4.3 Uninstalling UserTech

    Precondition Expert user group

    Procedure 1. Select Start-up > Install additional software in the main menu. All addi-tional programs installed are displayed.

    2. Select the entry UserTech and press Uninstall. Reply to the request for confirmation with Yes. Uninstallation is prepared.

    3. Reboot the robot controller. Uninstallation is resumed and completed.

    LOG file A LOG file is created under C:\KRC\ROBOTER\LOG.

    It is advisable to archive all relevant data before updating a software pack-age.

    Caution!The only USB stick that may be used is the KUKA USB stick. Data may be lost or modified if any other USB stick is used.

    It is advisable to archive all relevant data before uninstalling a software pack-age.13 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 14 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 5 Operation5 Operation

    5.1 Refreshing UserTech

    Description This function allows UserTech to be refreshed while the robot controller is run-ning, e.g. to display inline forms that the user has redefined.

    UserTech is reinitialized without rebooting the system. The progress of the re-initialization is indicated in the message window.

    Precondition Expert user group

    Procedure In the main menu, select the menu sequence Configuration > Miscella-neous > Reinitialize UserTech.15 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 16 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6 Programming

    6.1 Overview of KFD syntax

    6.2 Symbols and fonts

    The following symbols and fonts are used in the syntax descriptions:

    TechnologiesDEFTP ENDTP (>>> 6.4.3 "DEFTP ... ENDTP" Page 22)

    Inline formsDECL FOLD (>>> 6.4.6 "DECL FOLD" Page 30)DECL INLINEFORM (>>> 6.4.8 "DECL INLINEFORM" Page 31)DECL PARAM (>>> 6.4.4 "DECL PARAM" Page 23)

    Parameter listsDECL PARAM PL_ (>>> 6.5.1 "DECL PARAM PL_" Page 37)DECL PLIST (>>> 6.5.3 "DECL PLIST" Page 38)

    Technology keysDECL STATKEY (>>> 6.6.2 "DECL STATKEY" Page 39)DECL STATKEYBAR (>>> 6.6.3 "DECL STATKEYBAR" Page 44)SET (>>> 6.6.4 "SET" Page 44)

    ScriptsDEFSCRIPT ENDSCRIPT (>>> 6.7.1 "DEFSCRIPT ENDSCRIPT" Page 45)DO (>>> 6.7.5 "DO" Page 46)MESSAGE (>>> 6.7.6 "MESSAGE" Page 47)REDECL (>>> 6.7.4 "REDECL" Page 46)SET (>>> 6.6.4 "SET" Page 44)SETVAR (>>> 6.7.2 "SETVAR" Page 45)SHOWVAR (>>> 6.7.3 "SHOWVAR" Page 45)SWITCH CASE(ELSE) ENDSWITCH

    (>>> 6.7.7 "SWITCH CASE (ELSE) ENDSWITCH" Page 47)

    SWITCH DIALOG CASE ENDSWITCH

    (>>> 6.7.8 "SWITCH DIALOG CASE ENDSWITCH" Page 48)

    ACCEPTINLINEFORM (>>> 6.7.9 "Predefined scripts" Page 49)CANCELINLINEFORMENDNOTHING

    Syntax element RepresentationKRL code Courier font

    Upper-case letters

    Examples: GLOBAL; ANIN ON; OFFSETElements that must be replaced by program-spe-cific entries

    Italics Upper/lower-case letters

    Examples: Distance; Time; Format17 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 18 / 81

    KUKA.UserTech 3.16.3 Important KFD terms

    6.3.1 Special characters

    The following special characters are used in the KFD code:

    Optional elements In angle brackets

    Example: Elements that are mutually exclusive

    Separated by the "|" symbol

    Example: IN |OUT

    Syntax element Representation

    Character Description; Designates a comment

    Example:

    ;This is a comment_ A statement in KFD must be contained in one continuous

    program line.

    "_" is used to continue a program line despite an interven-ing line break. There must be a space between the preced-ing program line and the "_" character.

    Example:

    decl _int _number(= Program line: decl int number)

    / Cancels the special function of a subsequent character. The character "/" itself is not displayed in the string.

    Examples:

    /%: Function of the "%" character for designating a pa-rameter reference placeholder is canceled.

    /;: Function of the ";" character for designating a com-ment is canceled.Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.3.2 Strings

    A string is a sequence of alphanumeric characters of fixed or variable length.

    The following rules apply in KFD:

    Strings must not include any commas. Strings must not include any line breaks, i.e. they must be contained within

    one line. Strings are always enclosed in double quotation marks, e.g. "This is a

    string". If the quotation mark is intended to be part of the string, its meaning as a

    special character must be canceled using the "/" character, e.g. "The char-acter /"".

    6.3.3 Parameter reference placeholder

    A parameter reference placeholder consists of a percent sign and a parameter name. The percent sign causes the name of the parameter to be output not a text but as as a value.

    The following parameter reference placeholders are predefined:

    % Designates a parameter reference placeholder

    (>>> 6.3.3 "Parameter reference placeholder" Page 19)

    The "/" character or a space must be inserted after the parameter reference placeholder. If a space is used, a sec-ond space must be inserted if a further character or expres-sion follows after the parameter reference placeholder.

    A space used to terminate a parameter reference place-holder is not displayed in the string.

    Example:

    %INLINEFORM/ %INLINEFORM

    # Designates a value assignment

    Examples:

    #%INLINEFORM #TOGGLE

    Character Description

    Additional rules apply when programming fields of type BOOL. (>>> 6.4.5.7 "Field type BOOL" Page 29)

    Name Description%TP Name of the technology

    First parameter in every inline form%INLINEFORM Name of the inline form

    Second parameter in every inline form%MODULE Name of the program in Navigator19 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 20 / 81

    KUKA.UserTech 3.16.3.4 Naming conventions and keywords

    Names Examples of names in KFD: variable names, function names, subprogram names

    Names in KFD can have a maximum length of 24 characters. Names in KFD can consist of letters (A...Z), numbers (0...9) and the spe-

    cial characters _ and $. Names in KFD must not begin with a number. Names in KFD must not be keywords.

    Keywords Keywords are sequences of letters having a fixed meaning. They must not be used in programs in any way other than with this meaning. No distinction is made between uppercase and lowercase letters. A keyword remains valid ir-respective of the way in which it is written.

    Example: The sequence of letters CASE is an integral part of the KRL syntax SWITCHCASEENDSWITCH. For this reason, CASE must not be used in any other way, e.g. as a variable name.

    6.3.5 Simple data types

    The following simple data types are predefined:

    6.3.6 Areas of validity

    Variables and data objects have local validity, i.e. in a defined technology package, if they are declared between the DEFTP and ENDTP statements.

    Variables and data objects have global validity, i.e. in all technology packages, if they are declared outside the DEFTP and ENDTP statements.

    The names of all system variables begin with the $ sign. To avoid confu-sion, do not begin the names of user-defined variables with this sign.

    The use of keywords reserved for KRL is not permitted. Further information about keywords is contained in the Operating and Programming Instructions for System Integrators.

    Data type Keyword DescriptionInteger INT Integer

    -2-1 2-1

    Examples: 1; 32; 345Real REAL Floating-point number

    +1.1E-38 +3.4E+38

    Examples: 1.43; 38.50; 300.25Boolean BOOL Logic state

    TRUE FALSE

    Character CHAR 1 character

    ASCII character

    Examples: "A"; "1"; "q"Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.4 Programming a technology package

    Overview

    6.4.1 Designing the technology

    Define the structure of the inline forms, e.g. number, type and layout of the input boxes.

    Define the parameters in the inline form and their respective value ranges and parameter lists.

    Define the program lines (= folds) to be inserted. Define the technology keys (e.g. functions, conditions for activation and

    layout). Define the scripts to be called by user actions.

    Actions include:

    Open or close an inline form. Press Touch-Up. Press, release, or hold down a technology key.

    We recommend combining all global variables and data objects in a KFD file.

    Step Description1 Design the technology.

    (>>> 6.4.1 "Designing the technology" Page 21)2 Create KFD file.

    (>>> 6.4.2 "Creating a KFD file" Page 22)3 Define the technology.

    (>>> 6.4.3 "DEFTP ... ENDTP" Page 22)4 Define the parameters.

    (>>> 6.4.4 "DECL PARAM" Page 23)5 Define parameter lists.

    (>>> 6.5 "Programming parameter lists" Page 36)6 Prepare the scripts.

    (>>> 6.7.1 "DEFSCRIPT ENDSCRIPT" Page 45)7 Create folds.

    (>>> 6.4.6 "DECL FOLD" Page 30)8 Generate KRL code.

    (>>> 6.4.7 "Generating KRL code" Page 31)9 Define inline forms.

    (>>> 6.4.8 "DECL INLINEFORM" Page 31)10 Program technology keys.

    (>>> 6.6 "Programming technology keys" Page 39)11 Program the scripts.

    (>>> 6.7 "Programming scripts" Page 45)12 Integrate the technology into the graphical user interface.

    (>>> 6.8 "Integrating a technology into KUKA smartHMI" Page 49)21 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 22 / 81

    KUKA.UserTech 3.1 Display a technology key.

    6.4.2 Creating a KFD file

    Description Technologies created with UserTech are described as KFD files and saved by default in the directory C:\KRC\TP\USERTECH\TEMPLATE.

    Any editor can be used to edit the KFD file. The KFD file must be saved in ASCII format. The name of the KFD file can be freely chosen within the conventions of

    the Windows operating system. The KFD file can contain one or more technologies. The name of a tech-

    nology may only appear once within the system.

    With complex technologies it is recommended that the KFD files belonging to a single technology are saved in the directory C:\KRC\TP\TPName\TEM-PLATE.

    A key must be created in the registry database of the Windows operating sys-tem for the folder TPName.

    Procedure 1. Open the registry editor.2. Select the path \HKEY_Local_Machine\Software\KUKARoboter-

    GmbH\Options\KFD.3. Create a new folder:

    Right-click and select the menu sequence New > Key > String.4. Give the folder the name TPName.5. Place the cursor on the folder, right-click and select the menu item

    Change: The Edit String window is opened.6. Under "Value", enter the new key:

    %InstallationDir%\TP\TPName\Template7. Confirm the key with OK.

    6.4.3 DEFTP ... ENDTP

    Description Defining a technology

    Syntax DEFTP Name ENDTP

    Explanation of the syntax

    Element DescriptionDEFTP Name of the technologySOC Defines whether the inline forms for a technology can

    be selected via a list box in the inline form.

    TRUE: Selection is possible. FALSE: Selection is not possible.

    Default, if SOC is not defined: TRUESOT Defines whether technologies can be selected via a list

    box in the inline form.

    TRUE: Selection is possible. FALSE: Selection is not possible.

    Default, if SOT is not defined: TRUEIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingExample 1

    The technologies MyTech and OtherTech can be selected via a list box in the inline form.

    Example 2

    The technologies MyTech and OtherTech cannot be selected via a list box in the inline form.

    6.4.4 DECL PARAM

    Description Declaration of a box (field) in the inline form

    Syntax DECL PARAM Name =

    {

    VALUE {Field type}}

    Explanation of the syntax

    Example

    An integer value from 0 to 100 can be entered. The box is of type Number.

    DEFTP MyTechENDTPDEFTP OtherTechENDTP

    Fig. 6-1: List box for selecting a technology

    DEFTP MyTech = {SOT FALSE}ENDTPDEFTP OtherTechENDTP

    Fig. 6-2: MyTech technology

    Element DescriptionDECL PARAM Name of the boxSHORTNAME[] Name displayed before the boxUNIT[] Unit displayed after the boxENABLE[ ] Activation of an input box

    TRUE: Input box is activated.

    FALSE: Input box is deactivated.

    Default, if ENABLE[ ] is not defined: TRUEVALUE Type of box (field)

    (>>> 6.4.5 "Field types" Page 24)

    DECL PARAM FieldNumber = {SHORTNAME[] "Distance: ", UNIT[] "mm", _VALUE {NUMBER: MIN 0, MAX 100, STEP 2, DEFAULT 50}}23 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 24 / 81

    KUKA.UserTech 3.1The value in the input box can be increased or decreased in steps of 2 using the cursor keys on the keyboard.

    6.4.5 Field types

    6.4.5.1 Static field type

    Description A static text is displayed in the inline form, which cannot be edited.

    Syntax VALUE {STATIC: DEFAULT[]"String"}

    Explanation of the syntax

    Example

    6.4.5.2 Free field type

    Description A text is displayed in the input box, which can be edited.

    Syntax VALUE {FREE: DEFAULT[]"String"}

    Explanation of the syntax

    Example

    6.4.5.3 Field type Name

    Description A variable name, function name or subprogram name is displayed in the input box, which can be edited. The syntax of the name is checked.

    Fig. 6-3: Example of field type Number

    Element DescriptionDEFAULT[] Text displayed in the inline form

    DECL PARAM FieldStatic = _{VALUE {STATIC: DEFAULT[] "Field cannot be edited"}}

    Fig. 6-4: Example of static field type

    Element DescriptionDEFAULT[] Default text that is displayed in the input box when you

    first open the inline form

    If no string is defined, the input box is empty.

    DECL PARAM FieldFree = {SHORTNAME[] "Programmer: ", _VALUE {FREE: DEFAULT[] " Name "}}

    Fig. 6-5: Example of free field type

    Only input fields with field type Name can be linked with parameter lists.Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingSyntax VALUE {Name: DEFAULT[] "Name"}

    Explanation of the syntax

    Example

    No IncOnOpen key is created in the registry database. When the inline form is first opened, the value WPT1 is displayed by default. The next time the inline form is created, the number is incremented by one and the value WPT2 is dis-played.

    6.4.5.4 Field type Number

    Description An integer value is displayed in the input box, which can be edited using the numeric keypad on the keyboard.

    Syntax VALUE {NUMBER: MIN minimum value, MAX maximum value,

    }

    The use of keywords reserved for KRL is not permitted. Further information about keywords is contained in the Operating and Programming Instructions for System Integrators.

    Element DescriptionDEFAULT[] Name of the variable, function or subprogram that is dis-

    played by default in the input box when the inline form is first opened

    If the last character of a name is a number (09) then by default, the number is incremented by one every time an inline form of this type is created. The counter is re-set if the inline form is canceled after it is opened.

    If you do not want the number to be incremented, the key IncOnOpen, type DWORD, must be created in the registry database.

    Path in the registry database:HKEY_LOCAL_MACHINE\SOFTWARE\KUKA Robot-er GmbH\Options\KFD

    IncOnOpen:

    DWORD=00000000: Number is not incremented. DWORD=00000001: Number is incremented.

    DECL PARAM FieldName = {SHORTNAME[] "Welding-Point-Nr.: ", _VALUE {NAME: DEFAULT[] "WPT1"}}

    Fig. 6-6: Example of field type Name25 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 26 / 81

    KUKA.UserTech 3.1Explanation of the syntax

    Example

    An integer value from 0 to 100 can be entered.

    The value in the input box can be increased or decreased in steps of 2 using the cursor keys on the keyboard.

    6.4.5.5 Field type REAL

    Description A floating-point number is displayed in the input box, which can be edited us-ing the numeric keypad on the keyboard.

    Syntax VALUE {REAL: MIN minimum value, MAX maximum value,

    }

    Element DescriptionMIN Type: INT

    Minimum input value

    Note: This value must always be specified.MAX Type: INT

    Maximum input value

    Note: This value must always be specified.STEP Type: INT

    Increment for the cursor keys on the keyboard that can be used for increasing and decreasing the value in the input box.

    Default, if STEP is not defined: 1DEFAULT Type: INT

    Default value that is displayed when you first open the inline form.

    Default, if DEFAULT is not defined: 0AUTOLIMIT TRUE: A value that is too large or too small is automat-

    ically set to the minimum or maximum input value. (= default if AUTOLIMIT is not defined)

    Entered value < minimum value:Value is set to minimum value.

    Entered value > maximum value:Value is set to maximum value.

    DECL PARAM FieldNumber = {SHORTNAME[] "Distance: ", UNIT[] "mm", _VALUE {NUMBER: MIN 0, MAX 100, STEP 2, DEFAULT 50}}

    Fig. 6-7: Example of field type NumberIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingExplanation of the syntax

    Example

    A value from 0.5 to 5 can be entered.

    The value in the input box can be increased or decreased in steps of 0.5 using the cursor keys on the keyboard.

    6.4.5.6 Field type List

    Description A list box is displayed in the inline form. You can use the list to select a param-eter. The parameters in the list cannot be edited.

    Syntax VALUE {LIST: |ITEM[1] List parameter 1,

    < ,>

    }

    Element DescriptionMIN Type: REAL

    Minimum input value

    Note: This value must always be specified.MAX Type: REAL

    Maximum input value

    Note: This value must always be specified.STEP Type: REAL

    Increment for the cursor keys on the keyboard that can be used for increasing and decreasing the value in the input box.

    Default, if STEP is not defined: 0.1DEFAULT Type: REAL

    Default value that is displayed when you first open the inline form.

    Default, if DEFAULT is not defined: 0.0AUTOLIMIT TRUE: A value that is too large or too small is automat-

    ically set to the minimum or maximum input value. (= default if AUTOLIMIT is not defined)

    Entered value < minimum value:Value is set to minimum value.

    Entered value > maximum value:Value is set to maximum value.

    DECL PARAM FieldReal = {SHORTNAME[] "Delay: ", UNIT[] "sec", _VALUE {REAL: MIN 0.5, MAX 5, STEP 0.5, DEFAULT 2}}

    Fig. 6-8: Example of field type REAL27 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 28 / 81

    KUKA.UserTech 3.1Explanation of the syntax

    Example 1

    Example 2

    The value Triangle selected in the list box WeavePattern is not the value ac-tually processed. In the fold, the global variable Model is assigned value 3.

    Element DescriptionDEFAULT[] Default list parameter value that is displayed when you

    first open the inline form.

    This parameter must correspond to one of the defined list parameters. (VALUE[] or DISP[])

    POS Type: INT

    Default list parameter number [n] that is displayed when you first open the inline form.

    ITEM[1] ITEM[n]

    Values of list parameters [1] to [n]

    Complete syntax of the list parameters:{ITEM: VALUE[] "StringX" } VALUE[]: This value is processed. DISP[]: This value is displayed.Default, if DISP[] is not defined: the displayed value corresponds to the processed value.

    DECL PARAM FieldList = {SHORTNAME[] "Weave pattern:", _VALUE {LIST: POS 1, ITEM[1] {ITEM: VALUE[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}

    Fig. 6-9: Example of field type List

    DEFTP MyTech = {SOC TRUE}DECL PARAM FieldList = {SHORTNAME[] "Weave pattern:", _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] = "Model = %FieldList"DECL INLINEFORM MyCmd = {FOLD[1] MyFold, PARAM[1] FieldList}ENDTP

    Fig. 6-10: Example of field type List - inline form MyTech.MyCmdIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingKRL code in the program:

    6.4.5.7 Field type BOOL

    Description The inline form displays a checkbox that can be activated and deactivated.

    Syntax VALUE {BOOL: DEFAULT Bool,

    }

    Explanation of the syntax

    Rules for strings The string can have a maximum length of 16 characters.

    The following notations or characters are not allowed in the string:

    "" (empty string) " " (only space) "Las,on" (comma) "Las"on" (quotation marks)

    Example

    Element DescriptionDEFAULT Default check box value that is displayed when you first

    open the inline form.

    TRUE: Check box active. FALSE: Check box inactive.

    TRUE[] Text that is inserted in the program as KRL code if the checkbox is active.

    If TRUE[] is not defined and the checkbox is active, "TRUE" is inserted into the program by default as KRL code.

    Note: For BOOL type fields, additional rules apply when creating strings. (>>> "Rules for strings" Page 29)

    FALSE[] Text that is inserted in the program as KRL code if the check box is inactive.

    If FALSE[] is not defined and the check box is inactive, "FALSE" is inserted into the program by default as KRL code.

    Note: For BOOL type fields, additional rules apply when creating strings. (>>> "Rules for strings" Page 29)

    DEFTP MyTechDECL PARAM ParamList = {SHORTNAME[] "Val: ", _ VALUE {Name: DEFAULT[] "VAL1"}}...

    DECL PARAM FieldBool = {SHORTNAME[] "Laser", _VALUE {BOOL: DEFAULT TRUE, TRUE[] "EIN", FAlSE[] "AUS"}}...

    DECL FOLD PFold[1] PFold[1] = "ParamList"...

    DECL INLINEFORM ILF_With_ParamList={FOLD[1] PFold, _PARAM[1] ParamList, PARAM[2] FieldBoolENDTP29 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 30 / 81

    KUKA.UserTech 3.1KRL code in the program (check box active):

    KRL code in the program (check box inactive):

    6.4.6 DECL FOLD

    Description Declaring a fold

    Folds make programs more transparent. Folds are used to hide sections of the program. The hidden program sections are processed during program execu-tion in exactly the same way as visible program sections.

    Syntax DECL FOLD NAME[n]

    NAME [1] = "String1",

    ...

    NAME [n] = "StringN"

    Explanation of the syntax

    Example

    The following values are selected in the inline form:

    DataSet = DataSet6 DistanceWay = 210 Pattern = STEP INLINEFORM = ON

    KRL code in the program:

    Fig. 6-11: Example of field type BOOL (check box active)

    Fig. 6-12: Example of field type BOOL (check box inactive)

    Element DescriptionNAME Name of the fold[n] Number of lines in the foldString1 StringN Contents of the fold

    All parameter reference placeholders in a string are re-placed in the program by the values selected in the in-line form.

    DECL FOLD MyFold[2]MyFold[1] = "Laser(#%INLINEFORM/,%DataSet/,%Pattern/)"MyFold[2] = "TRIGGER WHEN PATH=%DistanceWay/ DELAY=0 _ DO LASER_ON=TRUE"

    Laser(#ON,DataSet6,STEP)TRIGGER WHEN PATH=210 DELAY=0 DO LASER_ON=TRUEIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.4.7 Generating KRL code

    Description Subprograms or functions which are also to be inserted in selected programs on closing an inline form must be defined globally.

    Procedure 1. Create a program in folder KRC:\R1\TP.2. In the program, define the required subprograms and functions with the

    corresponding transfer parameters.

    6.4.8 DECL INLINEFORM

    Description Declaration of an inline form

    Syntax DECL INLINEFORM Name =

    {

    }

    Explanation of the syntax

    Element DescriptionDECL INLINEFORM

    Name of the inline form

    FOCUS Type: INT

    Number of the input box that is focused on by default the first time the inline form is opened

    Precondition for this function:

    The inline form was called via the Commands menu.

    The technology in which the inline form is declared is defined as follows:DEFTP Name = {SOC FALSE, SOT FALSE}ENDTP

    FOLD[1] FOLD[n]

    Names of the folds assigned to the inline form

    (>>> 6.4.6 "DECL FOLD" Page 30)

    If no fold is assigned to the inline form, its contents will be inserted into the program in accordance with the set-ting made under STYLE.

    PARAM[1] PARAM[n]

    Names of the boxes displayed in the inline form

    (>>> 6.4.4 "DECL PARAM" Page 23)31 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 32 / 81

    KUKA.UserTech 3.16.4.9 Format types

    6.4.9.1 Format type WYSIWYG

    Description The formatting of the KRL code corresponds exactly to the text of the inline form.

    SPLINE Specifies whether the inline form of technology packag-es is interpreted as an inline form containing a SPLINE control structure. Whether the inline form actually con-tains a SPLINE control structure is defined when the fold is created.

    TRUE: Interpretation as inline form with SPLINE control structure

    FALSE: Interpretation as inline form without SPLINE control structure

    Default, if no value or an invalid value is entered for SPLINE: FALSE

    ILF_TYPE Specifies whether the fold of the inline form can be in-serted into a fold with SPLINE control structure.

    IN_SPLINE: Fold can be inserted into a SPLINE fold.

    OFF_SPLINE: Fold cannot be inserted into a SPLINE fold.

    ALL: Fold can be inserted into any fold.

    Default, if no value or an invalid value is entered for ILF_TYPE: OFF_SPLINE

    STYLE Formatting of the KRL code

    WYSIWYG SUB DSUB FCT DFCT ASS ASSAGG

    Default, if STYLE is not defined: WYSIWYG

    (>>> 6.4.9 "Format types" Page 32)ONACCEPT Name of the script that is run when you press Com-

    mand OK

    (>>> 8.3.1 "Script call after the inline form is opened and closed" Page 60)

    ONTOUCHUP Name of the script that is run when you press Touch UpONOPEN Name of the script that is run when you open the inline

    form (press Change or select via the Commands menu)

    (>>> 8.3.1 "Script call after the inline form is opened and closed" Page 60)

    Element DescriptionIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingExample

    KRL code in the program:

    6.4.9.2 Format type SUB

    Description The formatting of the KRL code corresponds to a subprogram call.

    The parameters are reduced to the contents of the 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.

    Example

    KRL code in the program:

    6.4.9.3 Format type DSUB

    Description The formatting of the KRL code corresponds to a subprogram call.

    The parameters are reduced to the contents of the boxes, separated by commas and contained within brackets.

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist}DECL INLINEFORM OffENDTP

    Fig. 6-13: Inline form Laser.On (example 1)

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist, STYLE SUB}DECL INLINEFORM OffENDTP

    Fig. 6-14: Inline form Laser.On (example 2)33 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 34 / 81

    KUKA.UserTech 3.1 The dot separating the name of the technology and the name of the inline form is suppressed.

    Parameter names and units are inserted as a comment.

    Example

    KRL code in the program:

    6.4.9.4 Format type FCT

    Description The formatting of the KRL code corresponds to a function call:

    Irrespective of its format, the value of the first parameter is used as the name of the function.

    The following parameters are reduced to the contents of the boxes, sepa-rated 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 inline form name and the parame-ter list.

    Example

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist, STYLE DSUB}DECL INLINEFORM OffENDTP

    Fig. 6-15: Inline form Laser.On (example 2)

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "3", DISP[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist, STYLE FCT}DECL INLINEFORM OffENDTP

    Fig. 6-16: Inline form Laser.On (example 3)Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingKRL code in the program:

    6.4.9.5 Format type DFCT

    Description The formatting of the KRL code corresponds to a function call:

    Irrespective of its format, the value of the first parameter is used as the name of the function.

    The following parameters are reduced to the contents of the boxes, sepa-rated 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 inline form name and the parame-ter list.

    Parameter names and units are inserted as a comment.

    Example

    KRL code in the program:

    6.4.9.6 Format type ASS

    Description The formatting of the KRL code corresponds to an assignment:

    The parameters are reduced to the contents of the fields and separated by commas.

    The dot separating the name of the technology and the name of the inline form is suppressed.

    An equals sign is inserted between the inline form name and the parame-ter list.

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "3", DISP[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist, STYLE DFCT}DECL INLINEFORM OffENDTP

    Fig. 6-17: Inline form Laser.On (example 3)35 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 36 / 81

    KUKA.UserTech 3.1Example

    KRL code in the program:

    6.4.9.7 Format type ASSAGG

    Description The formatting of the KRL code corresponds to an aggregate assignment:

    The parameters are reduced to the parameter name and the content of the fields.

    The parameters are separated by commas and enclosed in braces. The dot separating the name of the technology and the name of the inline

    form is suppressed. An equals sign is inserted between the inline form name and the parame-

    ter list.

    Example

    KRL code in the program:

    6.5 Programming parameter lists

    An input box of field type Name can be linked to a parameter list. Every pa-rameter list contains a data set. This data set is displayed in an option window. The structure and the properties of the data set must be programmed.

    DEFTP LaserDECL PARAM Fieldlist = {SHORTNAME[] "WeavePattern: ", _VALUE {LIST: ITEM[1] {ITEM: VALUE[] "3", DISP[] "Triangle"}, _ITEM[2] {ITEM: VALUE[] "Trapezoid"}, _ITEM[3] {ITEM: VALUE[] "Sinus"}}}DECL PARAM Fieldname = {SHORTNAME[] "WeldDataSet: ", _VALUE {NAME: DEFAULT[] "DataSet0"}}DECL PARAM DistanceWay = {SHORTNAME[] "Distance: ", _VALUE {NUMBER: MIN 0, MAX 500, DEFAULT 200}, Unit[] "mm"}DECL INLINEFORM On = {PARAM[1] Fieldname, PARAM[2] DistanceWay, _PARAM[3] Fieldlist, STYLE ASS}DECL INLINEFORM OffENDTP

    Fig. 6-18: Inline form Laser.On (example 4)

    DEFTP SEARCHDECL 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

    Fig. 6-19: Inline form SEARCH.DirectionIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingOverview

    Example (>>> 8.2 "Example program for a parameter list" Page 56)

    6.5.1 DECL PARAM PL_

    Description Declaration of the structure of the data set

    Syntax DECL PARAM PL_Name =

    {VAR[]"String",SHORTCUT[]"String",UNIT[]"String",VALUE {FREE: DEFAULT[] "_"}}

    Explanation of the syntax

    6.5.2 Defining the structure data type

    Description The structure data type of a data set and the default values of the structure data type must be defined in C:\KRC\ROBOTER\KRC\R1\SYSTEM\$CON-FIG.DAT, in section "User-defined types" of the USER GLOBALS fold.

    Step Description1 Define the parameters of the parameter list.

    (>>> 6.4.4 "DECL PARAM" Page 23)2 Define the structure of the data set.

    (>>> 6.5.1 "DECL PARAM PL_" Page 37)3 Define the structure data set and default data set in $CON-

    FIG.DAT.

    (>>> 6.5.2 "Defining the structure data type" Page 37)4 Define the parameter list and assign it to the input box.

    (>>> 6.5.3 "DECL PLIST" Page 38)

    Element DescriptionDECL PARAM PL_ Name of the data set

    (>>> 6.5.3 "DECL PLIST" Page 38)SHORTNAME[] Name of the data set that is displayed in the op-

    tion windowVAR[] Name of the structure data type of the data set

    (>>> 6.5.2 "Defining the structure data type" Page 37)

    SHORTCUT[] Prefix of the default data set (>>> 6.5.2 "Defining the structure data type" Page 37)

    UNIT[] System name of the data setVALUE {FREE: DEFAULT[] "_"}

    Placeholder for the default values of the data set

    (>>> 6.5.2 "Defining the structure data type" Page 37)37 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 38 / 81

    KUKA.UserTech 3.1Syntax Structure data type:

    STRUC NameType1 StructureNameParam1,

    ,TypeN StructureNameParamN

    Default values:

    DECL Name PrefixDEFAULT={StructureNameParam1 Default1,,StructureNameParamN DefaultN}

    Explanation of the syntax

    6.5.3 DECL PLIST

    Description Declaration of the parameter list

    Syntax DECL PLIST Name[n] -> Assignment of input box Name[1]= NameParam1...

    Name[n] = NameParamN

    Explanation of the syntax

    Element DescriptionName Name of the structure data type

    (>>> 6.5.1 "DECL PARAM PL_" Page 37)Type1 TypeN Data types of the parameters of the data set

    INT REAL BOOL

    StructureNameParam1 Structu-reNameParamN

    Structure names of the parameters of the data set

    Prefix Prefix of the default data set

    (>>> 6.5.1 "DECL PARAM PL_" Page 37)Default1 DefaultN Default values of the parameters of the data set

    The default values are freely selectable.

    Element DescriptionDECL PLIST Name of the data set

    (>>> 6.5.1 "DECL PARAM PL_" Page 37)[n] Number of parameters in the data set-> Name of the input box in the inline form to which the

    data set is linked

    Note: Parameter lists can only be linked with input box-es with field type Name.Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.6 Programming technology keys

    Overview

    6.6.1 Designing the technology keys

    With UserTech, functions can be assigned to the 4 technology keys on the left of the smartPAD.

    Define functions of the technology keys. Define layout of the technology keys. Define size of the technology keys. Define the conditions for activating the technology keys. Define scripts called by user actions (e.g. press, release, or hold down

    technology key).

    6.6.2 DECL STATKEY

    Description Declaration of a technology key

    Syntax DECL STATKEY Name =

    {

    [1] [n] Sequence of parameters in the data set (= sequence in the option window)

    NameParam1 NameParamN

    Names of the parameters of the data set

    The layout and range of values of the parameters must be defined with DECL PARAM.

    (>>> 6.4.4 "DECL PARAM" Page 23)

    Element Description

    Step Description1 Design the technology keys.

    (>>> 6.6.1 "Designing the technology keys" Page 39)2 Prepare the scripts.

    (>>> 6.7.1 "DEFSCRIPT ENDSCRIPT" Page 45)3 Define technology keys.

    (>>> 6.6.2 "DECL STATKEY" Page 39)4 Define technology key bar.

    (>>> 6.6.3 "DECL STATKEYBAR" Page 44)5 Program the scripts.

    (>>> 6.7 "Programming scripts" Page 45)39 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 40 / 81

    KUKA.UserTech 3.1

    }

    Explanation of the syntax

    Layout:

    Element DescriptionDECL STATKEY Name of the technology keyNEXT Name of the next technology key

    Element DescriptionTOPTEXT[] Text displayed next to the technology key (top)CENTERTEXT[] Text displayed next to the technology key (cen-

    tered)BOTTOMTEXT[] Text displayed next to the technology key (bot-

    tom)PICTURE[] Path for the graphic displayed next to the technol-

    ogy key

    (>>> 6.6.2.1 "Required image sizes" Page 42)KEYDOWN_PICTURE[]

    Path for the graphic displayed next to the technol-ogy key if the key with the PLUS function is pressed

    (>>> 6.6.2.1 "Required image sizes" Page 42)

    If no path is given here, the graphic specified un-der PICTURE[ ] is displayed.Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming Activation options:

    KEYDOWNMINUS_PICTURE[]

    Path for the graphic displayed next to the technol-ogy key if the key with the MINUS function is pressed

    (>>> 6.6.2.1 "Required image sizes" Page 42)

    If no path is given here, the graphic specified un-der PICTURE[ ] is displayed.

    STYLE Format of the technology key

    #SWITCH: Single technology keyOne key is assigned to a single technology key. The key always has the PLUS function.

    #TOGGLE: Double technology keyTwo keys are assigned to a double technolo-gy key. The top key takes the MINUS func-tion. The bottom key takes the PLUS function.

    Default, if STYLE is not defined: #SWITCH

    Element DescriptionENABLE Activation of the technology key

    TRUE: Technology key is activated.

    FALSE: Technology key is deactivated.

    Default, if ENABLE is not defined: TRUENEED_SAFETY-SWITCH

    TRUE: Technology key is active if the enabling switch is pressed.

    NEED_DRIVESOK TRUE: Technology key is active if the drives are switched on.

    NEED_PROSTATEO Type: INT

    Activation of the technology key is dependent on the operating state of the Submit interpreter.

    Default value: 32 (= technology key is active if the Submit interpreter is running)

    (>>> 6.6.2.2 "Determining the decimal value for activation options" Page 43)

    NEED_PROSTATE Type: INT

    Activation of the technology key is dependent on the operating state of the robot interpreter.

    Default value: 30 (= technology key is active if the Start key is released.)

    (>>> 6.6.2.2 "Determining the decimal value for activation options" Page 43)

    Element Description41 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 42 / 81

    KUKA.UserTech 3.1Call scripts:

    6.6.2.1 Required image sizes

    For the graphics, icons (*.ico) or bitmaps (*.bmp) can be used. The use of icons is recommended.

    The following image sizes are required:

    34 x 48 pixels for a single technology key

    NEED_MODEOP Type: INT

    Activation of the technology key is dependent on the operating mode.

    Default value: 7 (= technology key is active in the operating modes T1, T2 and AUT.)

    Example: For the technology key to be active in all operating modes and when the keyswitch is set to in an invalid position, the value 31 must be programmed.

    (>>> 6.6.2.2 "Determining the decimal value for activation options" Page 43)

    USERMODE Type: INT

    Identification number of the lowest user group for which the technology key is active.

    0: Active in every user group 10: User 20: Expert 30: Administrator

    Default, if USERMODE is not defined: 0

    Element DescriptionONKEYDOWN Name of the script that is run when the key with

    the PLUS function is pressedONKEYUP Name of the script that is run when the key with

    the PLUS function is releasedONKEYSHOW Name of the script that is run when the technolo-

    gy key is activated via the main menuONKEYDOWNMINUS Name of the script that is run when the key with

    the MINUS function is pressedONKEYUPMINUS Name of the script that is run when the key with

    the MINUS function is releasedONKEYREPEAT Name of the script that is run when the key with

    the PLUS function is held down for longer

    The script is repeatedly triggered until the key is released. The interval between repetitions be-comes shorter and shorter.

    ONKEYREPEATMINUS Name of the script that is run when the key with the MINUS function is held down for longer

    The script is repeatedly triggered until the key is released. The interval between repetitions be-comes shorter and shorter.

    Element DescriptionIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming 34 x 128 pixels for a double technology key

    6.6.2.2 Determining the decimal value for activation options

    Description A technology key can be activated in accordance with the operating states of the Submit interpreter or robot interpreter and the operating modes:

    NEED_PROSTATEO (Submit interpreter) NEED_PROSTATE (robot interpreter) NEED_MODEOP (operating modes)

    Procedure 1. In the case of a bit number with the binary value 1, raise 2 to the power of that number.

    2. Add the resulting values.

    Examples NEED_PROSTATEO: Technology key is active if the Submit interpreter is run-ning (default).

    NEED_PROSTATE: Technology key is active if the Start key is released (de-fault).

    NEED_MODEOP: Technology key is active in T1, T2 and AUT (default).

    Operating mode

    Bit number

    Binary value

    Power Decimal value

    ACTIVE 5 1 25 = 32 32

    END 4 0 0RESET 3 0 0STOP 2 0 0FREE 1 0 0UNKNOWN 0 0 0

    Operating mode

    Bit number

    Binary value

    Power Decimal value

    ACTIVE 5 0 0 30END 4 1 24 = 16RESET 3 1 23 = 8STOP 2 1 22 = 4FREE 1 1 21 = 2UNKNOWN 0 0 0

    Operating mode

    Bit number

    Binary value

    Power

    Decimal value

    INVALID 4 0 0 7AUT EXT 3 0 0AUT 2 1 22 = 4T1 1 1 21 = 2T2 0 1 20 = 143 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 44 / 81

    KUKA.UserTech 3.1NEED_MODEOP: Technology key is active in T1, T2 , AUT and AUT EXT, as well as for an invalid keyswitch setting.

    6.6.3 DECL STATKEYBAR

    Description Declaration of a technology key bar

    Syntax DECL STATKEYBAR Name =

    {

    }

    Explanation of the syntax

    6.6.4 SET

    Description Setting a technology key or a technology key bar

    SET can be used within or outside scripts. Within scripts, placeholders that have had their value assigned before execution of the script are allowed, e.g. %INLINEFORM.

    Syntax SET Name=

    Explanation of the syntax

    Operating mode

    Bit number

    Binary value

    Power Decimal value

    INVALID 4 1 24 = 16 31

    AUT EXT 3 1 23 = 8AUT 2 1 22 = 4T1 1 1 21 = 2T2 0 1 20 = 1

    Element DescriptionDECL STATKEYBAR Name of the technology key barSTATKEY[1] STATKEY[4]

    Name of the technology keys

    [1]: First technology key from the top [4]: Last technology key from the top

    Element DescriptionSET Name of the technology key

    The remaining syntax is identical to the syntax fol-lowing "DECL STATKEY Name =". (>>> 6.6.2 "DECL STATKEY" Page 39)

    Name of the technology key barThe remaining syntax is identical to the syntax fol-lowing "DECL STATKEYBAR Name =". (>>> 6.6.3 "DECL STATKEYBAR" Page 44)Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.7 Programming scripts

    6.7.1 DEFSCRIPT ENDSCRIPT

    Description Definition of a script

    Scripts can be linked with the following actions:

    Open or close an inline form. Change or create an inline form. Toggle between the inline forms of a technology package. Press Touch-Up. Press, release, or hold down a technology key. Display a technology key.

    Syntax DEFSCRIPT Name

    Statements

    ENDSCRIPT

    Explanation of the syntax

    6.7.2 SETVAR

    Description Setting a variable in the kernel system

    Syntax SETVAR (FULLPATH[]"String", VALUE[]"String")

    Explanation of the syntax

    Example

    After running the script, the following applies:

    $OUT[20]==TRUE

    6.7.3 SHOWVAR

    Description Reading a variable from the kernel system

    Syntax SHOWVAR (FULLPATH[] "String", PARAM Name)

    Scripts must not be nested.

    Element DescriptionDEFSCRIPT Name of the script

    Element DescriptionFULLPATH Name of the variable

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a variable name with path specification.

    VALUE Value of the variable

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a target value.

    DEFTP MyTech DEFSCRIPT Example SETVAR(FULLPATH[] "$OUT[20]", VALUE[] "TRUE") ENDSCRIPTENDTP45 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 46 / 81

    KUKA.UserTech 3.1Explanation of the syntax

    Example

    After running the script with a program selected in T1 mode, the following mes-sage is displayed in the message window:

    $MODE_OP=#T1

    6.7.4 REDECL

    Description Creating or overwriting a variable in the kernel system

    Syntax REDECL (PATH[] "String", DECLARATION[] "String")

    Explanation of the syntax

    Example

    After running the script with a program selected, the variable "HOME" is cre-ated in the corresponding data list.

    6.7.5 DO

    Description Calling a script

    Syntax DO Name

    Explanation of the syntax

    Element DescriptionFULLPATH Name of the variable

    The parameter reference placeholders in the string are re-placed by the current values. The string is interpreted as a variable name with path specification.

    PARAM Name of the parameter into which the read value is written.

    DEFTP MyTech DECL PARAM MyParam ={VALUE {FREE: DEFAULT[]""}} DEFSCRIPT Example SHOWVAR(FULLPATH[] "MODE_OP", PARAM MyParam)VALUE[] "TRUE") MESSAGE "$MODE_OP=%MyParam" ENDSCRIPTENDTP

    Element DescriptionPATH[] Path name of the new variable

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a variable name with path specification.

    DECLARA-TION[]

    Declaration of the new variable

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a target value.

    DEFTP MyTech DEFSCRIPT Example REDECL(PATH[] "%MODULE/", DECLARATION[] "DECL AXIS HOME= _ {A1 09, A2-90, A3 90, A4 0, A5 0, A6 0}") ENDSCRIPTENDTP

    DEFDAT TEST EXTERNAL DECLARATIONS DECL AXIS HOME={A1 5.5, A2 -95.5, A3 95.5, A4 5.5, A5 5.5, A6 5.5}ENDDAT

    Element DescriptionDO Name of the scriptIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.7.6 MESSAGE

    Description Definition of a one-line message which is displayed in the message window

    Syntax MESSAGE "String"

    Explanation of the syntax

    6.7.7 SWITCH CASE (ELSE) ENDSWITCH

    Description Calls one of several possible scripts, depending on the polling of a variable. The CASE line whose result corresponds to the variable is selected.

    Once the associated script has been executed, the program is resumed after ENDSWITCH.

    If there is no result corresponding to the variable, the CASE ELSE line is se-lected. If this is not present, or no associated script has been defined, no script is executed and the program is resumed after ENDSWITCH.

    Syntax SWITCH InterrogationString

    CASE "ResultString1" DO Script1

    ...

    ENDSWITCH

    Element DescriptionMESSAGE Message that is displayed

    The parameter reference placeholders in the string are replaced by the current values. The string is used as a key for the language system.

    (>>> 6.7.10 "Language system keys for messages and buttons" Page 49)

    SWITCH...CASE(ELSE)...ENDSWITCH blocks must not be nested.47 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 48 / 81

    KUKA.UserTech 3.1Explanation of the syntax

    6.7.8 SWITCH DIALOG CASE ENDSWITCH

    Description Enables a dialog between the program and the user. The dialog is displayed in a separate window. The user answers using buttons that call defined scripts. The responses and corresponding scripts are defined in the CASE lines.

    Once the script has been executed, the program is resumed after END-SWITCH.

    Syntax SWITCH DIALOG "QuestionString"

    CASE "AnswerString1" DO Script1

    CASE "AnswerString2" DO Script2>

    ...

    ENDSWITCH

    Element DescriptionSWITCH Name of the variable to be polled

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a variable name with path specification.

    The following keywords may be used:

    ISCHANGEPolls whether an existing inline form has been opened by pressing Change (= CASE "TRUE") or whether a new inline form has been inserted via the Commands menu (= CASE "FALSE"). (>>> 8.3.2 "Script call after the inline form is modi-fied and created" Page 61)

    DOALWAYSPolls whether toggling between 2 inline forms has occurred (= CASE "TRUE"). (>>> 8.3.3 "Script call after switching to an inline form" Page 62)

    CASE DO Result of polling; name of the script to be executed

    The parameter reference placeholders in the string are replaced by the current values. The string is interpreted as a variable name with path specification.

    CASE ELSE Name of the script to be executed if none of the defined results occur

    SWITCH DIALOG...CASE...ENDSWITCH blocks must not be nested.Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 ProgrammingExplanation of the syntax

    6.7.9 Predefined scripts

    6.7.10 Language system keys for messages and buttons

    Description Messages and button labels are saved in the relevant local language via lan-guage system keys. KXR files with the name Menubar_TPUSER are available for this purpose in C:\KRC\DATA for the languages that can be selected on the KUKA smartHMI.

    The KXR file must contain a module with the name of the technology in which the script is defined. This is a prerequisite for access to the language system.

    In the case of global scripts, the module KUKATPUSER is accessed. For mes-sages and buttons, the appropriate key must be created in the language sys-tem for every language.

    If access to the language system fails, the messages or buttons are not dis-played in the selected language, and the key is shown instead. The name of the technology which contains the script currently being executed is displayed as the source of the message.

    For parameterized outputs, every parameter must be added to the key within braces.

    6.8 Integrating a technology into KUKA smartHMI

    Overview User-defined inline forms and technology keys must be defined in the config-uration file SmartHMI.User.Config. SmartHMI.User.Config is located in the di-rectory C:\KRC\USER.

    Element DescriptionSWITCH DIALOG

    Dialog message that is displayed

    The parameter reference placeholders in the string are replaced by the current values. The string is used as a key for the language system.

    (>>> 6.7.10 "Language system keys for messages and buttons" Page 49)

    CASE Answer displayed on the button

    If no string is defined, no button is displayed.

    The parameter reference placeholders in the string are replaced by the current values. The string is used as a key for the language system.

    (>>> 6.7.10 "Language system keys for messages and buttons" Page 49)

    DO Name of the script executed when the button is pressed

    Name DescriptionACCEPTINLINE-FORM

    The inline form is closed and the modified param-eters are applied.

    CANCELINLINE-FORM

    The inline form is closed and the modified param-eters are not applied.

    END The currently running script is aborted.NOTHING Placeholder for a script49 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 50 / 81

    KUKA.UserTech 3.1The configuration file is used to define menu elements, for example. Menu items entered in these nodes are not backed up. If the technology package or the KUKA System Software is updated, the changes made there are lost.

    User-defined inline forms and technology keys must be defined in separate menu trees in the configuration file SmartHMI.User.Config.

    Inline forms are included in the Commands menu of smartHMI (Com-mandMenu).

    Technology keys are included in the main menu Configuration > Status keys of smartHMI (MainMenu).

    6.8.1 Configuration file SmartHMI.User.Config

    Menu elements of smartHMI are child elements of the following element:

    SmartHMI.User.Config

    We recommend archiving SmartHMI.User.Config before a software update.

    ...

    INLINEFORM 2011 KUKATPUSER;MyTech; _ MyCmd ...

    ...

    ...

    Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 6 Programming6.8.2 Defining menu elements

    Precondition Windows interface

    Procedure 1. Open SmartHMI.User.Config with an XML editor.2. Create menu tree CommandMenu and define the menu elements there

    in order to call inline forms via the Commands menu.

    Element Description

    The element is used to define the menu to which a menu item is added.

    CommandMenu: Menu item is added to the Commands menu.

    MainMenu: Menu item is added to the main menu.

    is a child element of . The element reflects the menu structure.

    The attribute DisplayName contains the name of the menu item in the menu. The name is used as the language system key.

    The MergeOrder attribute defines the position of the menu item in the menu.

    is a child element of . The ele-ment is used to add a menu item to which a function is assigned (e.g. call inline form or display technology keys).

    The attribute DisplayName contains the name of the menu item in the menu. The name is used as the language system key.

    The MergeOrder attribute defines the position of the menu item in the menu.

    is a child element of . The element calls the function of the menu item.

    Variable

    is a child element of . contains 3 arguments.

    PlugInName: Name of the function module INLINEFORM: Inline form USERSTATKEYBAROCX: Technology key bar

    ProcID: Number of the function module 2011: Inline form 11: Technology key bar

    ParamList: Parameters of the function moduleComplete syntax of the parameter list:KUKATPUSER;TechName.IlfName|StatkeybarName TechName: Name of the technology in which the function

    module is defined IlfName: Name of the inline form called by the menu item StatkeybarName: Name of the technology key bar called

    by the menu item

    ...

    51 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 52 / 81

    KUKA.UserTech 3.1 Add the required elements to the menu tree in order to represent menu sequences.

    In the required element, add a ele-ment in order to define the menu item that calls the inline form.

    In the element, add the element with the corresponding arguments.

    3. Create the MainMenu menu tree and define the menu elements there in order to display technology keys via the Configuration > Status keys main menu.

    If they do not yet exist, add the following elements to the element: The two elements form the Configuration > Status keys menu sequence.

    In the second element, add a ele-ment in order to define the menu item that displays the technology keys.

    In the element, add the element with the corresponding arguments.

    4. Save the changes and reboot the robot controller.

    Examples (>>> 8.4 "Examples of integration of technology packages" Page 63)

    If a submenu is added to an existing menu, the display name must exactly match the existing display name. If the names do not match, a new menu item is created.

    ...

    Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 7 Archiving7 Archiving

    7.1 Archiving files

    Description The following technology-specific directories/files are archived:

    C:\KRC\USER\SmartHMI.User.Config C:\KRC\TP\USERTECH\TEMPLATE (KFD files)

    Target locations Archiving can be performed to the following target destinations:

    USB stick in KCP or robot controller Network

    Precondition A KUKA.USB data stick is connected. Or the network path to which the data are to be archived is configured.

    Procedure 1. In the main menu, select File > Archive > Target, and then choose the menu item Configuration or All.

    2. Confirm the request for confirmation with Yes. The archive is created. Once the archiving is completed, this is indicated in the message window.

    7.2 Restoring files

    Precondition If data are to be restored from the USB stick: A KUKA.USB data stick with the archive is connected.

    Procedure 1. In the main menu, select File > Restore > Target, and then choose the menu item Configuration or All.

    2. Confirm the request for confirmation with Yes. Archived files are restored to the robot controller. A message indicates completion of the restoration process.

    3. When data have been restored from the USB stick: remove the stick.4. Reboot the robot controller.

    Detailed information on archiving can be found in the operating and program-ming instructions.53 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 54 / 81

    KUKA.UserTech 3.1Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 8 Examples8 Examples

    8.1 LASER technology

    Program

    Description

    1 DEFTP LASER 2 3 DECL PARAM DataSet = {SHORTNAME[] "WeldDataSet=", _ VALUE {NAME: DEFAULT[] "DataSet1"}} 4 5 DECL PARAM DistanceWay = {SHORTNAME[] "Distance=", _ VALUE {NUMBER: DEFAULT 200, MIN 0, MAX 500, STEP 10}, _ UNIT[] "mm"} 6 7 DECL PARAM DelayTime = {SHORTNAME[] "Delay=", _ VALUE {REAL:DEFAULT 0.8, MIN 0, MAX 20.3, STEP 0.3}, _ UNIT[] "ms"} 8 9 DECL PARAM Pattern = {SHORTNAME[] "WeavePattern=", _ VALUE {LIST: ITEM[1] {ITEM: VALUE[] "PULSE"}, _ ITEM[2] {ITEM: VALUE[] "STEP"}, ITEM[3] {ITEM: VALUE[] "CONT"}}}10 11 DECL FOLD LasOn[2]12 LasOn[1] = "Laser(#ON,%DataSet/,%Pattern/)"13 LasOn[2] = "TRIGGER WHEN DISTANCE=%DistanceWay/ _ DELAY=0 DO LASER_ON=TRUE"1415 DECL FOLD LasOff[2]16 LasOff[1] = "Laser(#OFF)"17 LasOff[2] = "TRIGGER WHEN DISTANCE=0 _ DELAY=%DelayTime/ DO LASER_ON=FALSE"1819 DECL INLINEFORM ON = {PARAM[1] DataSet, PARAM[2] DistanceWay, _ PARAM[3] Pattern, FOLD[1] LasOn}2021 DECL INLINEFORM OFF = {PARAM[1] DelayTime, FOLD[1] LasOff}2223 ENDTP

    Line Description1 Name of the technology3 Declaration of an input box for the weld data set

    Field type Name5 Declaration of an input box for the distance parameter

    Field type Number7 Declaration of an input box for the time parameter

    Field type REAL9 Declaration of a list box for selection of the weld type

    Field type List:

    PULSE STEP CONT

    11 13 Declaration of the fold LasOn: Trigger to activate the laser15 17 Declaration of the fold LasOff: Trigger to deactivate the laser55 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 56 / 81

    KUKA.UserTech 3.1Inline forms

    8.2 Example program for a parameter list

    The example program MyTech is saved as a KFD file in the directory C:\KRC\TP\USERTECH\TEMPLATE.

    19 Declaration of the inline form LASER.ON

    The following boxes are available:

    Input box for the weld data set Input box for the distance parameter List box for selection of the weld type

    LASER.ON is assigned to the fold LasOn.21 Declaration of the inline form LASER.OFF

    The following boxes are available:

    Input box for the time parameter

    LASER.OFF is assigned to the fold LasOff.

    Line Description

    Fig. 8-1: Inline form LASER.OFF

    Fig. 8-2: Inline form LASER.ONIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 8 ExamplesProgram 1 DEFTP MyTech 2 3 DECL PARAM ParamList = {SHORTNAME[] "Val: ", _ VALUE {Name: DEFAULT[] "VAL1"}} 4 5 DECL PARAM LSR_MAX_PWR = {SHORTNAME[] "Maximum Power", _ VALUE {NUMBER: MIN 0, MAX 20000, STEP 100, AUTOLIMIT TRUE, _ DEFAULT 2000}, UNIT[] "W"} 6 7 DECL PARAM LSR_MIN_PWR = {SHORTNAME[] "Minimum Power", _ VALUE {NUMBER: MIN 0, MAX 20000, STEP 100, AUTOLIMIT TRUE, _ DEFAULT 2000}, UNIT[] "W"} 8 9 DECL PARAM LSR_PRG = {SHORTNAME[] "Laser Program", _ VALUE {NUMBER: MIN 1, MAX 79, STEP 1, AUTOLIMIT TRUE, _ DEFAULT 1}}10 11 DECL PARAM SNSR_PRG = {SHORTNAME[] "Sensor Program", _ VALUE {NUMBER: MIN 0, MAX 3, STEP 1, AUTOLIMIT TRUE, _ DEFAULT 1}}1213 DECL PARAM GAS_PRESSURE = {SHORTNAME[] "Cutting Gas", _ VALUE {NUMBER: MIN 0, MAX 8, STEP 1, AUTOLIMIT TRUE, _ DEFAULT 2}, UNIT[] "bar"}1415 DECL PARAM GAS_PRE_FLOW = {SHORTNAME[] "PRE Flow Time", _ VALUE {NUMBERMIN 0, MAX 5000, STEP 100, AUTOLIMIT TRUE, _ DEFAULT 0}, UNIT[] "ms"}1617 DECL PARAM GAS_POST_FLOW = {SHORTNAME[] "POST Flow Time", _ VALUE {NUMBER: MIN 0, MAX 5000, STEP 100, AUTOLIMIT TRUE, _ DEFAULT 0}, UNIT[] "ms"}1819 DECL PARAM LSR_DLY = {SHORTNAME[] "Piercing Time", _ VALUE {NUMBER: MIN 0, MAX 5000, STEP 100, AUTOLIMIT TRUE, _ DEFAULT 0}, UNIT[] "ms"}2021 DECL PARAM PL_LsrTool = {SHORTNAME[] "PLTOOL", _ VAR[] "LSC_TOOL_TYP", SHORTCUT[] "LT", UNIT[] "TOOL", _ VALUE {FREE: DEFAULT[] "_"}} 22 23 DECL FOLD MyFold[1] 24 MyFold[1]= ";test"2526 DECL FOLD PFold[1] 27 PFold[1]= ";ParamList"2829 DECL PLIST LsrTool[8] -> ParamList30 LsrTool[1] = LSR_MAX_PWR 31 LsrTool[2] = LSR_MIN_PWR 32 LsrTool[3] = LSR_PRG 33 LsrTool[4] = SNSR_PRG 34 LsrTool[5] = GAS_PRESSURE 35 LsrTool[6] = GAS_PRE_FLOW 36 LsrTool[7] = GAS_POST_FLOW 37 LsrTool[8] = LSR_DLY3839 DECL INLINEFORM MyCmd = {FOLD[1] MyFold}40 41 DECL INLINEFORM ILF_With_ParamList = FOLD[1] PFold, _ PARAM[1] ParamList}4243 ENDTP57 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 58 / 81

    KUKA.UserTech 3.1Description

    $CONFIG.DAT Structure data type LSC_TOOL_TYP of a data set and the default values of the structure data type must be defined in C:\KRC\ROBOTER\KRC\R1\SYS-TEM\$CONFIG.DAT, in the section User-defined types of the USER GLO-BALS fold.

    Inline form

    Line Description1 Name of the technology3 Declaration of the input box ParamList for the laser data set

    Field type Name

    Note: Parameter lists can only be linked with input boxes with field type Name.

    5 19 Declaration of the parameters of the laser data set

    Field type Number

    LSR_MAX_PWR (Maximum Power) LSR_MIN_PWR (Minimum Power) LSR_PRG (Laser Program) SNSR_PRG (Sensor Program) GAS_PRESSURE (Cutting Gas) GAS_PRE_FLOW (PRE Flow Time) GAS_POST_FLOW (POST Flow Time) LSR_DLY (Piercing Time)

    21 Declaration of the structure of the data set

    Structure data type LSC_TOOL_TYP and the default values of the structure data type must be defined in $CONFIG.DAT, in the section User-defined types of the USER GLOBALS fold.

    23 27 Declaration of the folds29 Declaration of the parameter list

    The assignment "-> ParamList" links the parameter list to the input box "ParamList".

    30 37 Assignment of parameters and sequence of parameters in the data set (= sequence in the option window)

    39, 41 Declaration of the inline forms of the technology package

    MyCmd ILF_With_ParamList

    STRUC LSC_TOOL_TYP _ INT LSR_MAX_PWR,INT LSR_MIN_PWR,INT LSR_Prg, _ REAL SNSR_Prg,INT SNSR_State,REAL GAS_Pressure, _ INT LSR_Dly,INT GAS_Pre_Flow,INT GAS_Post_Flow DECL LSC_TOOL_TYP LTDEFAULT = _ {LSR_MAX_PWR 500,LSR_MIN_PWR 50,LSR_Prg 1, _ SNSR_Prg 1.0,SNSR_State 0,GAS_Pressure 1.0, _ LSR_Dly 100,GAS_Pre_Flow 0,GAS_Post_Flow 0}

    Fig. 8-3: MyTech inline form with parameter listIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 8 ExamplesParameter list

    8.3 Calling scripts via actions

    Overview When defining inline forms, it is possible to specify scripts that are called after the following actions:

    Item Description1 List box containing the inline forms of the technology package

    MyCmd ILF_With_ParamList

    2 Input box ParamList for the laser data set

    The parameters of the data set are set in the PLTOOL option win-dow.

    Fig. 8-4: Option window PLTOOL

    A View A 4 SNSR_PRGB View B 5 GAS_PRESSURE1 LSR_MAX_PWR 6 GAS_PRE_FLOW2 LSR_MIN_PWR 7 GAS_POST_FLOW3 LSR_PRG 8 LSR_DLY59 / 81Issued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 60 / 81

    KUKA.UserTech 3.1 Open or close an inline form. (>>> 8.3.1 "Script call after the inline form is opened and closed" Page 60)

    Change or create an inline form. (>>> 8.3.2 "Script call after the inline form is modified and created" Page 61)

    Toggle between the inline forms of a technology package. (>>> 8.3.3 "Script call after switching to an inline form" Page 62)

    8.3.1 Script call after the inline form is opened and closed

    Program

    Description

    1 DEFTP TEST 2 3 ;--------------------- 4 ;------ Scripts ----- 5 ;--------------------- 6 7 DEFSCRIPT OP_Test 8 MESSAGE "Fired when ILF is opened!" 9 ENDSCRIPT1011 DEFSCRIPT CL_Test12 MESSAGE "Fired when ILF is closed!"13 DO ACCEPTINLINEFORM14 ENDSCRIPT1516 ;---------------------17 ;------ FOLDs -----18 ;---------------------1920 DECL FOLD TestFold[1]21 TestFold[1]="/;only for testing ONOPEN-event"2223 ;---------------------24 ;------ INLINEFORMs -----25 ;---------------------2627 DECL INLINEFORM TestILF={FOLD[1] TestFold, ONOPEN OP_Test, _ ONACCEPT CL_Test}2829 ENDTP

    Line Description7 9 Definition of the script OP_Test

    When the script is called, the message "Fired when ILF is open-ed!" is displayed in the message window.

    11 14 Definition of the script CL_Test

    When the script is called, the message "Fired when ILF is closed!" is displayed in the message window.

    27 Declaration of the inline form

    ONOPEN: keyword for calling a script when the inline form is opened

    ONACCEPT: keyword for calling a script when the inline form is closedIssued: 13.12.2010 Version: KST UserTech 3.1 V1 en

  • 8 Examples8.3.2 Script call after the inline form is modified and created

    Program

    Description

    1 DEFTP TEST 2 3 ;--------------------- 4 ;------ Scripts ----- 5 ;--------------------- 6 7 DEFSCRIPT CH_Test 8 MESSAGE "Fired only when ILF is changed!" 9 ENDSCRIPT1011 DEFSCRIPT NEW_Test12 MESSAGE "Fired only when ILF is created!"13 ENDSCRIPT1415 DEFSCRIPT OP_Test16 SWITCH "ISCHANGE"17 CASE "TRUE" DO CH_Test18 CASE "FALSE" DO MEW_Test19 ENDSWITCH20 ENDSCRIPT2122 DEFSCRIPT CL_Test23 MESSAGE "Fired when ILF is closed!"24 DO ACCEPTINLINEFORM25 ENDSCRIPT2627 ;---------------------28 ;------ FOLDs -----29 ;---------------------3031 DECL FOLD TestFold[1]32 TestFold[1]="/;only for testing ONOPEN-event"3334 ;---------------------35 ;------ INLINEFORMs -----36 ;---------------------37 38 DECL INLINEFORM TestILF={FOLD[1] TestFold, ONOPEN OP_Test, _ ONACCEPT CL_Test}3940 ENDTP

    Line Description7 9 Definition of the script CH_Test

    When the script is called, the message "Fired only when ILF is changed!" is displayed.

    11 13 Definition of the script NEW_Tes