Documente Academic
Documente Profesional
Documente Cultură
Describe a do loop
Describe a subprogram
Slide 3
Do loops
In a do loop, the MCU is instructed to repeat an operation (in this case, drill a hole five
times) rather than be programmed for five separate hole locations.
Usually, looping capability on a CNC controller is an optional item, therefore not all
controllers have it. The looping feature is sometimes added to the controller by the
controller's manufacturer
In other cases, it is programmed into the controller by the machine tool manufacturer.
This means that the NC codes used to initiate a do loop can vary widely from machine
to machine, even if they are all equipped with the same basic controller model
Slide 4
Do loops
Programming a Loop
The method described in this section is only one of the schemes in use
Slide 5
Do loops
Where:
Slide 6
Subprograms
Slide 7
Calling Subprograms
Where:
M98 – Instructs the MCU to jump to a subprogram
P2000 – Tells the MCU that O2000 is the subprogram ID
L1 – Instructs the MCU to execute the subprogram one time
Slide 8
Calling Subprograms
Subprogram Explanation
Notice that a subprogram has its own program ID number, in this case
O1000
The sequence blocks also are numbered independently from the main
program
Slide 9
Subroutines
Subroutines :
Register orders once, recall anywhere in the program and repeat as many
times as needed
Slide 10
Nested Loops
It also provides a way for the programmer to check his or her work
Slide 12
Summary
G25P...Q..-L.
Where:.
Slide 13
Summary
To program a particular machine, it will be necessary to consult the programming manual for
the machine in question.
Slide 14
Vocabulary Introduced in this section
Do loop
Main program
Nested loop
Subprogram
Subroutine
Slide 15
End of Section
Reference Note
Copyright University of Patras, School of Engineering, Dept. of
Mechanical Engineering & Aeronautics, Dimitris Mourtzis. Dimitris
Mourtzis. «Computer Numerical Control of Machine Tools. Do Loops
and Subprograms». Version: 1.0. Patras 2015. Available at:
https://eclass.upatras.gr/courses/MECH1213/
License Note
This material is provided under the license terms of Creative Commons
Attribution-NonCommercial-NoDerivatives (CC BY-NC-ND 4.0) [1] or newer,
International Version. Works of Third Parties (photographs, diagrams etc) are
excluded from this license and are referenced in the respective “Third Parties’
works Note”
[1] https://creativecommons.org/licenses/by-nc-nd/4.0/
The owner can provide the licensee a separate license for commercial use upon
request.
Notes Preservation
Any reproduction or modification of this material must
include:
the Reference Note
the License Note
the Notes Preservation statement
the Third Parties’ Works Note (if exists)
as well as the accompanying hyperlinks.