beautypg.com

2 subprograms, Operating sequence, Programming notes – HEIDENHAIN TNC 320 (340 551-01) User Manual

Page 299: Programming a subprogram, Calling a subprogram, 2 subpr ogr ams 9.2 subprograms

background image

˜ ˜¢¬

299

9.2 Subpr

ogr

ams

9.2 Subprograms

Operating sequence

1

^F˜ ˜F¨F4¤›F’˜›^F˜z"›˜zpV"h˜¤z˜›p˜›^F˜*dp4c˜am˜§^a4^˜"˜

’¤*zpV"h˜a’˜4"ddF=˜§a›^˜

˜ 

2

^F˜’¤*zpV"h˜a’˜›^Fm˜F¨F4¤›F=˜Oph˜*FVammamV˜›p˜Fm=˜^F˜

’¤*zpV"h˜Fm=˜a’˜h"cF=˜ ˜¬

3

^F˜ ˜›^Fm˜F’¤hF’˜›^F˜z"›˜zpV"h˜Oph˜›^F˜*dp4c˜"O›F˜›^F˜

’¤*zpV"h˜4"dd

Programming notes

„

˜h"am˜zpV"h˜4"m˜4pm›"am˜¤z˜›p˜¢QT˜’¤*zpV"h’

„

p¤˜4"m˜4"dd˜’¤*zpV"h’˜am˜"m©˜’F„¤Fm4F˜"m=˜"’˜pO›Fm˜"’˜=F’aF=

„

˜’¤*zpV"h˜4"mmp›˜4"dd˜a›’FdO

„

a›F˜’¤*zpV"h’˜"›˜›^F˜Fm=˜pO˜›^F˜h"am˜zpV"h˜|*F^am=˜›^F˜*dp4c˜

§a›^˜¬¢˜p˜¬}

„

O˜’¤*zpV"h’˜"F˜dp4"›F=˜*FOpF˜›^F˜*dp4c˜§a›^˜¬¢˜p˜¬:˜›^F©˜

§add˜*F˜F¨F4¤›F=˜"›˜dF"’›˜pm4F˜F¦Fm˜aO˜›^F©˜"F˜mp›˜4"ddF=

Programming a subprogram

8

p˜h"c˜›^F˜*FVammamV:˜zF’’˜›^F˜ ˜ ˜cF©

8

m›F˜›^F˜’¤*zpV"h˜m¤h*F

8

p˜h"c˜›^F˜Fm=:˜zF’’˜›^F˜ ˜ ˜cF©˜"m=˜Fm›F˜›^F˜

d"*Fd˜m¤h*F˜‰¬Š

Calling a subprogram

8

p˜4"dd˜"˜’¤*zpV"h:˜zF’’˜›^F˜ ˜

˜cF©

8

Label number:

˜ m›F˜›^F˜d"*Fd˜m¤h*F˜pO˜›^F˜

’¤*zpV"h˜©p¤˜§a’^˜›p˜4"dd˜O˜©p¤˜§"m›˜›p˜¤’F˜"˜d"*Fd˜

m"hF:˜zF’’˜›^F˜cF©˜Š˜›p˜’§a›4^˜›p˜›F¨›˜Fm›©

8

Repeat REP:

˜VmpF˜›^F˜=a"dpV˜„¤F’›apm˜§a›^˜›^F˜˜

˜cF©˜FzF"›˜ ˜a’˜¤’F=˜pmd©˜Op˜zpV"h˜

’F4›apm˜FzF"›’

0 BEGIN PGM ...

CALL LBL1

L Z+100 M2
LBL1

LBL0
END PGM ...

˜ ˜¬˜a’˜mp›˜zFha››F=˜|"*Fd˜¬˜a’˜pmd©˜¤’F=˜›p˜h"c˜

›^F˜Fm=˜pO˜"˜’¤*zpV"h}˜