# 1 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av"
;cp.av (TopSpin 2.0)

;basic cp experiment
;written by HF 1.3.2001
;changed by JOS 05/06/03
;comments added by STE 4.4.2006

;parameters: 
;p3 : proton 90 at power level pl12
;p15 : contact time at pl1 (f1) and pl2 (f2)
;pl1 : X power level during contact
;pl2 : proton power level during contact
;pl12 : decoupling power level (if not pl13)
;pl13 : special decoupliong power level
;d1 : recycle delay
;p31 : TPPM pulse length
;cpdprg2 : cw, tppm (at pl12), or lgs, cwlg. cwlgs (LG-decoupling 
;spnam0 : use e.g. ramp.100 for variable amplitude CP
;here pl13 is used instead of pl12)
;zgoptns : -Dfslg, -Dlacq, or blank

;$COMMENT=basic cp experiment, arbitrary contact and decoupling schemes
;$CLASS=Solids
;$DIM=1D
;$TYPE=cross polarisation
;$SUBTYPE=simple 1D
;$OWNER=Bruker
prosol relations=<solids_cp>










# 1 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/user/trigg.incl" 1
;$COMMENT=definition of external trigger output
;$CLASS=Solids INCL
;$OWNER=Bruker





# 39 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av" 2

			;10 usec trigger pulse at TCU connector I cable 6
# 1 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/user/tppm.incl" 1
;$COMMENT=calculation of last pulse in cpd loop
;$CLASS=Solids INCL
;$OWNER=Bruker
"p30=p31-0.4u"				;calculate correction for cpd=tppm

# 41 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av" 2


# 1 "mc_line 43 file C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av dc-measurement inserted automatically"
    dccorr
# 43 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av"
1 ze			;accumulate into an empty memory

2 d1 do:f2		;recycle delay, decoupler off in go-loop
# 1 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/user/p15_prot.incl" 1
;p15_prot.incl

; Test the rf on-time and duty cycle
;protect against too long contact time
;Test the rf on-time and duty cycle 
;$COMMENT=protect against too long contact time
;$CLASS=Solids INCL
;$OWNER=Bruker
1m
if "p15<10.1m" goto Passp15
print "contact time exceeds 10msec limit!"
goto HaltAcqu
Passp15, 1m



# 46 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av" 2

			;make sure p15 does not exceed 10 msec	
			;let supervisor change this pulseprogram if 
			;more is needed


		

# 1 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/user/aq_prot.incl" 1
;aq_prot.incl
; Test the rf on-time and duty cycle
;protect against too long acquisition time
;$COMMENT=protect against too long acquisition time
;$CLASS=Solids INCL
;$OWNER=Bruker
1m
if "aq<50.1m" goto Passaq
print "acquisition time exceeds 50m limit!"
goto HaltAcqu
Passaq, 1m



# 54 "C:/Bruker/TOPSPIN2.1pl8/exp/stan/nmr/lists/pp/cp.av" 2

			;allows max. 50 msec acquisition time, supervisor
			;may change  to max. 1s at less than 5 % duty cycle
			;and reduced decoupling field


  1u fq=cnst21:f2
  10u pl12:f2 pl1:f1	;preselect pl12 drive power for F2, pl1 for F1
  6u setnmr4|31 \n 4u  setnmr4^31			;trigger for scope, 10 usec
  p3:f2 ph1		;proton 90 pulse
  0.3u
  (p15 ph2):f1 (p15:spf0 pl2 ph10):f2 	;contact pulse with square or ramp
  
  1u cpds2:f2 		;pl12 is used here with tppm, pl13 with cwlg, cwlgs
  
  go=2 ph31  		;select appropriate decoupling sequence, cw or
			;tppm, both executed at power level 12, or lgs
			;executed at power level pl13
  1m do:f2		;decoupler off
  wr #0			;save data to disk
HaltAcqu, 1m		;jump address for protection files
exit			;quit

ph0= 0
ph1= 1 3
ph2= 0 0 2 2 1 1 3 3
ph10= 0
ph31= 0 2 2 0 1 3 3 1

