//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

aXhxpto1 = aX90
pwXhxpto1 = pwX90
t1HXpto1 = 9.0*pwHr18*trunc(t1HXpto1/(9.0*pwHr18) + 0.5)
t2HXpto1 = 9.0*pwHr18*trunc(t2HXpto1/(9.0*pwHr18) + 0.5)














