The invention discloses a numerically controlled lathe with an alarm function. The structure includes a numerically controlled body, a control panel, an observation port and a base. The numerically controlled body includes a motor, a fixture, a baffle, a material guide belt, a separation device, a water pipe, and a transmission machine. , the guide belt includes a positioning rod, a runner, an isolation belt, and a waste chute; the isolation belt includes a guide plate, an isolation plate, and a waste chamber; the separation device includes a conveyor belt, a bite groove, a drive shaft, and a support rod; Rollers, teeth, and support rods include fixed blocks and brushes. When the water level alarm device sounds, the conveyor is started. Because the bite grooves on the inside of the conveyor belt and the teeth engage with each other, the drive drives the drive shaft to rotate, and the drive shaft rotates to drive the isolation belt. Rotate, the isolation belt will bring the waste chips in the waste chip chute to the separation device, and a brush is installed on the support rod. Chips block the water pipe, so as to avoid the accumulation of coolant and cause the CNC machine body to rust.