Set values to zero when no new data after certain time has arrived from Serial

Hello,

You do it wrong. This line currentMillis = millis(); should be startMillis = millis();, and currentMillis = millis(); should be at the top of loop()

Then, the code to check if time has elapsed should be:

if (startMillis != 0 && currentMillis - startMillis >= period)
{
  motor2PWM= 0;
  motor3PWM = 0; 
  showParsedData();
  startMillis = 0;
}