EasyManua.ls Logo

Tormach 1100M - Functions Reference; Subroutines; Subroutines Reference

Tormach 1100M
305 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
10: PROGRAMMING
1. **
2. * / MOD
3. + -
4. EQ NE GT GE LT LE
5. AND OR XOR
If operations in different precedence groups are strung
together, operations with a higher precedence are performed
before operations with a lower precedence. If an expression
contains more than one operation with the same precedence,
the operation on the left is performed first.
E X A M P L E
[2.0 / 3 * 1.5 - 5.5 / 11.0] is equivalent to
[[[2.0 / 3] * 1.5] - [5.5 / 11.0]]
which is equivalent to [1.0 - 0.5]
which is
0.5
The logical operations and modulus are to be performed on
any real numbers, not just on integers. The number zero is
equivalent to logical false, and any non-zero number is
equivalent to logical true.
Functions Reference
The available functions are:
l ATAN[Y]/[X]: Four quadrant inverse tangent
l ABS[arg]: Absolute value
l ACOS[arg]: Inverse cosine
l ASIN[arg]: Inverse sine
l COS[arg]: Cosine
l EXP[arg]: e raised to the given power (ex)
l FIX[arg]: Round down to integer
l FUP[arg]: Round up to integer
l ROUND[arg]: Round to nearest integer
l LN[arg]: Base-e logarithm
l SIN[arg]: Sine
l SQRT[arg]: Square root
l TAN[arg]: Tangent
l EXISTS[arg]: Check named parameter
10.6.3 Subroutines
Subroutines are subprograms that are called from inside
another program.
Read the following sections for reference:
Subroutines Reference 221
Conditional Subroutines Reference 222
Repeating Subroutines Reference 223
Looping Subroutines Reference 223
Subroutines Reference
Subroutines are identified in a program by a unique subroutine
label. The subroutine label is the letter o followed by an
integer (with no sign) between 0 and 99999 written with no
more than five digits (000009 is not permitted, for example) or
a string of characters surrounded by <> symbols.
Examples of valid subroutine labels:
l
o123
l
o99999
l
o<my test code>
Subroutine labels may be used in any order, but they must be
unique in a program. Each subroutine label must be followed
by a subroutine keyword. The subroutine keyword defines the
action associated with the subroutine label.
Valid subroutine keywords and their meanings are:
l Sub: Begin subroutine definition
l Endsub: End of subroutine definition
l Call: Call the subroutine
l Do/while/endwhile: Execute the subroutine while a
condition is true
l Repeat/endrepeat: Execute the subroutine while a
condition is true
l If/elseif/else/endif: Conditionally execute the
subroutine
l Break: Break out of a while or if/elseif statement
l Continue: Skip remaining code and restart at top of
while or repeat loop
l Return: Return a value
The sub and endsub keywords are used to define the
beginning and end a subroutine. All lines of code between the
sub and endsub keywords are considered to be part of the
subroutine.
Example of sub, endsub, call:
o100 sub
G53 G00 X0 Y0 Z0 (rapid move to machine home)
o100 endsub
...
©Tormach® 2023
Specifications subject to change without notice.
Page 221 Tormach 1100 Operator's Manual (Version 1223A)
For the most recent version, see tormach.com/support

Table of Contents