Resetting the application stops the program and resets the variables to their initialization values. Depending on the type of reset, retain variables and persistent variables are also reset.
-
Reset Warm: All variables are reset, except
RETAINandPERSISTENTvariables. -
Reset Cold: All variables are reset, except
PERSISTENTvariables. -
Reset Origin: All variables are reset.
-
Reset Origin Device: All variables are reset and all applications are deleted.
The following sample program and statements clarify the functionality of the various resets.
Example 38. Sample program
Declaration
VAR
iVar: INT := 0;
END_VAR
VAR RETAIN
iVarRetain: INT :=0;
END_VAR
VAR PERSISTENT
iVarPersistent : INT:= 0;
END_VAR
Implementation
iVar := 100; iVarRetain := 200; iVarPersistent :=300;
-
Insert the Persistent Variables object below the application and open it in the editor.
-
Execute the command.
-
Execute the command.
The instance path of the persistent variables is inserted.
-
Download the application to the controller.
Requirement: The sample program runs on the controller.
-
Click to switch to online mode.
-
Monitor the variables
iVar,iVarRetain, andiVarPersistent. -
In the Online menu, click Reset Warm.
You are prompted whether you really want to execute the command.
-
Click Yes to confirm the dialog.
The application is reset. The
iVarvariable is set to the initialization value 0. Both of the other variables retain their values. -
In the Online menu, click Reset Cold.
You are prompted whether you really want to execute the command.
-
Click Yes to confirm the dialog.
The application is reset. The
iVarandiVarRetainvariables are set to the initialization value 0. TheiVarPersistentvariable retains its value. -
In the Online menu, click Reset Origin.
You are prompted whether you really want to execute the command.
-
Click Yes to confirm the dialog.
The application is reset. All variables are reset to their initialization values.