Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

Embed Size (px)

Citation preview

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    1/939

    FANUC Robotics SYSTEMR-J3i B Controller KARELReference Manual

    MARAIKLRF06031E REV A Applies to Version 6.31 and later 

    ©2003 FANUC Robotics America, Inc.

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    2/939

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    3/939

    About This Manual

    Copyrights and Trademarks

    This new publication contains proprietary information of FANUC Robotics America, Inc. furnished

    for customer use only. No other uses are authorized without the express written permission of 

    FANUC Robotics America, Inc.

    FANUC Robotics America, Inc

    3900 W. Hamlin Road

    Rochester Hills, Michigan 48309-3253

    FANUC Robotics America, Inc. The descriptions and specifications contained in this manual were in

    effect at the time this manual was approved. FANUC Robotics America, Inc, hereinafter referred to as

    FANUC Robotics, reserves the right to discontinue models at any time or to change specifications or 

    design without notice and without incurring obligations.

    FANUC Robotics manuals present descriptions, specifications, drawings, schematics, bills of 

    material, parts, connections and/or procedures for installing, disassembling, connecting, operating and

     programming FANUC Robotics’ products and/or systems. Such systems consist of robots, extended

    axes, robot controllers, application software, the KAREL® programming language, INSIGHT®

    vision equipment, and special tools.

    FANUC Robotics recommends that only persons who have been trained in one or more approved

    FANUC Robotics Training Course(s) be permitted to install, operate, use, perform procedures on,

    repair, and/or maintain FANUC Robotics’ products and/or systems and their respective components.

    Approved training necessitates that the courses selected be relevant to the type of system installed

    and application performed at the customer site.

    Warning

    This equipment generates, uses, and can radiate radio frequency energyand if not installed and used in accordance with the instruction manual,may cause interference to radio communications. As temporarilypermitted by regulation, it has not been tested for compliance with thelimits for Class A computing devices pursuant to subpart J of Part 15 of FCC Rules, which are designed to provide reasonable protection againstsuch interference. Operation of the equipment in a residential area is

    likely to cause interference, in which case the user, at his own expense,will be required to take whatever measure may be required to correctthe interference.

    FANUC Robotics conducts courses on its systems and products on a regularly scheduled basis at its

    headquarters in Rochester Hills, Michigan. For additional information contact

    i

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    4/939

    About This Manual MARAIKLRF06031E REV A

    FANUC Robotics America, Inc

    Training Depar tment

    3900 W. Hamlin Road

    Rochester Hills, Michigan 48309-3253

    www.fanucrobotics.com

    For customer assistance, including Technical Support, Service, Parts & Part Repair, and

    Marketing Requests, contact the Customer Resource Center, 24 hours a day, at 1-800-47-ROBOT

    (1-800-477-6268). International customers should call 011-1-248-377-7159.

    Send your comments and suggestions about this manual to:

    [email protected]

    The information illustrated or contained herein is not to be reproduced, copied, translated into another 

    language, or transmitted in whole or in part in any way without the prior written consent of FANUC

    Robotics America, Inc.

    AccuStat®, ArcTool®, KAREL®, PaintTool®, PalletTool®, SOCKETS®, SpotTool®,SpotWorks®, and TorchMate® are Registered Trademarks of FANUC Robotics.

    FANUC Robotics reserves all proprietary rights, including but not limited to trademark and trade

    name rights, in the following names:

    AccuAir™, AccuCal™, AccuChop™, AccuFlow™, AccuPath™, AccuSeal™, ARC Mate™,

    ARC Mate Sr.™, ARC Mate System 1™, ARC Mate System 2™, ARC Mate System 3™, ARC

    Mate System 4™, ARC Mate System 5™, ARCWorks Pro™, AssistTool™, AutoNormal™,

    AutoTCP™, BellTool™, BODYWorks™, Cal Mate™, Cell Finder™, Center Finder™, Clean

    Wall™, CollisionGuard™, DispenseTool™, F-100™, F-200i™, FabTool™, FANUC LASER 

    DRILL™, Flexibell™, FlexTool™, HandlingTool™, HandlingWorks™, INSIGHT™, INSIGHT

    II™, IntelliTrak™, Integrated Process Solution™, Intelligent Assist Device™, IPC -Integrated PumpControl™, IPD Integral Pneumatic Dispenser™, ISA Integral Servo Applicator™, ISD Integral

    Servo Dispenser™, Laser Mate System 3™, Laser Mate System 4™, LaserPro™, LaserTool™,

    LR Tool™, MIG Eye™, MotionParts™, NoBots™, Paint Stick™, PaintPro™, PaintTool 100™,

    PAINTWorks™, PAINTWorks II™, PAINTWorks III™, PalletMate™, PalletMate PC™, PalletTool

    PC™, PayloadID™, RecipTool™, RemovalTool™, Robo Chop™, Robo Spray™, S-420i™,

    S-430i™, ShapeGen™, SoftFloat™, SOFT PARTS™, SpotTool+™, SR Mate™, SR ShotTool™,

    SureWeld™, SYSTEM R-J2 Controller™, SYSTEM R-J3 Controller™, SYSTEM R-J3i MODEL B

    Controller™, TCP Mate™, TorchMate™, TurboMove™, visLOC™, visPRO-3D™, visTRAC™,

    WebServer™, WebTP™, and YagTool™.

    Patents

    One for more of the following U.S. patents might be related to the FANUC Robotics products

    described in this manual.

    ii

    http://-/?-http://-/?-http://-/?-

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    5/939

    MARAIKLRF06031E REV A About This Manual

    3,906,323 4,274,802 4,289,441 4,299,529 4,336,926 4,348,623 4,359,815 4,366,423 4,374,349

    4,396,973 4,396,975 4,396,987 4,406,576 4,415,965 4,416,577 4,430,923 4,431,366 4,458,188

    4,462,748 4,465,424 4,466,769 4,475,160 4,479,673 4,479,754 4,481,568 4,482,289 4,482,968

    4,484,855 4,488,242 4,488,746 4,489,821 4,492,301 4,495,453 4,502,830 4,504,771 4,530,062

    4,530,636 4,538,639 4,540,212 4,542,471 4,543,639 4,544,971 4,549,276 4,549,846 4,552,506

    4,554,497 4,556,361 4,557,660 4,562,551 4,575,666 4,576,537 4,591,944 4,603,286 4,626,756

    4,628,778 4,630,567 4,637,773 4,638,143 4,639,878 4,647,753 4,647,827 4,650,952 4,652,203

    4,653,975 4,659,279 4,659,280 4,663,730 4,672,287 4,679,297 4,680,518 4,697,979 4,698,777

    4,700,118 4,700,314 4,701,686 4,702,665 4,706,000 4,706,001 4,706,003 4,707,647 4,708,175

    4,708,580 4,712,972 4,723,207 4,727,303 4,728,247 4,728,872 4,732,526 4,742,207 4,742,611

    4,750,858 4,753,128 4,754,392 4,771,222 4,773,523 4,773,813 4,774,674 4,775,787 4,776,247

    4,777,783 4,780,045 4,780,703 4,782,713 4,785,155 4,796,005 4,805,477 4,807,486 4,812,836

    4,813,844 4,815,011 4,815,190 4,816,728 4,816,733 4,816,734 4,827,203 4,827,782 4,828,094

    4,829,454 4,829,840 4,831,235 4,835,362 4,836,048 4,837,487 4,842,474 4,851,754 4,852,024

    4,852,114 4,855,657 4,857,700 4,859,139 4,859,845 4,866,238 4,873,476 4,877,973 4,892,457

    4,892,992 4,894,594 4,894,596 4,894,908 4,899,095 4,902,362 4,903,539 4,904,911 4,904,915

    4,906,121 4,906,814 4,907,467 4,908,559 4,908,734 4,908,738 4,916,375 4,916,636 4,920,248

    4,922,436 4,931,617 4,931,711 4,934,504 4,942,539 4,943,759 4,953,992 4,956,594 4,956,7654,965,500 4,967,125 4,969,109 4,969,722 4,969,795 4,970,370 4,970,448 4,972,080 4,972,735

    4,973,895 4,974,229 4,975,920 4,979,127 4,979,128 4,984,175 4,984,745 4,988,934 4,990,729

    5,004,968 5,006,035 5,008,832 5,008,834 5,012,173 5,013,988 5,034,618 5,051,676 5,055,754

    5,057,756 5,057,995 5,060,533 5,063,281 5,063,295 5,065,337 5,066,847 5,066,902 5,075,534

    5,085,619 5,093,552 5,094,311 5,099,707 5,105,136 5,107,716 5,111,019 5,111,709 5,115,690

    5,192,595 5,221,047 5,238,029 5,239,739 5,272,805 5,286,160 5,289,947 5,293,107 5,293,911

    5,313,854 5,316,217 5,331,264 5,367,944 5,373,221 5,421,218 5,423,648 5,434,489 5,644,898

    5670202 5,696,687 5,737,218 5,823,389 5853027 5,887,800 5,941,679 5,959,425 5,987,726

    6,059,092 6,064,168 6,070,109 6,082,797 6,086,294 6,122,062 6,147,323 6,193,621 6,204,620

    6,243,621 6,253,799 6,285,920 6,313,595 6,325,302 6,345,818 6,360,142 6,378,190 6,385,508

    VersaBell, ServoBell and SpeedDock Patents Pending.

    Conventions

    This manual includes information essential to the safety of personnel, equipment, software, and data.

    This information is indicated by headings and boxes in the text.

    Warning

    Information appearing under WARNING concerns the protection of 

    personnel. It is boxed and in bold type to set it apart from other text.

    Caution

    Information appearing under  CAUTION concerns the protection of equipment,software, and data. It is boxed to set it apart from other text.

    iii

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    6/939

    About This Manual MARAIKLRF06031E REV A

    Note  Information appearing next to NOTE concerns related information or useful hints.

    iv

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    7/939

    Contents

    About This Manual   .................................................................................................................................   i

    Safety   ...............................................................................................................................................   xxix

    Chapter 1 KAREL LANGUAGE OVERVIEW   .................................................................................   1– 1

    1.1 OVERVIEW ......................................................................................................................   1– 2

    1.2 KAREL PROGRAMMING LANGUAGE  .............................................................................   1– 21.2.1 Overview ..........................................................................................................................   1– 21.2.2 Entering a Program  ............................................................................................................   1– 4

    1.2.3 Translating a Program   ........................................................................................................   1– 41.2.4 Loading Program Logic and Data  .........................................................................................   1– 41.2.5 Executing a Program  ..........................................................................................................   1– 51.2.6 Execution History   .............................................................................................................   1– 51.2.7 Program Structure   .............................................................................................................   1– 6

    1.3 SYSTEM SOFTWARE   ......................................................................................................   1– 71.3.1 Software Components  ........................................................................................................   1– 71.3.2 Supported Robots  ..............................................................................................................   1– 8

    1.4 CONTROLLERS................................................................................................................   1– 81.4.1 Memory   ..........................................................................................................................   1– 81.4.2 Input/Output System  ........................................................................................................   1– 101.4.3 User Interface Devices   .....................................................................................................   1– 10

    Chapter 2 LANGUAGE ELEMENTS   ............................................................................................   2– 1

    2.1 LANGUAGE COMPONENTS  ............................................................................................   2– 22.1.1 Character Set ....................................................................................................................   2– 22.1.2 Operators .........................................................................................................................   2– 52.1.3 Reserved Words   ................................................................................................................   2– 62.1.4 User-Defined Identifiers   .....................................................................................................   2– 82.1.5 Labels  .............................................................................................................................   2– 92.1.6 Predefined Identifiers   .........................................................................................................   2– 92.1.7 System Variables  .............................................................................................................   2– 132.1.8 Comments   .....................................................................................................................   2– 13

    2.2   TRANSLATOR DIRECTIVES   .......................................................................................   2– 13

    2.3 DATA TYPES   ................................................................................................................   2– 16

    2.4 USER-DEFINED DATA TYPES AND STRUCTURES   .........................................................   2– 17

    2.4.1 User-Defined Data Types  ..................................................................................................   2– 182.4.2 User-Defined Data Structures   ............................................................................................   2– 19

    2.5 ARRAYS .......................................................................................................................   2– 222.5.1 Multi-Dimensional Arrays   ................................................................................................   2– 222.5.2 Variable-Sized Arrays   ......................................................................................................   2– 24

    Chapter 3 USE OF OPERATORS   ................................................................................................   3– 1

    v

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    8/939

    Contents MARAIKLRF06031E REV A

    3.1 EXPRESSIONS AND ASSIGNMENTS  ................................................................................   3– 23.1.1 Rule for Expressions and Assignments  ..................................................................................   3– 23.1.2 Evaluation of Expressions and Assignments   ...........................................................................   3– 23.1.3 Variables and Expressions   ...................................................................................................   3– 4

    3.2 OPERATIONS   .................................................................................................................   3– 43.2.1 Arithmetic Operations  ........................................................................................................   3– 5

    3.2.2 Relational Oper ations  .........................................................................................................   3– 73.2.3 Boolean Operations   ...........................................................................................................   3– 83.2.4 Special Operations  ...........................................................................................................   3– 10

    Chapter 4 MOTION AND PROGRAM CONTROL   .........................................................................   4– 1

    4.1 MOTION CONTROL STATEMENTS   ..................................................................................   4– 24.1.1 Extended Axis Motion   .......................................................................................................   4– 44.1.2 Group Motion ...................................................................................................................   4– 4

    4.2 PROGRAM CONTROL STRUCTURES  ...............................................................................   4– 54.2.1 Alternation Control Structures   .............................................................................................   4– 54.2.2 Looping Control Statements  ................................................................................................   4– 64.2.3 Unconditional Branch Statement   ..........................................................................................   4– 64.2.4 Execution Control Statements   ..............................................................................................   4– 6

    4.2.5 Condition Handlers  ............................................................................................................   4– 7

    Chapter 5 ROUTINES   .................................................................................................................   5– 1

    5.1 ROUTINE EXECUTION   ...................................................................................................   5– 25.1.1 Declaring Routines   ............................................................................................................   5– 25.1.2 Invoking Routines   .............................................................................................................   5– 55.1.3 Returning from Routines   ....................................................................................................   5– 75.1.4 Scope of Variables   .............................................................................................................   5– 85.1.5 Parameters and Arguments  ..................................................................................................   5– 95.1.6 Stack Usage   ...................................................................................................................   5– 13

    5.2 BUILT- IN ROUTINES  ....................................................................................................   5– 16

    Chapter 6 CONDITION HANDLERS   ............................................................................................   6– 1

    6.1 CONDITION HANDLER  OPERATIONS   .............................................................................   6– 36.1.1 Global Condition Handlers  ..................................................................................................   6– 46.1.2 Local Condition Handlers   ...................................................................................................   6– 7

    6.2 CONDITIONS   .................................................................................................................   6– 96.2.1 Port_Id Conditions   ..........................................................................................................   6– 106.2.2 Relational Conditions  .......................................................................................................   6– 106.2.3 System and Program Event Conditions  ................................................................................   6– 126.2.4 Local Conditions  .............................................................................................................   6– 176.2.5 Synchronization of Local Condition Handlers  .......................................................................   6– 18

    6.3 ACTIONS   .....................................................................................................................   6– 206.3.1 Assignment Actions  .........................................................................................................   6– 216.3.2 Motion Related Actions  ....................................................................................................   6– 226.3.3 Routine Call Actions  ........................................................................................................   6– 23

    6.3.4 Miscellaneous Actions   .....................................................................................................   6– 24

    Chapter 7 FILE INPUT/OUTPUT OPERATIONS   ...........................................................................   7– 1

    7.1 FILE VARIABLES  ............................................................................................................   7– 3

    7.2 OPEN FILE STATEMENT   .................................................................................................   7 – 57.2.1 Setting File and Port Attributes   ............................................................................................   7– 5

    vi

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    9/939

    MARAIKLRF06031E REV A Contents

    7.2.2 File String ......................................................................................................................   7– 127.2.3 Usage String ...................................................................................................................   7– 12

    7.3 CLOSE FILE STATEMENT   .............................................................................................   7– 16

    7.4 READ STATEMENT  .......................................................................................................   7– 16

    7.5 WRITE STATEMENT   .....................................................................................................   7– 18

    7.6 INPUT/OUTPUT BUFFER   ...............................................................................................   7– 207.7 FORMATTING TEXT (ASCII) INPUT/OUTPUT  .................................................................   7– 20

    7.7.1 Formatting INTEGER Data Items  .......................................................................................   7– 227.7.2 Formatting REAL Data Items   ............................................................................................   7– 247.7.3 Formatting BOOLEAN Data Items  .....................................................................................   7– 267.7.4 Formatting STRI NG Data Items  .........................................................................................   7– 287.7.5 Formatting VECTOR Data Items  ........................................................................................   7– 317.7.6 Formatting Positional Data Items   .......................................................................................   7– 31

    7.8 FORMATTING BINARY INPUT/OUTPUT   ........................................................................   7– 327.8.1 Formatting INTEGER Data Items  .......................................................................................   7– 347.8.2 Formatting REAL Data Items   ............................................................................................   7– 357.8.3 Formatting BOOLEAN Data Items  .....................................................................................   7– 357.8.4 Formatting STRING Data Items  .........................................................................................   7– 35

    7.8.5 Formatting VECTOR Data Items  ........................................................................................   7– 367.8.6 Formatting POSITION Data Items  ......................................................................................   7– 367.8.7 Formatting XYZWPR Data Items  .......................................................................................   7– 367.8.8 Formatting XYZWPREXT Data Items   ................................................................................   7– 377.8.9 Formatting JOINTPOS Data Items   .....................................................................................   7– 37

    7.9 USER INTERFACE TIPS  .................................................................................................   7– 377.9.1 USER Menu on the Teach Pendant   .....................................................................................   7– 377.9.2 USER Menu on the CRT/KB  .............................................................................................   7– 39

    Chapter 8 MOTION   .....................................................................................................................   8– 1

    8.1 POSITIONAL DATA  .........................................................................................................   8– 2

    8.2 FRAMES OF REFERENCE   ...............................................................................................   8– 48.2.1 World Frame   ....................................................................................................................   8– 5

    8.2.2 User Frame (UFRAME)   .....................................................................................................   8– 58.2.3 Tool Definition (UTOOL)   ...................................................................................................   8– 58.2.4 Using Frames in the Teach Pendant Editor (TP)   ......................................................................   8– 6

    8.3 JOG COORDINATE SYSTEMS  ..........................................................................................   8– 6

    8.4 MOTION CONTROL  ........................................................................................................   8– 78.4.1 Motion Trajectory   ...........................................................................................................   8– 108.4.2 Motion Trajectories with Extended Axes  ..............................................................................   8– 188.4.3 Acceleration and Deceleration   ...........................................................................................   8– 198.4.4 Motion Speed   .................................................................................................................   8– 238.4.5 Motion Termination  .........................................................................................................   8– 288.4.6 Multiple Segment Motion   .................................................................................................   8– 318.4.7 Path Motion   ...................................................................................................................   8– 388.4.8 Motion Times   .................................................................................................................   8– 41

    8.4.9 Correspondence Between Teach Pendant Program Motion and KAREL Program Motion   ..............   8– 45

    Chapter 9 FILE SYSTEM   ............................................................................................................   9– 1

    9.1 FILE SPECIFICATION  ......................................................................................................   9– 39.1.1 Device Name ....................................................................................................................   9– 39.1.2 File Name..........................................................................................................................   9– 49.1.3 File Type...........................................................................................................................   9– 5

    vii

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    10/939

    Contents MARAIKLRF06031E REV A

    9.2 STORAGE DEVICE ACCESS  ............................................................................................   9– 69.2.1 Memory File Devices  .........................................................................................................   9– 79.2.2 Virtual Devices   .................................................................................................................   9– 89.2.3 File Pipes .........................................................................................................................   9– 9

    9.3 FILE ACCESS   ...............................................................................................................   9– 14

    9.4 MEMORY DEVICE   ........................................................................................................   9– 14

    Chapter 10 DICTIONARIES AND FORMS   ...................................................................................   10– 1

    10.1 CREATING USER DICTIONARIES  ..................................................................................   10– 310.1.1 Dictionary Syntax   ...........................................................................................................   10– 310.1.2 Dictionary Element Number   ..............................................................................................   10– 410.1.3 Dictionary Element Name   .................................................................................................   10– 510.1.4 Dictionary Cursor Positioning  ............................................................................................   10– 510.1.5 Dictionary Element Text  ...................................................................................................   10– 610.1.6 Dictionary Reserved Word Commands   ................................................................................   10– 910.1.7 Character Codes  .............................................................................................................   10– 1010.1.8 Nesting Dictionary Elements   ............................................................................................   10– 1010.1.9 Dictionary Comment  .......................................................................................................   10– 11

    10.1.10 Generating a KAREL Constant File   ...................................................................................   10– 11

    10.1.11 Compressing and Loading Dictionaries on the Controller   .......................................................   10– 1110.1.12 Accessing Dictionary Elements from a KAREL Program  .......................................................   10– 12

    10.2 CREATING USER FORMS  .............................................................................................   10– 1310.2.1 Form Syntax ..................................................................................................................   10– 1410.2.2 Form Attributes   .............................................................................................................   10– 1510.2.3 Form Title and Menu Label  ..............................................................................................   10– 1610.2.4 Form Menu Text   ............................................................................................................   10– 1710.2.5 Form Selectable Menu Item  ..............................................................................................   10– 1710.2.6 Edit Data Item   ...............................................................................................................   10– 1810.2.7 Non-Selectable Text  ........................................................................................................   10– 2410.2.8 Display Only Data Items  ..................................................................................................   10– 2410.2.9 Cursor Position Attributes  ................................................................................................   10– 25

    10.2.10 Form Reserved Words and Character Codes   ........................................................................   10– 2510.2.11 Form Function Key Element Name or Number   ....................................................................   10– 27

    10.2.12 Form Help Element Name or Number   ................................................................................   10– 2810.2.13 Teach Pendant Form Screen   .............................................................................................   10– 2810.2.14 CRT/KB Form Screen  .....................................................................................................   10– 2910.2.15 Form File Naming Convention  ..........................................................................................   10– 3010.2.16 Compressing and Loading Forms on the Controller   ...............................................................   10– 3010.2.17 Displaying a Form  ..........................................................................................................   10– 32

    Chapter 11 FULL SCREEN EDITOR   ............................................................................................   11– 1

    11.1 SCREEN LAYOUT  .........................................................................................................   11– 211.1.1 Edit Windows .................................................................................................................   11– 311.1.2 Function Key Line  ...........................................................................................................   11– 5

    11.2 EDITOR COMMAND SUMMARY   ...................................................................................   11– 611.2.1 Cursor Manipulation  .......................................................................................................   11– 13

    11.2.2 Text Scrolling   ................................................................................................................   11– 1411.2.3 Text Insertion and Editing Modes   ......................................................................................   11– 1511.2.4 Text Deletion .................................................................................................................   11– 1611.2.5 Text Find and Replace  .....................................................................................................   11– 1611.2.6 Text Block Manipulation   .................................................................................................   11– 1811.2.7 Window Manipulation  .....................................................................................................   11– 1911.2.8 KAREL Program Translation  ............................................................................................   11– 20

    viii

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    11/939

    MARAIKLRF06031E REV A Contents

    11.2.9 Miscellaneous Editor Commands   ......................................................................................   11– 2011.2.10 File Save and Exit  ..........................................................................................................   11– 21

    Chapter 12 SYSTEM VARIABLES   ...............................................................................................   12– 1

    12.1 ACCESS RIGHTS   ..........................................................................................................   12– 212.1.1 System Variables Accessed by KAREL Programs  ..................................................................   12– 3

    12.2 STORAGE .....................................................................................................................   12– 4

    Chapter 13 KAREL COMMAND LANGUAGE (KCL)   ....................................................................   13– 1

    13.1 COMMAND FORMAT  ....................................................................................................   13– 213.1.1 Default Program  ..............................................................................................................   13– 213.1.2 Variables and Data Types  ..................................................................................................   13– 3

    13.2 MOTION CONTROL COMMANDS   .................................................................................   13– 3

    13.3 ENTERING COMMANDS  ...............................................................................................   13– 313.3.1 Abbreviations  .................................................................................................................   13– 413.3.2 Error Messages   ...............................................................................................................   13– 413.3.3 Subdirectories .................................................................................................................   13– 4

    13.4 COMMAND PROCEDURES  ............................................................................................   13– 4

    13.4.1 Command Procedure Format  .............................................................................................   13– 513.4.2 Creating Command Procedures   ..........................................................................................   13– 613.4.3 Error Processing  ..............................................................................................................   13– 613.4.4 Executing Command Procedures  ........................................................................................   13– 6

    Chapter 14 INPUT/OUTPUT SYSTEM   .........................................................................................   14– 1

    14.1 USER-DEFINED SIG NALS   .............................................................................................   14– 214.1.1 DIN and DOUT Signals  ....................................................................................................   14– 214.1.2 GIN and GOUT Signals  ....................................................................................................   14– 314.1.3 AIN and AOUT Signals  ....................................................................................................   14– 314.1.4 Hand Signals   ..................................................................................................................   14– 6

    14.2 SYSTEM-DEFINED SIGNALS   ........................................................................................   14– 714.2.1 Robot Digital Input and Output Signals (RDI/RDO)  ...............................................................   14– 7

    14.2.2 Operator Panel Input and Output Signals (OPIN/OPOUT)   .......................................................   14– 714.2.3 Teach Pendant Input and Output Signals (TPIN/TPOUT)  .......................................................   14– 19

    14.3   HARDWARE CONFIGURATIONS  ................................................................................   14– 2614.3.1 Modular I/O   ..................................................................................................................   14– 2714.3.2 PROCESS I/O   ...............................................................................................................   14– 3114.3.3 External Operator Panel Signals   ........................................................................................   14– 3314.3.4 Serial Input/Output   .........................................................................................................   14– 37

    Chapter 15 MULTI-TASKING   .......................................................................................................   15– 1

    15.1 MULTI-TASKING TERMINOLOGY  .................................................................................   15– 2

    15.2 INTERPRETER ASSIGNMENT   .......................................................................................   15– 3

    15.3 MOTION CONTROL   ......................................................................................................   15– 3

    15.4 TASK SCHEDULING  .....................................................................................................   15– 415.4.1 Priority Scheduling  ..........................................................................................................   15– 515.4.2 Time Slicing ...................................................................................................................   15– 6

    15.5 STARTING TASKS  .........................................................................................................   15– 615.5.1 Running Programs fr om the User Operator Panel (UOP) PNS Signal   ........................................   15– 715.5.2 Child Tasks   ....................................................................................................................   15– 7

    15.6 TASK CONTROL AND MONITORING  .............................................................................   15– 8

    ix

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    12/939

    Contents MARAIKLRF06031E REV A

    15.6.1 From TPP Programs   ........................................................................................................   15– 815.6.2 From KAREL Programs   ...................................................................................................   15– 815.6.3 From KCL   .....................................................................................................................   15– 9

    15.7 USING SEMAPHOR ES AND TASK SYNCHRONIZATION   .................................................   15– 9

    15.8 USING QUEUES FOR TASK COMMUNICATIONS  ...........................................................   15– 15

    Appendix A KAREL LANGUAGE ALPHABETICAL DESCRIPTION   ...............................................   A– 1A.1 - A - KAREL LANGUAGE DESCRIPTION  ........................................................................   A– 16

    A.1.1 ABORT Action ...............................................................................................................   A– 16A.1.2 ABORT Condition  ...........................................................................................................   A– 16A.1.3 ABORT Statement  ...........................................................................................................   A– 17A.1.4 ABORT_TASK Built-In Procedure  .....................................................................................   A– 17A.1.5 ABS Built-In Function   .....................................................................................................   A– 18A.1.6 ACOS Built-In Function  ...................................................................................................   A– 19A.1.7 ACT_SCREEN Built-In Procedure  .....................................................................................   A– 20A.1.8 ADD_BYNAMEPC Built-In Procedure  ...............................................................................   A– 20A.1.9 ADD_DICT Built-In Procedure   .........................................................................................   A– 22

    A.1.10 ADD_INTPC Built-In Procedure  ........................................................................................   A– 23A.1.11 ADD_REALPC Built-In Procedure   ....................................................................................   A– 24

    A.1.12 ADD_STRINGPC Built-In Procedure  .................................................................................   A– 25A.1.13 %ALPHABETIZE Translator Directive  ...............................................................................   A– 27A.1.14 APPEND_NODE Built-In Procedure   ..................................................................................   A– 27A.1.15 APPEND_QUEUE Built-In Procedure  ................................................................................   A– 28A.1.16 APPROACH Built-In Function   ..........................................................................................   A– 29A.1.17 ARRAY Data Type  ..........................................................................................................   A– 29A.1.18 ARRAY_LEN Built-In Function   ........................................................................................   A– 31A.1.19 ASIN Built-In Function   ....................................................................................................   A– 31A.1.20 Assignment Action  ..........................................................................................................   A– 32A.1.21 Assignment Statement  ......................................................................................................   A– 33A.1.22 AT NODE Condition   .......................................................................................................   A– 35A.1.23 ATAN2 Built-In Function   .................................................................................................   A– 35A.1.24 ATTACH Statement  .........................................................................................................   A– 36A.1.25 ATT_WINDOW_D Built-In Procedure  ................................................................................   A– 37

    A.1.26 ATT_WINDOW_S Built-In Procedure   ................................................................................   A– 38A.1.27 AVL_POS_NUM Built-In Procedure   ..................................................................................   A– 38

    A.2 - B - KAREL LANGUAGE DESCRIPTION   ........................................................................   A– 39A.2.1 BOOLEAN Data Type   .....................................................................................................   A– 39A.2.2 BYNAME Built-In Function   .............................................................................................   A– 41A.2.3 BYTE Data Type  .............................................................................................................   A– 41A.2.4 BYTES_AHEAD Built-In Procedure   ..................................................................................   A– 42A.2.5 BYTES_LEFT Built-In Function  ........................................................................................   A– 44

    A.3 - C - KAREL LANGUAGE DESCRIPTION   ........................................................................   A– 45A.3.1 CALL_PROG Built-In Procedure  .......................................................................................   A– 45A.3.2 CALL_PROGLIN Built-In Procedure   .................................................................................   A– 46A.3.3 CANCEL Action  .............................................................................................................   A– 46A.3.4 CANCEL Statement   ........................................................................................................   A– 47

    A.3.5 CANCEL FILE Statement   ................................................................................................   A– 49A.3.6 CHECK_DICT Built-In Procedure   .....................................................................................   A– 50A.3.7 CHECK_EPOS Built-In Procedure  .....................................................................................   A– 50A.3.8 CHECK_NAME Built-In Procedure   ...................................................................................   A– 51A.3.9 CHR Built-In Function   .....................................................................................................   A– 52

    A.3.10 CLEAR Built-In Procedure  ...............................................................................................   A– 52A.3.11 CLEAR_SEMA Built-In Procedure   ....................................................................................   A– 53A.3.12 CLOSE FILE Statement   ...................................................................................................   A– 54

    x

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    13/939

    MARAIKLRF06031E REV A Contents

    A.3.13 CLOSE HAND Statement  .................................................................................................   A– 54A.3.14 CLOSE_TPE Built-In Procedure  ........................................................................................   A– 55A.3.15 CLR_IO_STAT Built-In Procedure   .....................................................................................   A– 55A.3.16 CLR_PORT_SIM Built-In Procedure   ..................................................................................   A– 56A.3.17 CLR_POS_REG Built-In Procedure   ...................................................................................   A– 56A.3.18 %CMOSVARS Translator Directive   ...................................................................................   A– 57A.3.19 CNC_DYN_DISB Built-In Procedure  .................................................................................   A– 58A.3.20 CNC_DYN_DISE Built-In Procedure   .................................................................................   A– 58A.3.21 CNC_DYN_DISI Built-In Procedure   ..................................................................................   A– 59A.3.22 CNC_DYN_DISP Built-In Procedure   .................................................................................   A– 60A.3.23 CNC_DYN_DISR Built-In Procedure  .................................................................................   A– 60A.3.24 CNC_DYN_DISS Built-In Procedure   .................................................................................   A– 61A.3.25 CNCL_STP_MTN Built-In Procedure  .................................................................................   A– 62A.3.26 CNV_CONF_STR Built-In Procedure  .................................................................................   A– 63A.3.27 CNV_INT_STR Built-In Procedure   ....................................................................................   A– 63A.3.28 CNV_JPOS_REL Built-In Procedure  ..................................................................................   A– 64A.3.29 CNV_REAL_STR Built-In Procedure  .................................................................................   A– 65A.3.30 CNV_REL_JPOS Built-In Procedure   ..................................................................................   A– 66A.3.31 CNV_STR_CONF Built-In Procedure  .................................................................................   A– 67A.3.32 CNV_STR_INT Built-In Procedure   ....................................................................................   A– 67A.3.33 CNV_STR_REAL Built-In Procedure   .................................................................................   A– 68A.3.34 CNV_STR_TIME Built-In Procedure   .................................................................................   A– 69A.3.35 CNV_TIME_STR Built-In Procedure   .................................................................................   A– 69A.3.36 %COMMENT Translator Directive   ....................................................................................   A– 70A.3.37 COMMON_ASSOC Data Type   .........................................................................................   A– 71A.3.38 CONDITION...ENDCONDITION Statement   .......................................................................   A– 72A.3.39 CONFIG Data Type  .........................................................................................................   A– 73A.3.40 CONNECT TIMER Statement  ...........................................................................................   A– 74A.3.41 CONTINUE Action  .........................................................................................................   A– 75A.3.42 CONTINUE Condition  .....................................................................................................   A– 76A.3.43 CONT_TASK Built-In Procedure  .......................................................................................   A– 76A.3.44 COPY_FILE Built-In Procedure  .........................................................................................   A– 77A.3.45 COPY_PATH Built-In Procedure  ........................................................................................   A– 78A.3.46 COPY_QUEUE Built-In Procedure   ....................................................................................   A– 80

    A.3.47 COPY_TPE Built-In Procedure  ..........................................................................................   A– 82A.3.48 COS Built-In Function   .....................................................................................................   A– 82A.3.49 CR Input/Output Item   ......................................................................................................   A– 83A.3.50 CREATE_TPE Built-In Procedure  ......................................................................................   A– 84A.3.51 CREATE_VAR Built-In Procedure   .....................................................................................   A– 85A.3.52 %CRTDEVICE ...............................................................................................................   A– 87A.3.53 CURJPOS Built-In Function   .............................................................................................   A– 88A.3.54 CURPOS Built-In Function   ...............................................................................................   A– 89A.3.55 CURR_PROG Built-In Function   ........................................................................................   A– 90

    A.4 - D - KAREL LANGUAGE DESCRIPTION  ........................................................................   A– 90A.4.1 DAQ_CHECKP Built-In Procedure  ....................................................................................   A– 90A.4.2 DAQ_REGPIPE Built-In Procedure  ....................................................................................   A– 91A.4.3 DAQ_START Built-In Procedure  .......................................................................................   A– 93A.4.4 DAQ_STOP Built-In Procedure   .........................................................................................   A– 95

    A.4.5 DAQ_UNREG Built-In Procedure  ......................................................................................   A– 96A.4.6 DAQ_WRITE Built-In Procedure  .......................................................................................   A– 97A.4.7 %DEFGROUP Translator Directive  ....................................................................................   A– 99A.4.8 DEF_SCREEN Built-In Pr ocedure   ...................................................................................   A– 100A.4.9 DEF_WINDOW Built-In Procedure  ..................................................................................   A– 100

    A.4.10 %DELAY Translator Directive   ........................................................................................   A– 102A.4.11 DELAY Statement  .........................................................................................................   A– 102

    xi

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    14/939

    Contents MARAIKLRF06031E REV A

    A.4.12 DELETE_FILE Built-In Procedure  ...................................................................................   A– 103A.4.13 DELETE_NODE Built-In Procedure  .................................................................................   A– 104A.4.14 DELETE_QUEUE Built-In Procedure  ...............................................................................   A– 104A.4.15 DEL_INST_TPE Built-In Procedure  .................................................................................   A– 105A.4.16 DET_WINDOW Built-In Procedure   .................................................................................   A– 106A.4.17 DISABLE CONDITION Action  .......................................................................................   A– 106A.4.18 DISABLE CONDITION Statement   ..................................................................................   A– 107A.4.19 DISCONNECT TIMER Statement   ...................................................................................   A– 108A.4.20 DISCTRL_ALPH Built_In Procedure   ...............................................................................   A– 109A.4.21 DISCTRL_FORM Built_In Procedure  ...............................................................................   A– 111A.4.22 DISCTRL_LIST Built-In Procedure  ..................................................................................   A– 113A.4.23 DISCTRL_PLMN Built-In Procedure   ...............................................................................   A– 114A.4.24 DISCTRL_SBMN Built-In Procedure  ...............................................................................   A– 116A.4.25 DISCTRL_TBL Built-In Procedure   ..................................................................................   A– 119A.4.26 DISMOUNT_DEV Built-In Procedure   ..............................................................................   A– 122A.4.27 DISP_DAT_T Data Type   ................................................................................................   A– 122

    A.5 - E - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 124A.5.1 ENABLE CONDITION Action   .......................................................................................   A– 124A.5.2 ENABLE CONDITION Statement   ...................................................................................   A– 124A.5.3 %ENVIRONMENT Translator Directive  ...........................................................................   A– 125

    A.5.4 ERR_DATA Built-In Procedure   .......................................................................................   A– 127A.5.5 ERROR Condition  .........................................................................................................   A– 128A.5.6 EVAL Clause   ...............................................................................................................   A– 129A.5.7 EVENT Condition  .........................................................................................................   A– 129A.5.8 EXP Built-In Function   ...................................................................................................   A– 130

    A.6 - F - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 131A.6.1 FILE Data Type   ............................................................................................................   A– 131A.6.2 FILE_LIST Built-In Procedure   ........................................................................................   A– 131A.6.3 FOR...ENDFOR Statement   .............................................................................................   A– 133A.6.4 FORCE_SPMENU Built-In Procedure  ..............................................................................   A– 134A.6.5 FORMAT_DEV Built-In Procedure  ..................................................................................   A– 137A.6.6 FRAME Built-In Function   ..............................................................................................   A– 138A.6.7 FROM Clause   ..............................................................................................................   A– 139

    A.7 - G - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 140A.7.1 GET_ATTR_PRG Built-In Procedure   ...............................................................................   A– 140A.7.2 GET_FILE_POS Built-In Function  ...................................................................................   A– 142A.7.3 GET_JPOS_REG Built-In Function  ..................................................................................   A– 143A.7.4 GET_JPOS_TPE Built-In Function  ...................................................................................   A– 144A.7.5 GET_PORT_ASG Built-in Procedure   ...............................................................................   A– 145A.7.6 GET_PORT_ATR Built-In Function   .................................................................................   A– 146A.7.7 GET_PORT_CMT Built-In Procedure  ...............................................................................   A– 149A.7.8 GET_PORT_MOD Built-In Procedure   ..............................................................................   A– 149A.7.9 GET_PORT_SIM Built-In Procedure  ................................................................................   A– 151

    A.7.10 GET_PORT_VAL Built-In Procedure  ................................................................................   A– 152A.7.11 GET_POS_FRM Built-In Procedure   .................................................................................   A– 152A.7.12 GET_POS_REG Built-In Function   ...................................................................................   A– 153A.7.13 GET_POS_TPE Built-In Function   ....................................................................................   A– 154

    A.7.14 GET_POS_TYP Built-In Procedure  ..................................................................................   A– 155A.7.15 GET_PREG_CMT Built-In-Procedure................................................................................   A– 156A.7.16 GET_QUEUE Built-In Procedure  .....................................................................................   A– 156A.7.17 GET_REG Built-In Procedure   .........................................................................................   A– 158A.7.18 GET_REG_CMT............................................................................................................   A– 158A.7.19 GET_TIME Built-In Procedure  .........................................................................................   A– 159A.7.20 GET_TPE_CMT Built-in Procedure   .................................................................................   A– 160

    xii

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    15/939

    MARAIKLRF06031E REV A Contents

    A.7.21 GET_TPE_PRM Built-in Procedure   .................................................................................   A– 161A.7.22 GET_TSK_INFO Built-In Procedure   ................................................................................   A– 163A.7.23 GET_VAR Built-In Procedure   .........................................................................................   A– 165A.7.24 GO TO Statement  ..........................................................................................................   A– 167A.7.25 GROUP_ASSOC Data Type  ............................................................................................   A– 168

    A.8 - H - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 169

    A.8.1 HOLD Action ...............................................................................................................   A– 169A.8.2 HOLD Statement   ..........................................................................................................   A– 170

    A.9 - I - KAREL LANGUAGE DESCRIPTION   .......................................................................   A– 171A.9.1 IF ... ENDIF Statement   ..................................................................................................   A– 171A.9.2 IN Clause   ....................................................................................................................   A– 172A.9.3 %INCLUDE Translator Directive  .....................................................................................   A– 173A.9.4 INDEX Built-In Function   ...............................................................................................   A– 174A.9.5 INI_DYN_DISB Built-In Procedure   .................................................................................   A– 174A.9.6 INI_DYN_DISE Built-In Procedure  ..................................................................................   A– 176A.9.7 INI_DYN_DISI Built-In Procedure   ..................................................................................   A– 177A.9.8 INI_DYN_DISP Built-In Procedure  ..................................................................................   A– 179A.9.9 INI_DYN_DISR Built-In Procedure   .................................................................................   A– 180

    A.9.10 INI_DYN_DISS Built-In Procedure  ..................................................................................   A– 181A.9.11 INIT_QUEUE Built-In Procedure   ....................................................................................   A– 182A.9.12 INIT_TBL Built-In Procedure   .........................................................................................   A– 183A.9.13 IN_RANGE Built-In Function   .........................................................................................   A– 195A.9.14 INSERT_NODE Built-In Procedure  ..................................................................................   A– 196A.9.15 INSERT_QUEUE Built-In Procedure  ................................................................................   A– 197A.9.16 INTEGER Data Type  .....................................................................................................   A– 198A.9.17 INV Built-In Function   ....................................................................................................   A– 199A.9.18 IO_MOD_TYPE Built-In Procedure  .................................................................................   A– 200A.9.19 IO_STATUS Built-In Function  .........................................................................................   A– 201

    A.10 - J - KAREL LANGUAGE DESCRIPTION  .......................................................................   A– 203A.10.1 J_IN_RANGE Built-In Function   ......................................................................................   A– 203A.10.2 JOINTPOS Data Type  ....................................................................................................   A– 203A.10.3 JOINT2POS Built-In Function  .........................................................................................   A– 204

    A.11 - K - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 205

    A.11.1 KCL Built-In Procedure   .................................................................................................   A– 205A.11.2 KCL_NO_WAIT Built-In Procedure  .................................................................................   A– 206A.11.3 KCL_STATUS Built-In Procedure  ....................................................................................   A– 207

    A.12 - L - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 208A.12.1 LN Built-In Function   .....................................................................................................   A– 208A.12.2 LOAD Built-In Procedure  ...............................................................................................   A– 208A.12.3 LOAD_STATUS Built-In Procedure   .................................................................................   A– 209A.12.4 LOCK_GROUP Built-In Procedure   ..................................................................................   A– 210A.12.5 %LOCKGROUP Translator Directive   ...............................................................................   A– 212

    A.13 - M - KAREL LANGUAGE DESCRIPTION  .....................................................................   A– 213A.13.1 MIRROR Built-In Function  .............................................................................................   A– 213A.13.2 MODIFY_QUEUE Built-In Procedure   ..............................................................................   A– 215A.13.3 MOTION_CTL Built-In Function   ....................................................................................   A– 216

    A.13.4 MOUNT_DEV Built-In Procedure   ...................................................................................   A– 217A.13.5 MOVE ABOUT Statement  ..............................................................................................   A – 217A.13.6 MOVE ALONG Statement   .............................................................................................   A– 219A.13.7 MOVE AWAY Statement  ................................................................................................   A– 220A.13.8 MOVE AXIS Statement   .................................................................................................   A– 222A.13.9 MOVE_FILE Built-In Procedure  ......................................................................................   A– 223

    A.13.10 MOVE NEAR Statement  ................................................................................................   A– 224

    xiii

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    16/939

    Contents MARAIKLRF06031E REV A

    A.13.11 MOVE RELATIVE Statement   .........................................................................................   A– 225A.13.12 MOVE TO Statement  .....................................................................................................   A– 227A.13.13 MSG_CONNECT Built-In Procedure   ...............................................................................   A– 228A.13.14 MSG_DISCO Built-In Procedure   .....................................................................................   A– 229A.13.15 MSG_PING  .................................................................................................................   A– 230

    A.14 - N - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 231

    A.14.1 NOABORT Action  ........................................................................................................   A – 231A.14.2 %NOABORT Translator Directive   ...................................................................................   A– 232A.14.3 %NOBUSYLAMP Translator Directive   ............................................................................   A– 232A.14.4 NODE_SIZE Built-In Function  ........................................................................................   A– 232A.14.5 %NOLOCKGROUP Translator Directive   ..........................................................................   A– 234A.14.6 NOMESSAGE Action  ....................................................................................................   A– 235A.14.7 NOPAUSE Action  .........................................................................................................   A– 236A.14.8 %NOPAUSE Translator Directive   ....................................................................................   A– 236A.14.9 %NOPAUSESHFT Translator Directive   ............................................................................   A– 237

    A.14.10 NOWAIT Clause  ...........................................................................................................   A– 237

    A.15 - O - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 238A.15.1 OPEN FILE Statement  ...................................................................................................   A– 238A.15.2 OPEN HAND Statement  .................................................................................................   A– 239A.15.3 OPEN_TPE Built-In Procedure  ........................................................................................   A– 239A.15.4 ORD Built-In Function  ...................................................................................................   A– 241A.15.5 ORIENT Built-In Function  ..............................................................................................   A– 241

    A.16 - P - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 242A.16.1 PATH Data Type   ...........................................................................................................   A– 242A.16.2 PATH_LEN Built-In Function  ..........................................................................................   A– 245A.16.3 PAUSE Action ..............................................................................................................   A– 245A.16.4 PAUSE Condition   .........................................................................................................   A– 246A.16.5 PAUSE Statement   .........................................................................................................   A– 247A.16.6 PAUSE_TASK Built-In Procedure  ....................................................................................   A– 248A.16.7 PEND_SEMA Built-In Procedure   ....................................................................................   A– 249A.16.8 PIPE_CONFIG Built-In Procedure   ...................................................................................   A– 249A.16.9 POP_KEY_RD Built-In Procedure  ...................................................................................   A– 250

    A.16.10 Port_Id Action ..............................................................................................................   A– 251

    A.16.11 Port_Id Condition  ..........................................................................................................   A– 252A.16.12 POS Built-In Function  ....................................................................................................   A– 253A.16.13 POS2JOINT Built-In Function  .........................................................................................   A– 253A.16.14 POS_REG_TYPE Built-In Procedure  ................................................................................   A– 255A.16.15 POSITION Data Type  ....................................................................................................   A– 257A.16.16 POST_ERR Built-In Pr ocedure  ........................................................................................   A– 258A.16.17 POST_SEMA Built-In Procedure  .....................................................................................   A– 259A.16.18 PRINT_FILE Built-In Procedure  ......................................................................................   A– 259A.16.19 %PRIORITY Translator  Directive   ....................................................................................   A– 260A.16.20 PROG_LIST Built-In Procedure  .......................................................................................   A– 260A.16.21 PROGRAM Statement   ...................................................................................................   A– 262A.16.22 PULSE Action ..............................................................................................................   A– 263A.16.23 PULSE Statement   .........................................................................................................   A– 263A.16.24 PURGE CONDITION Statement   .....................................................................................   A– 265

    A.16.25 PURGE_DEV Built-In Procedure  .....................................................................................   A– 265A.16.26 PUSH_KEY_RD Built-In Procedure  .................................................................................   A– 266

    A.17 - Q - KAREL LANGUAGE DESCRIPTION  ......................................................................   A– 268A.17.1 QUEUE_TYPE Data Type  ..............................................................................................   A– 268

    A.18 - R - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 268A.18.1 READ Statement  ...........................................................................................................   A– 268A.18.2 READ_DICT Built-In Procedure  ......................................................................................   A– 270

    xiv

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    17/939

    MARAIKLRF06031E REV A Contents

    A.18.3 READ_DICT_V Built-In-Procedure   .................................................................................   A– 271A.18.4 READ_KB Built-In Procedure  .........................................................................................   A– 273A.18.5 REAL Data Type  ...........................................................................................................   A – 277A.18.6 Relational Condition  ......................................................................................................   A– 278A.18.7 RELAX HAND Statement  ..............................................................................................   A– 279A.18.8 RELEASE Statement   .....................................................................................................   A– 280A.18.9 REMOVE_DICT Built-In Procedure  .................................................................................   A– 281

    A.18.10 RENAME_FILE Built-In Procedure   .................................................................................   A– 282A.18.11 RENAME_VAR Built-In Procedure  ..................................................................................   A– 282A.18.12 RENAME_VARS Built-In Procedure  ................................................................................   A– 283A.18.13 REPEAT ... UNTIL Statement  .........................................................................................   A– 284A.18.14 RESET Built-In Procedure  ..............................................................................................   A– 285A.18.15 RESUME Action   ..........................................................................................................   A– 285A.18.16 RESUME Statement   ......................................................................................................   A– 286A.18.17 RETURN Statement   ......................................................................................................   A– 287A.18.18 ROUND Built-In Function   ..............................................................................................   A– 287A.18.19 ROUTINE Statement  .....................................................................................................   A– 288A.18.20 RUN_TASK Built-In Procedure   .......................................................................................   A– 289

    A.19 - S - KAREL LANGUAGE DESCRIPTION   ......................................................................   A– 291A.19.1 SAVE Built-In Procedure  ................................................................................................   A– 291

    A.19.2 SAVE_DRAM Built-In Procedure......................................................................................   A– 292A.19.3 SELECT ... ENDSELECT Statement   ................................................................................   A– 292A.19.4 SELECT_TPE Built-In Procedure  ....................................................................................   A– 293A.19.5 SEMA_COUNT Built-In Function   ...................................................................................   A– 294A.19.6 SEMAPHORE Condition   ...............................................................................................   A– 295A.19.7 SEND_DATAPC Built-In Procedure  .................................................................................   A– 295A.19.8 SEND_EVENTPC Built-In Procedure  ...............................................................................   A– 296A.19.9 SET_ATTR_PRG Built-In Procedure   ................................................................................   A– 297

    A.19.10 SET_CURSOR Built-In Procedure   ...................................................................................   A– 299A.19.11 SET_EPOS_REG Built-In Procedure  ................................................................................   A– 299A.19.12 SET_EPOS_TPE Built-In Procedure  .................................................................................   A– 301A.19.13 SET_FILE_ATR Built-In Procedure   .................................................................................   A– 301A.19.14 SET_FILE_POS Built-In Procedure  ..................................................................................   A– 302A.19.15 SET_INT_REG Built-In Procedure  ...................................................................................   A– 303

    A.19.16 SET_JPOS_REG Built-In Procedure  .................................................................................   A– 304A.19.17 SET_JPOS_TPE Built-In Procedure   .................................................................................   A– 305A.19.18 SET_LANG Built-In Pr ocedure   .......................................................................................   A– 305A.19.19 SET_PERCH Built-In Procedure  ......................................................................................   A– 306A.19.20 SET_PORT_ASG Built-In Procedure  ................................................................................   A– 307A.19.21 SET_PORT_ATR Built-In Function   ..................................................................................   A– 309A.19.22 SET_PORT_CMT Built-In Procedure   ...............................................................................   A– 311A.19.23 SET_PORT_MOD Built-In Procedure  ...............................................................................   A– 312A.19.24 SET_PORT_SIM Built-In Procedure  .................................................................................   A– 313A.19.25 SET_PORT_VAL Built-In Procedure  ................................................................................   A– 314A.19.26 SET_POS_REG Built-In Procedure  ..................................................................................   A– 315A.19.27 SET_POS_TPE Built-In Procedure  ...................................................................................   A– 316A.19.28 SET_PREG_CMT Built-In-Procedure  ................................................................................   A– 317A.19.29 SET_REAL_REG Built-In Procedure   ...............................................................................   A– 317

    A.19.30 SET_REG_CMT Built-In-Procedure  ..................................................................................   A– 318A.19.31 SET_TIME Built-In Procedure   ........................................................................................   A– 318A.19.32 SET_TPE_CMT Built-In Procedure  ..................................................................................   A– 320A.19.33 SET_TRNS_TPE Built-In Procedure   ................................................................................   A– 320A.19.34 SET_TSK_ATTR Built-In Procedure   ................................................................................   A– 321A.19.35 SET_TSK_NAME Built-In Procedure  ...............................................................................   A– 322A.19.36 SET_VAR Built-In Procedure   ..........................................................................................   A– 323

    xv

  • 8/18/2019 Karel Reference Manual Ver.6.31 [Maraiklrf06031e Rev a]

    18/939

    Contents MARAIKLRF06031E REV A

    A.19.37 SHORT Data Type  .........................................................................................................   A– 324A.19.38 SIGNAL EVENT Action  ................................................................................................   A– 325A.19.39 SIGNAL EVENT Statement  ............................................................................................   A– 325A.19.40 SIGNAL SEMAPHORE Action  .......................................................................................   A– 326A.19.41 SIN Built-In Function   ....................................................................................................   A– 326A.19.42 SQRT Built-In Function   ...................................................................................