A flexible software for real-time control in nuclear fusion experiments