Controling Motor speed via Simulink and serial Com

Hey guys whasup?
i’m new to arduino.
I’m trying to send data from serial port to arduino and control the speed of motor but when i set the speed of motor using the serial port it wont work
or it will work but for a few second and then motor goes off
could u guys help me out?
I even used the trigger diagram in simulink (DSP tools ) but it didnt work out.
I attached my Simulik model
best regards

Model.jpg