PURPOSE: To easily return to a desired output mode without altering wirings even if a mode of a detection signal output is reverse by providing exchange means of outputs of a plurality of signals according to a moving direction of a diffraction grating.
CONSTITUTION: Signals to be detected by photodiodes 5, 6 are respectively amplified by amplifiers A1, A2, and interlock switches S1, S2 are connected to an output side through resistors R1, R2. When the switches S1, S2 are connected to a contact (b), an output of the amplifier A1 is applied to an output terminal O2 through a contact (b) of the switch S1, and an output of the amplifier A1 is output to an output terminal O1 through a contact (b) of the switch S2. When the switches S1, S2 are connected at contacts (a), the output of the amplifier A1 is output to the terminal O1 through the contact (a) of the switch S1, and the output of the amplifier A2 is output to the terminal O2 through the contact (a) of the switch S2. Accordingly, output modes of the amplifiers A1, A2 to the terminals O1, O2 can be simply altered by switching the switches S1, S2.