May not be of help as it is not outside of the program.....
Bridgeport BPC-MC and DX-32 Control
Loops
Loops are sections of program that have been marked in a way that allows them to be repeated a specified number of times in a program. They are usually used to shorten a program or to make it easier to modify a program. The drawback to using loops is that a program cannot be restarted from inside a loop. The loop must be run in its entirety.
Typical Loop Format
GaaXbbYccZdd Set-up position that allows the first incremental move in the loop to move the feature to its first position. Not always used.
=N___/__ Loop call where N___ is the sequence number that marks the end of the loop and /__ is the number, without decimal point, of times to run the loop. This block cannot have a sequence number.
G__X__Y__F__ Move within the loop, usually an incremental move that causes the feature to move to its new location.
XY
XY Loop motions
XY
XY
N___ End of loop. The Naaa must match the loop call block. This block may have a motion command in it. This block cannot be immediately preceded by a macro call.
Example Loop This cuts a 2" square(less tool dia) .5" deep in four passes
N5G0X-1.5Y1.Z0 Set-up position
=N30/4 Repeat through N30 4 times
N10G1X-1.5Y1.W-.125F5. Return to XY position with an incremental Z move of -.125
N15X1.F20. N15 thru N30 cut a square
N20Y-1.
N25X-1.
N30Y1.1 End of loop, return to loop call unless last repeat, then go to next block.
Example 2
Example 2, Center drill only, format for machining centers
G0T1M6; 90 deg spot drill Characters after a semi-colon are a note only
S4000M3
G0X0.625Y0Z0.1 Setup position to allow incremental move to first hole
.G81Z0.24F10. Decimal point as first character makes this a definition block, see manual page 6. Because there is no XY, this block does not cause cycle execution.
=N200/3 Repeat thru line N200 three times
V0.625 Incremental Y move to drill first hole in the row
=N100/11 Repeat thru line N100 eleven times
N100U0.5 Incremental X move to drill 11 holes in the row
V0.625 Incremental Y move to last hole in next row
=N101/11 Repeat thru line N101 eleven times
N101U-0.5 Incremental X move to drill 11 holes in the row
N200 End of repeat for =N200
G0T2M6 Continue the program.
For expansion of this example see Handout 9
Macros or Subroutines
Macros or subroutines are sections of program that have been defined in a way that allows them to be used repeatedly in a program. They are usually used to shorten a program or to make it easier to modify a program. When combined with variables they are a very powerful programming tool. The drawback to using macros is that a program cannot be restarted from inside a macro. The macro must be run in its entirety. The macro definition must be programmed before the macro call in the program since the control only looks back to find a macro.
Example 2
Example 2, Center drill only, format for machining centers
G0T1M6;90 deg spot drill Characters after a semi-colon are a note only
S4000M3
G0X0.625Y0Z0.1 Setup position to allow incremental move to first hole
.G81Z0.24F10. Decimal point as first character makes this a definition block,
see manual page 6. Because there is no XY, this block
does not cause cycle execution.
#1 Start of macro 1
=N200/3 Repeat thru line N200 three times
V0.625 Incremental Y move to drill first hole in the row
=N100/11 Repeat thru line N100 eleven times
N100U0.5 Incremental X move to drill 11 holes in the row
V0.625 Incremental Y move to last hole in next row
=N101/11 Repeat thru line N101 eleven times
N101U-0.5 Incremental X move to drill 11 holes in the row
N200 End of repeat for =N200/3
N201 The end of repeat block must not be the last block before the
$ or the $ will not be seen by the control
$ End of macro 1
=#1 Call macro 1
.G80 Cancel drilling cycle. This should be a definition block since
the cycle was turned on with a definition block.
G0T2M6; .210 drill
S4000M3
G0X0.625Y0Z0.1 Setup position to allow incremental move to first hole
.G83Z1.2Z.4Z.2F10. Decimal point as first character makes this a definition block,
see manual page 6. Because there is no XY, this block
does not cause cycle execution.
=#1
.G80
G0T3M6; ¼ -20 tap
S1600M3
G0X0.625Y0Z0.1 Setup position to allow incremental move to first hole
.M29 Enable rigid tapping
.G84Z.7F80. Decimal point as first character makes this a definition block,
see manual page 6. Because there is no XY, this block
does not cause cycle execution.
=#1
.G80
.M28 Cancels rigid tapping
G0M22
Thank you for the information. This is what I'm trying to accomplish.
I want to have to pallet holders on the table. There will be several different pallets that can go on the pallet holders. So I need to be able to call the program for the pallet randomly. For example when pallet A&B or on the table I need program A and B to run. Then next time it might be pallet A and C and those two programs need to run.
Maybe I'm just expecting more than what this control can handle. It seems that none of the ideas that I have can be done without going in and editing the program to make it choose which part to run.