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

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

Example in PARTdesigner

Example in PARTdesigner

The start values are displayed when the table is loaded. The start value is represented by the first parameter set in the formula [Equation]. For the selector this is 1, for TFW (TMA) and TFWF (TMAF) the value "alpha" due to the condition set.

Example in PARTdataManager: Standard values loaded

Example in PARTdataManager: Standard values loaded

Feature algorithm [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

Feature algorithm [Attribute algorithm] TMAF with IF condition + forced setting of a 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

By default, the start value (the first value) is only set only when the table is loaded, unless the new start value is not contained in the currently set value range.

If you want to force a value, note the following:

  1. The value must be set as the first parameter pair.

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

  3. It is recommended to set a forced value in every condition or in none, 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 the behavior in the PARTdataManager (resp. PARTdesigner Table):

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

  • 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 shows the difference between standard and forced setting. With forced setting, the start value (first value in angle brackets) is always reset. Not with the standard IF condition, unless the new start 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 manually to the value "beta" and change the 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

A number variable can also be used 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