Hi sir:
I recommend you, that your machine has PLC:
1) Review the Opto isolador first
2) Power supply Normally +5vdc in Tolerance, if you measure +5.3 OR 5.4 Vdc is faulty , replace or repair.feeding to the CPU.
3) use the schematic diagram from your machine.