Calculation example: time limit on successive state changes

In this example of using the Calculation feature, we want to prevent state changes occurring in a pump (a digital object) from taking place with too short a time interval. In other words, we want to place a minimum time limit on how quickly the pump will be allowed to change states.

The pump we wish to control in this manner is shown in the illustration below and is called Pump_2. It’s a simple two-state pump, either ON (1) or OFF (0).

 

images\DEF_Calc_Pump_2.gif

 

  1. Double click on the Pump_2 graphic to bring up the properties tabs for this digital object.
  2. Click on the Calculation tab.

    images\DEF_Calc_Pump_2_Calculationtab.gif
     
  3. Since we want to control the state of the pump without being “overruled” by the PLC communicating with the Stateatom and continually putting new state values in here, we choose the Command atom on which to attach our Calculation parameters as shown above.
  4. On the Execution trigger, we choose to make the expression execute when a change occurs in the object, i.e. when the pump changes states. Therefore On object changes is selected.
  5. Our expression is constructed with the If (condition) function called IIF and the IGSS object function called MSecsSinceLastExec().

 

For a complete list of the object functions available for Calculation, please click here.

For a complete list of the arithmetical functions and operators available for Calculation, please click here.