fanuc robotics system r-30ia and r-30ib...

912
FANUC Robotics SYSTEM R-30iA and R-30iB Controller KAREL Reference Manual MARRC75KR07091E Rev D Applies to Version 7.50 and higher © 2012 FANUC Robotics America Corporation

Upload: nguyendang

Post on 13-Apr-2018

735 views

Category:

Documents


56 download

TRANSCRIPT

  • FANUC Robotics SYSTEMR-30iA and R-30iB ControllerKAREL Reference ManualMARRC75KR07091E Rev DApplies to Version 7.50 and higher

    2012 FANUC Robotics America Corporation

  • About This ManualThis manual can be used with controllers labeled R-30iA or R-J3iC. If you have a controller labeledR-J3iC, you should read R-30iA as R-J3iC throughout this manual.

    Copyrights and Trademarks

    This new publication contains proprietary information of FANUC Robotics America Corporation,furnished for customer use only. No other uses are authorized without the express written permissionof FANUC Robotics America Corporation.

    FANUC Robotics America Corporation3900 W. Hamlin RoadRochester Hills, MI 48309-3253

    The descriptions and specifications contained in this manual were in effect at the time this manualwas approved. FANUC Robotics America Corporation, hereinafter referred to as FANUC Robotics,reserves the right to discontinue models at any time or to change specifications or design withoutnotice and without incurring obligations.

    FANUC Robotics manuals present descriptions, specifications, drawings, schematics, bills ofmaterial, parts, connections and/or procedures for installing, disassembling, connecting, operating andprogramming FANUC Robotics products and/or systems. Such systems consist of robots, extendedaxes, robot controllers, application software, the KAREL programming language, INSIGHTvision equipment, and special tools.

    FANUC Robotics recommends that only persons who have been trained in one or more approvedFANUC 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 installedand 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 ofFCC Rules, which are designed to provide reasonable protection againstsuch interference. Operation of the equipment in a residential area islikely 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.

    i

  • About This Manual MARRC75KR07091E Rev D

    FANUC Robotics conducts courses on its systems and products on a regularly scheduled basis at itsheadquarters in Rochester Hills, Michigan. For additional information contact

    FANUC Robotics America Corporation3900 W. Hamlin RoadRochester Hills, MI 48309-3253

    www.fanucrobotics.com

    For customer assistance, including Technical Support, Service, Parts & Part Repair, andMarketing 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, downloaded,translated into another language, distributed, or published in any physical or electronic format,including Internet, or transmitted in whole or in part in any way without the prior written consentof FANUC Robotics America, Inc.

    AccuStat, ArcTool, iRVision, KAREL, PaintTool,PalletTool, SOCKETS, SpotTool,SpotWorks, and TorchMateare Registered Trademarks of FANUC Robotics.

    FANUC Robotics reserves all proprietary rights, including but not limited to trademark and tradename 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, ARCMate System 4, ARC Mate System 5, ARCWorks Pro, AssistTool, AutoNormal,AutoTCP, BellTool, BODYWorks, Cal Mate, Cell Finder, Center Finder, Clean Wall,DualARM, LR Tool, MIG Eye, MotionParts, MultiARM, NoBots, Paint Stick,PaintPro, PaintTool 100, PAINTWorks, PAINTWorks II, PAINTWorks III, PalletMate,PalletMate PC, PalletTool PC, PayloadID, RecipTool, RemovalTool, Robo Chop, RoboSpray, S-420i, S-430i, ShapeGen, SoftFloat, SOFT PARTS, SpotTool+, SR Mate,SR ShotTool, SureWeld, SYSTEM R-J2 Controller, SYSTEM R-J3 Controller, SYSTEMR-J3iB Controller, SYSTEM R-J3iC Controller, SYSTEM R-30iA Controller, SYSTEMR-30iB Controller, TCP Mate, TorchMate, TripleARM, TurboMove, visLOC,visPRO-3D, visTRAC, WebServer, WebTP, and YagTool.

    Patents

    One or more of the following U.S. patents might be related to the FANUC Robotics productsdescribed in this manual.

    ii

    http://www.fanucrobotics.commailto:[email protected]

  • MARRC75KR07091E Rev D About This Manual

    FRA Patent List

    4,630,567 4,639,878 4,707,647 4,708,175 4,708,580 4,942,539 4,984,745 5,238,029 5,239,7395,272,805 5,293,107 5,293,911 5,331,264 5,367,944 5,373,221 5,421,218 5,434,489 5,644,8985,670,202 5,696,687 5,737,218 5,823,389 5,853,027 5,887,800 5,941,679 5,959,425 5,987,7266,059,092 6,064,168 6,070,109 6,086,294 6,122,062 6,147,323 6,204,620 6,243,621 6,253,7996,285,920 6,313,595 6,325,302 6,345,818 6,356,807 6,360,143 6,378,190 6,385,508 6,425,1776,477,913 6,490,369 6,518,980 6,540,104 6,541,757 6,560,513 6,569,258 6,612,449 6,703,0796,705,361 6,726,773 6,768,078 6,845,295 6,945,483 7,149,606 7,149,606 7,211,978 7,266,4227,399,363

    FANUC LTD Patent List

    4,571,694 4,626,756 4,700,118 4,706,001 4,728,872 4,732,526 4,742,207 4,835,362 4,894,5964,899,095 4,920,248 4,931,617 4,934,504 4,956,594 4,967,125 4,969,109 4,970,370 4,970,4484,979,127 5,004,968 5,006,035 5,008,834 5,063,281 5,066,847 5,066,902 5,093,552 5,107,7165,111,019 5,130,515 5,136,223 5,151,608 5,170,109 5,189,351 5,267,483 5,274,360 5,292,0665,300,868 5,304,906 5,313,563 5,319,443 5,325,467 5,327,057 5,329,469 5,333,242 5,337,1485,371,452 5,375,480 5,418,441 5,432,316 5,440,213 5,442,155 5,444,612 5,449,875 5,451,8505,461,478 5,463,297 5,467,003 5,471,312 5,479,078 5,485,389 5,485,552 5,486,679 5,489,7585,493,192 5,504,766 5,511,007 5,520,062 5,528,013 5,532,924 5,548,194 5,552,687 5,558,1965,561,742 5,570,187 5,570,190 5,572,103 5,581,167 5,582,750 5,587,635 5,600,759 5,608,2995,608,618 5,624,588 5,630,955 5,637,969 5,639,204 5,641,415 5,650,078 5,658,121 5,668,6285,687,295 5,691,615 5,698,121 5,708,342 5,715,375 5,719,479 5,727,132 5,742,138 5,742,1445,748,854 5,749,058 5,760,560 5,773,950 5,783,922 5,799,135 5,812,408 5,841,257 5,845,0535,872,894 5,887,122 5,911,892 5,912,540 5,920,678 5,937,143 5,980,082 5,983,744 5,987,5915,988,850 6,023,044 6,032,086 6,040,554 6,059,169 6,088,628 6,097,169 6,114,824 6,124,6936,140,788 6,141,863 6,157,155 6,160,324 6,163,124 6,177,650 6,180,898 6,181,096 6,188,1946,208,105 6,212,444 6,219,583 6,226,181 6,236,011 6,236,896 6,250,174 6,278,902 6,279,4136,285,921 6,298,283 6,321,139 6,324,443 6,328,523 6,330,493 6,340,875 6,356,671 6,377,8696,382,012 6,384,371 6,396,030 6,414,711 6,424,883 6,431,018 6,434,448 6,445,979 6,459,9586,463,358 6,484,067 6,486,629 6,507,165 6,654,666 6,665,588 6,680,461 6,696,810 6,728,4176,763,284 6,772,493 6,845,296 6,853,881 6,888,089 6,898,486 6,917,837 6,928,337 6,965,0916,970,802 7,038,165 7,069,808 7,084,900 7,092,791 7,133,747 7,143,100 7,149,602 7,131,8487,161,321 7,171,041 7,174,234 7,173,213 7,177,722 7,177,439 7,181,294 7,181,313 7,280,6877,283,661 7,291,806 7,299,713 7,315,650 7,324,873 7,328,083 7,330,777 7,333,879 7,355,7257,359,817 7,373,220 7,376,488 7,386,367 7,464,623 7,447,615 7,445,260 7,474,939 7,486,8167,495,192 7,501,778 7,502,504 7,508,155 7,512,459 7,525,273 7,526,121

    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.

    iii

  • About This Manual MARRC75KR07091E Rev D

    Warning

    Information appearing under WARNING concerns the protection ofpersonnel. 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.

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

    iv

  • Contents

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

    Safety .............................................................................................................................................. xxvii

    Chapter 1 KAREL LANGUAGE OVERVIEW ................................................................................ 111.1 OVERVIEW .................................................................................................................... 121.2 KAREL PROGRAMMING LANGUAGE ............................................................................. 121.2.1 Overview ......................................................................................................................... 121.2.2 Creating a Program ............................................................................................................ 141.2.3 Translating a Program ........................................................................................................ 141.2.4 Loading Program Logic and Data ......................................................................................... 141.2.5 Executing a Program .......................................................................................................... 151.2.6 Execution History ............................................................................................................. 151.2.7 Program Structure ............................................................................................................. 151.3 SYSTEM SOFTWARE ...................................................................................................... 171.3.1 Software Components ........................................................................................................ 171.3.2 Supported Robots .............................................................................................................. 171.4 CONTROLLER ................................................................................................................ 181.4.1 Memory .......................................................................................................................... 181.4.2 Input/Output System ........................................................................................................ 1101.4.3 User Interface Devices ..................................................................................................... 110

    Chapter 2 LANGUAGE ELEMENTS ............................................................................................ 212.1 LANGUAGE COMPONENTS ............................................................................................ 222.1.1 Character Set .................................................................................................................... 222.1.2 Operators ......................................................................................................................... 252.1.3 Reserved Words ................................................................................................................ 262.1.4 User-Defined Identifiers ..................................................................................................... 272.1.5 Labels ............................................................................................................................. 282.1.6 Predefined Identifiers ......................................................................................................... 282.1.7 System Variables ............................................................................................................. 2102.1.8 Comments ..................................................................................................................... 2102.2 TRANSLATOR DIRECTIVES ....................................................................................... 2112.3 DATA TYPES ................................................................................................................ 2132.4 USER-DEFINED DATA TYPES AND STRUCTURES ......................................................... 2142.4.1 User-Defined Data Types .................................................................................................. 2142.4.2 User-Defined Data Structures ............................................................................................ 2162.5 ARRAYS ....................................................................................................................... 2182.5.1 Multi-Dimensional Arrays ................................................................................................ 2192.5.2 Variable-Sized Arrays ...................................................................................................... 220

    Chapter 3 USE OF OPERATORS ................................................................................................ 31

    v

  • Contents MARRC75KR07091E Rev D

    3.1 EXPRESSIONS AND ASSIGNMENTS ................................................................................ 323.1.1 Rule for Expressions and Assignments .................................................................................. 323.1.2 Evaluation of Expressions and Assignments ........................................................................... 323.1.3 Variables and Expressions ................................................................................................... 343.2 OPERATIONS ................................................................................................................. 343.2.1 Arithmetic Operations ........................................................................................................ 353.2.2 Relational Operations ......................................................................................................... 363.2.3 Boolean Operations ........................................................................................................... 373.2.4 Special Operations ............................................................................................................. 38

    Chapter 4 PROGRAM CONTROL ............................................................................................... 414.1 OVERVIEW ..................................................................................................................... 424.2 PROGRAM CONTROL STRUCTURES ............................................................................... 424.2.1 Alternation Control Structures ............................................................................................. 424.2.2 Looping Control Statements ................................................................................................ 434.2.3 Unconditional Branch Statement .......................................................................................... 434.2.4 Execution Control Statements .............................................................................................. 434.2.5 Condition Handlers ............................................................................................................ 44

    Chapter 5 ROUTINES ................................................................................................................. 515.1 ROUTINE EXECUTION ................................................................................................... 525.1.1 Declaring Routines ............................................................................................................ 525.1.2 Invoking Routines ............................................................................................................. 555.1.3 Returning from Routines .................................................................................................... 575.1.4 Scope of Variables ............................................................................................................. 585.1.5 Parameters and Arguments .................................................................................................. 595.1.6 Stack Usage ................................................................................................................... 5135.2 BUILT- IN ROUTINES .................................................................................................... 515

    Chapter 6 CONDITION HANDLERS ............................................................................................ 616.1 CONDITION HANDLER OPERATIONS ............................................................................. 636.1.1 Global Condition Handlers .................................................................................................. 636.2 CONDITIONS ................................................................................................................. 666.2.1 Port_Id Conditions ............................................................................................................ 676.2.2 Relational Conditions ......................................................................................................... 676.2.3 System and Program Event Conditions .................................................................................. 686.3 ACTIONS ..................................................................................................................... 6116.3.1 Assignment Actions ......................................................................................................... 6116.3.2 Motion Related Actions .................................................................................................... 6136.3.3 Routine Call Actions ........................................................................................................ 6136.3.4 Miscellaneous Actions ..................................................................................................... 614

    Chapter 7 FILE INPUT/OUTPUT OPERATIONS ........................................................................... 717.1 OVERVIEW .................................................................................................................... 737.2 FILE VARIABLES ............................................................................................................ 737.3 OPEN FILE STATEMENT ................................................................................................. 747.3.1 Setting File and Port Attributes ............................................................................................ 757.3.2 File String ...................................................................................................................... 7107.3.3 Usage String ................................................................................................................... 7117.4 CLOSE FILE STATEMENT ............................................................................................. 714

    vi

  • MARRC75KR07091E Rev D Contents

    7.5 READ STATEMENT ....................................................................................................... 7147.6 WRITE STATEMENT ..................................................................................................... 7167.7 INPUT/OUTPUT BUFFER ............................................................................................... 7177.8 FORMATTING TEXT (ASCII) INPUT/OUTPUT ................................................................. 7187.8.1 Formatting INTEGER Data Items ....................................................................................... 7197.8.2 Formatting REAL Data Items ............................................................................................ 7227.8.3 Formatting BOOLEAN Data Items ..................................................................................... 7257.8.4 Formatting STRING Data Items ......................................................................................... 7277.8.5 Formatting VECTOR Data Items ........................................................................................ 7317.8.6 Formatting Positional Data Items ....................................................................................... 7327.9 FORMATTING BINARY INPUT/OUTPUT ........................................................................ 7347.9.1 Formatting INTEGER Data Items ....................................................................................... 7357.9.2 Formatting REAL Data Items ............................................................................................ 7367.9.3 Formatting BOOLEAN Data Items ..................................................................................... 7367.9.4 Formatting STRING Data Items ......................................................................................... 7367.9.5 Formatting VECTOR Data Items ........................................................................................ 7377.9.6 Formatting POSITION Data Items ...................................................................................... 7377.9.7 Formatting XYZWPR Data Items ....................................................................................... 7377.9.8 Formatting XYZWPREXT Data Items ................................................................................ 7387.9.9 Formatting JOINTPOS Data Items ..................................................................................... 7387.10 USER INTERFACE TIPS ................................................................................................. 7387.10.1 USER Menu on the Teach Pendant ..................................................................................... 7387.10.2 USER Menu on the CRT/KB ............................................................................................. 740

    Chapter 8 POSITION DATA ......................................................................................................... 818.1 OVERVIEW .................................................................................................................... 828.2 POSITIONAL DATA ......................................................................................................... 828.3 FRAMES OF REFERENCE ............................................................................................... 838.3.1 World Frame .................................................................................................................... 848.3.2 User Frame (UFRAME) ..................................................................................................... 858.3.3 Tool Definition (UTOOL) ................................................................................................... 858.3.4 Using Frames in the Teach Pendant Editor (TP) ...................................................................... 858.4 JOG COORDINATE SYSTEMS .......................................................................................... 86

    Chapter 9 FILE SYSTEM ............................................................................................................ 919.1 OVERVIEW .................................................................................................................... 929.2 FILE SPECIFICATION ...................................................................................................... 939.2.1 Device Name .................................................................................................................... 939.2.2 File Name ........................................................................................................................ 949.2.3 File Type ......................................................................................................................... 959.3 STORAGE DEVICE ACCESS ............................................................................................ 969.3.1 Overview ......................................................................................................................... 979.3.2 Memory File Devices ....................................................................................................... 9139.3.3 Virtual Devices ............................................................................................................... 9149.3.4 File Pipes ....................................................................................................................... 9169.4 FILE ACCESS ............................................................................................................... 9209.5 FORMATTING XML INPUT ........................................................................................... 9209.5.1 Overview ....................................................................................................................... 9209.5.2 Installation Sequence ....................................................................................................... 9219.5.3 Example KAREL Program Referencing an XML File ............................................................ 922

    vii

  • Contents MARRC75KR07091E Rev D

    9.5.4 Parse Errors ................................................................................................................... 9269.6 MEMORY DEVICE ........................................................................................................ 927

    Chapter 10 DICTIONARIES AND FORMS ................................................................................... 10110.1 OVERVIEW ................................................................................................................... 10310.2 CREATING USER DICTIONARIES .................................................................................. 10310.2.1 Dictionary Syntax ........................................................................................................... 10310.2.2 Dictionary Element Number .............................................................................................. 10410.2.3 Dictionary Element Name ................................................................................................. 10510.2.4 Dictionary Cursor Positioning ............................................................................................ 10510.2.5 Dictionary Element Text ................................................................................................... 10610.2.6 Dictionary Reserved Word Commands ................................................................................ 10810.2.7 Character Codes ............................................................................................................. 101010.2.8 Nesting Dictionary Elements ............................................................................................ 101010.2.9 Dictionary Comment ....................................................................................................... 101110.2.10 Generating a KAREL Constant File ................................................................................... 101110.2.11 Compressing and Loading Dictionaries on the Controller ....................................................... 101110.2.12 Accessing Dictionary Elements from a KAREL Program ....................................................... 101210.3 CREATING USER FORMS ............................................................................................. 101310.3.1 Form Syntax .................................................................................................................. 101410.3.2 Form Attributes ............................................................................................................. 101510.3.3 Form Title and Menu Label .............................................................................................. 101610.3.4 Form Menu Text ............................................................................................................ 101710.3.5 Form Selectable Menu Item .............................................................................................. 101810.3.6 Edit Data Item ............................................................................................................... 101910.3.7 Dynamic Forms using Tree View ........................................................................................ 102610.3.8 Non-Selectable Text ........................................................................................................ 102710.3.9 Display Only Data Items .................................................................................................. 102710.3.10 Cursor Position Attributes ................................................................................................ 102710.3.11 Form Reserved Words and Character Codes ........................................................................ 102810.3.12 Form Function Key Element Name or Number .................................................................... 103010.3.13 Form Function Key Using a Variable ................................................................................. 103110.3.14 Form Help Element Name or Number ................................................................................ 103110.3.15 Teach Pendant Form Screen ............................................................................................. 103210.3.16 CRT/KB Form Screen ..................................................................................................... 103210.3.17 Form File Naming Convention .......................................................................................... 103310.3.18 Compressing and Loading Forms on the Controller ............................................................... 103410.3.19 Displaying a Form .......................................................................................................... 1036

    Chapter 11 SOCKET MESSAGING ............................................................................................. 11111.1 OVERVIEW .................................................................................................................. 11211.2 SYSTEM REQUIREMENTS ............................................................................................ 11211.2.1 Overview ....................................................................................................................... 11211.2.2 Software Requirements .................................................................................................... 11211.2.3 Hardware Requirements ................................................................................................... 11211.3 CONFIGURING THE SOCKET MESSAGING OPTION ...................................................... 11311.3.1 Overview ....................................................................................................................... 11311.3.2 Setting up a Server Tag ..................................................................................................... 11311.3.3 Setting up a Client Tag ..................................................................................................... 11611.4 SOCKET MESSAGING AND KAREL ............................................................................... 11911.4.1 Overview ....................................................................................................................... 11911.4.2 MSG_CONN( string, integer ) .......................................................................................... 119

    viii

  • MARRC75KR07091E Rev D Contents

    11.4.3 MSG_DISCO( string, integer ) .......................................................................................... 11911.4.4 MSG_PING( string, integer ) ........................................................................................... 111011.4.5 Exchanging Data during a Socket Messaging Connection ....................................................... 111011.5 NETWORK PERFORMANCE ......................................................................................... 111011.5.1 Overview ...................................................................................................................... 111011.5.2 Guidelines for a Good Implementation ............................................................................... 111111.6 PROGRAMMING EXAMPLES ....................................................................................... 111111.6.1 .................................................................................................................................... 111111.6.2 A KAREL Client Application ........................................................................................... 111111.6.3 A KAREL Server Application .......................................................................................... 111411.6.4 ANSI C Loopback Client Example .................................................................................... 1116

    Chapter 12 SYSTEM VARIABLES ............................................................................................... 12112.1 ACCESS RIGHTS .......................................................................................................... 12212.2 STORAGE ..................................................................................................................... 123

    Chapter 13 KAREL COMMAND LANGUAGE (KCL) .................................................................... 13113.1 COMMAND FORMAT .................................................................................................... 13213.1.1 Default Program .............................................................................................................. 13213.1.2 Variables and Data Types .................................................................................................. 13313.2 PROGRAM CONTROL COMMANDS .............................................................................. 13313.3 ENTERING COMMANDS ............................................................................................... 13313.3.1 Abbreviations ................................................................................................................. 13413.3.2 Error Messages ............................................................................................................... 13413.3.3 Subdirectories ................................................................................................................. 13413.4 COMMAND PROCEDURES ............................................................................................ 13413.4.1 Command Procedure Format ............................................................................................. 13513.4.2 Creating Command Procedures .......................................................................................... 13613.4.3 Error Processing .............................................................................................................. 13613.4.4 Executing Command Procedures ........................................................................................ 136

    Chapter 14 INPUT/OUTPUT SYSTEM ......................................................................................... 14114.1 USER-DEFINED SIGNALS ............................................................................................. 14214.1.1 DIN and DOUT Signals .................................................................................................... 14214.1.2 GIN and GOUT Signals .................................................................................................... 14314.1.3 AIN and AOUT Signals .................................................................................................... 14314.1.4 Hand Signals .................................................................................................................. 14514.2 SYSTEM-DEFINED SIGNALS ........................................................................................ 14514.2.1 Robot Digital Input and Output Signals (RDI/RDO) ............................................................... 14614.2.2 Operator Panel Input and Output Signals (OPIN/OPOUT) ....................................................... 14614.2.3 Teach Pendant Input and Output Signals (TPIN/TPOUT) ....................................................... 141714.3 Serial Input/Output ......................................................................................................... 142214.3.1 Serial Input/Output ......................................................................................................... 1422

    Chapter 15 MULTI-TASKING ....................................................................................................... 15115.1 MULTI-TASKING TERMINOLOGY ................................................................................. 15215.2 INTERPRETER ASSIGNMENT ....................................................................................... 15315.3 MOTION CONTROL ...................................................................................................... 15315.4 TASK SCHEDULING ..................................................................................................... 15415.4.1 Priority Scheduling .......................................................................................................... 155

    ix

  • Contents MARRC75KR07091E Rev D

    15.4.2 Time Slicing ................................................................................................................... 15615.5 STARTING TASKS ......................................................................................................... 15615.5.1 Running Programs from the User Operator Panel (UOP) PNS Signal ........................................ 15715.5.2 Child Tasks .................................................................................................................... 15715.6 TASK CONTROL AND MONITORING ............................................................................. 15715.6.1 From TPP Programs ........................................................................................................ 15815.6.2 From KAREL Programs ................................................................................................... 15815.6.3 From KCL ..................................................................................................................... 15815.7 USING SEMAPHORES AND TASK SYNCHRONIZATION ................................................. 15915.8 USING QUEUES FOR TASK COMMUNICATIONS ........................................................... 1514

    Appendix A KAREL LANGUAGE ALPHABETICAL DESCRIPTION ............................................... A1A.1 OVERVIEW ................................................................................................................... A9A.2 - A - KAREL LANGUAGE DESCRIPTION ........................................................................ A18A.2.1 ABORT Action ............................................................................................................... A18A.2.2 ABORT Condition ........................................................................................................... A18A.2.3 ABORT Statement ........................................................................................................... A19A.2.4 ABORT_TASK Built-In Procedure ..................................................................................... A19A.2.5 ABS Built-In Function ..................................................................................................... A20A.2.6 ACOS Built-In Function ................................................................................................... A20A.2.7 ACT_SCREEN Built-In Procedure ..................................................................................... A21A.2.8 ACT_TBL Built-In Procedure ............................................................................................. A22A.2.9 ADD_BYNAMEPC Built-In Procedure ............................................................................... A24A.2.10 ADD_DICT Built-In Procedure ......................................................................................... A25A.2.11 ADD_INTPC Built-In Procedure ........................................................................................ A26A.2.12 ADD_REALPC Built-In Procedure .................................................................................... A27A.2.13 ADD_STRINGPC Built-In Procedure ................................................................................. A29A.2.14 %ALPHABETIZE Translator Directive ............................................................................... A30A.2.15 APPEND_NODE Built-In Procedure .................................................................................. A30A.2.16 APPEND_QUEUE Built-In Procedure ................................................................................ A31A.2.17 APPROACH Built-In Function .......................................................................................... A32A.2.18 ARRAY Data Type .......................................................................................................... A33A.2.19 ARRAY_LEN Built-In Function ........................................................................................ A34A.2.20 ASIN Built-In Function .................................................................................................... A34A.2.21 Assignment Action .......................................................................................................... A35A.2.22 Assignment Statement ...................................................................................................... A36A.2.23 ATAN2 Built-In Function ................................................................................................. A38A.2.24 ATTACH Statement ......................................................................................................... A39A.2.25 ATT_WINDOW_D Built-In Procedure ................................................................................ A39A.2.26 ATT_WINDOW_S Built-In Procedure ................................................................................ A40A.2.27 AVL_POS_NUM Built-In Procedure .................................................................................. A41A.3 - B - KAREL LANGUAGE DESCRIPTION ........................................................................ A42A.3.1 BOOLEAN Data Type ..................................................................................................... A42A.3.2 BYNAME Built-In Function ............................................................................................. A43A.3.3 BYTE Data Type ............................................................................................................. A44A.3.4 BYTES_AHEAD Built-In Procedure .................................................................................. A45A.3.5 BYTES_LEFT Built-In Function ........................................................................................ A46A.4 - C - KAREL LANGUAGE DESCRIPTION ........................................................................ A47A.4.1 CALL_PROG Built-In Procedure ....................................................................................... A47A.4.2 CALL_PROGLIN Built-In Procedure ................................................................................. A48A.4.3 CANCEL Action ............................................................................................................. A49A.4.4 CANCEL Statement ........................................................................................................ A49

    x

  • MARRC75KR07091E Rev D Contents

    A.4.5 CANCEL FILE Statement ................................................................................................ A50A.4.6 CHECK_DICT Built-In Procedure ..................................................................................... A51A.4.7 CHECK_EPOS Built-In Procedure ..................................................................................... A52A.4.8 CHECK_NAME Built-In Procedure ................................................................................... A53A.4.9 CHR Built-In Function ..................................................................................................... A53A.4.10 CLEAR Built-In Procedure ............................................................................................... A54A.4.11 CLEAR_SEMA Built-In Procedure .................................................................................... A55A.4.12 CLOSE FILE Statement ................................................................................................... A55A.4.13 CLOSE HAND Statement ................................................................................................. A56A.4.14 CLOSE_TPE Built-In Procedure ........................................................................................ A56A.4.15 CLR_IO_STAT Built-In Procedure ..................................................................................... A57A.4.16 CLR_PORT_SIM Built-In Procedure .................................................................................. A57A.4.17 CLR_POS_REG Built-In Procedure ................................................................................... A58A.4.18 %CMOSVARS Translator Directive ................................................................................... A59A.4.19 %CMOS2SHADOW Translator Directive ............................................................................ A59A.4.20 CNC_DYN_DISB Built-In Procedure ................................................................................. A59A.4.21 CNC_DYN_DISE Built-In Procedure ................................................................................. A60A.4.22 CNC_DYN_DISI Built-In Procedure .................................................................................. A61A.4.23 CNC_DYN_DISP Built-In Procedure ................................................................................. A62A.4.24 CNC_DYN_DISR Built-In Procedure ................................................................................. A62A.4.25 CNC_DYN_DISS Built-In Procedure ................................................................................. A63A.4.26 CNCL_STP_MTN Built-In Procedure ................................................................................. A64A.4.27 CNV_CNF_STRG Built-In Procedure .................................................................................. A64A.4.28 CNV_CONF_STR Built-In Procedure ................................................................................. A65A.4.29 CNV_INT_STR Built-In Procedure .................................................................................... A66A.4.30 CNV_JPOS_REL Built-In Procedure .................................................................................. A67A.4.31 CNV_REAL_STR Built-In Procedure ................................................................................. A67A.4.32 CNV_REL_JPOS Built-In Procedure .................................................................................. A68A.4.33 CNV_STR_CONF Built-In Procedure ................................................................................. A69A.4.34 CNV_STR_INT Built-In Procedure .................................................................................... A70A.4.35 CNV_STR_REAL Built-In Procedure ................................................................................. A71A.4.36 CNV_STR_TIME Built-In Procedure ................................................................................. A71A.4.37 CNV_TIME_STR Built-In Procedure ................................................................................. A72A.4.38 %COMMENT Translator Directive .................................................................................... A73A.4.39 COMPARE_FILE Built-in Procedure ................................................................................... A73A.4.40 CONDITION...ENDCONDITION Statement ....................................................................... A75A.4.41 CONFIG Data Type ......................................................................................................... A77A.4.42 CONNECT TIMER Statement ........................................................................................... A78A.4.43 CONTINUE Action ......................................................................................................... A79A.4.44 CONTINUE Condition ..................................................................................................... A79A.4.45 CONT_TASK Built-In Procedure ....................................................................................... A80A.4.46 COPY_FILE Built-In Procedure ......................................................................................... A81A.4.47 COPY_PATH Built-In Procedure ........................................................................................ A82A.4.48 COPY_QUEUE Built-In Procedure .................................................................................... A83A.4.49 COPY_TPE Built-In Procedure .......................................................................................... A85A.4.50 COS Built-In Function ..................................................................................................... A86A.4.51 CR Input/Output Item ...................................................................................................... A86A.4.52 CREATE_TPE Built-In Procedure ...................................................................................... A87A.4.53 CREATE_VAR Built-In Procedure ..................................................................................... A88A.4.54 %CRTDEVICE ............................................................................................................... A90A.4.55 CURJPOS Built-In Function ............................................................................................. A91A.4.56 CURPOS Built-In Function ............................................................................................... A92A.4.57 CURR_PROG Built-In Function ........................................................................................ A93A.5 - D - KAREL LANGUAGE DESCRIPTION ........................................................................ A93A.5.1 DAQ_CHECKP Built-In Procedure .................................................................................... A93

    xi

  • Contents MARRC75KR07091E Rev D

    A.5.2 DAQ_REGPIPE Built-In Procedure .................................................................................... A94A.5.3 DAQ_START Built-In Procedure ....................................................................................... A96A.5.4 DAQ_STOP Built-In Procedure ......................................................................................... A98A.5.5 DAQ_UNREG Built-In Procedure ...................................................................................... A99A.5.6 DAQ_WRITE Built-In Procedure ..................................................................................... A100A.5.7 %DEFGROUP Translator Directive .................................................................................. A102A.5.8 DEF_SCREEN Built-In Procedure ................................................................................... A102A.5.9 DEF_WINDOW Built-In Procedure .................................................................................. A103A.5.10 %DELAY Translator Directive ........................................................................................ A104A.5.11 DELAY Statement ......................................................................................................... A105A.5.12 DELETE_FILE Built-In Procedure ................................................................................... A106A.5.13 DELETE_NODE Built-In Procedure ................................................................................. A107A.5.14 DELETE_QUEUE Built-In Procedure ............................................................................... A107A.5.15 DEL_INST_TPE Built-In Procedure ................................................................................. A108A.5.16 DET_WINDOW Built-In Procedure ................................................................................. A109A.5.17 DISABLE CONDITION Action ....................................................................................... A109A.5.18 DISABLE CONDITION Statement .................................................................................. A110A.5.19 DISCONNECT TIMER Statement ................................................................................... A111A.5.20 DISCTRL_ALPH Built_In Procedure ............................................................................... A112A.5.21 DISCTRL_FORM Built_In Procedure ............................................................................... A114A.5.22 DISCTRL_LIST Built-In Procedure .................................................................................. A116A.5.23 DISCTRL_PLMN Built-In Procedure ............................................................................... A117A.5.24 DISCTRL_SBMN Built-In Procedure ............................................................................... A119A.5.25 DISCTRL_TBL Built-In Procedure .................................................................................. A122A.5.26 DISMOUNT_DEV Built-In Procedure .............................................................................. A125A.5.27 DISP_DAT_T Data Type ................................................................................................ A125A.5.28 DOSFILE_INF Built-In Procedure ..................................................................................... A127A.6 - E - KAREL LANGUAGE DESCRIPTION ...................................................................... A128A.6.1 ENABLE CONDITION Action ....................................................................................... A128A.6.2 ENABLE CONDITION Statement ................................................................................... A129A.6.3 %ENVIRONMENT Translator Directive ........................................................................... A129A.6.4 ERR_DATA Built-In Procedure ....................................................................................... A131A.6.5 ERROR Condition ......................................................................................................... A132A.6.6 EVAL Clause ............................................................................................................... A133A.6.7 EVENT Condition ......................................................................................................... A134A.6.8 EXP Built-In Function ................................................................................................... A134A.7 - F - KAREL LANGUAGE DESCRIPTION ...................................................................... A135A.7.1 FILE Data Type ............................................................................................................ A135A.7.2 FILE_LIST Built-In Procedure ........................................................................................ A135A.7.3 FOR...ENDFOR Statement ............................................................................................. A137A.7.4 FORCE_SPMENU Built-In Procedure .............................................................................. A138A.7.5 FORMAT_DEV Built-In Procedure .................................................................................. A141A.7.6 FRAME Built-In Function .............................................................................................. A142A.7.7 FROM Clause .............................................................................................................. A144A.8 - G - KAREL LANGUAGE DESCRIPTION ...................................................................... A145A.8.1 GET_ATTR_PRG Built-In Procedure ............................................................................... A145A.8.2 GET_FILE_POS Built-In Function ................................................................................... A147A.8.3 GET_JPOS_REG Built-In Function .................................................................................. A148A.8.4 GET_JPOS_TPE Built-In Function ................................................................................... A148A.8.5 GET_PORT_ASG Built-in Procedure ............................................................................... A149A.8.6 GET_PORT_ATR Built-In Function ................................................................................. A151A.8.7 GET_PORT_CMT Built-In Procedure ............................................................................... A153A.8.8 GET_PORT_MOD Built-In Procedure .............................................................................. A154A.8.9 GET_PORT_SIM Built-In Procedure ................................................................................ A155

    xii

  • MARRC75KR07091E Rev D Contents

    A.8.10 GET_PORT_VAL Built-In Procedure ................................................................................ A156A.8.11 GET_POS_FRM Built-In Procedure ................................................................................. A157A.8.12 GET_POS_REG Built-In Function ................................................................................... A158A.8.13 GET_POS_TPE Built-In Function .................................................................................... A158A.8.14 GET_POS_TYP Built-In Procedure .................................................................................. A159A.8.15 GET_PREG_CMT Built-In-Procedure ............................................................................... A160A.8.16 GET_QUEUE Built-In Procedure ..................................................................................... A161A.8.17 GET_REG Built-In Procedure ......................................................................................... A162A.8.18 GET_REG_CMT .......................................................................................................... A163A.8.19 GET_SREG_CMT Builtin Procedure ................................................................................. A163A.8.20 GET_STR_REG Built-In Procedure ................................................................................... A164A.8.21 GET_TIME Built-In Procedure ......................................................................................... A164A.8.22 GET_TPE_CMT Built-in Procedure ................................................................................. A165A.8.23 GET_TPE_PRM Built-in Procedure ................................................................................. A166A.8.24 GET_TSK_INFO Built-In Procedure ................................................................................ A168A.8.25 GET_USEC_SUB Built-In Procedure ................................................................................ A170A.8.26 GET_USEC_TIM Built-In Function .................................................................................. A171A.8.27 GET_VAR Built-In Procedure ......................................................................................... A171A.8.28 GO TO Statement .......................................................................................................... A175A.9 - H - KAREL LANGUAGE DESCRIPTION ...................................................................... A176A.9.1 HOLD Action ............................................................................................................... A176A.9.2 HOLD Statement .......................................................................................................... A177A.10 - I - KAREL LANGUAGE DESCRIPTION ....................................................................... A178A.10.1 IF ... ENDIF Statement .................................................................................................. A178A.10.2 IN Clause .................................................................................................................... A179A.10.3 %INCLUDE Translator Directive ..................................................................................... A180A.10.4 INDEX Built-In Function ............................................................................................... A181A.10.5 INI_DYN_DISB Built-In Procedure ................................................................................. A181A.10.6 INI_DYN_DISE Built-In Procedure .................................................................................. A183A.10.7 INI_DYN_DISI Built-In Procedure .................................................................................. A184A.10.8 INI_DYN_DISP Built-In Procedure .................................................................................. A186A.10.9 INI_DYN_DISR Built-In Procedure ................................................................................. A187A.10.10 INI_DYN_DISS Built-In Procedure .................................................................................. A188A.10.11 INIT_QUEUE Built-In Procedure .................................................................................... A189A.10.12 INIT_TBL Built-In Procedure ......................................................................................... A190A.10.13 IN_RANGE Built-In Function ......................................................................................... A201A.10.14 INSERT_NODE Built-In Procedure .................................................................................. A202A.10.15 INSERT_QUEUE Built-In Procedure ................................................................................ A203A.10.16 INTEGER Data Type ..................................................................................................... A204A.10.17 INV Built-In Function .................................................................................................... A205A.10.18 IO_MOD_TYPE Built-In Procedure ................................................................................. A206A.10.19 IO_STATUS Built-In Function ......................................................................................... A207A.11 - J - KAREL LANGUAGE DESCRIPTION ....................................................................... A208A.11.1 J_IN_RANGE Built-In Function ...................................................................................... A208A.11.2 JOINTPOS Data Type .................................................................................................... A209A.11.3 JOINT2POS Built-In Function ......................................................................................... A209A.12 - K - KAREL LANGUAGE DESCRIPTION ...................................................................... A211A.12.1 KCL Built-In Procedure ................................................................................................. A211A.12.2 KCL_NO_WAIT Built-In Procedure ................................................................................. A212A.12.3 KCL_STATUS Built-In Procedure .................................................................................... A213A.13 - L - KAREL LANGUAGE DESCRIPTION ...................................................................... A213A.13.1 LN Built-In Function ..................................................................................................... A213A.13.2 LOAD Built-In Procedure ............................................................................................... A214A.13.3 LOAD_STATUS Built-In Procedure ................................................................................. A215

    xiii

  • Contents MARRC75KR07091E Rev D

    A.13.4 LOCK_GROUP Built-In Procedure .................................................................................. A216A.13.5 %LOCKGROUP Translator Directive ............................................................................... A217A.14 - M - KAREL LANGUAGE DESCRIPTION ..................................................................... A218A.14.1 MIRROR Built-In Function ............................................................................................. A218A.14.2 MODIFY_QUEUE Built-In Procedure .............................................................................. A219A.14.3 MOTION_CTL Built-In Function .................................................................................... A221A.14.4 MOUNT_DEV Built-In Procedure ................................................................................... A221A.14.5 MOVE_FILE Built-In Procedure ...................................................................................... A222A.14.6 MSG_CONNECT Built-In Procedure ............................................................................... A223A.14.7 MSG_DISCO Built-In Procedure ..................................................................................... A225A.14.8 MSG_PING ................................................................................................................. A225A.15 - N - KAREL LANGUAGE DESCRIPTION ...................................................................... A226A.15.1 NOABORT Action ........................................................................................................ A226A.15.2 %NOABORT Translator Directive ................................................................................... A227A.15.3 %NOBUSYLAMP Translator Directive ............................................................................ A227A.15.4 NODE_SIZE Built-In Function ........................................................................................ A227A.15.5 %NOLOCKGROUP Translator Directive .......................................................................... A229A.15.6 NOMESSAGE Action .................................................................................................... A230A.15.7 NOPAUSE Action ......................................................................................................... A230A.15.8 %NOPAUSE Translator Directive .................................................................................... A231A.15.9 %NOPAUSESHFT Translator Directive ............................................................................ A231A.16 - O - KAREL LANGUAGE DESCRIPTION ...................................................................... A232A.16.1 OPEN FILE Statement ................................................................................................... A232A.16.2 OPEN HAND Statement ................................................................................................. A233A.16.3 OPEN_TPE Built-In Procedure ........................................................................................ A233A.16.4 ORD Built-In Function ................................................................................................... A234A.16.5 ORIENT Built-In Function .............................................................................................. A235A.17 - P - KAREL LANGUAGE DESCRIPTION ...................................................................... A236A.17.1 PATH Data Type ........................................................................................................... A236A.17.2 PATH_LEN Built-In Function .......................................................................................... A238A.17.3 PAUSE Action .............................................................................................................. A238A.17.4 PAUSE Condition ......................................................................................................... A239A.17.5 PAUSE Statement ......................................................................................................... A240A.17.6 PAUSE_TASK Built-In Procedure .................................................................................... A241A.17.7 PEND_SEMA Built-In Procedure .................................................................................... A242A.17.8 PIPE_CONFIG Built-In Procedure ................................................................................... A242A.17.9 POP_KEY_RD Built-In Procedure ................................................................................... A243A.17.10 Port_Id Action .............................................................................................................. A244A.17.11 Port_Id Condition .......................................................................................................... A245A.17.12 POS Built-In Function .................................................................................................... A246A.17.13 POS2JOINT Built-In Function ......................................................................................... A246A.17.14 POS_REG_TYPE Built-In Procedure ................................................................................ A248A.17.15 POSITION Data Type .................................................................................................... A249A.17.16 POST_ERR Built-In Procedure ........................................................................................ A250A.17.17 POST_ERR_L Built-In Procedure...................................................................................... A251A.17.18 POST_SEMA Built-In Procedure ..................................................................................... A253A.17.19 PRINT_FILE Built-In Procedure ...................................................................................... A253A.17.20 %PRIORITY Translator Directive .................................................................................... A254A.17.21 PROG_BACKUP Built-In Procedure ................................................................................ A255A.17.22 PROG_CLEAR Built-In Procedure ................................................................................... A258A.17.23 PROG_RESTORE Built-In Procedure ............................................................................... A260A.17.24 PROG_LIST Built-In Procedure ....................................................................................... A262A.17.25 PROGRAM Statement ................................................................................................... A263A.17.26 PULSE Action .............................................................................................................. A264

    xiv

  • MARRC75KR07091E Rev D Contents

    A.17.27 PULSE Statement ......................................................................................................... A265A.17.28 PURGE CONDITION Statement ..................................................................................... A266A.17.29 PURGE_DEV Built-In Procedure ..................................................................................... A267A.17.30 PUSH_KEY_RD Built-In Procedure ................................................................................. A268A.18 - Q - KAREL LANGUAGE DESCRIPTION ...................................................................... A269A.18.1 QUEUE_TYPE Data Type .............................................................................................. A269A.19 - R - KAREL LANGUAGE DESCRIPTION ...................................................................... A269A.19.1 READ Statement ........................................................................................................... A269A.19.2 READ_DICT Built-In Procedure ...................................................................................... A271A.19.3 READ_DICT_V Built-In-Procedure ................................................................................. A272A.19.4 READ_KB Built-In Procedure ......................................................................................... A273A.19.5 REAL Data Type ........................................................................................................... A277A.19.6 Relational Condition ...................................................................................................... A279A.19.7 RELAX HAND Statement .............................................................................................. A280A.19.8 RELEASE Statement ..................................................................................................... A281A.19.9 REMOVE_DICT Built-In Procedure ................................................................................. A281A.19.10 RENAME_FILE Built-In Procedure ................................................................................. A282A.19.11 RENAME_VAR Built-In Procedure .................................................................................. A283A.19.12 RENAME_VARS Built-In Procedure ................................................................................ A283A.19.13 REPEAT ... UNTIL Statement ......................................................................................... A284A.19.14 RESET Built-In Procedure .............................................................................................. A285A.19.15 RESUME Action .......................................................................................................... A286A.19.16 RESUME Statement ...................................................................................................... A286A.19.17 RETURN Statement ...................................................................................................... A287A.19.18 ROUND Built-In Function .............................................................................................. A288A.19.19 ROUTINE Statement ..................................................................................................... A289A.19.20 RUN_TASK Built-In Procedure ....................................................................................... A290A.20 - S - KAREL LANGUAGE DESCRIPTION ...................................................................... A291A.20.1 SAVE Built-In Procedure ................................................................................................ A291A.20.2 SAVE_DRAM Built-In Procedure .................................................................................... A292A.20.3 SELECT ... ENDSELECT Statement ................................................................................ A293A.20.4 SELECT_TPE Built-In Procedure .................................................................................... A294A.20.5 SEMA_COUNT Built-In Function ................................................................................... A294A.20.6 SEMAPHORE Condition ............................................................................................... A295A.20.7 SEND_DATAPC Built-In Procedure ................................................................................. A295A.20.8 SEND_EVENTPC Built-In Procedure ............................................................................... A296A.20.9 SET_ATTR_PRG Built-In Procedure ................................................................................ A297A.20.10 SET_CURSOR Built-In Procedure ................................................................................... A299A.20.11 SET_EPOS_REG Built-In Procedure ................................................................................ A300A.20.12 SET_EPOS_TPE Built-In Procedure ................................................................................. A301A.20.13 SET_FILE_ATR Built-In Procedure ................................................................................. A302A.20.14 SET_FILE_POS Built-In Procedure .................................................................................. A303A.20.15 SET_INT_REG Built-In Procedure ................................................................................... A304A.20.16 SET_JPOS_REG Built-In Procedure ................................................................................. A304A.20.17 SET_JPOS_TPE Built-In Procedure ................................................................................. A305A.20.18 SET_LANG Built-In Procedure ....................................................................................... A306A.20.19 SET_PERCH Built-In Procedure ...................................................................................... A307A.20.20 SET_PORT_ASG Built-In Procedure ................................................................................ A308A.20.21 SET_PORT_ATR Built-In Function .................................................................................. A309A.20.22 SET_PORT_CMT Built-In Procedure ............................................................................... A311A.20.23 SET_PORT_MOD Built-In Procedure ............................................................................... A312A.20.24 SET_PORT_SIM Built-In Procedure ................................................................................. A313A.20.25 SET_PORT_VAL Built-In Procedure ................................................................................ A314A.20.26 SET_POS_REG Built-In Procedure .................................................................................. A315

    xv

  • Contents MARRC75KR07091E Rev D

    A.20.27 SET_POS_TPE Built-In Procedure ................................................................................... A316A.20.28 SET_PREG_CMT Built-In-Procedure ............................................................................... A317A.20.29 SET_REAL_REG Built-In Procedure ............................................................................... A317A.20.30 SET_REG_CMT Built-In-Procedure ................................................................................. A317A.20.31 SET_SREG_CMT Built-in Procedure ................................................................................. A318A.20.32 SET_STR_REG Built-in Procedure .................................................................................... A319A.20.33 SET_TIME Built-In Procedure ........................................................................................ A319A.20.34 SET_TPE_CMT Built-In Procedure .................................................................................. A321A.20.35 SET_TRNS_TPE Built-In Procedure ................................................................................ A321A.20.36 SET_TSK_ATTR Built-In Procedure ................................................................................ A322A.20.37 SET_TSK_NAME Built-In Procedure ............................................................................... A323A.20.38 SET_VAR Built-In Procedure .......................................................................................... A324A.20.39 %SHADOWVARS Translator Directive ............................................................................ A327A.20.40 SHORT Data Type ......................................................................................................... A327A.20.41 SIGNAL EVENT Action ................................................................................................ A328A.20.42 SIGNAL EVENT Statement ............................................................................................ A328A.20.43 SIGNAL SEMAPHORE Action ....................................................................................... A329A.20.44 SIN Built-In Function .................................................................................................... A329A.20.45 SQRT Built-In Function ................................................................................................. A330A.20.46 %STACKSIZE Translator Directive .................................................................................. A330A.20.47 STD_PTH_NODE Data Type .......................................................................................... A331A.20.48 STOP Action ................................................................................................................ A331A.20.49 STOP Statement ............................................................................................................ A332A.20.50 STRING Data Type ....................................................................................................... A333A.20.51 STR_LEN Built-In Function ........................................................................................... A334A.20.52 STRUCTURE Data Type ................................................................................................ A334A.20.53 SUB_STR Built-In Function ........................................................................................... A335A.21 - T - KAREL LANGUAGE DESCRIPTION ...................................................................... A336A.21.1 TAN Built-In Function ................................................................................................... A336A.21.2 %TIMESLICE Translator Directive .................................................................................. A337A.21.3 %TPMOTION Translator Directive .................................................................................. A337A.21.4 TRANSLATE Built-In Procedure ..................................................................................... A337A.21.5 TRUNC Built-In Function .............................................................................................. A339A.22 - U - KAREL LANGUAGE DESCRIPTION ...................................................................... A340A.22.1 UNHOLD Action .......................................................................................................... A340A.22.2 UNHOLD Statement ...................................................................................................... A340A.22.3 UNINIT Built-In Function .............................................................................................. A341A.22.4 %UNINITVARS Translator Directive ............................................................................... A341A.22.5 UNLOCK_GROUP Built-In Procedure ............................................................................. A342A.22.6 UNPAUSE Action ......................................................................................................... A343A.22.7 UNPOS Built-In Procedure ............................................................................................. A344A.22.8 USING ... ENDUSING Statement .................................................................................... A344A.23 - V - KAREL LANGUAGE DESCRIPTION ...................................................................... A345A.23.1 V_CAM_CALIB iRVision Built-In Procedure .................................................................... A345A.23.2 V_GET_OFFSET iRVision Built-In Procedure ................................................................... A347A.23.3 V_GET_PASSFL iRVision Built-In Procedure .................................................................... A348A.23.4 V_GET_QUEUE iRVision Built-in Procedure .................................................................... A350A.23.5 V_INIT_QUEUE iRVision Built-in Procedure .................................................................... A350A.23.6 V_RALC_QUEUE iRVision Built-in Procedure .................................................................. A351A.23.7 V_RUN_FIND iRVision Built-In Procedure ....................................................................... A351A.23.8 V_SET_REF iRVision Built-In Procedure .......................................................................... A353A.23.9 V_START_VTRK iRVision Built-in Procedure ................................................................... A354A.23.10 V_STOP_VTRK iRVision Built-in Procedure ..................................................................... A354A.23.11 VAR_INFO Built-In Procedure ........................................................................................ A355

    xvi

  • MARRC75KR07091E Rev D Contents

    A.23.12 VAR_LIST Built-In Procedure ......................................................................................... A357A.23.13 VECTOR Data Type ...................................................................................................... A360A.23.14 VOL_SPACE Built-In Procedure ...................................................................................... A361A.23.15 VREG_FND_POS iRVision Built-in Procedure ................................................................... A362A.23.16 VREG_OFFSET iRVision Built-in Procedure ..................................................................... A363A.24 - W - KAREL LANGUAGE DESCRIPTION ..................................................................... A364A.24.1 WAIT FOR Statement .................................................................................................... A364A.24.2 WHEN Clause .............................................................................................................. A364A.24.3 WHILE...ENDWHILE Statement ..................................................................................... A365A.24.4 WITH Clause ............................................................................................................... A365A.24.5 WRITE Statement ......................................................................................................... A366A.24.6 WRITE_DICT Built-In Procedure .................................................................................... A367A.24.7 WRITE_DICT_V Built-In Procedure ................................................................................ A368A.25 - X - KAREL LANGUAGE DESCRIPTION ...................................................................... A369A.25.1 XML_ADDTAG Built-In Procedure ................................................................................. A369A.25.2 XML_GETDATA Built-In Procedure ................................................................................. A370A.25.3 XML_REMTAG Built-In Procedure .................................................................................. A371A.25.4 XML_SCAN Built-In Procedure ....................................................................................... A371A.25.5 XML_SETVAR Built-In Procedure ................................................................................... A373A.25.6 XYZWPR Data Type ..................................................................................................... A374A.25.7 XYZWPREXT Data Type ............................................................................................... A375A.26 - Y - KAREL LANGUAGE DESCRIPTION ...................................................................... A375A.27 - Z - KAREL LANGUAGE DESCRIPTION ...................................................................... A375

    Appendix B KAREL EXAMPLE PROGRAMS ................................................................................ B1B.1 SETTING UP DIGITAL OUTPUT PORTS FOR PROCESS MONITORING .............................. B6B.2 COPYING PATH VARIABLES ......................................................................................... B18B.3 SAVING DATA TO THE DEFAULT DEVICE ..................................................................... B28B.4 STANDARD ROUTINES .......