BASIC commands
PROGRAMMING MANUAL
67
R
e
vi
si
o
n
1
.0
3.2.62 CONSTANT
/i
3.2.63 CONTROL
/i
3.2.64 COPY
/i
Type
System command
Syntax
CONSTANT ["name"[, value]]
Description
Declares the name as a constant for use both within the program containing
the
CONSTANT
definition and all other programs in the Trajexia Studio
project.
Note: The program containing the
CONSTANT
definition must be run before
the name is used in other programs. In addition, only that program should be
running at the time the
CONSTANT
is executed, otherwise the program error
will appear and the program will stop when trying to execute this command.
For fast startup the program should also be the only process running at
power-up.
Using
CONSTANT
with only the name will erase the specified constant.
Using
CONSTANT
with no parameters will erase all
CONSTANT
declara-
tions. This also happens when the TJ2-MC64 is reset by switching the power
off and back on, or by executing the EX command.
A maximum of 256
CONSTANT
s can be declared.
The maximum length of the name of the
GLOBAL
is 32 characters.
Arguments
•
name
Any user-defined name containing lower case alpha, numerical or under-
score characters.
•
value
The value assigned to
name
.
Example
CONSTANT "nak", $15
CONSTANT "start_button", 5
IF IN(start_button)=ON THEN OP(led1, ON)
IF key_char=nak THEN GOSUB no_ack_received
See also
LIST_GLOBAL
Type
System parameter (read-only)
Syntax
CONTROL
Description
The
CONTROL
parameter returns the type of TJ2-MC64 in the system. The
value of this system parameter for the TJ2-MC64 is 266..
Note: When the Machine Controller is locked, 1000 is added to above values,
so e.g. a locked TJ2-MC64 will return 1266.
Arguments
N/A
Example
No example.
See also
N/A
Type
Program command
Syntax
COPY program_name new_program_name
Description
The
COPY
command copies an existing program in the controller to a new
program with the specified name. The program name can be specified without
quotes.
Note: This command is implemented for the Command Line Terminal. Within
Trajexia Studio users can select the command from the
Program
menu.
Arguments
•
program_name
Name of the program to be copied.
•
new_program_name
Name to use for the new program.
Example
>> COPY "prog" "newprog"
See also
DEL
,
NEW
,
RENAME
.