powered by CADENAS

Manual

Manual

7.8.12.4.2. IF condition: Value range variable controlled by other

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, 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

Forced setting of a value can be achieved by setting the first pair of parameters in angle brackets.

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 currently set value is not part of the new value range.

  • If the selector in 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