powered by CADENAS

Manual

Manual

6.8.5.  Attribute algorithms

[Note] Note

An example on attribute algorithms can be found in the "Training" catalog ($CADENAS/training/training.cip) under \v11_news\value_ranges\value_ranges_with_condition\din_1771.prj.

Dependencies between variables are expressed using so-called attribute algorithms. In the example (see following figure), you can see that the variable NENN is represented by the product of variables H, B and L.

NENN = '$H.x$B.x$L.'

Create attribute algorithms - Example

  1. Click on the button New.

  2. Under Last name, enter the variable name NENN.

  3. Under Mode, select the option Table mode or Dual mode.

    (In Designer mode, no attribute algorithm can be used.)

  4. Under Status, select the option Attribute algorithm.

  5. Under Equation, open the enlarged input field with a click on the browse button ....

    Click on the button $VAR=.

    --> The variable name entered under Last name is entered into the field as first part of the expression of the attribute algorithm.

  6. Enter the Assignment, which shall specify the Variable NENN.

    --> As NENN is a textual variable, the expression is NENN = '$H.x$B.x$L.'.

    [Note] Note

    Correct Syntax is important in this case:

    • Text variables

      Make sure your entries occur within the two apostrophes. In the format Dollar sign Name_of_variable Point (without empty spaces) variables can be used as place holders in the algorithm. Combinations with other text or arithmetic operators and connections via IF and ELSEIF functions (see explanation further down) are possible.

    • Numeric variables

      In the case of numeric variables no apostrophes are required. A numeric variable can be assigned a fixed numerical value and/or a calculation which, in turn, contains variables.

    Close the dialog with a click on OK.

    -> The entry is set under Equation.

  7. Click on Apply.

    -> The variable NENN is carried over into the listing of all project variables.

    -> The variable NENN is marked with the respective icon for Attribute algorithm.

Buttons for the creation of equation

  • $VAR=

    This button transfers the variable displayed under Last name into the input field.

  • IF

    An algorithm constructed through an IF condition can look as follows:

    IF ( ) THEN 
       D3 = 
    ELSE 
       D3 = 
    ENDIF

    Enter your condition (e.g. "L1.EQ.10") between the brackets ().

    Enter the value which D3 is to assume if the condition is met after THEN D3 =.

    The value for D3 if the condition is not met is located after ELSE D3 =. You include the condition with ENDIF:

    Example with values:

    IF (L1.EQ.10) THEN
    D3 = 20
    ELSE
    D3 = 30
    ENDIF

  • ELSEIF

    If more than one condition is to be checked, you can work with ELSEIF statements.

    Example with values

    IF (L1.LT.10) THEN 
    D3 = 1 
    ELSEIF (L1.LT.20) THEN 
    D3 = 2 
    ENDIF