beautypg.com

Rockwell Automation AutoMax Enhanced Ladder Language Reference Manual User Manual

Page 290

background image

AĆ18

A.6.2

About the User Specified Initialization Method

When a variable is configured to use a User Specified value, the value defined as the

initial value is written to the variable at the start of the first scan. If the variable's initial

value is changed via inline editing, forcing, setting, or a program's execution, this new

value is not retained when the program is stopped and rerun. The value written to the

variable each time the program is placed into run is always that specified in the Initial

Value field of the Variable's property sheet. Choose User Specified initialization when

you want a variable to use the initial value you defined every time the program is placed

into run.

IMPORTANT

Do not use userĆspecified initialization for a global I/O variable being used as an input. If

you do, a bus error (error 31) occurs when you try to run the task.

A.6.3

About the Retained Value Initialization Method

When a variable is configured to use a Retained Value, the value defined as the initial

value is written to the variable at the start of the first scan. If the variable's initial value is

changed via inline editing, forcing, setting, or through the Variable Properties dialog

box, the value the variable contains when program execution stops is the one that is

written to the variable when the program is rerun. Retained Value initialization is the

default initialization type for timers and counters. An initial value of a variable configured

to use Retained Value initialization can be changed by any ladder program. For

example, you can change a timer or counter preset value by using ladder logic. Initial

values changed online can be permanently installed only by saving the program from

the Processor. Choose Retained Value initialization when you want a variable to be

initialized with the value it had at the time the program was stopped. Make sure that you

specify global variables using Retained Value initialization as nonĆvolatile variables.

IMPORTANT

Do not use retainedĆvalue initialization for global I/O variables. Doing so causes an error

when the program is verified.