Patent ID: 8583404

Claim:
A photoelectric sensor comprising: a light-projecting unit for projecting light; a light-receiving unit for receiving light projected from the light-projecting unit and generating data on an amount of received light; an output unit for outputting a detection signal indicating that a detection target has been detected; a signal processing unit for receiving the data on the amount of received light generated by the light-receiving unit, performing a measuring process for the data on the amount of received light, comparing measurement data obtained by the measurement process with a predetermined threshold to determine whether a detection target is present or not, and switching between ON and OFF states of the detection signal according to a result of the determination; and an input unit for inputting a set value for the threshold, wherein the signal processing unit includes: first time-measuring means for measuring a length of a measurement data change period which is from when measurement data at a level at which the detection signal is off starts to change in a direction of the threshold to when the measurement data returns to a level at which the measurement data started to change; second time-measuring means for measuring a length of an ON-period for which measurement data at a level at which the detection signal is on is obtained during the measurement data change period; and output means for outputting, on the basis of measurement results obtained from the first time-measuring means and the second time-measuring means, information on the length of the ON-period and on a margin for the measurement data change period with respect to the ON-period in order to display the information.