Persistance and retention (memory that is) - again.

M

Thread Starter

Mark Hutton

Just as an after thought on the memory retention discussion.

IEC 1131-3 offers the programmer the option of defining variables as
retained e.g.

VAR_OUT RETAIN
speed_profile:ARRAY[1..4] OF REAL;
max_speed REAL;
END_VAR

(taken from Programming Industrial Control Systems using IEC1131-3,
R.W.Lewis (IEE: ISBN 0 85296 827 2)

However, the standard (1993) (2.4.2) states that this only applies to 'warm restarts' (defined in 1131-1), all variablea are initialised to their
default value on a 'cold restart'.

I can paraphrase the text if required.
_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
S
On Mon Jan 24 08:23:42 2000 Mark Hutton wrote...
>
>Basically, from IEC 1131-3 (1993) 2.4.2 Initialisation.
>
>When a PLC program/sub program is started (run) the variables are
>initialised in predetermined ways.
>
>- the value the variable held when the PLC was stopped - retained value.
>- a user specified value.
>- the default value for the type (0 for most)
>
>Further.
>
>On a 'warm start', initial values of retentive variables (defined by use of
>the keyword RETAIN) shall be the retained value.
>
>On a 'cold start', the initial values of retentative variables will be
>either the user specified value or the default value for type.

You know, I like this a lot.

I propose we adopt this as our way of handling data table value init's.

--
Stan Brown [email protected] 843-745-3154
Westvaco

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
S
On Thu Jan 20 07:40:21 2000 Mark Hutton wrote...
>
>Just as an after thought on the memory retention discussion.
>
>IEC 1131-3 offers the programmer the option of defining variables as retained e.g.
>
>VAR_OUT RETAIN
> speed_profile:ARRAY[1..4] OF REAL;
> max_speed REAL;
>END_VAR
>
>(taken from Programming Industrial Control Systems using IEC1131-3,
>R.W.Lewis (IEE: ISBN 0 85296 827 2)
>
>However, the standard (1993) (2.4.2) states that this only applies to 'warm
>restarts' (defined in 1131-1), all variablea are initialised to their
>default value on a 'cold restart'.
>
>I can paraphrase the text if required.

Still differs from established practice, even if it _is_ in the spec.

--
Stan Brown [email protected] 843-745-3154
Westvaco
Charleston SC.
--

_______________________________________________
LinuxPLC mailing list
[email protected]
http://linuxplc.org/mailman/listinfo/linuxplc
 
Top