The utility model relates to a machine tool accessory, specially relates to a revolving switch device. A raceway wallboard is provided with a support type reflecting photoelectric switch, a transmission switch is arranged on a transmission switch support, a receiving switch is arranged on a receiving switch support, both the transmission switch support and the receiving switch support are provided with a hole and a ring groove which is homocentric with the hole, the hole is provided with a revolving shaft, and the ring groove is glidingly provided with a limited bolt. The utility model has novel structure, the transmission switch support and the receiving switch support are provided with the revolving hole and the ring groove, which can revolve and adjust angle by winding the hole as center respectively, the bolt is fixed when the angle is proper. The utility model effectively resolves the problems of the mounting angle and adjustable height of the photoelectric switch, thereby no needing replacement of photoelectric switch aiming at workpieces with different standards, saving cost and improving the detecting efficiency and accuracy. In addition, the utility is mounted with an anti-collision device, thereby resolving the switch protection problem and reducing the damage.