A light barrier or light grid which has at least one light emitter
arranged in a first housing and at least one associated light receiver
arranged in a second housing. At least one emitter of visible alignment
light installed in the first or the second housing generates one or more
alignment light beams which is used to geometrically orient the light
emitter relative to the opposite light receiver. For optically aligning
the two housings, at least one alignment mechanism is present in the
housing which receives the alignment beam. The alignment mechanism has at
least one surface which optically deflects the alignment beam towards a
target plane.