Negating inputs and outputs

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg logi.CAD 3 is using the expressions "negate" and "negation". You might know this as "invert" and/or "inverting".

How to toggle the negating behavior of an in-/output in the →graphical FBD-editor:

  1. Select one or several inputs/output of an FBD-element (e.g. a →call of a →block or a →value field containing a →variable) by clicking onto the in-/outputs while pressing and holding the Ctrl-key.
    Negations are only possible for shown in-/outputs of the →generic data type ANY_BIT. You are not able to negate in-/outputs of other types.

  2. From the context menu of the FBD-editor, select Negate In-/Output. Alternative: Press the i-key or double-click.
    Result: The in-/output is negated. But if it has already been negated, the negation is removed.

Negated inputs and outputs are represented by small circles around the respective in-/output. The color of this circle is determined by the data type that is assigned to the in-/output.
Example: The input IN1 of the function call MyFun is negated.
images/download/attachments/443058153/NegatedIO-version-1-modificationdate-1587640136787-api-v2.png

Notes and restrictions

  • By default, negated inputs to which no other element is connected are causing a warning. Reason: logi.cals warns to use such inputs because the →IEC-standard only contains the generic specification for the behavior of a negation: The negation is performed outside the POU.
    The IEC-standard does not contain any detailed specifications on how a negated input should behave when no other element is connected. See the following examples on the behavior of such negations in logi.CAD 3.
    images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg This validation is done due to the rule Negations of unconnected block inputs are not allowed. If necessary, you are able to change the preset configuration of the rule.

  • It is also possible to forbid the negations of all inputs/outputs. In this case, activate the rule Inputs and outputs must not be negated.

  • Moreover, logi.CAD 3 forbids the negation of some inputs – no matter how the above-mentioned rules are set. If you negate suche inputs anyway, a corresponding error message is displayed.
    The negation of the following inputs is never supported:

    • unconnected inputs for the transition condition

    • unconnected value field inputs

Examples for the behavior of negated inputs

images/s/b2ic8e/9012/1ca6q62/_/images/icons/emoticons/information.svg The following examples illustrate the behavior for →functions . Observe that the same behavior is valid for →function blocks as well.


Initial scenario 1: The value of the Boolean input G of the SEL function determines whether the function returns the value of the input IN0 or IN1: In case of FALSE, the function returns the value of IN0.
images/download/attachments/469860358/NegateInput1-version-1-modificationdate-1626182805453-api-v2.png

Example 1.1: By negating the input G, the value FALSE of the variable boolSel is negated. Hence, value TRUE is valid for the input G. In case of TRUE, the function returns the value of IN1.
images/download/attachments/469860358/NegateInput2-version-1-modificationdate-1626182805230-api-v2.png

Example 1.2: If the input G is unconnected and negated, the default →initial value FALSE of BOOL is negated. Hence, the value TRUE is again valid for the input G. As in example 1, the function returns the value of IN1.

images/download/thumbnails/469860358/NegateInput3-version-2-modificationdate-1626183407733-api-v2.png
The icon for the function call indicates that the call is causing a warning. In particular, the warning is caused by the negated input to which no other element is connected,


Initial scenario 2: The user-defined function assigns the value of the input IN1 to the output OUT1.
images/download/attachments/469860358/NegateInput4-version-1-modificationdate-1626184254478-api-v2.png

Example 2.1: By negating the input IN1, the value FRUE of the variable boolFunl is negated. Hence, the value FALSE is valid for the input IN1 and assigned to the output OUT1.

images/download/attachments/469860358/NegateInput5-version-1-modificationdate-1626184254334-api-v2.png

Example 2.1: If the input IN1 is unconnected and negated, the initial value TRUE of the input IN1 (as specified in the function) is negated. Hence, the value FALSE is again valid for the input IN1. As in example 2.1, the value FALSE is assigned to the output OUT1.

images/download/thumbnails/469860358/NegateInput6-version-1-modificationdate-1626184254569-api-v2.png
The icon for the function call indicates that the call is causing a warning. In particular, the warning is caused by the negated input to which no other element is connected,


Initial scenario 3: The value of the input EN of the user-defined function (from example 2) control the execution of the function .
See "Execution control: EN, ENO" for details on the behavior. Here a short summary:

In case of EN=TRUE, the functionality of the function is executed, hence the assignment of IN1 to OUT1.
The output ENO is reset to TRUE.

If EN is not connected, the preset default value is valid for EN.

Connected EN, EN=TRUE:
images/download/attachments/469860358/NegateInput7-version-1-modificationdate-1626247717954-api-v2.png

Unconnected EN, EN=TRUE:

images/download/attachments/469860358/NegateInput9-version-1-modificationdate-1626247717522-api-v2.png

In case of EN=FALSE, the functionality of the function is not executed .
The output ENO is reset to FALSE.

Connected EN, EN=FALSE:
images/download/attachments/469860358/NegateInput8-version-1-modificationdate-1626247717872-api-v2.png

Example 3.1: If the input EN is unconnected and negated, the preset default value TRUE for EN is negated. Hence, the value FALSE is valid for the input EN. Subsequently, the functionality of the function is not executed and the output ENO is reset to FALSE.

images/download/attachments/469860358/NegateInput10-version-1-modificationdate-1626247718033-api-v2.png
The icon for the function call indicates that the call is causing a warning. In particular, the warning is caused by the negated input EN to which no other element is connected,