The error is seen when Simulink doesn't get acknowledgement from the target. One very common reason for this is target crashing/ going to bad state.
In your case, since you've added custom code(as asked in your previous question) there's a high chance that the code is causing the target to crash and hence the target is not responding. One possible way of verifying this is to deploy the code using "Deploy" option and see if the target still works(try putting digital output with pulse generator to blink LED).
If it is due to your code, then you need to check your code to see if there are any illegal operations.
If you still face the same issue after trying the above, please reach out to MathWorks Technical support.
Hope this helps.