The CNC device can control the spindle drive in three ways. One is the spindle drive device, which outputs an analog voltage value from zero to plus or minus 10v through the spindle analog voltage output interface. The positive and negative voltage controls the rotation of the motor, and the voltage controls the rotation speed of the motor. The other is to output unipolar 0~ 10v analog voltage to the spindle drive device, and specify the positive and negative rotation through the positive and negative rotation switch signal. The third is to select the 12 binary code or 2 bcd code (3 bcd code) switch signal output by the numerical control device to drive the spindle to control the spindle speed.