If everything is discreet I/O, then you can use a timer, and comparison instructions to get pretty close. I don't have the logic handy, but I wrote a program a couple years ago to turn cooling fans on and off based on product temp. You would need to know if the temp was above or below the desired setpoint.
I used an infrared temperature transmitter (Omron) to get the temp(analog in). I conpared the temp with our desired preset to establish error(two instructions one GRT or GEQ for high one for low LES or LEQ.) If an error existed for more than two minutes, I would either turn a fan on or off. If in your case you are only interested in error in one direction, you can substitute the output of your controller as the comparison instruction(GEQ or LEQ). I was working with a somewhat stable PV (process variable) so it was easy to control. This may be what you are trying to accomplish.
True PID, would be different. You would need analog in and out. The PID instruction in AB controllers is notorious, but it does work. First you need to understand what PID is. It works on three different algorithms, Proportional, Intergal, and Differential. There is a time function here as well (I, D) All work together to drive the analog output to a smooth curve and keep error within control. I used this instruction to control the temperature in vats for log preperation. I spent quite a bit of time playing with it to get a good understanding of how it worked. This PV was not very stable, and it required the PID.