Delta ISPSoft — 7.2.7 Memory Configuration of Function Block

Chapter 7 Function Block and Library The calculation for the example is as follows. All the instances will occupy the internal memory by the order of their declarations. The first declared one is the function block instance INS_D.  Function block instance INS_D  One word (WORD x 1) The sum is 1 (word). The size of the memory that a local/global symbol whose data type is not a function block in a function block instance occupies is calculated as follows.  Function block instance INS_A  Two words (DWROD x 1) + Four words (LREAL x 1) The sum is 2+4=6 (words).  Function block instance INS_B  One word (WROD x 1) + Four words (REAL x 2) The sum is 1+4=5 (words).

 Function block instance INS_C1 / INS_C2 The size of the memory that a local/global symbol occupies is calculated by the word. The size which is less than one word is calculated as one word. As a result, the size of the memory that a local symbol whose data type is BOOL occupies is calculated as one word. The size of the memory that a local symbol whose array type is BOOL and whose array size is 22 elements occupies is larger than one word, but is less than two words. The size is calculated as two words. The calculation is as follows.  Two words (BOOL x 2) + Two words (Boolean array which is composed of twenty-two elements x 1) The sum is 2+2=4.

There are two instances of function block C, and therefore the size of the memory that the two function block instances occupy is 2x4=8 (words).  Function block instance INS_B / INS_C1 / INS_C2  As the previous example shown INS_B occupies 5 (Words) ; INS_C1 / INS_C2 occupies 8 (Words); and therefore the size of the memory that two function block occupy is 5 + 8 = 13 (Words). The size of the memory that the function block instances and the local/global symbols occupy is 1 + 6 + 5 + 8 + 13 = 33 (words). 7-29