FANUC Robotics SYSTEM R-30iA and R-30iB Controller. KAREL Reference Manual - page 1

 

  Index      Manuals     FANUC Robotics SYSTEM R-30iA and R-30iB Controller. KAREL Reference Manual (MARRC75KR07091E Rev D)

 

Search            copyright infringement  

    

 

   

 

   

 

Content      ..      1       2         ..

 

 

 

FANUC Robotics SYSTEM R-30iA and R-30iB Controller. KAREL Reference Manual - page 1

 

 

FANUC Robotics SYSTEM
R-30iA and R-30iB Controller
KAREL Reference Manual
MARRC75KR07091E Rev D
Applies to Version 7.50 and higher
2012
About This Manual
This manual can be used with controllers labeled R-30iA or R-J3iC. If you have a controller labeled
R-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 permission
of FANUC Robotics America Corporation.
FANUC Robotics America Corporation
3900
W. Hamlin Road
Rochester Hills, MI 48309-3253
The descriptions and specifications contained in this manual were in effect at the time this manual
was 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 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 energy
and if not installed and used in accordance with the instruction manual,
may cause interference to radio communications. As temporarily
permitted by regulation, it has not been tested for compliance with the
limits for Class A computing devices pursuant to subpart J of Part 15 of
FCC Rules, which are designed to provide reasonable protection against
such 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 correct
the interference.
i
About This Manual
MARRC75KR07091E Rev D
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
FANUC Robotics America Corporation
3900
W. Hamlin Road
Rochester Hills, MI 48309-3253
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:
product.documentation@fanucrobotics.com
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 consent
of FANUC Robotics America, Inc.
AccuStat®, ArcTool®, iRVision®, 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™,
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™, 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-J3iB Controller™, SYSTEM R-J3iC Controller™, SYSTEM R-30iA Controller™, SYSTEM
R-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 products
described in this manual.
ii
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,739
5,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,898
5,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,726
6,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,799
6,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,177
6,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,079
6,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,422
7,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,596
4,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,448
4,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,716
5,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,066
5,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,148
5,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,850
5,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,758
5,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,196
5,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,299
5,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,628
5,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,144
5,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,053
5,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,591
5,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,693
6,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,194
6,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,413
6,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,869
6,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,958
6,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,417
6,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,091
6,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,848
7,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,687
7,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,725
7,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,816
7,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 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.
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
1-1
1.1
OVERVIEW
1-2
1.2
KAREL PROGRAMMING LANGUAGE
1-2
1.2.1
Overview
1-2
1.2.2
Creating a Program
1-4
1.2.3
Translating a Program
1-4
1.2.4
Loading Program Logic and Data
1-4
1.2.5
Executing a Program
1-5
1.2.6
Execution History
1-5
1.2.7
Program Structure
1-5
1.3
SYSTEM SOFTWARE
1-7
1.3.1
Software Components
1-7
1.3.2
Supported Robots
1-7
1.4
CONTROLLER
1-8
1.4.1
Memory
1-8
1.4.2
Input/Output System
1-10
1.4.3
User Interface Devices
1-10
Chapter 2
LANGUAGE ELEMENTS
2-1
2.1
LANGUAGE COMPONENTS
2-2
2.1.1
Character Set
2-2
2.1.2
Operators
2-5
2.1.3
Reserved Words
2-6
2.1.4
User-Defined Identifiers
2-7
2.1.5
Labels
2-8
2.1.6
Predefined Identifiers
2-8
2.1.7
System Variables
2-10
2.1.8
Comments
2-10
2.2
TRANSLATOR DIRECTIVES
2-11
2.3
DATA TYPES
2-13
2.4
USER-DEFINED DATA TYPES AND STRUCTURES
2-14
2.4.1
User-Defined Data Types
2-14
2.4.2
User-Defined Data Structures
2-16
2.5
ARRAYS
2-18
2.5.1
Multi-Dimensional Arrays
2-19
2.5.2
Variable-Sized Arrays
2-20
Chapter 3
USE OF OPERATORS
3-1
v
Contents
MARRC75KR07091E Rev D
3.1
EXPRESSIONS AND ASSIGNMENTS
3-2
3.1.1
Rule for Expressions and Assignments
3-2
3.1.2
Evaluation of Expressions and Assignments
3-2
3.1.3
Variables and Expressions
3-4
3.2
OPERATIONS
3-4
3.2.1
Arithmetic Operations
3-5
3.2.2
Relational Operations
3-6
3.2.3
Boolean Operations
3-7
3.2.4
Special Operations
3-8
Chapter 4
PROGRAM CONTROL
4-1
4.1
OVERVIEW
4-2
4.2
PROGRAM CONTROL STRUCTURES
4-2
4.2.1
Alternation Control Structures
4-2
4.2.2
Looping Control Statements
4-3
4.2.3
Unconditional Branch Statement
4-3
4.2.4
Execution Control Statements
4-3
4.2.5
Condition Handlers
4-4
Chapter 5
ROUTINES
5-1
5.1
ROUTINE EXECUTION
5-2
5.1.1
Declaring Routines
5-2
5.1.2
Invoking Routines
5-5
5.1.3
Returning from Routines
5-7
5.1.4
Scope of Variables
5-8
5.1.5
Parameters and Arguments
5-9
5.1.6
Stack Usage
5-13
5.2
BUILT- IN ROUTINES
5-15
Chapter 6
CONDITION HANDLERS
6-1
6.1
CONDITION HANDLER OPERATIONS
6-3
6.1.1
Global Condition Handlers
6-3
6.2
CONDITIONS
6-6
6.2.1
Port_Id Conditions
6-7
6.2.2
Relational Conditions
6-7
6.2.3
System and Program Event Conditions
6-8
6.3
ACTIONS
6-11
6.3.1
Assignment Actions
6-11
6.3.2
Motion Related Actions
6-13
6.3.3
Routine Call Actions
6-13
6.3.4
Miscellaneous Actions
6-14
Chapter 7
FILE INPUT/OUTPUT OPERATIONS
7-1
7.1
OVERVIEW
7-3
7.2
FILE VARIABLES
7-3
7.3
OPEN FILE STATEMENT
7-4
7.3.1
Setting File and Port Attributes
7-5
7.3.2
File String
7-10
7.3.3
Usage String
7-11
7.4
CLOSE FILE STATEMENT
7-14
vi
MARRC75KR07091E Rev D
Contents
7.5
READ STATEMENT
7-14
7.6
WRITE STATEMENT
7-16
7.7
INPUT/OUTPUT BUFFER
7-17
7.8
FORMATTING TEXT (ASCII) INPUT/OUTPUT
7-18
7.8.1
Formatting INTEGER Data Items
7-19
7.8.2
Formatting REAL Data Items
7-22
7.8.3
Formatting BOOLEAN Data Items
7-25
7.8.4
Formatting STRING Data Items
7-27
7.8.5
Formatting VECTOR Data Items
7-31
7.8.6
Formatting Positional Data Items
7-32
7.9
FORMATTING BINARY INPUT/OUTPUT
7-34
7.9.1
Formatting INTEGER Data Items
7-35
7.9.2
Formatting REAL Data Items
7-36
7.9.3
Formatting BOOLEAN Data Items
7-36
7.9.4
Formatting STRING Data Items
7-36
7.9.5
Formatting VECTOR Data Items
7-37
7.9.6
Formatting POSITION Data Items
7-37
7.9.7
Formatting XYZWPR Data Items
7-37
7.9.8
Formatting XYZWPREXT Data Items
7-38
7.9.9
Formatting JOINTPOS Data Items
7-38
7.10
USER INTERFACE TIPS
7-38
7.10.1
USER Menu on the Teach Pendant
7-38
7.10.2
USER Menu on the CRT/KB
7-40
Chapter 8
POSITION DATA
8-1
8.1
OVERVIEW
8-2
8.2
POSITIONAL DATA
8-2
8.3
FRAMES OF REFERENCE
8-3
8.3.1
World Frame
8-4
8.3.2
User Frame (UFRAME)
8-5
8.3.3
Tool Definition (UTOOL)
8-5
8.3.4
Using Frames in the Teach Pendant Editor (TP)
8-5
8.4
JOG COORDINATE SYSTEMS
8-6
Chapter 9
FILE SYSTEM
9-1
9.1
OVERVIEW
9-2
9.2
FILE SPECIFICATION
9-3
9.2.1
Device Name
9-3
9.2.2
File Name
9-4
9.2.3
File Type
9-5
9.3
STORAGE DEVICE ACCESS
9-6
9.3.1
Overview
9-7
9.3.2
Memory File Devices
9-13
9.3.3
Virtual Devices
9-14
9.3.4
File Pipes
9-16
9.4
FILE ACCESS
9-20
9.5
FORMATTING XML INPUT
9-20
9.5.1
Overview
9-20
9.5.2
Installation Sequence
9-21
9.5.3
Example KAREL Program Referencing an XML File
9-22
vii
Contents
MARRC75KR07091E Rev D
9.5.4
Parse Errors
9-26
9.6
MEMORY DEVICE
9-27
Chapter 10
DICTIONARIES AND FORMS
10-1
10.1
OVERVIEW
10-3
10.2
CREATING USER DICTIONARIES
10-3
10.2.1
Dictionary Syntax
10-3
10.2.2
Dictionary Element Number
10-4
10.2.3
Dictionary Element Name
10-5
10.2.4
Dictionary Cursor Positioning
10-5
10.2.5
Dictionary Element Text
10-6
10.2.6
Dictionary Reserved Word Commands
10-8
10.2.7
Character Codes
10-10
10.2.8
Nesting Dictionary Elements
10-10
10.2.9
Dictionary Comment
10-11
10.2.10
Generating a KAREL Constant File
10-11
10.2.11
Compressing and Loading Dictionaries on the Controller
10-11
10.2.12
Accessing Dictionary Elements from a KAREL Program
10-12
10.3
CREATING USER FORMS
10-13
10.3.1
Form Syntax
10-14
10.3.2
Form Attributes
10-15
10.3.3
Form Title and Menu Label
10-16
10.3.4
Form Menu Text
10-17
10.3.5
Form Selectable Menu Item
10-18
10.3.6
Edit Data Item
10-19
10.3.7
Dynamic Forms using Tree View
10-26
10.3.8
Non-Selectable Text
10-27
10.3.9
Display Only Data Items
10-27
10.3.10
Cursor Position Attributes
10-27
10.3.11
Form Reserved Words and Character Codes
10-28
10.3.12
Form Function Key Element Name or Number
10-30
10.3.13
Form Function Key Using a Variable
10-31
10.3.14
Form Help Element Name or Number
10-31
10.3.15
Teach Pendant Form Screen
10-32
10.3.16
CRT/KB Form Screen
10-32
10.3.17
Form File Naming Convention
10-33
10.3.18
Compressing and Loading Forms on the Controller
10-34
10.3.19
Displaying a Form
10-36
Chapter 11
SOCKET MESSAGING
11-1
11.1
OVERVIEW
11-2
11.2
SYSTEM REQUIREMENTS
11-2
11.2.1
Overview
11-2
11.2.2
Software Requirements
11-2
11.2.3
Hardware Requirements
11-2
11.3
CONFIGURING THE SOCKET MESSAGING OPTION
11-3
11.3.1
Overview
11-3
11.3.2
Setting up a Server Tag
11-3
11.3.3
Setting up a Client Tag
11-6
11.4
SOCKET MESSAGING AND KAREL
11-9
11.4.1
Overview
11-9
11.4.2
MSG_CONN( string, integer )
11-9
viii
MARRC75KR07091E Rev D
Contents
11.4.3
MSG_DISCO( string, integer )
11-9
11.4.4
MSG_PING( string, integer )
11-10
11.4.5
Exchanging Data during a Socket Messaging Connection
11-10
11.5
NETWORK PERFORMANCE
11-10
11.5.1
Overview
11-10
11.5.2
Guidelines for a Good Implementation
11-11
11.6
PROGRAMMING EXAMPLES
11-11
11.6.1
11-11
11.6.2
A KAREL Client Application
11-11
11.6.3
A KAREL Server Application
11-14
11.6.4
ANSI C Loopback Client Example
11-16
Chapter 12
SYSTEM VARIABLES
12-1
12.1
ACCESS RIGHTS
12-2
12.2
STORAGE
12-3
Chapter 13
KAREL COMMAND LANGUAGE (KCL)
13-1
13.1
COMMAND FORMAT
13-2
13.1.1
Default Program
13-2
13.1.2
Variables and Data Types
13-3
13.2
PROGRAM CONTROL COMMANDS
13-3
13.3
ENTERING COMMANDS
13-3
13.3.1
Abbreviations
13-4
13.3.2
Error Messages
13-4
13.3.3
Subdirectories
13-4
13.4
COMMAND PROCEDURES
13-4
13.4.1
Command Procedure Format
13-5
13.4.2
Creating Command Procedures
13-6
13.4.3
Error Processing
13-6
13.4.4
Executing Command Procedures
13-6
Chapter 14
INPUT/OUTPUT SYSTEM
14-1
14.1
USER-DEFINED SIGNALS
14-2
14.1.1
DIN and DOUT Signals
14-2
14.1.2
GIN and GOUT Signals
14-3
14.1.3
AIN and AOUT Signals
14-3
14.1.4
Hand Signals
14-5
14.2
SYSTEM-DEFINED SIGNALS
14-5
14.2.1
Robot Digital Input and Output Signals (RDI/RDO)
14-6
14.2.2
Operator Panel Input and Output Signals (OPIN/OPOUT)
14-6
14.2.3
Teach Pendant Input and Output Signals (TPIN/TPOUT)
14-17
14.3
Serial Input/Output
14-22
14.3.1
Serial Input/Output
14-22
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-4
15.4.1
Priority Scheduling
15-5
ix
Contents
MARRC75KR07091E Rev D
15.4.2
Time Slicing
15-6
15.5
STARTING TASKS
15-6
15.5.1
Running Programs from the User Operator Panel (UOP) PNS Signal
15-7
15.5.2
Child Tasks
15-7
15.6
TASK CONTROL AND MONITORING
15-7
15.6.1
From TPP Programs
15-8
15.6.2
From KAREL Programs
15-8
15.6.3
From KCL
15-8
15.7
USING SEMAPHORES AND TASK SYNCHRONIZATION
15-9
15.8
USING QUEUES FOR TASK COMMUNICATIONS
15-14
Appendix A
KAREL LANGUAGE ALPHABETICAL DESCRIPTION
A-1
A.1
OVERVIEW
A-9
A.2
- A - KAREL LANGUAGE DESCRIPTION
A-18
A.2.1
ABORT Action
A-18
A.2.2
ABORT Condition
A-18
A.2.3
ABORT Statement
A-19
A.2.4
ABORT_TASK Built-In Procedure
A-19
A.2.5
ABS Built-In Function
A-20
A.2.6
ACOS Built-In Function
A-20
A.2.7
ACT_SCREEN Built-In Procedure
A-21
A.2.8
ACT_TBL Built-In Procedure
A-22
A.2.9
ADD_BYNAMEPC Built-In Procedure
A-24
A.2.10
ADD_DICT Built-In Procedure
A-25
A.2.11
ADD_INTPC Built-In Procedure
A-26
A.2.12
ADD_REALPC Built-In Procedure
A-27
A.2.13
ADD_STRINGPC Built-In Procedure
A-29
A.2.14
%ALPHABETIZE Translator Directive
A-30
A.2.15
APPEND_NODE Built-In Procedure
A-30
A.2.16
APPEND_QUEUE Built-In Procedure
A-31
A.2.17
APPROACH Built-In Function
A-32
A.2.18
ARRAY Data Type
A-33
A.2.19
ARRAY_LEN Built-In Function
A-34
A.2.20
ASIN Built-In Function
A-34
A.2.21
Assignment Action
A-35
A.2.22
Assignment Statement
A-36
A.2.23
ATAN2 Built-In Function
A-38
A.2.24
ATTACH Statement
A-39
A.2.25
ATT_WINDOW_D Built-In Procedure
A-39
A.2.26
ATT_WINDOW_S Built-In Procedure
A-40
A.2.27
AVL_POS_NUM Built-In Procedure
A-41
A.3
- B - KAREL LANGUAGE DESCRIPTION
A-42
A.3.1
BOOLEAN Data Type
A-42
A.3.2
BYNAME Built-In Function
A-43
A.3.3
BYTE Data Type
A-44
A.3.4
BYTES_AHEAD Built-In Procedure
A-45
A.3.5
BYTES_LEFT Built-In Function
A-46
A.4
- C - KAREL LANGUAGE DESCRIPTION
A-47
A.4.1
CALL_PROG Built-In Procedure
A-47
A.4.2
CALL_PROGLIN Built-In Procedure
A-48
A.4.3
CANCEL Action
A-49
A.4.4
CANCEL Statement
A-49
x
MARRC75KR07091E Rev D
Contents
A.4.5
CANCEL FILE Statement
A-50
A.4.6
CHECK_DICT Built-In Procedure
A-51
A.4.7
CHECK_EPOS Built-In Procedure
A-52
A.4.8
CHECK_NAME Built-In Procedure
A-53
A.4.9
CHR Built-In Function
A-53
A.4.10
CLEAR Built-In Procedure
A-54
A.4.11
CLEAR_SEMA Built-In Procedure
A-55
A.4.12
CLOSE FILE Statement
A-55
A.4.13
CLOSE HAND Statement
A-56
A.4.14
CLOSE_TPE Built-In Procedure
A-56
A.4.15
CLR_IO_STAT Built-In Procedure
A-57
A.4.16
CLR_PORT_SIM Built-In Procedure
A-57
A.4.17
CLR_POS_REG Built-In Procedure
A-58
A.4.18
%CMOSVARS Translator Directive
A-59
A.4.19
%CMOS2SHADOW Translator Directive
A-59
A.4.20
CNC_DYN_DISB Built-In Procedure
A-59
A.4.21
CNC_DYN_DISE Built-In Procedure
A-60
A.4.22
CNC_DYN_DISI Built-In Procedure
A-61
A.4.23
CNC_DYN_DISP Built-In Procedure
A-62
A.4.24
CNC_DYN_DISR Built-In Procedure
A-62
A.4.25
CNC_DYN_DISS Built-In Procedure
A-63
A.4.26
CNCL_STP_MTN Built-In Procedure
A-64
A.4.27
CNV_CNF_STRG Built-In Procedure
A-64
A.4.28
CNV_CONF_STR Built-In Procedure
A-65
A.4.29
CNV_INT_STR Built-In Procedure
A-66
A.4.30
CNV_JPOS_REL Built-In Procedure
A-67
A.4.31
CNV_REAL_STR Built-In Procedure
A-67
A.4.32
CNV_REL_JPOS Built-In Procedure
A-68
A.4.33
CNV_STR_CONF Built-In Procedure
A-69
A.4.34
CNV_STR_INT Built-In Procedure
A-70
A.4.35
CNV_STR_REAL Built-In Procedure
A-71
A.4.36
CNV_STR_TIME Built-In Procedure
A-71
A.4.37
CNV_TIME_STR Built-In Procedure
A-72
A.4.38
%COMMENT Translator Directive
A-73
A.4.39
COMPARE_FILE Built-in Procedure
A-73
A.4.40
CONDITION...ENDCONDITION Statement
A-75
A.4.41
CONFIG Data Type
A-77
A.4.42
CONNECT TIMER Statement
A-78
A.4.43
CONTINUE Action
A-79
A.4.44
CONTINUE Condition
A-79
A.4.45
CONT_TASK Built-In Procedure
A-80
A.4.46
COPY_FILE Built-In Procedure
A-81
A.4.47
COPY_PATH Built-In Procedure
A-82
A.4.48
COPY_QUEUE Built-In Procedure
A-83
A.4.49
COPY_TPE Built-In Procedure
A-85
A.4.50
COS Built-In Function
A-86
A.4.51
CR Input/Output Item
A-86
A.4.52
CREATE_TPE Built-In Procedure
A-87
A.4.53
CREATE_VAR Built-In Procedure
A-88
A.4.54
%CRTDEVICE
A-90
A.4.55
CURJPOS Built-In Function
A-91
A.4.56
CURPOS Built-In Function
A-92
A.4.57
CURR_PROG Built-In Function
A-93
A.5
- D - KAREL LANGUAGE DESCRIPTION
A-93
A.5.1
DAQ_CHECKP Built-In Procedure
A-93
xi
Contents
MARRC75KR07091E Rev D
A.5.2
DAQ_REGPIPE Built-In Procedure
A-94
A.5.3
DAQ_START Built-In Procedure
A-96
A.5.4
DAQ_STOP Built-In Procedure
A-98
A.5.5
DAQ_UNREG Built-In Procedure
A-99
A.5.6
DAQ_WRITE Built-In Procedure
A-100
A.5.7
%DEFGROUP Translator Directive
A-102
A.5.8
DEF_SCREEN Built-In Procedure
A-102
A.5.9
DEF_WINDOW Built-In Procedure
A-103
A.5.10
%DELAY Translator Directive
A-104
A.5.11
DELAY Statement
A-105
A.5.12
DELETE_FILE Built-In Procedure
A-106
A.5.13
DELETE_NODE Built-In Procedure
A-107
A.5.14
DELETE_QUEUE Built-In Procedure
A-107
A.5.15
DEL_INST_TPE Built-In Procedure
A-108
A.5.16
DET_WINDOW Built-In Procedure
A-109
A.5.17
DISABLE CONDITION Action
A-109
A.5.18
DISABLE CONDITION Statement
A-110
A.5.19
DISCONNECT TIMER Statement
A-111
A.5.20
DISCTRL_ALPH Built_In Procedure
A-112
A.5.21
DISCTRL_FORM Built_In Procedure
A-114
A.5.22
DISCTRL_LIST Built-In Procedure
A-116
A.5.23
DISCTRL_PLMN Built-In Procedure
A-117
A.5.24
DISCTRL_SBMN Built-In Procedure
A-119
A.5.25
DISCTRL_TBL Built-In Procedure
A-122
A.5.26
DISMOUNT_DEV Built-In Procedure
A-125
A.5.27
DISP_DAT_T Data Type
A-125
A.5.28
DOSFILE_INF Built-In Procedure
A-127
A.6
- E - KAREL LANGUAGE DESCRIPTION
A-128
A.6.1
ENABLE CONDITION Action
A-128
A.6.2
ENABLE CONDITION Statement
A-129
A.6.3
%ENVIRONMENT Translator Directive
A-129
A.6.4
ERR_DATA Built-In Procedure
A-131
A.6.5
ERROR Condition
A-132
A.6.6
EVAL Clause
A-133
A.6.7
EVENT Condition
A-134
A.6.8
EXP Built-In Function
A-134
A.7
- F - KAREL LANGUAGE DESCRIPTION
A-135
A.7.1
FILE Data Type
A-135
A.7.2
FILE_LIST Built-In Procedure
A-135
A.7.3
FOR...ENDFOR Statement
A-137
A.7.4
FORCE_SPMENU Built-In Procedure
A-138
A.7.5
FORMAT_DEV Built-In Procedure
A-141
A.7.6
FRAME Built-In Function
A-142
A.7.7
FROM Clause
A-144
A.8
- G - KAREL LANGUAGE DESCRIPTION
A-145
A.8.1
GET_ATTR_PRG Built-In Procedure
A-145
A.8.2
GET_FILE_POS Built-In Function
A-147
A.8.3
GET_JPOS_REG Built-In Function
A-148
A.8.4
GET_JPOS_TPE Built-In Function
A-148
A.8.5
GET_PORT_ASG Built-in Procedure
A-149
A.8.6
GET_PORT_ATR Built-In Function
A-151
A.8.7
GET_PORT_CMT Built-In Procedure
A-153
A.8.8
GET_PORT_MOD Built-In Procedure
A-154
A.8.9
GET_PORT_SIM Built-In Procedure
A-155
xii
MARRC75KR07091E Rev D
Contents
A.8.10
GET_PORT_VAL Built-In Procedure
A-156
A.8.11
GET_POS_FRM Built-In Procedure
A-157
A.8.12
GET_POS_REG Built-In Function
A-158
A.8.13
GET_POS_TPE Built-In Function
A-158
A.8.14
GET_POS_TYP Built-In Procedure
A-159
A.8.15
GET_PREG_CMT Built-In-Procedure
A-160
A.8.16
GET_QUEUE Built-In Procedure
A-161
A.8.17
GET_REG Built-In Procedure
A-162
A.8.18
GET_REG_CMT
A-163
A.8.19
GET_SREG_CMT Builtin Procedure
A-163
A.8.20
GET_STR_REG Built-In Procedure
A-164
A.8.21
GET_TIME Built-In Procedure
A-164
A.8.22
GET_TPE_CMT Built-in Procedure
A-165
A.8.23
GET_TPE_PRM Built-in Procedure
A-166
A.8.24
GET_TSK_INFO Built-In Procedure
A-168
A.8.25
GET_USEC_SUB Built-In Procedure
A-170
A.8.26
GET_USEC_TIM Built-In Function
A-171
A.8.27
GET_VAR Built-In Procedure
A-171
A.8.28
GO TO Statement
A-175
A.9
- H - KAREL LANGUAGE DESCRIPTION
A-176
A.9.1
HOLD Action
A-176
A.9.2
HOLD Statement
A-177
A.10
- I - KAREL LANGUAGE DESCRIPTION
A-178
A.10.1
IF ... ENDIF Statement
A-178
A.10.2
IN Clause
A-179
A.10.3
%INCLUDE Translator Directive
A-180
A.10.4
INDEX Built-In Function
A-181
A.10.5
INI_DYN_DISB Built-In Procedure
A-181
A.10.6
INI_DYN_DISE Built-In Procedure
A-183
A.10.7
INI_DYN_DISI Built-In Procedure
A-184
A.10.8
INI_DYN_DISP Built-In Procedure
A-186
A.10.9
INI_DYN_DISR Built-In Procedure
A-187
A.10.10
INI_DYN_DISS Built-In Procedure
A-188
A.10.11
INIT_QUEUE Built-In Procedure
A-189
A.10.12
INIT_TBL Built-In Procedure
A-190
A.10.13
IN_RANGE Built-In Function
A-201
A.10.14
INSERT_NODE Built-In Procedure
A-202
A.10.15
INSERT_QUEUE Built-In Procedure
A-203
A.10.16
INTEGER Data Type
A-204
A.10.17
INV Built-In Function
A-205
A.10.18
IO_MOD_TYPE Built-In Procedure
A-206
A.10.19
IO_STATUS Built-In Function
A-207
A.11
- J - KAREL LANGUAGE DESCRIPTION
A-208
A.11.1
J_IN_RANGE Built-In Function
A-208
A.11.2
JOINTPOS Data Type
A-209
A.11.3
JOINT2POS Built-In Function
A-209
A.12
- K - KAREL LANGUAGE DESCRIPTION
A-211
A.12.1
KCL Built-In Procedure
A-211
A.12.2
KCL_NO_WAIT Built-In Procedure
A-212
A.12.3
KCL_STATUS Built-In Procedure
A-213
A.13
- L - KAREL LANGUAGE DESCRIPTION
A-213
A.13.1
LN Built-In Function
A-213
A.13.2
LOAD Built-In Procedure
A-214
A.13.3
LOAD_STATUS Built-In Procedure
A-215
xiii
Contents
MARRC75KR07091E Rev D
A.13.4
LOCK_GROUP Built-In Procedure
A-216
A.13.5
%LOCKGROUP Translator Directive
A-217
A.14
- M - KAREL LANGUAGE DESCRIPTION
A-218
A.14.1
MIRROR Built-In Function
A-218
A.14.2
MODIFY_QUEUE Built-In Procedure
A-219
A.14.3
MOTION_CTL Built-In Function
A-221
A.14.4
MOUNT_DEV Built-In Procedure
A-221
A.14.5
MOVE_FILE Built-In Procedure
A-222
A.14.6
MSG_CONNECT Built-In Procedure
A-223
A.14.7
MSG_DISCO Built-In Procedure
A-225
A.14.8
MSG_PING
A-225
A.15
- N - KAREL LANGUAGE DESCRIPTION
A-226
A.15.1
NOABORT Action
A-226
A.15.2
%NOABORT Translator Directive
A-227
A.15.3
%NOBUSYLAMP Translator Directive
A-227
A.15.4
NODE_SIZE Built-In Function
A-227
A.15.5
%NOLOCKGROUP Translator Directive
A-229
A.15.6
NOMESSAGE Action
A-230
A.15.7
NOPAUSE Action
A-230
A.15.8
%NOPAUSE Translator Directive
A-231
A.15.9
%NOPAUSESHFT Translator Directive
A-231
A.16
- O - KAREL LANGUAGE DESCRIPTION
A-232
A.16.1
OPEN FILE Statement
A-232
A.16.2
OPEN HAND Statement
A-233
A.16.3
OPEN_TPE Built-In Procedure
A-233
A.16.4
ORD Built-In Function
A-234
A.16.5
ORIENT Built-In Function
A-235
A.17
- P - KAREL LANGUAGE DESCRIPTION
A-236
A.17.1
PATH Data Type
A-236
A.17.2
PATH_LEN Built-In Function
A-238
A.17.3
PAUSE Action
A-238
A.17.4
PAUSE Condition
A-239
A.17.5
PAUSE Statement
A-240
A.17.6
PAUSE_TASK Built-In Procedure
A-241
A.17.7
PEND_SEMA Built-In Procedure
A-242
A.17.8
PIPE_CONFIG Built-In Procedure
A-242
A.17.9
POP_KEY_RD Built-In Procedure
A-243
A.17.10
Port_Id Action
A-244
A.17.11
Port_Id Condition
A-245
A.17.12
POS Built-In Function
A-246
A.17.13
POS2JOINT Built-In Function
A-246
A.17.14
POS_REG_TYPE Built-In Procedure
A-248
A.17.15
POSITION Data Type
A-249
A.17.16
POST_ERR Built-In Procedure
A-250
A.17.17
POST_ERR_L Built-In Procedure
A-251
A.17.18
POST_SEMA Built-In Procedure
A-253
A.17.19
PRINT_FILE Built-In Procedure
A-253
A.17.20
%PRIORITY Translator Directive
A-254
A.17.21
PROG_BACKUP Built-In Procedure
A-255
A.17.22
PROG_CLEAR Built-In Procedure
A-258
A.17.23
PROG_RESTORE Built-In Procedure
A-260
A.17.24
PROG_LIST Built-In Procedure
A-262
A.17.25
PROGRAM Statement
A-263
A.17.26
PULSE Action
A-264
xiv
MARRC75KR07091E Rev D
Contents
A.17.27
PULSE Statement
A-265
A.17.28
PURGE CONDITION Statement
A-266
A.17.29
PURGE_DEV Built-In Procedure
A-267
A.17.30
PUSH_KEY_RD Built-In Procedure
A-268
A.18
- Q - KAREL LANGUAGE DESCRIPTION
A-269
A.18.1
QUEUE_TYPE Data Type
A-269
A.19
- R - KAREL LANGUAGE DESCRIPTION
A-269
A.19.1
READ Statement
A-269
A.19.2
READ_DICT Built-In Procedure
A-271
A.19.3
READ_DICT_V Built-In-Procedure
A-272
A.19.4
READ_KB Built-In Procedure
A-273
A.19.5
REAL Data Type
A-277
A.19.6
Relational Condition
A-279
A.19.7
RELAX HAND Statement
A-280
A.19.8
RELEASE Statement
A-281
A.19.9
REMOVE_DICT Built-In Procedure
A-281
A.19.10
RENAME_FILE Built-In Procedure
A-282
A.19.11
RENAME_VAR Built-In Procedure
A-283
A.19.12
RENAME_VARS Built-In Procedure
A-283
A.19.13
REPEAT ... UNTIL Statement
A-284
A.19.14
RESET Built-In Procedure
A-285
A.19.15
RESUME Action
A-286
A.19.16
RESUME Statement
A-286
A.19.17
RETURN Statement
A-287
A.19.18
ROUND Built-In Function
A-288
A.19.19
ROUTINE Statement
A-289
A.19.20
RUN_TASK Built-In Procedure
A-290
A.20
- S - KAREL LANGUAGE DESCRIPTION
A-291
A.20.1
SAVE Built-In Procedure
A-291
A.20.2
SAVE_DRAM Built-In Procedure
A-292
A.20.3
SELECT ... ENDSELECT Statement
A-293
A.20.4
SELECT_TPE Built-In Procedure
A-294
A.20.5
SEMA_COUNT Built-In Function
A-294
A.20.6
SEMAPHORE Condition
A-295
A.20.7
SEND_DATAPC Built-In Procedure
A-295
A.20.8
SEND_EVENTPC Built-In Procedure
A-296
A.20.9
SET_ATTR_PRG Built-In Procedure
A-297
A.20.10
SET_CURSOR Built-In Procedure
A-299
A.20.11
SET_EPOS_REG Built-In Procedure
A-300
A.20.12
SET_EPOS_TPE Built-In Procedure
A-301
A.20.13
SET_FILE_ATR Built-In Procedure
A-302
A.20.14
SET_FILE_POS Built-In Procedure
A-303
A.20.15
SET_INT_REG Built-In Procedure
A-304
A.20.16
SET_JPOS_REG Built-In Procedure
A-304
A.20.17
SET_JPOS_TPE Built-In Procedure
A-305
A.20.18
SET_LANG Built-In Procedure
A-306
A.20.19
SET_PERCH Built-In Procedure
A-307
A.20.20
SET_PORT_ASG Built-In Procedure
A-308
A.20.21
SET_PORT_ATR Built-In Function
A-309
A.20.22
SET_PORT_CMT Built-In Procedure
A-311
A.20.23
SET_PORT_MOD Built-In Procedure
A-312
A.20.24
SET_PORT_SIM Built-In Procedure
A-313
A.20.25
SET_PORT_VAL Built-In Procedure
A-314
A.20.26
SET_POS_REG Built-In Procedure
A-315
xv
Contents
MARRC75KR07091E Rev D
A.20.27
SET_POS_TPE Built-In Procedure
A-316
A.20.28
SET_PREG_CMT Built-In-Procedure
A-317
A.20.29
SET_REAL_REG Built-In Procedure
A-317
A.20.30
SET_REG_CMT Built-In-Procedure
A-317
A.20.31
SET_SREG_CMT Built-in Procedure
A-318
A.20.32
SET_STR_REG Built-in Procedure
A-319
A.20.33
SET_TIME Built-In Procedure
A-319
A.20.34
SET_TPE_CMT Built-In Procedure
A-321
A.20.35
SET_TRNS_TPE Built-In Procedure
A-321
A.20.36
SET_TSK_ATTR Built-In Procedure
A-322
A.20.37
SET_TSK_NAME Built-In Procedure
A-323
A.20.38
SET_VAR Built-In Procedure
A-324
A.20.39
%SHADOWVARS Translator Directive
A-327
A.20.40
SHORT Data Type
A-327
A.20.41
SIGNAL EVENT Action
A-328
A.20.42
SIGNAL EVENT Statement
A-328
A.20.43
SIGNAL SEMAPHORE Action
A-329
A.20.44
SIN Built-In Function
A-329
A.20.45
SQRT Built-In Function
A-330
A.20.46
%STACKSIZE Translator Directive
A-330
A.20.47
STD_PTH_NODE Data Type
A-331
A.20.48
STOP Action
A-331
A.20.49
STOP Statement
A-332
A.20.50
STRING Data Type
A-333
A.20.51
STR_LEN Built-In Function
A-334
A.20.52
STRUCTURE Data Type
A-334
A.20.53
SUB_STR Built-In Function
A-335
A.21
- T - KAREL LANGUAGE DESCRIPTION
A-336
A.21.1
TAN Built-In Function
A-336
A.21.2
%TIMESLICE Translator Directive
A-337
A.21.3
%TPMOTION Translator Directive
A-337
A.21.4
TRANSLATE Built-In Procedure
A-337
A.21.5
TRUNC Built-In Function
A-339
A.22
- U - KAREL LANGUAGE DESCRIPTION
A-340
A.22.1
UNHOLD Action
A-340
A.22.2
UNHOLD Statement
A-340
A.22.3
UNINIT Built-In Function
A-341
A.22.4
%UNINITVARS Translator Directive
A-341
A.22.5
UNLOCK_GROUP Built-In Procedure
A-342
A.22.6
UNPAUSE Action
A-343
A.22.7
UNPOS Built-In Procedure
A-344
A.22.8
USING ... ENDUSING Statement
A-344
A.23
- V - KAREL LANGUAGE DESCRIPTION
A-345
A.23.1
V_CAM_CALIB iRVision Built-In Procedure
A-345
A.23.2
V_GET_OFFSET iRVision Built-In Procedure
A-347
A.23.3
V_GET_PASSFL iRVision Built-In Procedure
A-348
A.23.4
V_GET_QUEUE iRVision Built-in Procedure
A-350
A.23.5
V_INIT_QUEUE iRVision Built-in Procedure
A-350
A.23.6
V_RALC_QUEUE iRVision Built-in Procedure
A-351
A.23.7
V_RUN_FIND iRVision Built-In Procedure
A-351
A.23.8
V_SET_REF iRVision Built-In Procedure
A-353
A.23.9
V_START_VTRK iRVision Built-in Procedure
A-354
A.23.10
V_STOP_VTRK iRVision Built-in Procedure
A-354
A.23.11
VAR_INFO Built-In Procedure
A-355
xvi
MARRC75KR07091E Rev D
Contents
A.23.12
VAR_LIST Built-In Procedure
A-357
A.23.13
VECTOR Data Type
A-360
A.23.14
VOL_SPACE Built-In Procedure
A-361
A.23.15
VREG_FND_POS iRVision Built-in Procedure
A-362
A.23.16
VREG_OFFSET iRVision Built-in Procedure
A-363
A.24
- W - KAREL LANGUAGE DESCRIPTION
A-364
A.24.1
WAIT FOR Statement
A-364
A.24.2
WHEN Clause
A-364
A.24.3
WHILE...ENDWHILE Statement
A-365
A.24.4
WITH Clause
A-365
A.24.5
WRITE Statement
A-366
A.24.6
WRITE_DICT Built-In Procedure
A-367
A.24.7
WRITE_DICT_V Built-In Procedure
A-368
A.25
- X - KAREL LANGUAGE DESCRIPTION
A-369
A.25.1
XML_ADDTAG Built-In Procedure
A-369
A.25.2
XML_GETDATA Built-In Procedure
A-370
A.25.3
XML_REMTAG Built-In Procedure
A-371
A.25.4
XML_SCAN Built-In Procedure
A-371
A.25.5
XML_SETVAR Built-In Procedure
A-373
A.25.6
XYZWPR Data Type
A-374
A.25.7
XYZWPREXT Data Type
A-375
A.26
- Y - KAREL LANGUAGE DESCRIPTION
A-375
A.27
- Z - KAREL LANGUAGE DESCRIPTION
A-375
Appendix B
KAREL EXAMPLE PROGRAMS
B-1
B.1
SETTING UP DIGITAL OUTPUT PORTS FOR PROCESS MONITORING
B-6
B.2
COPYING PATH VARIABLES
B-18
B.3
SAVING DATA TO THE DEFAULT DEVICE
B-28
B.4
STANDARD ROUTINES
B-31
B.5
USING REGISTER BUILT-INS
B-33
B.6
PATH VARIABLES AND CONDITION HANDLERS PROGRAM
B-38
B.7
LISTING FILES AND PROGRAMS AND MANIPULATING STRINGS
B-44
B.8
GENERATING AND MOVING ALONG A HEXAGON PATH
B-49
B.9
USING THE FILE AND DEVICE BUILT-INS
B-54
B.10
USING DYNAMIC DISPLAY BUILT-INS
B-58
B.11
MANIPULATING VALUES OF DYNAMICALLY DISPLAYED VARIABLES
B-68
B.12
DISPLAYING A LIST FROM A DICTIONARY FILE
B-70
B.12.1
Dictionary Files
B-80
B.13
USING THE DISCTRL_ALPHA BUILT-IN
B-81
B.13.1
Dictionary Files
B-85
B.14
APPLYING OFFSETS TO A COPIED TEACH PENDANT PROGRAM
B-85
Appendix C
KCL COMMAND ALPHABETICAL DESCRIPTION
C-1
C.1
ABORT command
C-6
C.2
APPEND FILE command
C-6
C.3
APPEND NODE command
C-6
C.4
CHDIR command
C-7
xvii
Contents
MARRC75KR07091E Rev D
C.5
CLEAR ALL command
C-7
C.6
CLEAR BREAK CONDITION command
C-8
C.7
CLEAR BREAK PROGRAM command
C-8
C.8
CLEAR DICT command
C-9
C.9
CLEAR PROGRAM command
C-9
C.10
CLEAR VARS command
C-9
C.11
COMPRESS DICT command
C-10
C.12
COMPRESS FORM command
C-10
C.13
CONTINUE command
C-11
C.14
COPY FILE command
C-11
C.15
CREATE VARIABLE command
C-12
C.16
DELETE FILE command
C-13
C.17
DELETE NODE command
C-13
C.18
DELETE VARIABLE command
C-14
C.19
DIRECTORY command
C-14
C.20
DISABLE BREAK PROGRAM command
C-15
C.21
DISABLE CONDITION command
C-15
C.22
DISMOUNT command
C-15
C.23
EDIT command
C-16
C.24
ENABLE BREAK PROGRAM
C-16
C.25
ENABLE CONDITION command
C-16
C.26
FORMAT command
C-17
C.27
HELP command
C-17
C.28
HOLD command
C-18
C.29
INSERT NODE command
C-18
C.30
LOAD ALL command
C-18
C.31
LOAD DICT command
C-19
C.32
LOAD FORM command
C-19
C.33
LOAD MASTER command
C-20
C.34
LOAD PROGRAM command
C-20
C.35
LOAD SERVO command
C-21
C.36
LOAD SYSTEM command
C-21
C.37
LOAD TP command
C-22
C.38
LOAD VARS command
C-23
C.39
LOGOUT command
C-24
C.40
MKDIR command
C-24
C.41
MOUNT command
C-24
C.42
MOVE FILE command
C-25
C.43
PAUSE command
C-25
C.44
PURGE command
C-26
C.45
PRINT command
C-26
xviii
MARRC75KR07091E Rev D
Contents
C.46
RECORD command
C-27
C.47
RENAME FILE command
C-27
C.48
RENAME VARIABLE command
C-28
C.49
RENAME VARS command
C-28
C.50
RESET command
C-29
C.51
RMDIR command
C-29
C.52
RUN command
C-30
C.53
RUNCF command
C-30
C.54
SAVE MASTER command
C-31
C.55
SAVE SERVO command
C-31
C.56
SAVE SYSTEM command
C-31
C.57
SAVE TP command
C-32
C.58
SAVE VARS command
C-33
C.59
SET BREAK CONDITION command
C-33
C.60
SET BREAK PROGRAM command
C-34
C.61
SET CLOCK command
C-35
C.62
SET DEFAULT command
C-35
C.63
SET GROUP command
C-35
C.64
SET LANGUAGE command
C-36
C.65
SET LOCAL VARIABLE command
C-36
C.66
SET PORT command
C-37
C.67
SET TASK command
C-37
C.68
SET TRACE command
C-38
C.69
SET VARIABLE command
C-38
C.70
SET VERIFY command
C-39
C.71
SHOW BREAK command
C-39
C.72
SHOW BUILTINS command
C-40
C.73
SHOW CONDITION command
C-40
C.74
SHOW CLOCK command
C-40
C.75
SHOW CURPOS command
C-41
C.76
SHOW DEFAULT command
C-41
C.77
SHOW DEVICE command
C-41
C.78
SHOW DICTS command
C-41
C.79
SHOW GROUP command
C-41
C.80
SHOW HISTORY command
C-42
C.81
SHOW LANG command
C-42
C.82
SHOW LANGS command
C-42
C.83
SHOW LOCAL VARIABLE command
C-42
C.84
SHOW LOCAL VARS command
C-44
C.85
SHOW MEMORY command
C-44
C.86
SHOW PROGRAM command
C-44
xix
Contents
MARRC75KR07091E Rev D
C.87
SHOW PROGRAMS command
C-45
C.88
SHOW SYSTEM command
C-45
C.89
SHOW TASK command
C-45
C.90
SHOW TASKS command
C-46
C.91
SHOW TRACE command
C-46
C.92
SHOW TYPES command
C-46
C.93
SHOW VARIABLE command
C-47
C.94
SHOW VARS command
C-47
C.95
SHOW data_type command
C-48
C.96
SIMULATE command
C-48
C.97
SKIP command
C-49
C.98
STEP OFF command
C-50
C.99
STEP ON command
C-50
C.100
TRANSLATE command
C-50
C.101
TYPE command
C-51
C.102
UNSIMULATE command
C-51
C.103
WAIT command
C-52
Appendix D
CHARACTER CODES
D-1
D.1
CHARACTER CODES
D-2
Appendix E
SYNTAX DIAGRAMS
E-1
Glossary
GL-28
Index
Index-1
xx
List of Figures
Figure
1-1.
Controller Memory
1-9
Figure
1-2.
R-30iA Controller
1-11
Figure
3-1.
Determining w_handle Relative to WORLD Frame
3-10
Figure
3-2.
Determining b_handle Relative to BUMPER Frame
3-11
Figure
7-1.
"t_sc" Screen
7-39
Figure
7-2.
"t_sc" Screen with $TP_USESTAT = TRUE
7-39
Figure
7-3.
"c_sc" Screen
7-40
Figure
7-4.
"c_sc" Screen with $CRT_USERSTAT = TRUE
7-41
Figure
8-1.
Referencing Positions in KAREL
8-4
Figure
9-1.
XML File 1 Separated start and end tags
9-22
Figure
9-2.
XML File 2 Combined start and end tags
9-22
Figure
9-3.
XML File 3 GRID tag not registered or processed
9-22
Figure
9-4.
KAREL Program
9-23
Figure
10-1.
Dictionary Compressor and User Dictionary File
10-12
Figure
10-2.
Teach Pendant Form Screen
10-32
Figure
10-3.
CRT/KB Form Screen
10-33
Figure
10-4.
Dictionary Compressor and Form Dictionary File
10-34
Figure
10-5.
Example of Selectable Menu Items
10-36
Figure
10-6.
Example of Edit Data Items
10-38
Figure
10-7.
Example of Display Only Data Items
10-42
Figure
14-1.
KAREL Logic for Converting Input to a Real Value Representing the Voltage
14-4
Figure
14-2.
RSR Timing Diagram
14-16
Figure
14-3.
PNS Timing Diagram
14-17
Figure
14-4.
Location of Ports on the Controller
14-23
Figure
15-1.
Task Synchronization Using a Semaphore
15-10
Figure
A-1.
Example of COMPARE_FILE built-in Procedure
A-74
Figure
A-2.
FRAME Built-In Function
A-143
Figure
A-3.
GET_USEC_SUB Built-In Function
A-171
Figure
E-1
E-3
Figure
E-2
E-4
Figure
E-3
E-5
Figure
E-4
E-6
Figure
E-5
E-7
xxi
Contents
MARRC75KR07091E Rev D
Figure
E-6.
...................................................................................................................................... E-8
Figure
E-7.
...................................................................................................................................... E-9
Figure
E-8.
E-10
Figure
E-9.
E-11
Figure
E-10.
E-12
Figure
E-11.
E-13
Figure
E-12.
E-14
Figure
E-13.
E-15
Figure
E-14.
E-16
Figure
E-15.
E-17
Figure
E-16.
E-18
Figure
E-17.
E-19
Figure
E-18.
E-20
Figure
E-19.
E-21
Figure
E-20.
E-22
Figure
E-21.
E-23
Figure
E-22.
E-24
Figure
E-23.
E-25
Figure
E-24.
E-26
Figure
E-25.
E-27
xxii
List of Tables
Table
2-1.
ASCII Character Set
2-2
Table
2-2.
Multinational Character Set
2-4
Table
2-3.
Graphics Character Set
2-5
Table
2-4.
KAREL Operators
2-5
Table
2-5.
KAREL Operator Precedence
2-6
Table
2-6.
Reserved Word List
2-6
Table
2-7.
Predefined Identifier and Value Summary
2-8
Table
2-8.
Port and File Predefined Identifier Summary
2-9
Table
2-9.
Translator Directives
2-11
Table
2-10.
Simple and Structured Data Types
2-14
Table
3-1.
Summary of Operation Result Types
3-3
Table
3-2.
KAREL Operators
3-5
Table
3-3.
Arithmetic Operations Using +, -, and * Operators
3-5
Table
3-4.
Arithmetic Operations Examples
3-5
Table
3-5.
Arithmetic Operations Using Bitwise Operands
3-6
Table
3-6.
KAREL Operator Precedence
3-6
Table
3-7.
Relational Operation Examples
3-7
Table
3-8.
BOOLEAN Operation Summary
3-8
Table
3-9.
BOOLEAN Operations Using AND, OR, and NOT Operators
3-8
Table
3-10.
Examples of Vector Operations
3-13
Table
5-1.
Stack Usage
5-13
Table
5-2.
KAREL Built—In Routine Summary
5-16
Table
6-1.
Conditions
6-2
Table
6-2.
Actions
6-2
Table
6-3.
Condition Handler Operations
6-3
Table
6-4.
Interval Between Global Condition Handler Scans
6-4
Table
6-5.
Port_Id Conditions
6-7
Table
6-6.
Relational Conditions
6-8
Table
6-7.
System and Program Event Conditions
6-9
Table
6-8.
Assignment Actions
6-12
Table
6-9.
Motion Related Actions
6-13
Table
6-10.
Miscellaneous Actions
6-14
Table
7-1.
Predefined File Variables
7-3
xxiii
Contents
MARRC75KR07091E Rev D
Table
7-2.
Predefined Attribute Types
7-5
Table
7-3.
Attribute Values
7-6
Table
7-4.
Usage Specifiers
7-11
Table
7-5.
Text (ASCII) Input Format Specifiers
7-18
Table
7-6.
Text (ASCII) Output Format Specifiers
7-19
Table
7-7.
Examples of INTEGER Input Data Items
7-20
Table
7-8.
Examples of INTEGER Output Data Items
7-21
Table
7-9.
Examples of REAL Input Data Items
7-23
Table
7-10.
Examples of REAL Output Data Items
7-24
Table
7-11.
Examples of BOOLEAN Input Data Items
7-26
Table
7-12.
Examples of BOOLEAN Output Data Items
7-27
Table
7-13.
Examples of STRING Input Data Items
7-28
Table
7-14.
Examples of STRING Output Data Items
7-30
Table
7-15.
Examples of VECTOR Output Data Items
7-32
Table
7-16.
Examples of POSITION Output Data Items (p =
POS(2.0,-4.0,8.0,0.0,90.0,0.0,config_var))
7-33
Table
7-17.
Binary Input/Output Format Specifiers
7-35
Table
7-18.
Defined Windows for t_sc"
7-38
Table
7-19.
Defined Windows for c_sc"
7-40
Table
8-1.
Turn Number Definitions
8-2
Table
9-1.
File Type Descriptions
9-5
Table
9-2.
Virtual Devices
9-14
Table
9-3.
System Variable Field Descriptions
9-18
Table
9-4.
File Listings for the MD Device
9-27
Table
9-5.
Testing Restrictions when Using the MD: Device
9-30
Table
10-1.
Conversion Characters
10-7
Table
10-2.
Reserved Words
10-9
Table
10-3.
Conversion Characters
10-20
Table
10-4.
Tree View Format
10-26
Table
10-5.
Reserved Words
10-28
Table
10-6.
Reserved Words for Scrolling Window
10-29
Table
12-1.
Access Rights for System Variables
12-2
Table
14-1.
Standard Operator Panel Input Signals
14-7
Table
14-2.
Standard Operator Panel Output Signals
14-7
Table
14-3.
User Operator Panel Input Signals
14-9
Table
14-4.
User Operator Panel Output Signals
14-14
Table
14-5.
Teach Pendant Input Signal Assignments
14-17
Table
14-6.
Ports P1 - P4
14-24
Table
14-7.
Default Communications Settings for Devices
14-24
Table
15-1.
System Function Priority Table
15-5
Table
A-1.
Syntax Notation
A-9
xxiv
MARRC75KR07091E Rev D
Contents
Table
A-2.
Actions
A-11
Table
A-3.
Clauses
A-11
Table
A-4.
Conditions
A-12
Table
A-5.
Data Types
A-12
Table
A-6.
Directives
A-13
Table
A-7.
KAREL Built—In Routine Summary
A-13
Table
A-8.
Items
A-16
Table
A-9.
Statements
A-17
Table
A-10.
Valid and Invalid BOOLEAN Values
A-42
Table
A-11.
INTEGER Representation of Current Time
A-165
Table
A-12.
Conversion Characters
A-185
Table
A-13.
Conversion Characters
A-193
Table
A-14.
Valid and Invalid INTEGER Literals
A-204
Table
A-15.
IO_STATUS Errors
A-207
Table
A-16.
Group_mask Setting
A-216
Table
A-17.
Group_mask Setting
A-221
Table
A-18.
Valid and Invalid REAL operators
A-278
Table
A-19.
Group_mask setting
A-291
Table
A-20.
Attribute Values
A-310
Table
A-21.
32-Bit INTEGER Format of Time
A-320
Table
A-22.
Example STRING Literals
A-333
Table
A-23.
Group_mask Settings
A-342
Table
A-24.
Function Code Values
A-346
Table
A-25.
Valid Data Types
A-356
Table
A-26.
Valid Data Types
A-358
Table
B-1.
KAREL Example Programs
B-2
Table
D-1.
ASCII Character Codes
D-2
Table
D-2.
Special ASCII Character Codes
D-3
Table
D-3.
Multinational Character Codes
D-4
Table
D-4.
Graphics Character Codes (not available in R-30iB)
D-6
Table
D-5.
Teach Pendant Input Codes
D-7
Table
D-6.
European Character Codes
D-8
Table
D-7.
Graphics Characters
D-10
xxv
Safety
FANUC Robotics is not and does not represent itself as an expert in safety systems, safety equipment, or
the specific safety aspects of your company and/or its work force. It is the responsibility of the owner,
employer, or user to take all necessary steps to guarantee the safety of all personnel in the workplace.
The appropriate level of safety for your application and installation can best be determined by safety
system professionals. FANUC Robotics therefore, recommends that each customer consult with such
professionals in order to provide a workplace that allows for the safe application, use, and operation of
FANUC Robotic systems.
According to the industry standard ANSI/RIA R15-06, the owner or user is advised to consult the
standards to ensure compliance with its requests for Robotics System design, usability, operation,
maintenance, and service. Additionally, as the owner, employer, or user of a robotic system, it is your
responsibility to arrange for the training of the operator of a robot system to recognize and respond to
known hazards associated with your robotic system and to be aware of the recommended operating
procedures for your particular application and robot installation.
Ensure that the robot being used is appropriate for the application. Robots used in classified (hazardous)
locations must be certified for this use.
FANUC Robotics therefore, recommends that all personnel who intend to operate, program, repair,
or otherwise use the robotics system be trained in an approved FANUC Robotics training course and
become familiar with the proper operation of the system. Persons responsible for programming the
system-including the design, implementation, and debugging of application programs-must be familiar
with the recommended programming procedures for your application and robot installation.
The following guidelines are provided to emphasize the importance of safety in the workplace.
CONSIDERING SAFETY FOR YOUR ROBOT INSTALLATION
Safety is essential whenever robots are used. Keep in mind the following factors with regard to safety:
The safety of people and equipment
Use of safety enhancing devices
Techniques for safe teaching and manual operation of the robot(s)
Techniques for safe automatic operation of the robot(s)
Regular scheduled inspection of the robot and workcell
Proper maintenance of the robot
xxvii
Safety
MARRC75KR07091E Rev D
Keeping People Safe
The safety of people is always of primary importance in any situation. When applying safety measures
to your robotic system, consider the following:
External devices
Robot(s)
Tooling
Workpiece
Using Safety Enhancing Devices
Always give appropriate attention to the work area that surrounds the robot. The safety of the work
area can be enhanced by the installation of some or all of the following devices:
Safety fences, barriers, or chains
Light curtains
Interlocks
Pressure mats
Floor markings
Warning lights
Mechanical stops
EMERGENCY STOP buttons
DEADMAN switches
Setting Up a Safe Workcell
A safe workcell is essential to protect people and equipment. Observe the following guidelines to
ensure that the workcell is set up safely. These suggestions are intended to supplement and not replace
existing federal, state, and local laws, regulations, and guidelines that pertain to safety.
Sponsor your personnel for training in approved FANUC Robotics training course(s) related to
your application. Never permit untrained personnel to operate the robots.
Install a lockout device that uses an access code to prevent unauthorized persons from operating
the robot.
Use anti-tie-down logic to prevent the operator from bypassing safety measures.
Arrange the workcell so the operator faces the workcell and can see what is going on inside the cell.
xxviii
MARRC75KR07091E Rev D
Safety
Clearly identify the work envelope of each robot in the system with floor markings, signs, and
special barriers. The work envelope is the area defined by the maximum motion range of the
robot, including any tooling attached to the wrist flange that extend this range.
Position all controllers outside the robot work envelope.
Never rely on software or firmware based controllers as the primary safety element unless they
comply with applicable current robot safety standards.
Mount an adequate number of EMERGENCY STOP buttons or switches within easy reach of the
operator and at critical points inside and around the outside of the workcell.
Install flashing lights and/or audible warning devices that activate whenever the robot is operating,
that is, whenever power is applied to the servo drive system. Audible warning devices shall
exceed the ambient noise level at the end-use application.
Wherever possible, install safety fences to protect against unauthorized entry by personnel into
the work envelope.
Install special guarding that prevents the operator from reaching into restricted areas of the work
envelope.
Use interlocks.
Use presence or proximity sensing devices such as light curtains, mats, and capacitance and
vision systems to enhance safety.
Periodically check the safety joints or safety clutches that can be optionally installed between the
robot wrist flange and tooling. If the tooling strikes an object, these devices dislodge, remove
power from the system, and help to minimize damage to the tooling and robot.
Make sure all external devices are properly filtered, grounded, shielded, and suppressed to prevent
hazardous motion due to the effects of electro-magnetic interference (EMI), radio frequency
interference (RFI), and electro-static discharge (ESD).
Make provisions for power lockout/tagout at the controller.
Eliminate pinch points . Pinch points are areas where personnel could get trapped between a
moving robot and other equipment.
Provide enough room inside the workcell to permit personnel to teach the robot and perform
maintenance safely.
Program the robot to load and unload material safely.
If high voltage electrostatics are present, be sure to provide appropriate interlocks, warning, and
beacons.
If materials are being applied at dangerously high pressure, provide electrical interlocks for
lockout of material flow and pressure.
xxix
Safety
MARRC75KR07091E Rev D
Staying Safe While Teaching or Manually Operating the Robot
Advise all personnel who must teach the robot or otherwise manually operate the robot to observe the
following rules:
Never wear watches, rings, neckties, scarves, or loose clothing that could get caught in moving
machinery.
Know whether or not you are using an intrinsically safe teach pendant if you are working in
a hazardous environment.
Before teaching, visually inspect the robot and work envelope to make sure that no potentially
hazardous conditions exist. The work envelope is the area defined by the maximum motion range
of the robot. These include tooling attached to the wrist flange that extends this range.
The area near the robot must be clean and free of oil, water, or debris. Immediately report unsafe
working conditions to the supervisor or safety department.
FANUC Robotics recommends that no one enter the work envelope of a robot that is on, except for
robot teaching operations. However, if you must enter the work envelope, be sure all safeguards
are in place, check the teach pendant DEADMAN switch for proper operation, and place the
robot in teach mode. Take the teach pendant with you, turn it on, and be prepared to release the
DEADMAN switch. Only the person with the teach pendant should be in the work envelope.
Warning
Never bypass, strap, or otherwise deactivate a safety device, such as a
limit switch, for any operational convenience. Deactivating a safety
device is known to have resulted in serious injury and death.
Know the path that can be used to escape from a moving robot; make sure the escape path is
never blocked.
Isolate the robot from all remote control signals that can cause motion while data is being taught.
Test any program being run for the first time in the following manner:
Warning
Stay outside the robot work envelope whenever a program is being
run. Failure to do so can result in injury.
— Using a low motion speed, single step the program for at least one full cycle.
— Using a low motion speed, test run the program continuously for at least one full cycle.
— Using the programmed speed, test run the program continuously for at least one full cycle.
Make sure all personnel are outside the work envelope before running production.
xxx

 

 

 

 

 

 

 

 

Content      ..      1       2         ..