powered by CADENAS

Manual

Manual

7.8.12.4.2. IF condition: Default value "Forced" or "Standard"

The following example shows how to control a value range variable through another value range variable (SEL "Selector" here), once using a standard IF condition (TFW "Standard" here) and once in a forced way (TFWF "Forced" here).

Example in PARTdesigner

Example in PARTdesigner

When loading the table, starting values (default values) are displayed. The start value is represented by the first parameter set under Equation. In the case of selector, here in this example, this is 1, for TFW (TMA) and TFWF (TMAF) according to the set condition this is "alpha".

Example in PARTdataManager: Standard values loaded

Example in PARTdataManager: Standard values loaded

Attribute algorithm TMA with standard IF condition

IF (SEL.EQ.1)THEN
 TMA = '''a'',''alpha'',''b'',''beta'',''c'',''gamma'''
ELSEIF(SEL.EQ.2)THEN
 TMA = '''b'',''beta'',''a'',''alpha'',''c'',''gamma'''
ELSEIF(SEL.EQ.5)THEN
 TMA = '''xy'',''xy'''
ELSE
 TMA = '''c'',''gamma'',''a'',''alpha'',''b'',''beta'''
ENDIF

Attribute algorithm TMAF with IF condition + forced setting of value

[Note] Note

With forced setting the starting value (first value in angle brackets) is set always anew.

Correct example:

IF (SEL.EQ.1)THEN
 TMAF = '<''a'',''alpha''>,''b'',''beta'',''c'',''gamma'''
ELSEIF(SEL.EQ.2)THEN
 TMAF = '<''b'',''beta''>,''a'',''alpha'',''c'',''gamma'''
ELSEIF(SEL.EQ.5)THEN
 TMAF = '<''xy'',''xy''>'
ELSE
 TMAF = '<''c'',''gamma''>,''a'',''alpha'',''b'',''beta'''
ENDIF

With default method, the starting value (first value) is initially set only one-time when the table is loaded, except the new starting value is not contained in the currently set value range.

If you want to set a forced value please regard following:

  1. The value has to be set as first pair of parameters.

  2. The pair of parameters has to be set in angle brackets.

  3. It is recommended to set a forced value in each condition or in none, because otherwise the behavior could be confusing.

    Example: Here, in the second condition there is no forced value, what is not recommended.

    IF (SEL.EQ.1)THEN
    TMAF = '<''a'',''alpha''>,''b'',''beta'',''c'',''gamma'''
    ELSEIF(SEL.EQ.2)THEN
    TMAF = '''b'',''beta'',''a'',''alpha'',''c'',''gamma'''
    ELSEIF(SEL.EQ.5)THEN
    TMAF = '<''xy'',''xy''>'
    ELSE
    TMAF = '<''c'',''gamma''>,''a'',''alpha'',''b'',''beta'''
    ENDIF
    

Description of behavior in PARTdataManager (or PARTdesigner table):

  • When opening the table, selector 1 is loaded as start value (1 is the first value under Equation) and thus, according to condition, the value "alpha" is loaded in TFW (TMA) and TFWF (TMAF).

  • When setting the selector to 2, the values of TFW and TFWF change to "beta".

  • If now the selector is set to 1 again, only the value of TFWF is changed. TFW is not changed.

    [Note] Note

    This marks the difference between standard and forced setting. With forced setting, the starting value (value in angle brackets) is always updated. With standard IF condition a new value is only set, if the new starting value is not contained in the currently set value range.

  • If the selector is set to 5 now, both TFW and TFWF are changed.

    [Note] Note

    The reason for this is that the value "xy" in not part of the currently set value range. In this case the value is changed, even without forced setting.

    With selector 1 both values are changed again for the same reason.

  • Now set TFW and FFWF to the value "beta" manually and change selector to 3.

    Result: No change, neither for TFW nor for TFWF.

    [Note] Note

    The value range of selector 3 covers the manually set value. So there is no change.

  • When setting selector to 5 now, the new value is set.

    [Note] Note

    Reason for this is that the value "xy" is not part of the currently set value range.

[Note] Note

Numerical variables can be used as well for the selector.

IF (SEL.EQ.1)THEN
 NMA = '<1,''alpha''>,2,''beta'',3,''gamma'''
ELSEIF(SEL.EQ.2)THEN
 NMA = '<2,''beta''>,1,''alpha'',3,''gamma'''
ELSE
 NMA = '<3,''gamma''>,1,''alpha'',2,''beta'''
ENDIF