Cycle Program Templates
Bu içerik henüz dilinizde mevcut değil.
Cycle Programming lets an operator describe a part as a table of holes. What that table compiles to is set by a template: a plain text file that belongs to the machine, not to the control software.
You write it once, when the machine is commissioned, in a text editor. The operator never opens it; they see its result in every cycle program the panel produces from then on.
Coolant, the safety line, how tool length is applied, whether a rotary axis carries a part angle: these differ from machine to machine, and none of them should need a software release.
The two files, and which one wins
Section titled “The two files, and which one wins”data/cycle_templates/ default.tmpl ships with the control machine.tmpl this machine's own, if it has onemachine.tmpl is used whenever it exists. There is no setting to point at it: copying
the file in is all it takes.
default.tmpl is deliberately simple: standard drilling and tapping codes, no macro
calls. A machine with no macros installed still drills. A machine with its own macro
chain copies the file to machine.tmpl and calls its own macros from there.
The five sections
Section titled “The five sections”A template is five blocks, each introduced by its name on a line of its own. Anything outside a section is ignored, so notes in the file cost nothing.
| Section | Written |
|---|---|
[header] | once, at the top |
[tool] | once per tool change |
[cycle] | once per cycle block, and this sets the drilling cycle |
[hole] | once per hole |
[footer] | once, at the end |
The shipped default.tmpl:
[header]O1{{programId}} ({{name}})G17 G21 G40 G80 G90{{workOffset}}
[tool]G80T{{tool}} M06G43 H{{tool}}G00 Z{{retractZ}}(TOOL {{tool}} - {{groupHoleCount}} HOLES)
[cycle]S{{speed}} M03{{returnMode}} G{{cycleCode}} Z{{negDepth}} R{{clearance}} Q{{peck}} P{{dwellMs}} L0 F{{feed}}
[hole]X{{x}} Y{{y}}
[footer]G80M05G00 Z{{retractZ}}M30Placeholders
Section titled “Placeholders”| Usable in | Placeholders |
|---|---|
| any section | {{programId}} {{name}} {{holeCount}} {{workOffset}} {{retractZ}} {{returnMode}} |
[tool] | {{tool}} {{groupHoleCount}} |
[cycle] | {{cycleCode}} {{tool}} {{depth}} {{negDepth}} {{diameter}} {{clearance}} {{feed}} {{speed}} {{peck}} {{dwell}} {{dwellMs}} {{posCount}} {{seq}} |
[hole] | {{seq}} {{x}} {{y}} {{angle}} |
{{workOffset}} and {{returnMode}} arrive already written as codes: G54, G98.
{{negDepth}} is the depth the operator typed, negated, so nobody types a minus sign.
{{cycleCode}} is the drilling cycle the operator’s entries selected: 81, 82, 83
or 84.
The template decides which fields the operator sees
Section titled “The template decides which fields the operator sees”A placeholder your template never uses is a field the panel stops asking for.
default.tmpl has no {{angle}}, so a three-axis mill shows no part-angle field. Add
A{{angle}} to your machine.tmpl and the field appears.
The alternative would be a form that accepts a number and throws it away, and an operator with no way of telling.
Four rules that alarm when broken
Section titled “Four rules that alarm when broken”Each of these has a failure the template author does not see until a machine cuts.
L0 goes on the cycle line, before F. A cycle line with a zero repeat count sets
the drilling data up without drilling. That is what lets [cycle] be a setup line and
each [hole] a bare coordinate. Leave it out and the cycle line drills a hole wherever
the tool happens to be standing, because Z and R already make it a move. It goes
before F because the block-order check expects it there.
P is whole milliseconds and takes no decimal point. Use {{dwellMs}}, never
{{dwell}}. Half a second is P500; P0.5 is rejected. The operator enters seconds and
{{dwellMs}} is where they are converted. {{dwell}} is still there for a template that
passes the value to a macro instead.
G80 opens [tool]. The drilling cycle is still active when the tool block runs, so
without it the tool block’s own retract move becomes another hole.
Depth is negated for you. Use {{negDepth}} where the program needs Z-12.. Using
{{depth}} there drills upward.
The same file reads the program back
Section titled “The same file reads the program back”When the panel reopens a cycle program it reads the NC file back through the template:
each {{placeholder}} becomes a value it recovers. One file defines both directions.
Two consequences follow.
- The panel can never be left reading a format the machine no longer writes.
- A program that does not match the template is not treated as a cycle program. The panel says so and opens the plain editor rather than showing a form that does not match the file.
So editing the template is not free for programs already written: it changes what the panel can read back. Re-saving each program from the panel puts them back in step.
Where to go next
Section titled “Where to go next”- Cycle Programming: the operator’s side of this.
- Macros: where machine behaviour lives when the template calls out to it.