Subprogram Output

Subprograms are individual programs that define the tool motion for each tool in the INC file. The Subprograms can be used for multiple part fixturing. These programs differ from Subroutines in that they can be run separately in the machine control. A Subroutine requires a main program for them to be executed in the machine control.

SURFCAM's post processor will output a separate Subprogram for each tool identified in the INC file. The post then creates a Main Program that calls the appropriate number of Subprograms.

The following Commands, Sequences, and Variables are used to define and call the Subprograms.

Commands

Sequences

Variables

 

 

 

RenumSubs?

SubStart

sub

Subs1st?

SubEnd

subline

 

SubCall

times

 

Between

 

RenumSubs? — Mill

You can reset the line numbers at the beginning of each Subprogram and the main program. When it 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.

Subs1st? — Mill

This command defines the location of the Subprograms in relation to the main program. Enter a Y for the Subprograms to be output before the main program. An N outputs the Subprograms after the main program. This command is only entered in the POSTFORM file when Subprograms are desired. When this command is not used, the Subprograms are automatically placed before the main program.

Subs1st? Y

SubStart — Mill

This sequence defines the beginning of the Subprogram.

SubStart

O[sub]

End

The output code for this example follows. This code is placed at the beginning of the Subprogram by the post processor.

O1

SubEnd — Mill

This sequence defines the End of the Subprogram.

SubEnd

M99

End

The output code for this example follows. This code is placed at the end of the Subprogram code by the post processor.

M99

SubCall — Mill

This sequence defines the details of the Subprogram call in the main program.

SubCall

E[work] X[h] Y[v]

M98 P[sub] L[times]

End

The output code for this example follows. The P word is the Subprogram number called. The T word is the number of repetitions for the Subprogram.

E1 X1. Y1.

M98 P1 L5

Between — Mill

This sequence defines any special code desired between the Subprogram and the main program. This could be used to enter the code for the end of all subroutines on the FADAL.

Between

M17

M30

End

The output code:

 

X0 Y0

 

 

G91 G28 Z0

# Subprogram end

 

M17

 

 

M30

 

 

O1234

# Main program beginning

Sub — Mill

This variable identifies the Subprogram number and is usually entered in the SubStart and SubCall sequences. In the example below the variable sub identifies the Subprogram number and is used to call the Subprogram in the main program.

SubStart

O[sub]

End

SubEnd

M99

End

SubCall

E[work] X[h] Y[v]

M98 P[sub] L[times]

End

The output code for this example follows. The Subs1st? command is entered as Y. When the INC file is post processed, you are prompted for the Times variable. For this example, your input was a value of 5.

O621

X1. Y1.

X2.

Z.1 G0

M99

O1234

G0 G90 S2000 M3 E1 X0 Y0

H1 M7 Z.1

E1 X1. Y1.

M98 P621 L5

Subline — Mill

This variable is used to call the Subprogram using the block numbers. When the INC file is post processed, the block number of the first line of the Subprogram is output for this variable. When the variable is used, the RenumSubs? command must not be used.

The following example uses this variable instead of the subline variable. The block numbers for this example begin at 1 and are incremented by 1.

SubStart

O[sub]

End

SubEnd

M99

End

SubCall

E[work] X[h] Y[v]

M98 P[subline] L[times]

End

When the INC file is post processed, you are prompted for the Times variable. For this example, your input was a value of 5.

N1 O1

N2 X1. Y2.

N3 X2.

N4 Z1. G0

N5 M99

N6 G0 G90 S2000 M3 E1 X0 Y0

N7 H1 M7 Z.1

N8 E1 X1. Y1.

N9 M98 P1 L5

Times — Mill

This variable is used to identify the number of repetitions for the Subprogram. When the INC file is post processed, you are prompted for the times variable value. The default for this prompt is 0. The following examples show the SubCall sequence and NC code with and without the Times variable.

SubCall

E[work] X[h] Y[v]

M98 P[sub] L[times]

End

The output code for this example follows. When the INC file is post processed, you are prompted for the Times variable. For this example, your input was a value of 5.

G0 G90 S2000 M3 E1 X0 Y0

H1 M7 Z.1

E1 X0 Y0

M98 P621 L5

SubCall

E[work] X[h] Y[v]

M98 P[sub] L[times]

End

The output code for this example follows. When the INC file is post processed, you are prompted for the Times variable. For this example, the default value was used.

G0 G90 S2000 M3 E1 X0 Y0

H1 M7 Z.1

E1 X0 Y0

M98 P621 L0

In this example, the Times variable is not used.

SubCall

E[work] X[h] Y[v]

M98 P[sub]

End

The output code:

G0 G90 S2000 M3 E1 X0 Y0

H1 M7 Z.1

E1 X0 Y0

M98 P621

Return to SURFCAM Index


Your Ad Here