Instead of using a stepped add use a timed ramp and compute the ramp.
The ramp equation is Beginning_Point + ((Ending_Point - Beginning_Point)*(Timer.ACC/Timer.PRE))
Program the timer to run the full time of the ramp, eg if you want to ramp over ten seconds then use a ten second timer.
In the CLX the timer ACC can overrun the PRE so after the CPT do a final range check on the result.
Here is an example.
------------------------------------------
Using the method you posted above, if you want to use a periodic task then don't use a timer. Since a timer is a computer instruction, not a device, if it gets executed at a periodic rate that is longer than its PRE then you will have significant timing accuracy issues. Resetting it adds another task period (or scan period) in and compounds the problem.
Instead of using a timer, determine what vale to add at the task period rate and just add that each time the task runs. You can use the GSV instruction to get the task period and compute the amount to add so that even if the task period is changed the right ramp will be generated.
Use
GSV TASK THIS Rate TaskRate where TaskRate is a DINT tag to return the task period in microseconds.
Here is an example of a step/add ramp in a 50 millisecond periodic task ramping a pressure setpoint at a rate defined in KPa/second.
One thing to watch out for with this method is when ramping at very low rates the computed step change might be smaller than the resolution of the IEEE-754 floating point number format. In that case no matter how many times you add the step in the setpoint wont change. That is only an issue for very low rates with proportionally very large setpoints, I only mention it because occasionally someone comes here with that kind of a problem.