A new non-invasive approach for the measurement of ion beam energy