Diurnal variations of cosmic rays during a solar magnetic cycle