Barrier with a protection device for barriers, movable along an operating path and actuated by a motor, such as roller blinds, gates or the like, comprising: - a part fixed with respect to the movement of the barrier; - a kinematic chain (24, 23, 22, 70) by means of which the fixed part is connected to the barrier with play, the barrier being movable independently of the action of the motor over a travel section; - detection means (42, 95) for detecting, along the travel section, the relative position of the fixed part and the barrier; - a processing unit connected to the detection means and the motor, which acquires position data from the detection means (42, 95) and being suitable to actuate the motor to move the barrier along the operating path and prevent or reverse the action of the motor and/or the movement of the barrier when the barrier, along the travel section, does not have a established position, which is detected by the detection means, characterized by further comprising: a memory in the processing unit which is containing a set of safety positions along the travel section, which are stored in the memory and associated, biunivocally, with a stored set of positions of the barrier along the operating path; the processing unit being also adapted to: acquire the current position of the barrier along the operative path; detect when the barrier reaches a corresponding point belonging to the stored set of positions of the barrier along the operating path; compare the actual position of the barrier along the travel section detected by the detection means, with a value associated with the set of safety positions in the memory and associated with said point belonging to the stored set of positions; the processing unit being connected to the detection means (42, 95) for detecting within the travel section the relative position of the fixed part and the barrier and recording into the memory the positions assumed by the barrier within the travel section during a test travel movement of the barrier; the processing unit being also adapted to regard as a set of safety positions the positions recorded by the processing unit into the memory and consider the actual position as a position for preventing the action of the motor and/or the movement of the barrier only when the difference obtained from said comparison is greater than an activation tolerance value. - a part fixed with respect to the movement of the barrier; - a kinematic chain (24, 23, 22, 70) by means of which the fixed part is connected to the barrier with play, the barrier being movable independently of the action of the motor over a travel section; - detection means (42, 95) for detecting, along the travel section, the relative position of the fixed part and the barrier; - a processing unit connected to the detection means and the motor, which acquires position data from the detection means (42, 95) and being suitable to actuate the motor to move the barrier along the operating path and prevent or reverse the action of the motor and/or the movement of the barrier when the barrier, along the travel section, does not have a established position, which is detected by the detection means, a memory in the processing unit which is containing a set of safety positions along the travel section, which are stored in the memory and associated, biunivocally, with a stored set of positions of the barrier along the operating path; the processing unit being also adapted to: acquire the current position of the barrier along the operative path; detect when the barrier reaches a corresponding point belonging to the stored set of positions of the barrier along the operating path; compare the actual position of the barrier along the travel section detected by the detection means, with a value associated with the set of safety positions in the memory and associated with said point belonging to the stored set of positions; the processing unit being connected to the detection means (42, 95) for detecting within the travel section the relative position of the fixed part and the barrier and recording into the memory the positions assumed by the barrier within the travel section during a test travel movement of the barrier; the processing unit being also adapted to regard as a set of safety positions the positions recorded by the processing unit into the memory and consider the actual position as a position for preventing the action of the motor and/or the movement of the barrier only when the difference obtained from said comparison is greater than an activation tolerance value.