@cechurat ... this would mean that if I add a task in the future the timing might not be correct anymore.
Would it not be better that this can be configured with timing (e.g. seconds, minutes, days,.....) instead of a certain amount of samples?
you are right, it is necessary to force the valve to fully closed position once in a while. The SRTF function block is not the best one for your needs. I'd go for the ATMT state machine or simply use an ISSW switch to send logic 1 to the DN (CLOSE) input.