There are several ways to do this. I'll present a fairly generic method that will work with most all PLCs.
In the following example:
I1, is the INPUT
O1 is the OUTPUT
Timer1 is a TIMER that determines how long to keep the OUPUT relay energized after the input goes inactive.
The first rung of the ladder logic causes Timer1 to go active (TRUE) only after the INPUT, I1, has inactive (FALSE) for the time value that is set by Timer1.
The second rung is of the ladder logic is typical ladder logic latching relay. When I1 is TRUE O1 goes TRUE. The OUTPUT, O1, is wrapped back as an input term to the O1. The the Timer1 NC term (|/|) is used to reset output O1 when Timer1 goes active.
I1
--|/|------------------------(Timer1)
I1 Timer1
--||-------+---|/|------------(O1)
|
O1 |
--||-----+
Gary D