Hi,
I think you are using a level sensor that gives readability to 1cm order.
You will need atleast 1 AI module, and 1 DO (or relay output) module.
In the program for monitoring you would have a while loop within which the analog output (from sensor proportional to level) is first read and as suggested by Raghavendra, compare against the limits (45, 55 cm). Based on comparison just switch ON or OFF the DO channel.