Simulation Aids Module by Automation Professionals
E-Mail Support

Simulation / ramp

Given speed and acceleration limits, compute values on a trajectory from the current value to a target position. Supports separate forward and reverse speeds. Updates on a given poll rate in client and designer scopes, and at the scan class rate in gateway scope.

Syntax

ramp(pollRate, target, rampRate [, revRampRate [, accel]]) returns Double

ArgumentData TypeDescription
pollRateIntegerMilliseconds between computations, or zero to short-circuit the target to the output. Polling will cease when the output reaches the target.
targetNumberFinal value the expression attempts to reach.
rampRateNumberThe positive or forward ramp rate, in units per second. (Not units per poll).
revRampRateNumberOptional negative or reverse ramp rate, in units per second, expressed as a positive number. Same as the positive ramp rate if omitted.
accelNumberOptional maximum change in ramp rate, in units per second squared, or zero to disable acceleration limiting. Disabled if omitted.

Usage Notes

If triggered faster than the poll rate due to changing argument values, the profile will be computed with the new values and the actual milliseconds interval to the previous computation.