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

 

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

 

Search            copyright infringement  

 

   

 

   

 

Content      ..     25      26      27      28     ..

 

 

 

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

 

 

MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Purpose: Loads a p-code file from the default storage device and default directory into memory using
the specified or default file name. The file type is assumed to be ‘‘.PC.’’
If file_spec is not specified, the default program is used. If the default has not been set, then the
message, ‘‘Default program name not set,’’ will be displayed.
The following note applies to R-30iB controllers:
Note The KAREL option must be installed on the robot controller in order to load KAREL
programs.
Examples: KCL> LOAD PROGRAM test_prog
KCL> LOAD PROG
C.35
LOAD SERVO command
Syntax: LOAD SERVO < file_name > <CONVERT>
where:
file_name : a valid file name
CONVERT : converts variables to system definition
Purpose: Loads a servo parameter file from the default storage device and default directory into
memory using the specified or default file name. The file type is assumed to be ‘‘.SV.’’
If file_name is not specified, the default file name, ‘‘SYSSERVO.SV,’’ is used.
Example: KCL> LOAD SERVO
C.36
LOAD SYSTEM command
Syntax: LOAD SYSTEM < file_name > <CONVERT>
where:
file_name : a valid file name
CONVERT : converts variables to system definition
C-21
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Purpose: Loads the specified system variable file into memory, assigning values to all of the saved
system variables. The default storage device and default directory are used with the specified or
default file name. The file type is assumed to be ‘‘.SV.’’
If file_name is not specified, the default file name, ‘‘SYSVARS.SV,’’ is used.
Examples: KCL> LOAD SYSTEM awdef
KCL> LOAD SYSTEM CONVERT
The following rules are applicable for system variables:
If an array system variable that is not referenced by a program already exists when a .SV file is
loaded, the size in the .SV file is used and the contents are loaded. No errors are posted.
If an array system variable that is referenced by a program already exists when a .SV file with a
LARGER size is loaded, the size in the .SV file is ignored, and NONE of the array values are
loaded. The following errors are posted; " var_name memory not updated", "Array len creation
mismatch".
If an array system variable that is referenced by a program already exists when a .SV file with
a SMALLER size is loaded, the size in the .SV file is ignored but ALL the array values are
loaded. No errors are posted.
If a .SV file with a different type definition is loaded, the .SV file will stop loading and detect
the error. The following errors are posted; "Create type - var_name failed", "Duplicate creation
mismatch".
If a .SV. file with a different type definition is loaded, but the CONVERT option is specified,
it tries to load as much as it can. For example, the controller has a SCR_T type which has the
field $NEW but not the field $OLD. When an old .SV file is loaded that has $OLD but not
$NEW, the load procedure creates the SCR_T type based on what is in the .SV file and posts a
"Create type - var_name failed", "Duplicate creation mismatch" error. It then creates the type
SCR_! which has the field $OLD but not the field $NEW. It then does a field by field copy of
all of the old valid fields into the new type. Therefore, since there is not $NEW information in
the old type that field is not updated and the $OLD information is discarded. Any fields whose
types don’t match are discarded from the loaded type. So if a field was changed from integer
to real, the integer field in the loaded data would be discarded. Any fields that are arrays will
follow the same rules as array system variables.
C.37
LOAD TP command
Syntax: LOAD TP < file_name > <OVERWRITE>
where:
file_name : a valid file name
OVERWRITE : If specified, may overwrite a previously loaded TP program with the same name
C-22
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Purpose: Loads a TP program from the default storage device and default directory into memory
using the specified or default file name. The file type is assumed to be ‘‘.TP.’’
If file_name is not specified, the default program is used. If the default has not been set, then the
message, ‘‘Default program name not set,’’ will be displayed.
Examples: KCL> LOAD TP testprog
KCL> LOAD TP
C.38
LOAD VARS command
Syntax: LOAD VARS < file_name > <CONVERT>
where:
file_name : a valid file name
CONVERT : converts variables to system definition
Purpose: Loads the specified or default variable data file from the default storage device and
directory into memory. The file type is assumed to be ‘‘.VR.’’
If file_name is not specified, the default program is used. If the default has not been set then the
message, ‘‘Default program name not set,’’ will be displayed.
Examples: KCL> LOAD VARS test_prog
KCL> LOAD VARS
The following rules are applicable for array variables:
If an array variable that is not referenced by a program already exists when a .VR file is loaded,
the size in the .VR file is used and the contents are loaded. No errors are posted.
If an array variable already exists when a program is loaded, the size in the .PC file is ignored
and the program is loaded anyway. The following errors are posted: " var_name PC array length
ignored", and "Array len creation mismatch".
If an array variable that is referenced by a program already exists when a .VR file with a LARGER
size is loaded, the size in the .VR file is ignored and NONE of the array values are loaded. The
following errors are posted; " var_name memory not updated," "Array len creation mismatch."
If an array variable that is referenced by a program already exists when a .VR file with a
SMALLER size is loaded, the size in the .VR file is ignored but ALL the array values are loaded.
The following errors are posted; " var_name array length updated," "Array len creation mismatch."
The following rules are applicable for user-defined types in KAREL programs:
C-23
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Once a type is created it can never be changed, regardless of whether a program references it
or not. If all the variables referencing the type are deleted, the type will also be deleted. A new
version can then be loaded.
If a type already exists when a program with a different type definition is loaded, the .PC file
will not be loaded. The following errors are posted; "Create type - var_name failed," "Duplicate
creation mismatch."
If a type already exists when a .VR file with a different type definition is loaded, the .VR file will
stop loading when it detects the error. The following errors are posted; "Create type - var_name
failed," "Duplicate creation mismatch".
C.39
LOGOUT command
Syntax: LOGOUT
Purpose: Logs the current user from the KCL device out of the system. The password level reverts
to the OPERATOR level. If passwords are not enabled, an error message will be displayed by KCL
such as, "No user currently logged in".
Example: KCL>LOGOUT
(The alarm message: "Logout (SAM) SETUP from KCL")
KCL Username>
C.40
MKDIR command
Syntax: MKDIR <device_name>\path_name
where:
device_name : a valid storage device
path_name : a subdirectory previously created on the memory card device using the mkdir command.
Purpose: MKDIR creates a subdirectory on the memory card (MC:) device. FANUC Robotics
recommends you nest subdirectories only to 8 levels.
Example: KCL> MKDIR mc:\test_dir
KCL> MKDIR mc:\prog_dir\tpnx_dir
C.41
MOUNT command
Syntax: MOUNT device_name
C-24
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
where:
device_name : a valid storage device
Purpose: MOUNT indicates to the controller that a storage device is available for reading or writing
data.
A device must be formatted with the KCL> FORMAT command before it can be mounted successfully.
Example: KCL> MOUNT rd:
C.42
MOVE FILE command
Syntax: MOVE <FILE> file_spec
where:
file_spec : a valid file specification.
Purpose: Moves the specified file from one memory file device to another. The file should exist
on the FROM or RAM disks. If file_spec is a file on the FROM disk, the file is moved to the RAM
disk, and vice versa.
The wildcard character (*) can be used to replace the entire file name, the first part of the file name,
the last part of the file name, or both the first and last parts of the file name. The file type can also
use the wildcard in the same manner. If file_spec specifies multiple files, then they are all moved
to the other disk.
Examples: KCL> MOVE FILE fr:*.kl
KCL> MOVE rd:*.*
C.43
PAUSE command
Syntax: PAUSE <( prog_name | ALL)> <FORCE>
where:
prog_name : the name of any KAREL or TP program which is a task
ALL : pauses all running tasks
FORCE : pauses the task even if the NOPAUSE attribute is set
Purpose: Pauses the specified running task. If prog_name is not specified, the default program is
used.
C-25
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Execution of the current motion segment and the current program statement is completed before the
task is paused.
Condition handlers remain active. If the condition handler action is NOPAUSE and the condition
is satisfied, task execution resumes.
If the statement is a WAIT FOR and the wait condition is satisfied while the task is paused, the
statement following the WAIT FOR is executed immediately when the task is resumed.
If the statement is a DELAY, timing will continue while the task is paused. If the delay time is finished
while the task is paused, the statement following the DELAY is immediately executed when the task
is resumed. If the statement is a READ, it will accept input even though the task is paused.
The KCL> CONTINUE command resumes execution of a paused task. When a task is paused, the
CYCLE START button on the operator panel has the same effect as the KCL> CONTINUE command.
Examples: KCL> PAUSE test_prog FORCE
KCL> PAUSE ALL
C.44
PURGE command
Syntax: PURGE device_name
where:
device_name : the name of the memory file device to be purged
Purpose: Purges the specified memory file device by freeing any used blocks that are no longer
needed. The device should be set to "FR:" for FROM disk, "RD:" for RAM disk, or "MF:" for
both disks.
The purge operation is only necessary when the device does not have enough memory to perform an
operation. The purge operation will erase file blocks that were previously used, but are no longer
needed. These are called garbage blocks. The FROM disk can contain many garbage blocks if files
are deleted or overwritten. The RAM disk will not normally contain garbage blocks, but they may
occur when power is removed during a file copy.
The device must be mounted and no files can be open on the device or an error will be displayed.
Examples: KCL> PURGE fr:
KCL> PURGE mf:
C.45
PRINT command
Syntax: PRINT file_spec
C-26
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
where:
file_spec : a valid file specification
Purpose: Allows you to print the contents of an ASCII file to the default device.
Example: KCL> PRINT testprog.kl
C.46
RECORD command
Syntax: RECORD <[ prog_name ]> var_name
where:
prog_name : the name of any KAREL or TP program
var_name : the name of any POSITION, XYZWPR, or JOINTPOS variable
Purpose: Records the position of the TCP and/or auxiliary or extended axes. The robot must be
calibrated before the RECORD command is issued. The variable can be a system variable or a program
variable that exists in memory. The position is recorded relative to the user frame of reference.
You must enter the KCL> SAVE command to permanently assign the recorded position. The Record
function key, F3, under the teach pendant TEACH menu also allows you to record positions.
Example: KCL> RECORD [paint_prog]start_pos
KCL> RECORD $GROUP[1].$uframe
C.47
RENAME FILE command
Syntax: RENAME FILE old_file_spec TO new_file_ spec
where:
old_file_spec : a valid file specification
new_file_spec : a valid file specification
Purpose: Changes the old_file_spec to the new_file_spec . The file will no longer exist under the
old_file_spec . The old_file_spec and the new_file_spec must include both the file name and the file
type. The same file type must be used in both file_specs but they cannot be the same file.
Use the KCL> COPY FILE command to change the device name of a file.
Examples: KCL> RENAME FILE test.kl TO productn.kl
C-27
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
KCL> RENAME FILE mycmd.cf TO yourcmd.cf
C.48
RENAME VARIABLE command
Syntax: RENAME VARIABLE <[ prog_name ]> old_var_ name new_var_name
where:
prog_name : the name of any KAREL or TP program
old_var_name : the name of any program variable
new_var_name : a valid program variable name
Purpose: Changes the old_var_name to the new_var_name in the program specified with the
old_var_name . The variable will no longer exist under the old_var_name . The variable must exist
in memory under the old_var_name in the specified program.
The new_var_name cannot already exist in memory. The variable still belongs to the same program.
You cannot specify a prog_name with the new_var_name.
You must enter the KCL> SAVE VARS command to make the change permanent.
Examples: KCL> RENAME VARIABLE [test_prog]count part_count
KCL> RENAME VAR count part_count
C.49
RENAME VARS command
Syntax: RENAME VARS old_prog_name new_prog_name
where:
old_prog_name : the name of any KAREL or TP program
new_prog_name : the name of any KAREL or TP program
Purpose: Changes the name of the variable data associated with the old_prog_name to the
new_prog_name . The variable data will no longer exist under the old_prog_name .
Before you use the RENAME VARS command, the variable data must exist in memory under the
old_prog_name . Variable data cannot already exist in memory under the new_prog_name .
The command does not rename the program. To rename a KAREL program, use the KCL> RENAME
FILE to rename the .KL file, edit the program name in the .KL file, translate the program, and load
the new C file. To rename a TP program, use the SELECT menu.
C-28
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
You must enter the KCL> SAVE VARS command to make the change permanent.
Example: KCL> RENAME VARS test_1 test_2
Use this sequence of KCL commands to copy the variable data of one program ( prog_1 ) into
a variable file that is then used by another program ( prog_2 ):
LOAD VARS prog_1
RENAME VARS prog_1 prog_2
SAVE VARS prog_2
LOAD ALL prog_2
The effect of this sequence of commands cannot be accomplished with the KCL> COPY FILE
command.
The name of the program to which the variable data belongs is stored in the variable file. The KCL>
COPY FILE command does not change that stored program name, so the data cannot be used with
another program.
C.50
RESET command
Syntax: RESET
Purpose: Enables servo power after an error condition has shut off servo power, provided the cause
of the error has been cleared. The command also clears the message line on the CRT/KB display. The
error message remains displayed if the error condition still exists.
The RESET command has no effect on a program that is being executed. It has the same effect as
the FAULT RESET button on the operator panel and the RESET function key on the teach pendant
RESET screen.
Example: KCL> RESET
C.51
RMDIR command
Syntax: RMDIR <device_name>\path_name
where:
device_name : a valid storage device
path_name : a subdirectory previously created on the memory card device using the mkdir command.
C-29
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Purpose: RMDIR deletes a subdirectory on the memory card (MC:) device. The directory must be
empty before it can be deleted.
Example: KCL> RMDIR mc:\test_dir
KCL> RMDIR mc:\test_dir\prog_dir
C.52
RUN command
Syntax: RUN < prog_name >
where:
prog_name :the name of any KAREL or TP program
Purpose: Executes the specified program. The program must be loaded in memory. If no program is
specified the default program is run. If uninitialized variables are encountered, program execution
is paused.
Execution begins at the first executable line. RUN is a motion command; therefore, the device from
which it is issued must have motion control. If a RUN command is issued in a command file, it is
executed as a NOWAIT command. Therefore, the statement following the RUN command will be
executed immediately after the RUN command is issued without waiting for the program, specified by
the RUN command, to end.
See Also: Refer to the $RMT_MASTER description in the FANUC Robotics Software Reference
Manual for more information about assigning motion control to a remote device.
Example: KCL> RUN test_prog
C.53
RUNCF command
Syntax: RUNCF input_file_spec < output_file_spec >
where:
input_file_spec : a valid file specification
output_file_spec : a valid file specification
Purpose: Executes the KCL command procedure that is stored in the specified input file and displays
the output to the specified output file. The input file type is assumed to be .CF. The output file type is
assumed to be .LS if no file type is supplied.
If output_file_spec is not specified, the output will be displayed to the KCL output window.
C-30
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
The RUNCF command can be nested within command files up to four levels. Use %INCLUDE
input_file_spec to include another .CF file into the command procedure. RUNCF command itself is
not allowed inside a command procedure.
If the command file contains motion commands, the device from which the RUNCF command is
issued must have motion control.
See Also: Refer to Section 13.4 , ‘‘Command Procedures,’’ for more information
Examples: KCL> RUNCF startup output
KCL> RUNCF startup
C.54
SAVE MASTER command
Syntax: SAVE MASTER < file_name >
where:
file_name : a valid file name
Purpose: Saves the mastering data file from the default storage device and default directory into
memory using the specified or default file name. The file type will be ‘‘.SV.’’
If file_name is not specified, the default file name, ‘‘SYSMAST.SV,’’ is used.
Example: KCL> SAVE MASTER
C.55
SAVE SERVO command
Syntax: SAVE SERVO < file_name >
where:
file_name :a valid file name
Purpose: Saves the servo parameters into the default storage device using the specified or default file
name. The file type will be ‘‘.SV.’’
If file_name is not specified, the default file name, ‘‘SYSSERVO.SV,’’ is used.
Example: KCL> SAVE SERVO
C.56
SAVE SYSTEM command
Syntax: SAVE SYSTEM < file_name >
C-31
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
where:
file_name :a valid file name
Purpose: Saves the system variable values into the default storage device and default directory
using the specified system variable file (.SV). If you do not specify a file_spec the default name,
‘‘SYSVARS.SV,’’is used. For example:
SAVE SYSTEM file_1
In this case, the system variable data is saved in a variable file called file_1.SV .
SAVE SYSTEM
In this case, the system variable data is saved in a system variable file ‘‘SYSVARS.SV.’’
Examples: KCL> SAVE SYSTEM file_1
KCL> SAVE SYSTEM
C.57
SAVE TP command
Syntax: SAVE TP < file_name > <= prog_name >
where:
file_name : a valid file name
prog_name : the name of any TP program
Purpose: Saves the specified TP program to the specified file (.TP). If you do not specify a file_name
or a prog_name , the default program name is used. If only a file_name is specified, that name
will also be used for prog_name . For example:
SAVE TP file_1
In this case, the TP program file_1 is saved in a file called file_1.TP .
SAVE TP = prog_1
In this case, the TP program prog_1 is saved in a file whose name is the default program name.
If you specify a program name, it must be preceded by an equal sign (=).
Examples: KCL> SAVE TP file_1 = prog_1
KCL> SAVE TP file_1
C-32
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
KCL> SAVE TP = prog_1
KCL> SAVE TP
C.58
SAVE VARS command
Syntax: SAVE VARS < file_name > <= prog_name >
where:
file_name : a valid file name
prog_name : the name of any KAREL or TP program
Purpose: Saves variable data from the specified program, including the currently assigned values,
to the specified variable file (.VR). If you do not specify a file_name or a prog_name , the default
program name is used. If only a file_name is specified, that name will also be used for prog_name
. For example:
SAVE VARS file_1
In this case, the variable data for the program file_1 is saved in a variable file called file_1.VR.
SAVE VARS = prog_ 1
In this case, the variable data for prog_ 1 is saved in a variable file whose name is the default
program name.
If you specify a program name, it must be preceded by an equal sign (=).
Any variable data that is not saved is lost when an initial start of the controller is performed.
Examples: KCL> SAVE VARS file_1 = prog_1
KCL> SAVE VARS file_1
KCL> SAVE VARS = prog_1
KCL> SAVE VARS
C.59
SET BREAK CONDITION command
Syntax: SET BREAK CONDITION < prog_name > condition_no
where:
prog_name : the name of any running or paused KAREL program
C-33
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
condition_no : a particular condition
Purpose: Allows you to set a break point on the specified condition in the specified program or
default program. The specified condition must already exist so the program must be running or
paused. When the break point is triggered, a message will be posted to the error log and the break
point will be cleared.
Examples: KCL> SET BREAK CONDITION test_prog 1
KCL> SET BREAK COND 2
C.60
SET BREAK PROGRAM command
Syntax: SET BREAK PROGRAM < prog_name > brk_pnt_no line_no <(PAUSE | DISPLAY |
TRACE ON | TRACE OFF)>
where:
prog_name : the name of any KAREL or TP program in memory
brk_pnt_no : a particular program break point
line_no : a line number
PAUSE : task is paused when break point is executed
DISPLAY : message is displayed on the teach pendant USER menu when break point is executed
TRACE ON : trace is enabled when break point is executed
TRACE OFF : trace is disabled when break point is executed
Purpose: Allows you to set a break point at a specified line in the specified or default program.
The specified line must be an executable line of source code. Break points will be executed before
the specified line in the program. By default the task will pause when the break point is executed.
DISPLAY, TRACE ON, and TRACE OFF will not pause task execution.
Break points are local only to the program in which the break points were set. For example, break
point #1 can exist among one or more loaded programs with each at a unique line number. If you
specify an existing break point number, the existing break point is cleared and a new one is set
in the specified program at the specified line.
Break points in a program are cleared if the program is cleared from memory. You also use the KCL>
CLEAR BREAK PROGRAM command to clear break points from memory.
Use the KCL> CONTINUE command or the operator panel CYCLE START button to resume
execution of a paused program.
C-34
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Examples: KCL> SET BREAK PROGRAM test_prog 1 22 DISPLAY
KCL> SET BREAK PROG 3 30
C.61
SET CLOCK command
Syntax: SET CLOCK ’dd-mmm-yy hh:mm’
where:
The date is specified using two numeric characters for the day, a three letter abbreviation for the
month, and two numeric characters for the year; for example, 01-JAN- 00.
The time is specified using two numeric characters for the hour and two numeric characters for the
minutes; for example, 12:45.
Purpose: Sets the date and time of the internal controller clock.
The date and time are included in directory and translator listings.
See Also: SHOW CLOCK command
Example: KCL> SET CLOCK ’02-JAN-xx 21:45’
C.62
SET DEFAULT command
Syntax: SET DEFAULT prog_name
where:
prog_name : the name of any KAREL or TP program
Purpose: Sets the default program name to be used as an argument default for program and file
names. The default program name can also be set at the teach pendant.
See Also: Section 13.1.1 , ‘‘Default Program’’
Examples: KCL> SET DEFAULT test_prog
KCL> SET DEF test_prog
C.63
SET GROUP command
Syntax: SET GROUP group_no
where:
C-35
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
group_no : a valid group number
Purpose: Sets the default group number to use in other commands.
Example: KCL> SET GROUP 1
C.64
SET LANGUAGE command
Syntax: SET LANGUAGE lang_name
where:
lang_name : a particular language. The available choices are ENGLISH, JAPANESE, FRENCH,
GERMAN, SPANISH or DEFAULT.
Purpose: Sets the $LANGUAGE system variable which determines the language to use.
Example: KCL> SET LANG ENGLISH
C.65
SET LOCAL VARIABLE command
Syntax: SET LOCAL VARIABLE var_name <IN rout_name > <FROM prog_name > <
task_name > = value <{, value }>
where:
var_name :a local variable or parameter name
rout_name :the name of any KAREL routine
prog_name :the name of any KAREL program
task_name : the name of any KAREL task
value : new value for variable
Purpose: Assigns the specified value to the specified local variable or routine parameter. You can
assign constant values or variable values, but the value must be of the data type that has been declared
for the variable.
Please use the HELP SET VAR command for more information on assigning data types.
If the IN clause is omitted, the routine at the top of the stack is assumed. If the FROM clause is
omitted, the default program is assumed. If the task_name is omitted, the stack of the KCL default
task is searched.
Note The file RD: prog_name.rs is required to obtain local variable information.
C-36
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Example: See SHOW LOCAL VARIABLE command.
See Also: SHOW LOCAL VARIABLE and TRANSLATE command.
C.66
SET PORT command
Syntax: SET PORT port_name [index] = value
where:
port_name[index] : a valid I/O port value : a new value for the port
Purpose: Assigns the specified value to a specified input or output port. SET PORT can be used with
either physical or simulated output ports, but only with simulated input ports.
The valid ports are:
DIN, DOUT, RDO, OPOUT, TPOUT, WDI, WDO (BOOLEAN)-AIN, AOUT, GIN, GOUT
(INTEGER)
See Also: SIMULATE, UNSIMULATE command, Chapter 14 INPUT/OUTPUT SYSTEM ,
application-specific FANUC Robotics Setup and Operations Manual.
Example: KCL> SET PORT DOUT [1] = ON
KCL> SET PORT GOUT [2] = 255
KCL> SET PORT AIN [1] = 1000
C.67
SET TASK command
Syntax: SET TASK <[ prog_name ]> attr_name = value
where:
prog_name : the name of any KAREL or TP program which is a task
attr_name : PRIORITY or TRACELEN
value : new integer value for attribute
Purpose: Sets the specified task attribute. PRIORITY sets the task priority. The lower the number,
the higher the priority. 1 to 89 is lower than motion, but higher than the user interface. 90 to 99 is
lower than the user interface. The default is 50. TRACELEN sets the trace buffer length. The default
is 10 lines.
C-37
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
C.68
SET TRACE command
Syntax: SET TRACE (OFF | ON) <[ prog_name ]>
where:
prog_name : the name of any KAREL or TP program loaded in memory
Purpose: Turns the trace function ON or OFF (default is OFF). The program statement currently
being executed and its line number are stored in a buffer when TRACE is ON. TRACE should only
be set to ON during debugging operations because it slows program execution. To see the trace
data, SHOW TRACE command must be used.
See Also: SHOW TRACE command
C.69
SET VARIABLE command
Syntax: SET VARIABLE <[ prog_name ]> var_name = value <{, value }>
where:
prog_name : the name of any KAREL or TP program
var_name : a valid program variable
value : new value for variable or a program or system variable
Purpose: Assigns the specified value to the specified variable. You can assign constant values or
variable values, but the value must be of the data type that has been declared for the variable.
You can assign values to system variables with KCL write access, to program variables, or to standard
and user-defined variables and fields. You can assign only one ARRAY element. Use brackets ([])
after the variable name to specify an element.
Certain data types like positions and vectors might have more than one value specified.
KCL> SET VAR position_var = 0,0,0,0,0,0
The SET VARIABLE command displays the previous value of the specified variable followed by the
value which you have just assigned, providing you with an opportunity to check the assignment. The
DATA key on the teach pendant also allows you to assign values to variables.
When you use SET VARIABLE to define a position you can use one of the following formats:
KCL> SET VARIABLE var_name.X = value
KCL> SET VARIABLE var_name.Y = value
C-38
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
KCL> SET VARIABLE var_name.Z = value
KCL> SET VARIABLE var_name.W = value
KCL> SET VARIABLE var_name = value
where X,Y,Z,W,P, and R specify the location and orientation, c_str is a string value representing
configuration in terms of joint placement and turn numbers. Refer to Section 8.1, ‘‘Positional Data.’’
For example, to set X=200.0, W=60.0 and the turn numbers for axes 4 and 6 to 1 and
0 you would
type the following lines:
KCL> SET VARIABLE var_name.X = 200
KCL> SET VARIABLE var_name.W = 60
KCL> SET VARIABLE var_name.C = ’1,0’
You must enter the KCL>SAVE VARS command to make the changes permanent.
See Also: Section 2.3 , ‘‘Data Types’’
Examples: KCL> SET VARIABLE [prog1] scale = $MCR.$GENOVERRIDE
KCL> SET VAR weld_pgm.angle = 45.0
KCL> SET VAR v[2,1,3].r = -0.897
KCL> SET VAR part_array[2] = part_array[1]
KCL> SET VAR weld_pos.x = 50.0
KCL> SET VAR pth_b[3].nodepos = pth_a[3].nodepos
C.70
SET VERIFY command
Syntax: SET VERIFY (ON | OFF)
Purpose: This turns the display of KCL commands ON or OFF during execution of a KCL command
procedure (default is ON, meaning each command is displayed as it is executed). Only the RUNCF
command is displayed when VERIFY is OFF.
C.71
SHOW BREAK command
Syntax: SHOW BREAK < prog_name >
where:
C-39
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
prog_name : the name of any KAREL or TP program in memory
Purpose: Displays a list of program break points for the specified or default program. The following
information is displayed for each break point:
Break point number
Line number of the break point in the program
Examples: KCL> SHOW BREAK test_prog
KCL> SH BREAK
C.72
SHOW BUILTINS command
Syntax: SHOW BUILTINS
Purpose: Displays all the softpart built-ins that are loaded on the controller.
Example: KCL> SHOW BUILTINS
C.73
SHOW CONDITION command
Syntax: SHOW CONDITION < prog_name > < condition_no >
where:
prog_name : the name of any running or paused KAREL program
condition_no : a particular condition
Purpose: Displays the specified condition handler or a list of condition handlers for the specified or
default program. Also displays enabled/disabled status and whether a break point is set. Condition
handlers only exist when a program is running or paused.
Examples: KCL> SHOW CONDITION test_prog
KCL> SH COND
C.74
SHOW CLOCK command
Syntax: SHOW CLOCK
Purpose: Displays the current date and time of the controller clock.
See Also: SET CLOCK command
C-40
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Example: KCL> SHOW CLOCK
C.75
SHOW CURPOS command
Syntax: SHOW CURPOS
Purpose: Displays the position of the TCP relative to the current user frame of reference with an
x, y, and z location in millimeters; w, p, and r orientation in degrees; and the current configuration
string. Be sure the robot is calibrated.
Example: KCL> SHOW CURPOS
C.76
SHOW DEFAULT command
Syntax: SHOW DEFAULT
Purpose: Shows the current default program name.
Example: KCL> SHOW DEFAULT
C.77
SHOW DEVICE command
Syntax: SHOW DEVICE device_name:
where:
device_name : device to be shown
Purpose: Shows the status of the device.
Example: KCL> SHOW DEVICE rd:
C.78
SHOW DICTS command
Syntax: SHOW DICTS
Purpose: Shows the dictionaries loaded in the system for the language specified in the system
variable $LANGUAGE.
Example: KCL> SHOW DICTS
C.79
SHOW GROUP command
Syntax: SHOW GROUP
C-41
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Purpose: Shows the default group number.
Example: KCL> SHOW GROUP
C.80
SHOW HISTORY command
Syntax: SHOW HISTORY
Purpose: Shows the nesting information of the routine calls. To display the source lines of KAREL
programs, the .KL programs must exist on the RAM disk.
Example: KCL> SHOW HIST
C.81
SHOW LANG command
Syntax: SHOW LANG
Purpose: Shows the language specified in the system variable $LANGUAGE.
Example: KCL> SHOW LANG
C.82
SHOW LANGS command
Syntax: SHOW LANGS
Purpose: Shows all language currently available in the system.
Example: KCL> SHOW LANGS
C.83
SHOW LOCAL VARIABLE command
Syntax: SHOW LOCAL VARIABLE var_name <(HEXADECIMAL | BINARY)> <IN rout_name
> <FROM prog_name > < task_name >
where:
var_name : a local variable or parameter name
rout_name : the name of any KAREL routine
prog_name : the name of any KAREL program
task_name : the name of any KAREL task
C-42
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Purpose: Displays the name, type, and value of the specified local variable or routine parameter. Use
brackets ([ ]) after the variable name to specify a specific ARRAY element. If you do not specify a
specific element the entire variable is displayed.
If the IN clause is omitted, the routine at the top of the stack is assumed. If the FROM clause is
omitted, the default program is assumed. If the task_name is omitted, the stack of the KCL default
task is searched.
Note The file RD: prog_name.rs is required to obtain local variable information.
Example: Generate a .rs file from the KAREL translator.
KCL> TRANS testprog RS
Copy the .rs file to the RD device.
This is done automatically when you load the program from the KCL.
KCL> SET DEF testprog
KCL> LOAD PROG
Copied testprog.rs to RD:testprog.rs
To show local variables, the program must be running, paused, or aborted in the routine specified.
KCL> RUN
KCL> SHOW LOCAL VARS
KCL> SHOW LOCAL VARS IN testprog VALUES
KCL> SHOW LOCAL VAR var_1 IN rout_1 FROM testprog testtask
KCL> SHOW LOCAL VAR param_1
To set local variables, the program must be paused.
KCL> pause
KCL> set local var int_var = 12345
KCL> set local var strparam = "This is a string parameter"
See Also: TRANSLATE command.
C-43
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
C.84
SHOW LOCAL VARS command
Syntax: SHOW LOCAL VARS <VALUES> <IN rout_name > <FROM prog_name > < task_name
>
where:
VALUES: :specifies values should be displayed
rout_name :the name of any KAREL routine
prog_name :the name of any KAREL program
task_name :the name of any KAREL task
Purpose: Displays a list including the name, type, and if specified, the current value of each local
variable and each routine parameter.
If the IN clause is omitted, the routine at the top of the stack is assumed. If the FROM clause is
omitted, the default program is assumed. If the task_name is omitted, the stack of the KCL default
task is searched
Note The file RD: prog_name.rs is required to obtain local variable information.
Example: See SHOW LOCAL VARIABLE command.
See Also: TRANSLATE command and SHOW LOCAL VARIABLE.
C.85
SHOW MEMORY command
Syntax: SHOW MEMORY
Purpose: Displays current memory status. The command displays the following status information
for memory and lists each memory pool separately:
Total number of bytes in the pool
Available number of bytes in the pool
Example: KCL> SHOW MEMORY
C.86
SHOW PROGRAM command
Syntax: SHOW PROGRAM < prog_name >
where:
C-44
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
prog_name : the name of any KAREL or TP program in memory
Purpose: Displays the status information of the specified or default program being executed.
Example: KCL> SHOW PROGRAM test_prog
KCL> SH PROG
C.87
SHOW PROGRAMS command
Syntax: SHOW PROGRAMS
Purpose: Shows a list of programs and variable data that are currently loaded in memory.
Examples: KCL> SHOW PROGRAMS
KCL> SH PROGS
C.88
SHOW SYSTEM command
Syntax: SHOW SYSTEM < data_type > <VALUES>
where:
data_type : any valid KAREL data type
Purpose: Displays a list including the name, type, and if specified, the current value of each system
variable. If you specify a data_type , only the system variables of that type are listed.
See Also: SHOW VARIABLE command
Examples: KCL> SHOW SYSTEM REAL VALUES
KCL> SH SYS
C.89
SHOW TASK command
Syntax: SHOW TASK < prog_name >
where:
prog_name : the name of any KAREL or TP program which is a task
Purpose: Displays the task control data for the specified task. If prog_name is not specified, the
default program is used.
C-45
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Examples: KCL> SHOW TASK test_prog
KCL> SH TASK
C.90
SHOW TASKS command
Syntax: SHOW TASKS
Purpose: Displays the status of all known tasks running KAREL programs or TP programs.
You may see extra tasks running that are not yours. If the teach pendant is displaying a menu that
was written using KAREL, such as Program Adjustment or Setup Passwords, you will see the status
for this task also.
Examples: KCL> SHOW TASKS
C.91
SHOW TRACE command
Syntax: SHOW TRACE < prog_name >
where:
prog_name : the name of any KAREL or TP program which is a task
Purpose: Shows all the program statements and line numbers that have been executed since TRACE
has been turned on.
The number of lines that are shown depends on the trace buffer length, which can be set with the
SET_TASK command or the SET_TSK_ATTR built-in routine. To display the source lines of
KAREL programs, the .KL files must exist on the RAM disk.
See Also: SET TRACE command
Example: KCL> SHOW TRACE
C.92
SHOW TYPES command
Syntax: SHOW TYPES < prog_name > < FIELDS >
where:
prog_name : the name of any KAREL or TP program
FIELDS : specifies fields should be displayed
C-46
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Purpose: Displays a list including the name, type, and if specified, the fields of each user-defined
type in the specified or default program. The actual array dimensions and string sizes are not shown.
See Also: SHOW VARS command, SHOW VARIABLE command
Examples: KCL> SHOW TYPES test_prog FIELDS
KCL> SH TYPES
C.93
SHOW VARIABLE command
Syntax: SHOW VARIABLE <[ prog_name ]> var_name <(HEXADECIMAL | BINARY)>
where:
prog_name : the name of any KAREL or TP program
var_name : a valid program variable
Purpose: Displays the name, type, and value of the specified variable.
You can display the values of system variables that allow KCL read access or the values of program
variables. Use brackets ([]) after the variable name to specify a specific ARRAY element. If you do
not specify a specific element the entire variable is displayed.
See Also: SHOW VARS command, SHOW SYSTEM command
Examples: KCL> SHOW VARIABLE $UTOOL
KCL> SH VAR [test_prog]group_mask HEX
KCL> SH VAR [test_prog]group_mask BINARY
KCL> SH VAR weld_pth[3]
C.94
SHOW VARS command
Syntax: SHOW VARS < prog_name > <VALUES>
where:
prog_name : the name of any KAREL or TP program
VALUES : specifies values should be displayed
Purpose: Displays a list including the name, type and, if specified, the current value of each variable
in the specified or default program.
C-47
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
See Also: SHOW VARIABLE command, SHOW SYSTEM command, SHOW TYPES command
Example: KCL> SHOW VARS test_prog VALUES
KCL> SH VARS
C.95
SHOW data_type command
Syntax: SHOW data_type < prog_name > <VALUES>
where:
data_type : any valid KAREL data type
prog_name : the name of any KAREL or TP program
VALUES : specifies values should be displayed
Purpose: Displays a list of variables in the specified or default program ( prog_name ) of the
specified data type ( data_type ). The list includes the name, type, and if specified, the current
value of each variable.
See Also: SHOW VARS command, SHOW VARIABLE command
Examples: KCL> SHOW REAL test_prog VALUES
KCL> SH INTEGER
C.96
SIMULATE command
Syntax: SIMULATE port_name[index] < = value >
where:
port_name[index] : a valid I/O port
value : a new value for the port
Purpose: Simulating I/O allows you to test a program that uses I/O. Simulating I/O does not actually
send output signals or receive input signals.
Warning
Depending on how signals are used, simulating signals might alter
program execution. Do not simulate signals that are set up for safety
checks. If you do, you could injure personnel or damage equipment.
C-48
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
When simulating a port value, you can specify its initial simulated value or allow the initial value to
be the same as the physical port value. If no value is specified, the current physical port value is used.
The valid ports are:
DIN, DOUT, WDI, WDO (BOOLEAN)AIN, AOUT, GIN, GOUT (INTEGER)
See Also: UNSIMULATE command
Examples: KCL> SIMULATE DIN[17]
KCL> SIM DIN[1] = ON
KCL> SIM AIN[1] = 100
C.97
SKIP command
Syntax: SKIP < prog_name >
where:
prog_name : the name of any KAREL or TP program which is a task
Purpose: Skips execution of the current statement in the specified task. If prog_name is not
specified, the default program is used. It has no effect when a task is running or when the system
is in a READY state.
Entire motion statements are skipped with this command. You cannot skip single motion segments.
The KCL> CONTINUE command resumes execution of the paused task with the statement following
the last skipped statement. END statements cannot be skipped.
If you skip the last RETURN statement in a function routine, there is no way to return the value of the
function to the calling program. Therefore, when executing the END statement of the routine, the
task will abort.
If you skip into a FOR loop, you have skipped the statement that initializes the loop counter. When
the ENDFOR statement is executed the program will try to remove the loop counter from the stack. If
the FOR loop was nested in another FOR loop, the loop counter for the previous FOR loop will be
removed from the stack, causing potentially invalid results. If the FOR loop was not nested, a stack
underflow error will occur, causing the task to abort.
READ, MOVE, DELAY, WAIT FOR, and PULSE statements can be paused after they have begun
execution. In these cases, when the task is resumed, execution of the paused statement must be
finished before subsequent statements are executed. Subsequent skipped statements will not be
executed. In particular, READ and WAIT FOR statements often require user intervention, such as
entering data, before statement execution is completed.
C-49
C. KCL COMMAND ALPHABETICAL DESCRIPTION
MARRC75KR07091E Rev D
Step mode operation and step mode type have no effect on the KCL> SKIP command.
Examples: KCL> SKIP test_prog
KCL> SKIP
C.98
STEP OFF command
Syntax: STEP OFF
Purpose: Disables single stepping for the program in which it was enabled.
Example: KCL> STEP OFF
C.99
STEP ON command
Syntax: STEP ON < prog_name >
where:
prog_name : the name of any KAREL or TP program which is a task
Purpose: Enables single stepping for the specified or default program.
Examples: KCL> STEP ON test_prog
KCL> STEP ON
C.100
TRANSLATE command
Syntax: TRANSLATE < file_spec > <DISPLAY> <LIST> <RS>
where:
file_spec : a valid file specification
DISPLAY : display source during translation
LIST : create listing file
RS : create routine stack (.rs) file for local var access
Purpose: Translates KAREL source code (.KL type files) into p-code (.PC type files), which can be
loaded into memory and executed.
C-50
MARRC75KR07091E Rev D
C. KCL COMMAND ALPHABETICAL DESCRIPTION
Translation of a program can be canceled using the CANCEL COMMAND key, CTRL-C, or CTRL-Y
on the CRT/KB.
Examples: KCL> TRANSLATE testprog DISPLAY LIST
KCL> TRAN
C.101
TYPE command
Syntax: TYPE file_spec
where:
file_spec : a valid file specification
Purpose: This command allows you to display the contents of the specified ASCII file on the
CRT/KB. You can specify any type of ASCII file.
Examples: KCL> TYPE rd:testprog.kl
KCL> TYPE testprog.kl
C.102
UNSIMULATE command
Syntax: UNSIMULATE ( port_name[index] | ALL )
where:
port_name[index] : a valid I/O port
ALL : all simulated I/O ports
Purpose: Discontinues simulation of the specified input or output port. When a port is unsimulated,
the physical value replaces the simulated value.
Warning
Depending on how signals are used, unsimulating signals might alter
program execution or activate peripheral equipment. Do not unsimulate
a signal unless you are sure of the result. If you do, you could injure
personnel or damage equipment.
If you specify ALL instead of a particular port, simulation on all the simulated ports is discontinued.
The valid ports are:
C-51

 

 

 

 

 

 

 

Content      ..     25      26      27      28     ..