Element Properties : Creating and Modifying Elements : Properties Window : Resetting Default Values for Elements

Resetting Default Values for Elements

You may reset elements to their default values during runtime using these two operators:

Note:
Both reset operators can be used in any place where an assignment expression is allowed, except for combinational assignments.
Both types of execution tools, simulation and the code generators, support these reset operators.
reset_element(TextualElement)
This operator receives only the parameter indicating which textual element to reset. The derived events (wr, ch) are generated.
reset_all_elements()
This operator does not use parameters. When it is called within a subroutine, it executes after exiting the subroutine. The default values are not assigned during the subroutine run. However, no derived events (wr, ch) are generated.
Elements can be excluded from the reset_all_elements operation by adding an attribute to their properties. Elements with an attribute named STM_RESET_EXCLUDE and value “Yes” are not reset to their default value when the reset_all_elements operation is executed. The existence of the attribute is considered for fields (i.e., a record field cannot be excluded from reset_all, only the whole record). The STM_RESET_EXCLUDE attribute affects the reset_element operation.