Schneider Electric 840 USE 106 0 Stroller User Manual


 
Additional Guidelines for IEC Hot Standby
158
840 USE 106 00 January 2003
Use Constants Instead of Equal Literals
Equal Literals In the diagram below, when multiple EFB instances use the same fixed value as
input, they are using equal literals. This is not much logic, but there is already a lot
of data to save, actually it’s 12 bytes. The trick is to declare a constant of type REAL
with the value 1.0 and use that in the logic instead of always assigning equal literals
to the inputs.
The point is: Every literal, no matter what value it has, is stored separately in data
memory (program data area), this brings up the advantage that it could be modified
due to a download change. Literals are rarely modified, therefore the modified logic
in the diagram below would be more appropriate.
The four times allocated literal with the value 1.0 has been replaced with a one time
allocated constant that has the value 1.0 as well. This little change saved 12 bytes
of data memory, since the type REAL takes 4 bytes and now needs to be allocated
3 times less.
MUL_REAL
real_A
1.0
real_B
.1.7
ADD_REAL
real_C
1.0
real_D
.1.9
SUB_REAL
real_E
1.0
real_F
.1.8
ADD_REAL
real_G
1.0
real_H
.1.10