ISPSoft User Manual 7.2.3 Input/ Output Pins of a Function Block When a POU calls a function block, it sends the value in a device to the input pin of the function block. After the function block is executed, the operation result is sent to the device in the POU through the output pin of the function block. A single function block can accept multiple inputs and return multiple outputs, while function only has an output parameter (return value). Please refer to the following figures. Before a function block is executed The caller assigns D0 to DT_IN, the input pin of the function block. When the function block is called, the system sends the present value in D0 to DT_IN.
(DT_IN is a symbol of the VAR_INPUT type.) After a function block is executed After the function block is executed, the value of DT_IN becomes 89. The value in D0 is unchanged. Besides, DT_OUT sends the final operation result to D2, the device specified by the caller. Even if the value in D2 is overwritten during the execution of the program, the value of DT_OUT will remain unchanged.
(DT_ OUT is a symbol of the VAR_OUTPUT class.) Although the value of the symbol of the VAR_IN_OUT class will be sent to the device that the caller assigns to the symbol after the function block is executed, the present value in the device specified by the caller is sent to the symbol before the symbol sends the final operation result to the device. 7-8