...use a RS232 to IP converter unit like this to electrically (OPTO) isolate machine from PC is a good idea. Also, can access from any PC on your network.
https://www.ebay.com/itm/40311464772...cAAOSwC0ZhK8L5
Bad earth grounding at the machine or the PC can blow cards.