A low cost, real-time DSP-based diagnostic for the control of operation of a fusion experiment