Delta ISPSoft — 7.2.4 Index Type Symbol Variables

ISPSoft User Manual  Example of using a symbol whose data type is POINTER The function block FB0 has three input pins. The data types and the classes are in the red frame in the local symbol table below. D0, D1, and D2 in the POU (caller) are assigned to the three pins. (The initial values in D0, D1, and D2 are 0.) The execution of the program is as follows.  D0 is assigned to VAR_IN. VAR_IN is a symbol of the VAR_INPUT class, and the data type of VAR_IN is WORD. When the function block is called, the present value in D0 is copied into VAR_IN. After the operation inside the function block is performed, 4 will be added to the value of VAE_IN.

The operation result does not affect D0, and therefore the value in D0 is always 0.  D1 is assigned to VAR_IO. VAR_IO is a symbol of the VAR_IN_OUT class, and the data type of VAR_IO is WORD. When the function block is called, the present value in D1 is copied into VAR_IO. After the operation inside the function block is performed, 4 is added to the value of VAR_IO. Owing to the fact that VAR_IO is a symbol of the VAR_IN_OUT class, the value of VAR_IO is copied into D1 after the function block is executed. The value sent from D1 to VAR_IO is an accumulated value. The value in D1 accumulates during the execution of the function block.  D2 is assigned to pVAR.

Owing to the fact that the data type of pVAR is POINTER, the sum will be written into D2 after 4 is added to D2. The value in D2 accumulates during the execution of the function block. Although D1 and D2 get the same execution results, they have different execution processes. Besides, owing to the fact that pVAR is regarded as D2, the present value of pVAR is not displayed in a way in which the present value of VAR_IO is displayed when the online monitoring function is enabled. 7-16