Operation window: split a long G-code program into named tabs
A finished lathe program is often a few hundred lines; a mill program from CAM can run to thousands. When you want to change the finish feed or move a groove, you scroll, search for the tool number, and hope you landed in the right section. The Operation window in NC Proof Turn and NC Proof Mill fixes that. You split the program into named operations once, and from then on every operation is one click away.
The Operation window step by step (1:38, with narration). Press play to watch.
What an operation is
An operation is a section of your program that starts with a comment line like this:
(OP: ROUGH OD)
It runs until the next (OP: …) line or the end of the program. Everything before the first one is the Header (program number, safe-start line, tool list). Because it’s an ordinary comment, the machine skips it: the program runs exactly the same on the control, and you don’t need to remove anything before you send it.
Here’s a short Haas lathe program split into five operations: face, rough, finish, relief groove and thread.
%
O01060 (SHAFT IN FIVE OPERATIONS - HAAS)
(STOCK 1.250 INCH DIAMETER - STICK OUT 2.5 INCH)
(T101 CNMG 432 - OD ROUGH)
(T202 VNMG 331 - OD FINISH)
(T303 0.118 WIDE OD GROOVE TOOL)
(T404 OD THREAD 60 DEG)
G20 G18 G40 G80 G99
G28 U0. W0.
(OP: FACE)
T101
G50 S3000
G96 S500 M03
G00 X1.35 Z0. M08
G01 X-0.06 F0.006
G00 Z0.1
(OP: ROUGH OD)
G00 X1.35 Z0.1
G71 P100 Q200 U0.02 W0.005 D0.06 F0.01
N100 G00 X0.55
G01 Z0. F0.004
X0.75 Z-0.1
Z-1.
N200 X1.3
G28 U0. W0.
(OP: FINISH OD)
T202
G96 S650 M03
G00 X1.35 Z0.1
G70 P100 Q200
G28 U0. W0.
(OP: RELIEF GROOVE)
T303
G97 S800 M03
G00 X0.85 Z0.1
Z-0.85
G01 X0.62 F0.002
G04 P0.2
G00 X0.85
X1.35
G28 U0. W0.
(OP: THREAD 3/4-10)
T404
G97 S600 M03
G00 X0.85 Z0.2
G76 X0.627 Z-0.75 K0.0613 D0.012 F0.1 A60
G00 X1.35 M09
G28 U0. W0.
M30
%
Open it in NC Proof Turn and the Operation window shows six tabs: Header, FACE, ROUGH OD, FINISH OD, RELIEF GROOVE and THREAD 3/4-10. The program runs to the end with no messages. On a Fanuc 0i-TF the operation lines work the same way; only the G71 and G76 cycles are written in Fanuc’s two-line form.
How to use it
- Open the window. Right-click in the 3D view and choose Show → Operation window. It opens as a small window over the view; drag it by its title bar, resize it from the bottom-right corner, and close it with the X.
- Make operations. Type
(OP: name)lines in the code yourself, or let NC Proof do it: press + in the Operation window to start a new operation at the line your cursor is on, or right-click a line in the code and choose Start operation here. Type a name and press Enter (Esc cancels). NC Proof writes the(OP: …)line for you. - Jump between them. Click a tab to show that operation’s code. While the simulation runs, the tab the tool is in is underlined and the current line is marked, so you always know which operation you’re watching. A tab with a problem gets a red dot (error) or a yellow dot (warning).
- Edit in place. You can change the code right in the tab. The edit goes straight into the one program; there’s no copy to keep in sync. Moving the cursor in the tab moves the tool to that line in the simulation.
- Pull a tab out. Drag a tab out of the Operation window and it becomes a window of its own. Open the roughing and finishing operations side by side, or keep the thread operation on screen while you step through the groove.
Saved with your work
The (OP: …) lines are part of the program, so they’re saved with the .nc file and travel with it to the machine, to CAM edits and to the next person who opens it. If you save an NC Proof setup file (.ncp), it also remembers whether the Operation window was open, where it sat, its size and which tab was showing.
Good names help
Short names in capitals read best on the tabs: FACE, ROUGH OD, FINISH OD, DRILL 0.5, BORE, GROOVE, THREAD 3/4-10, PART OFF. On a mill: FACE MILL, ROUGH POCKET, SPOT, DRILL 0.257, TAP 5/16-18, CHAMFER. If your CAM post already writes an operation comment for each toolpath, adding OP: at the front of it is all it takes.
The Operation window is in both NC Proof Turn and NC Proof Mill. Try it on your own programs during the 7-day free trial at app.ncproof.com. The user guide covers the rest of the app.