You can specify the reset points for variables and step outputs, using any of the settings available in Matrox Design Assistant.
When you create a variable, you can specify its ResetPoint in the Add variable dialog. You can modify reset points using the Edit variables dialog.
You can set the ResetPoint for variables to InspectionStart, NeverReset, or FlowchartStart, respectively. InspectionStart specifies that the variables will be reset to their initial value at the project's inspection start action point. To never reset variables, or to only reset them once when the project starts, set ResetPoint to NeverReset or FlowchartStart, respectively. For more information, see the Lifetime section in Chapter 25: Variables and the Store step.
Steps between the main flowchart's inspection
start ()
and inspection
end (
),
have a ResetPoint property that
establishes the action point at which to reset the outputs of the
steps. Steps in subflowcharts can only be reset if their
subflowchart is called by the main flowchart. That is, steps in
event-driven subflowcharts do not
have the ResetPoint property; they
keep their values for the duration of the project. However, they
are not
persistent.
The ResetPoint property of a step is set from the step's Properties pane. You can set the ResetPoint property for a step's outputs to InspectionStart (the default setting) or NeverReset.
InspectionStart specifies that the step's outputs get cleared for each new inspection loop. NeverReset specifies that the step remembers its previous results; this can be useful when the flowchart has several branches, and the results of a step must be made available to subsequent loops. Be aware that not resetting a step's outputs makes them available forever, which can cause stale data in the operator view.
Note that if you select InspectionStart, a step's outputs have no values after inspection start, and before the step is run. As a result, linking to the step's outputs can display an error in the Quick Evaluate pane. For instance, in the Matrox Design Assistant BottleInspection example project, linking to an output of the SealPresent step could display the error: Retrieving the 'Occurrences' output from 'SealPresent.Markers("Stripe")' has failed. The SealPresent step has not run yet or was reset at inspection start.
This error is avoided if the step's outputs are validated before use. Use the CHECKVALID and ISVALID functions to ensure expressions that link to results do not cause errors.
You can use reset points to ensure that the results sent to the PLC (or operator view) are relevant to the current loop, and not leftover from previous loops.