Add('Expression', 'Enable', 'Reset=0')

Arguments

'Expression'

Analog input signal or expression

'Enable'

Digital input signal or expression;

'Enable' = 1 enables the addition

'Reset'

Optional parameter (default = 0) to stop and restart the calculation:

' Reset' = 0

Perform calculation

' Reset' = 1

Stop calculation and set result to 0

Description

This function adds the value of ‘Expression’ and its own actual value every cycle if ‘Enable’ = TRUE or 1. If ‘Enable’ = FALSE or 0, the last actual value will be held. ‘Reset’ = TRUE or 1 resets the actual value to 0.

Example

Each time a pushbutton is pressed, an analog value should be increased by 10 every cycle. With a reset-pushbutton the value should be reset to 0.

Solution