Coupling programs
Activation/deactivation and channel coupling/decoupling of the orbit or escape channel can be programmed using standard subroutines in the down channel (this corresponds to the left half in the figures). The subroutine examples used in the previous section are described below.
The programs assume an axis configuration that consists of 6 axes with X, Y, Z, A, B and C.
The variables used in the programs can be suitably assigned in advance in the down channel program for the current machining process. All the variables and macros used are initialised in the example program below.
Programing Example

Basic initialisation
;---- Channel IDs
"CH-Sinking" = "1"
"CH-Planetary" = "2"
"CH-Escape" = "3"
;---- Signal IDs
"S-EscapeReady" = "1711"
"S-OrbitReady" = "3711"
"S-PlanetarySectorReq" = "1000"
"S-PlanetarySectorOk" = "2000"
;---- Job IDs for PLCopen jobs
"MC-OrbCircle" = "233"
"MC-Reset" = "533"
"MC-Escape" = "633"
;---- Variables
V.P.PlanetaryMaxScale = 5
V.P.PlanetaryMaxEquid = 0
V.P.PlanetaryGeomId = 0
V.P.EscapeMode = 0 ; 0=Flat, 1= Alpha, 2=Point, 3=Bisec
V.P.AlphaAngle = 0
V.P.PointY = 0
V.P.PointZ = 0
V.P.BisecD1 = 0
V.P.BisecD2 = 0
Programing Example

Subroutine - Activate escape channel
%DS-ActivateEscape-ACS
;---- Activate the escape channel.
N5000 $IF V.P.EscapeMode == 0
N5010 #CHANNEL INTERFACE ON[ ESCAPE GEOMETRY=FLAT ]
N5020 $ELSEIF V.P.EscapeMode == 1
N5030 #CHANNEL INTERFACE ON[ ESCAPE GEOMETRY=ALPHA AN-GLE=V.P.AlphaAngle ]
N5040 $ELSEIF V.P.EscapeMode == 2
N5050 #CHANNEL INTERFACE ON[ ESCAPE GEOMETRY=POINT POINT_Y=V.P.PointY POINT_Z=V.P.PointZ ]
N5060 $ELSE (V.P.EscapeMode == 3)
N5070 #CHANNEL INTERFACE ON[ ESCAPE GEOMETRY=BISECTOR BISEC_D1 =V.P.BisecD1 BISEC_D2 = V.P.BisecD2]
N5080 $ENDIF
N5090 #TRACK CHAN ON[ DYN_CS="CH-Escape" SUPERIMPOSE]
;---- Start the program in the escape channel
N5100 #MC_MovePath SYN [ CH="CH-Escape" ID="MC-Escape" FileName="DsEscapeFile" \
@PL1=V.A.ACS.ABS.X @PL2=V.A.ACS.ABS.Y @PL3=V.A.ACS.ABS.Z \
@PL4=V.G.SELECTED_CS.TRANS.X @PL5=V.G.SELECTED_CS.TRANS.Y \
@PL6=V.G.SELECTED_CS.TRANS.Z \
@PL7=V.G.SELECTED_CS.ROT.X @PL8=V.G.SELECTED_CS.ROT.Y \
@PL9=V.G.SELECTED_CS.ROT.Z \
@PL10=V.A.ACS.ABS.A @PL11=V.A.ACS.ABS.B @PL12=V.A.ACS.ABS.C ]
N5110 #WAIT MC_Status [JobID="MC-Escape"]
N5120 V.P.McStatus = MCV_WAIT_STATUS ["MC-Escape"]
N5130 $IF V.P.McStatus != MC_DONE
N5140 #ERROR [ID455 MID0 RC2 PV1=V.P.McStatus \
PV2=MC_DONE PM1=2 PM2=3]
N5150 $ENDIFN5160 M17
Programing Example

Subroutine - Activate orbit channel
%DS-ActivatePlanetary
N6000 #CHANNEL INTERFACE ON [EXTEND AX=Y FREEZE=X FREEZE=Y]
; Start the orbit channel with same CS orientation
N6001 #MC_MovePath SYN [ CH="CH-Planetary" JobID="MC-OrbCircle" \
FileName="DsPlanetaryFile" \
@PL1=V.G.SELECTED_CS.ROT.X @PL2=V.G.SELECTED_CS.ROT.Y \
@PL3=V.G.SELECTED_CS.ROT.Z \
@PL4=V.P.PlanetaryMaxScale @PL5=V.P.PlanetaryMaxEquid \
@PL6=V.P.PlanetaryGeomId ]
N6002 #WAIT SYN [ID="S-PlanetaryReady" CH="CH-Planetary"]
N6003 #TRACK CHAN ON[ DYN_CS="CH-Planetary" WAIT FILTER=0]
N6004 #BACKWARD STORAGE CLEAR
N6005 M17
Notice

The orbit channel must always be deactivated before the escape channel.
Programing Example

Subroutine - Deactivate escape channel
%DS-DeactivateEscape.sub
N7005 #CHANNEL INTERFACE OFF [ESCAPE]
N7006 #TRACK CHAN OFF[DYN_CS SUPERIMPOSE]
N7007 #MC_GroupResetForced SYN [ CH="CH-Escape" ID="MC-Reset"]
(Reset escape channel)
N7008 #WAIT MC_Status [ID="MC-Reset" DONE ABORTED ERROR]
N7009 M17
Programing Example

Subroutine - Deactivate orbit channel
%DS-DeactivatePlanetary.sub
N7000 #CHANNEL INTERFACE OFF [EXTEND]
N7001 #TRACK CHAN OFF [DYN_CS]
N7002 #MC_GroupResetForced SYN [ CH="CH-Planetary" ID="MC-Reset"]
(Reset orbit channel)
N7003 #WAIT MC_Status [ID="MC-Reset" DONE ABORTED ERROR]
N7004 M17