Signal but intermittently no sound/MIDI from Yamaha keyboard

I am a new user on a trial of Cubase Elements, but I have not been able to use that trial much, because most of the time, there is no sound from my MIDI keyboard. The sound registers on the “MIDI Activity” indicator, but not on any of the individual armed MIDI tracks. I have tried re-installing the drivers, and am carefully not to insert or withdraw the USB cable while the program is open.

Occasionally, I will switch it on and it works as it should, and I can use it for a while, but after some time, it just stops working. Nothing else seems to be different when it starts or stops working.

Can anyone please help??