Delta ISPSoft — 7.2.5 Function Block Definition and Function Block Instance

ISPSoft User Manual 7.2.5 Function Block Definition and Function Block Instance The definition of a function block and an example of a function block are important concepts. Please refer to the following example. Whenever the superior POU (caller) is executed, the value of V1_IN is sent to the function block RIPPLE_FILTER. After the value sent to the function block this time is compared with the value recorded last time, the final operation result will be sent to V1_OUT in the superior POU. In order to record the operation result, a local symbol in which the operation result can be stored is declared in the function block.

When the program is compiled, the system assigns a substantial memory block to this local symbol. If several pieces of data in the superior POU are processed in the same way, and theses pieces of data are independent of one another, the execution result may be incorrect, as shown in the figure below. After the value of V2_IN is sent to the function block, it will be compared with the value gotten from the operation performed on V1_IN last time. As a result, V1_IN and V2_IN interfere with each other. 7-18