Block Number Output 

NC code can be output with a number at the beginning of each line of code. This can be referred to as a Block number, Sequence number or Line number . Block numbers must be defined within the POSTFORM file with the use of word addresses, commands, and variables.

Word Address 

Block numbers are typically output with the letter N. This letter must be entered in the Word Address section of the POSTFORM file. The number of digits output for the character should be determined by the machine tool control. Most machine tools use four digits maximum for the block numbers. The example below shows the Word address format for block numbers using the letter N.

N >4

The example uses the following command and sequence line.

Sequence#s N 1 1 1

G0 G90 S[speed]

INC file value

NC code output

1

N1 G0 G91 S1000

23

N23 G0 G90 S1000

3237

N3237 G0 G90 S1000

When a block number is only desired at the first line of a tool change, use the following code in the POST file.

N >4

Sequence#s N 0 1 100

The output code

1stToolChange

 

N[block] T[tool] M6

N100 T1 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X0 Y0

M[cool] G[lcomp] Z[d]

 

End

 

 

 

ToolChange

 

N[block] T[tool] M6

N200 T2 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X1. Y1.

M[cool] G[lcomp] Z[d]

 

End

 

Commands — Mill, Lathe, EDM 

The following commands are used to define block numbers:

First#

Last#

RenumSubs?

Sequence#s

1. First#? — Mill, Lathe, EDM

This switch determines whether a Block number is output on the first line of the program or omitted. Enter Y or N for the desired output. The example below will omit a number on the first line of the NC program.

First#? N

This is typically coded when the first line that is output for the NC code is a percent symbol.

2. Last#? — Mill, Lathe, EDM

This switch determines whether a Block number is output on the last line of the program or omitted. Enter a Y or N for the desired output. The example below will output a block number on the last line of the program.

Last#? Y

This is typically coded when the last line that is output for the NC code is a percent symbol.

3. RenumSubs? — Mill

You can reset the line numbers at the beginning of each Subprogram and the main program. When this command is not used, the line numbers are not reset at the beginning of each Subprogram and main program.

RenumSubs? Y

Note   When this command is entered as Y, the Subline variable should not be used.

The output code:

N1 O1

N2 G91

N3 X1.

N4 M99

N1 O2

N2 G91

N3 Y1.

N4 M99

N1 O1234

N2 G0 G90 S2000 M3 E1 X0 Y0

N3 H1 M7 Z.1

4. Sequence#s — Mill, Lathe, EDM

This line defines the Block numbers output in the NC program. There are four parameters required and placed in order on this line:

   Character

The first character after the command is the 1st character of the block number. These examples show the code and output for the commands using the letter N and the : symbol.

Note   The letter or symbol used must be formatted in the Word Address format.

Sequence#s N 1 1 1

The output code

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End

 

This example uses the letter C with the Replace command to output the : symbol for each block number.

: >2

Sequence#s : 1 1 1

The output code

1stToolChange

 

M6 T[Tool]

:1 M6 T1

G0 G90 S[Speed] M[Direct]

:2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

:3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

:4 H1 M7 Z.1

End

 

   Frequency

A number here indicates how often a block number is placed on a line. To output a number on every line, enter a 1. To output a number on every other line, enter a 2. Entering the number 10 will output a block number every ten lines. The following examples show the code and output for the parameter.

Sequence#s N 1 1 1

The output code

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

N2 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N3 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N4 H1 M7 Z.1

End

 

This example indicates a Frequency of 2 to output block numbers on every other line.

Sequence#s N 2 1 1

The output code

1stToolChange

 

M6 T[Tool]

N1 M6 T1

G0 G90 S[Speed] M[Direct]

G0 G90 S2000 M3

E[Work] X[H] Y[V]

N2 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

H1 M7 Z.1

End

 

Note   Use a frequency of 0 to not output the block numbers on each line. The post will only put them where they are requested.

   Increment

This is the value by which the block number is incremented before the next output. Using the value of 10 will create block numbers in the block address itself to be 10 greater than the last block number.

