Flexible NC programming
1.24 Subprogram technique
Examples
Example 1: Various input values and their rounding up results
Example
ROUNDUP(3.1)
ROUNDUP(3.6)
ROUNDUP(-3.1)
ROUNDUP(-3.6)
ROUNDUP(3.0)
ROUNDUP(3)
Example 2: ROUNDUP in the NC program
Program code
N10 X=ROUNDUP(3.5) Y=ROUNDUP(R2+2)
N15 R2=ROUNDUP($AA_IM[Y])
N20 WHEN X=100 DO Y=ROUNDUP($AA_IM[X])
...
1.24
Subprogram technique
1.24.1
General information
1.24.1.1
Subprogram
Function
The term "subprogram" has its origins during the time when part programs were split strictly
into main and subprograms. Main programs were the part programs selected for processing
on the controller and then launched. Subprograms were the part programs called from within
the main program.
This strict division no longer exists with today's SINUMERIK NC language. In principle, each
part program can be selected as a main program and launched or called from another part
program as a subprogram.
Accordingly, the subprogram can then be used to refer to a part program called from within
another part program.
154
Rounding up result
4.0
4.0
-3.0
-3.0
3.0
3.0
Programming Manual, 03/2013, 6FC5398-2BP40-3BA1
Job Planning