Plc and motion controller combined