In CNC programming, the code M04 is used to rotate the spindle in a clockwise direction. M codes are generally used to control auxiliary machine functions such as spindle rotation, coolant activation, and tool changes.
G codes like G03 and G04 are used for different functions in the CNC program, with G03 specifically being used for counterclockwise circular motion.