Quick answer off the top of my head is:
Have a timer for the period of time desired, or depending on which PLC your using, trigger the start/stop with the real time clock.
Lets say N17:0 will hold the max value and I:3.1 is the input.
Then while the timer is timing, or event triggered:
Compare I:3.1 to N17:0,
if I:3.1 is greater than N17:0,
move I:3.1 to N17:0.
When the timer times out you will have the max input value, over the time period stored in N17:0.
Ken
Bitmore beat me to it, but we both have the same basic solution. If your PLC has a real time clock, you could also capture the time at the highest value.