      subroutine fill_acq_head
      include '../common/common_hbook.F'
      include '../common/common_io.F'
      include '../common/common_acq.F'
      include '../common/common_packet.F'
      
      R_header=R_header+1
      
      Rhead_counter = CPU_counter
      Rhead_obt = CPU_obt
      Rhead_wlen = CPU_pkt_len
c$$$      do i=1,Rhead_wlen
c$$$         Rhead_buffer(i) = iand(z'000000ff',buffer(i))
c$$$      enddo
      ip=1
      call getbytes(4,buffer,ip,RHD_stamp)
      call getbytes(1,buffer,ip,RHD_acq_mode)
      call getbytes(4,buffer,ip,RHD_obt_ts)
      call getbytes(4,buffer,ip,RHD_last_ts)
      call getbytes(1,buffer,ip,RHD_fav_ws)
      call getbytes(1,buffer,ip,RHD_eff_ws)
      call getbytes(4,buffer,ip,RHD_trigA)
      call getbytes(4,buffer,ip,RHD_trigB)
      call getbytes(1,buffer,ip,RHD_acq_after_calib)
      call getbytes(4,buffer,ip,RHD_trk_calib_used)
      call getbytes(4,buffer,ip,RHD_acq_build)
      call getbytes(1,buffer,ip,RHD_acq_var)
      call getbytes(1,buffer,ip,RHD_cal_dsp_mask)

      call HFNT(ntp_acq_head)

      return
      end
