Bird
0
0
CNC Programmingscripting~10 mins

Program number and sequence numbers in CNC Programming - Step-by-Step Execution

Choose your learning style9 modes available
Concept Flow - Program number and sequence numbers
Start Program
Program Number: N100
Sequence 1: N100 G01 X10 Y10
Sequence 2: N110 G01 X20 Y20
Sequence 3: N120 G01 X30 Y30
End Program: M30
The CNC program starts with a program number, followed by sequence lines each with a sequence number, and ends with a program stop command.
Execution Sample
CNC Programming
N100 G01 X10 Y10
N110 G01 X20 Y20
N120 G01 X30 Y30
M30
This CNC program moves the tool to three positions in sequence and then ends.
Execution Table
StepLineProgram NumberSequence NumberCommandAction
1N100 G01 X10 Y10100100G01 X10 Y10Move tool to X10 Y10
2N110 G01 X20 Y20100110G01 X20 Y20Move tool to X20 Y20
3N120 G01 X30 Y30100120G01 X30 Y30Move tool to X30 Y30
4M30100M30End program
💡 Program ends at M30 command.
Variable Tracker
VariableStartAfter Step 1After Step 2After Step 3Final
Program NumberNone100100100100
Sequence NumberNone100110120120
Tool PositionUnknown(X10, Y10)(X20, Y20)(X30, Y30)(X30, Y30)
Program StateNot startedRunningRunningRunningEnded
Key Moments - 3 Insights
Why does the program number stay the same across sequence lines?
The program number identifies the whole program and stays constant; sequence numbers change to order commands within the program, as shown in execution_table rows 1 to 3.
What happens if a sequence number is skipped or repeated?
Skipping or repeating sequence numbers can confuse the CNC controller's order of execution. Sequence numbers should increase logically, as seen in execution_table steps 1 to 3.
Why is the M30 command not given a sequence number?
M30 is a program stop command and usually does not have a sequence number; it signals the program end, as shown in execution_table step 4.
Visual Quiz - 3 Questions
Test your understanding
Look at the execution table, what is the sequence number at step 2?
A100
B110
C120
DNone
💡 Hint
Check the 'Sequence Number' column in execution_table row 2.
At which step does the program end?
AStep 4
BStep 2
CStep 3
DStep 1
💡 Hint
Look for the M30 command in the 'Line' column in execution_table.
If the sequence number in step 3 was changed to N110, what would happen?
AProgram number would change
BProgram would run normally
CSequence numbers would repeat, causing confusion
DTool position would reset
💡 Hint
Refer to key_moments about sequence number repetition causing confusion.
Concept Snapshot
Program number (Nxxx) identifies the CNC program.
Sequence numbers (Nxxx) order commands inside the program.
Commands like G01 move the tool.
M30 ends the program.
Sequence numbers should increase logically.
Program number stays constant throughout.
Full Transcript
This lesson shows how a CNC program uses a program number and sequence numbers. The program starts with a program number, for example N100. Each line has a sequence number like N100, N110, N120 to order the commands. Commands like G01 move the tool to positions X10 Y10, X20 Y20, and X30 Y30 in order. The program ends with M30. The program number stays the same for all lines. Sequence numbers increase to keep commands in order. Repeating or skipping sequence numbers can cause confusion. The M30 command ends the program and usually has no sequence number. This helps CNC machines run the program step by step correctly.