Вы находитесь на странице: 1из 4

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 =N___/__ decimal a G__X__Y__F__ XY XY XY XY N___ Set-up position that allows the first incremental move in the loop to move the feature to its first position. Not always used. Loop call where N___ is the sequence number that marks the end of the loop and /__ is the number, without point, of times to run the loop. This block cannot have sequence number. Move within the loop, usually an incremental move that causes the feature to move to its new location. Loop motions 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. This cuts a 2" square(less tool dia) .5" deep in four passes Set-up position Repeat through N30 4 times Return to XY position with an incremental Z move of -.125 N15 thru N30 cut a square End of loop, return to loop call unless last repeat, then go to next block.

Example Loop N5G0X-1.5Y1.Z0 =N30/4 N10G1X-1.5Y1.W-.125F5. N15X1.F20. N20Y-1. N25X-1. N30Y1.1

Example 2 Example 2, Center drill only, format for machining centers G0T1M6; 90 deg spot drill S4000M3 G0X0.625Y0Z0.1 .G81Z0.24F10. this =N200/3 V0.625 =N100/11 N100U0.5 V0.625 =N101/11 N101U-0.5 N200 G0T2M6 Characters after a semi-colon are a note only Setup position to allow incremental move to first hole Decimal point as first character makes this a definition block, see manual page 6. Because there is no XY, block does not cause cycle execution. Repeat thru line N200 three times Incremental Y move to drill first hole in the row Repeat thru line N100 eleven times Incremental X move to drill 11 holes in the row Incremental Y move to last hole in next row Repeat thru line N101 eleven times Incremental X move to drill 11 holes in the row End of repeat for =N200 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

Вам также может понравиться