Resetting Applications

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 RETAIN and PERSISTENT variables.
  • Reset cold: All variables are reset, except PERSISTENT variables.
  • Reset origin: All variables are reset.
  • Reset origin device: All variables are reset and all applications are deleted.

The following sample program and instructions clarify the functionality of the various resets.

See also

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;
  1. Insert the Persistent Variables object below the application and open it in the editor.

  2. Click Build ‣ Build.

  3. Click Declare ‣ Add all instance paths.

    ⇒

    The instance path of the persistent variables is inserted.

  4. Load the application to the controller.

Executing a “Reset warm”, “Reset cold”, and “Reset origin”

Requirement: The sample program runs on the controller.

  1. Click Online ‣ Login to switch to online mode.

  2. Monitor the variables iVar, iVarRetain, and iVarPersistent.

  3. Click Online ‣ Reset warm.

    ⇒

    You are prompted whether you really want to execute the command.

  4. Click Yes to confirm.

    ⇒

    The application is reset. The iVar variable is set to the initialization value 0. Both of the other variables retain their values.

  5. Click Online ‣ Reset cold.

    ⇒

    You are prompted whether you really want to execute the command.

  6. Confirm by clicking Yes.

    ⇒

    The application is reset. The iVar and iVarRetain variables are set to the initialization value 0. The iVarPersistent variable retains its value.

  7. Click Online ‣ Reset origin.

    ⇒

    You are prompted whether you really want to execute the command.

  8. Confirm by clicking Yes.

    ⇒

    The application is reset. All variables are reset to their initialization values.

See also