This is not actually a lock, as it only has one set of doors. Its sole function is to control the amount of water entering the Canal Du Midi. Too much water in the canal would cause the canal to overflow one of its dikes somewhere downstream. This would destroy the dike, flood the surrounding lands, and empty out a section of the canal between two locks. Floods like this have indeed happened in the past, for example in Capestang and in Trebes.
The Ognon creek used to run past this structure before it got diverted to run underneath the canal at the base of the Ecluses d'Ognon. However, during heavy rains, the Ognon river will overflow into its old bed. When that happens, the Porte de Garde d'Ognon has to be closed so that excess water will flow west back into the diverted Ognon creek.
Click on any picture below to see a fullscreen image. Resize your browser window or turn your mobile device if you want to see more of the picture; the pictures are rather square whereas most modern screens are rectangular.