Deriv

(Engine-Level Function)

Description: Returns the derivative (rate of change) of a value.
Returns: Numeric
Usage: Steady State only.
Function Groups: Generic Math
Related to: Intgr | PID
Format: Deriv(Value, Time)
Parameters:  
Value   
Required. Normally, the name of a variable holding a numeric value for which the derivative will be taken.
Time   
Required. Any numeric expression giving the maximum time in seconds between derivative function updates.
Comments: This function takes the change in the Value parameter between two successive evaluations and divides by the elapsed time interval between these evaluations. If the Value changes from invalid to valid, it will take two evaluations before the function's result becomes valid. This function is the inverse of Intgr.
The time parameter is necessary because of VTScada's evaluation method of not doing any calculations unless necessitated by a change in a parameter. This means that if the Value remains unchanged, the Deriv function will be recalculated after the time interval specified by the Time parameter and return 0.
This function is often used in control functions such as PID loops where it makes up the "D" in the "PID".

Example:

  LevelROC = Deriv(Level, 0.1);

Assuming that Level is updated to show a changing value, this will set LevelROC to the rate of change of that level.