Specifications

BASIC commands
PROGRAMMING MANUAL 60
Revision 5.0
3.2.59 CONSTANT
/i
3.2.60 CONTROL
/i
3.2.61 COPY
/i
3.2.62 COS
/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 declarations.
This also happens when the TJ1-MC__ is reset by switching the power off and
back on, or by executing the EX command.
A maximum of 128 CONSTANTs can be declared.
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 N/A
Type System parameter (read-only)
Syntax CONTROL
Description The CONTROL parameter returns the type of TJ1-MC__ in the system. The
value of this system parameter for the TJ1-MC16 is 262, and for the TJ1-
MC04 the value is 263.
Note: When the Motion Controller is locked, 1000 is added to above values,
so e.g. a locked TJ1-MC16 will return 1262.
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.
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.
Type Mathematical function
Syntax COS(expression)
Description The COS function returns the cosine of the expression. Input values are in
radians and may have any value. The result value will be in the range from -1
to 1.