//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 < 1) then qHr18 = 1 endif















