Manipulator used as workpiece handler and for machining operation