Command Descriptions
69
DEF
Begin Program/Subroutine Definition
Type
Program or Subroutine Definition
Syntax
<a_><!>DEF<t>
Units
t = alpha text string (name of a program)
Range
text string of 6 characters or less
Default
n/a
Response
n/a
See Also
$, DEL, END, ERASE, GOBUF, GOSUB, GOTO, MEMORY, PCOMP, PLCP,
PRUN, RUN, [ SS ], TDIR, TMEM, TPROG, TSS, TSTAT
Product Rev
GT6K 6.0
GV6K 6.0
The
DEF
command is the beginning of a program or subroutine definition. The syntax for the command is
DEF
followed by 6 or fewer alpha-numeric characters. The first character may not be a number. Refer to the
MEMORY
command description for information on program size restriction and total number of programs
possible per product.
All programs are stored in a binary fashion within the Gem6K. A program transferred back out (
TPROG
)
after it has been defined (
DEF
), may not look identical to the program defined. However, the program is
functionally identical.
NOTE
When defining a program and the memory limitation is exceeded, an error message will
be generated, and bit 11 of the system status register will be set (
SS
or
TSS
). The
program will be stored up to the point where the memory limitation was exceeded.
There is no actual difference in the definition of, or execution of a program versus the definition, or
execution of a subroutine. Both a program and a subroutine are defined as the set of commands between a
DEF<t>
and an
END
command. If an invalid program/subroutine name is entered, an error message will be
generated. An invalid program/subroutine name is any name that is also a current command. (An example
of an invalid name would be
DEFhom1
, because it is impossible for the operating system to distinguish the
hom1
subroutine call from the
HOM1
go home command.). A subroutine/program definition cannot be
assigned the name “
CLR
” and cannot contain any of the following characters:
!
,
—
,
#
,
$
,
%
,
^
,
&
,
*
,
(
,
)
,
+
,
-
,
_
,
=
,
{
,
}
,
\
,
|
,
"
,
:
,
;
,
'
,
<
,
>
,
,
,
.
,
?
,
/
.
The
RUN
command can be used to start executing a program/subroutine. The program name by itself can
also be used to start executing a program/subroutine. A compiled motion profile must be compiled with the
PCOMP
command before it can be executed with the
PRUN
command; and a compiled PLC (
PLCP
) program
must be compiled with
PCOMP
before it can be executed with the
SCANP
or
PRUN
command.
The
GOTO
and
GOSUB
commands can be used within a program/subroutine to go to another
program/subroutine.
NOTE
: Program, compiled profile, or subroutine names must be deleted (
DEL
) before they can be
redefined.
Example:
DEL pick
; Delete program named pick
DEF pick
; Begin definition of program named pick
GO1
; Initiate motion
END
; End program definition
RUN pick
; Execute program pick
www.comoso.com
Содержание Gemini GT6K
Страница 24: ...www comoso com ...
Страница 40: ...www comoso com ...
Страница 344: ...www comoso com ...
Страница 350: ...www comoso com ...