HMI giving , no communication to PLC

this error is coming here and there but all the hardware and information is ok. what can cause that?

PLC and HMI model? Do you get any error code?

On the HMI the error says no communication to PLC but we having all the out puts. Or when you restart the machine all will be fine until a certain time again it pops up.