Sequence#s N 1 10 10

The output code

1stToolChange

 

M6 T[Tool]

N10 M6 T1

G0 G90 S[Speed] M[Direct]

N20 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N30 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N40 H1 M7 Z.1

End

 

   Start Value

This is simply the value of the very first block number that appears in the code; numbers after the first are determined by the start value plus a multiple of the Increment.

Sequence#s N 1 2 100

The output code

1stToolChange

 

M6 T[Tool]

N100 M6 T1

G0 G90 S[Speed] M[Direct]

N102 G0 G90 S2000 M3

E[Work] X[H] Y[V]

N104 E1 X0 Y0

H[Lcomp] M[Cool] Z[D]

N106 H1 M7 Z.1

End

 

Note   See Block Number Output.

Variables

The block variable  is the only variable available for Block numbers. When it is coded in a POSTFORM sequence, the output number is determined by the Sequence#s command. This variable is typically used when block numbers are only desired for the tool change lines. The following example shows the post file entries for the output of block numbers at tool changes only.

N >4

Sequence#s N 0 1 100

The output code

1stToolChange

 

N[block] T[tool] M6

N100 T1 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X0 Y0

M[cool] G[lcomp] Z[d]

M8 G43 Z.1

End

 

 

 

ToolChange

 

N[block] T[tool] M6

N200 T2 M6

G0 G90 S[speed] M[direct]

G0 G90 S2000 M3

G[work] X[h] Y[v]

G54 X1. Y1.

M[cool] G[lcomp] Z[d]

M8 G43 Z.1

End

 

When Block numbers are required for each program block, the block variable is not used. This is accomplished by changing the Sequence#s command to indicate the frequency of 1 as the following example indicates:

Sequence#s N 1 1 1

Suppressing Block Numbers 

Block numbers can be suppressed for the entire NC program or for specific lines of the program. You can also output blank lines within the NC code if desired. Suppression of block numbers is accomplished with the use of Word Address formatting or Commands.

When block numbers must be suppressed on only the first or last line of the NC program, use the First# and Last# commands described above.

When no block number output is desired, the Sequence#s command is used with a frequency of zero. This is shown in the following example. This example outputs no block numbers for the entire program.

Sequence#s N 0 1 1

This command, with the use of the block variable, can be used to output block numbers at specific NC code lines only.

The exclamation symbol “!” can be used to suppress a line number at any NC code line. It can also be used to output a blank line in the NC code.

This symbol must be entered in the Word Address format section of the post file. It should be entered as indicated by the following example.

! 00

When used in a POSTFORM sequence, the symbol is followed by a variable of 0. The following example shows the ! symbol being used to suppress the line number for the program number line.

Sequence#s N 1 1 1

The output code

Start

 

!0 O[program#]

 

End

 

 

 

1stToolChange

O1234

M6 T[tool]

N1 M6 T1

G0 G90 S[speed] M[direct] E[work] X[h] Y[v]

N2 G0 G90 S2000 M3 E1 X0 Y0

H[lcomp] M[cool] Z[d]

N3 H1 M7 Z.1

End

 

The following example indicates the use of the ! symbol to insert a blank line in the NC code.

Sequence#s N 1 1 1

RenumSubs? Y

First# N

Last# Y

 

Start

%0

O[program#]

End

 

SubStart

O[sub]

End

 

SubEnd

M99

!0

End

 

EndCode

M5 M9

G0 G49 G90 Z0

E0 X0 Y0

M6 T[Tool1]

M2

%0

End

 

The output code

%

N1 O1

N2 G91

N3 X1.

N4 M99

 

N1 O2

N2 G91

N3 Y1.

N4 M99

 

N1 O1234

N2 G0 G90 S2000 M3 E1 X0 Y0

N3 H1 M7 Z.1

N4 M98 P1 L1

N5 M98 P2 L1

N6 M5 M9

N7 G0 G49 G90 Z0

N8 E0 X0 Y0

N9 M6 T1

N10 M2

N11 % 

Return to SURFCAM Index


Your Ad Here