I was thinking a small capacitor across the input terminals, but a electrolytic may not be good enough if it's a high frequency noise/harmonic problem. However it would be a simple thing to try if you have a small electrolytic capacitor about.

The best thing would be to put a scope over the input terminals to see if it is a noise problem, as without seeing what's going on, it's pure guesswork.

Doesn't UCNC support Modbus?