Let's talk a bit of reality here. Since the PLC has a scan with a finite scan time the comparisons cannot be CONTINUOUS. So the question is - how often will fast enough to be considered continuous? Some analog don't change extremely rapidly. If they did we'd be talking about a separate signal processor chip or an analog circuit with a two second analog delay line. Let's say, for argument that every 1/10th of a second is fine. Make a 20 place long FIFO register. Each 1/10th of a second get the current reading, compare to the oldest reading on the FIFO stack, take whatever action is appropriate, then push this newest reading on the stack and wait another 1/10th of a second.
Adjust the FIFO length and delay as needed. Watch out for that pesky scan time.