//Set the R18 pulses from the Spin Rate

if (srate > 500) then 
   $pwHr18 = 2.0e6/(9.0*srate)
   pwHr18 = 0.1*trunc($pwHr18/0.1 + 0.5)
   srate = 2.0e6/(9.0*pwHr18)
   aHr18 = aH90*(4.0*pwH90)/pwHr18
   if (aHr18 = 4095) then 
      write('error','reset_r18 Error: aHr18 is >= to 4095')
   endif
endif

if (qHr18 < 2) then qHr18 = 2 endif

//Synchronize the PRESTO CP Times

t1HXpto2 = 9*pwHr18*trunc(t1HXpto2/(9.0*pwHr18) + 0.5)
t2HXpto2 = 9.0*pwHr18*trunc(t2HXpto2/(9.0*pwHr18) + 0.5)
t3HXpto2 = t2HXpto2
aXhxpto2 = aX90
pw1Xhxpto2 = pwX90
pw2Xhxpto2 = 2.0*pwX90















