Skip to main content

FB_SUB

Description Function Block

The FB_SUB function block is used to subtract the AnalogIn2 input from the AnalogIn1 input and pass the result to the AnalogOut output.

Then the AnalogOut output is set to 0 and the bError output is set to 1.

If the ErrAck input of the associated group is 1; the RESET state is adopted. As soon as the ErrAck input of the associated group becomes 0 again, the RESET state is quit and the system switches to the RUN state. In RESET state, the output AnalogOut=0 and the output bError=0.

EL6900

The FB_SUB function block is not supported by the EL6900.

EL6900_SUB.png
Table 56. VAR_INPUT

Name

Data Type

Initial Value

Description, Parameter Values

AnalogIn1

LINT

0

1st analog signal for subtraction

Permitted data types: UINT, INT, UDINT, DINT

AnalogIn2

LINT

0

2nd analog signal for subtraction

Permitted data types: UINT, INT, UDINT, DINT



Table 57. VAR_OUTPUT

Name

Data Type

Initial Value

Description, Parameter Values

AnalogOut

SAFEUSINT

0

Analog output which contains the result of the subtraction.

Permitted data types: UINT, INT, UDINT, DINT

The data type must be selected according to the input data types.

bError

SAFEBOOL

FALSE

Replace with:

TRUE: The AnalogOut output has an overflow or underflow.

FALSE: No error has occurred.