DVP-ES3 Series Programming Manual 4.7 Pointer Registers for 16-bit Counters ISPSoft supports function blocks. If you want to use a 16-bit counter in a function block, you must declare a 16-bit counter pointer register in the function block. The address of the 16-bit counter is transmitted to the 16-bit counter pointer register when the function block is called. When the variable declaration type is VAR_IN_OUT, and the data type is C_POINTE, the variable is the 16-bit counter pointer register. The value in the 16-bit counter pointer register can refer directly to the value stored in the device T, or in the variable which is the counter in ISPSoft.
You can declare up to eight 16-bit counter pointer registers in every function block. The range is CR0–CR7. If you want to use an instruction in the function block, and the counter is supported by the operands, you have to use a 16-bit counter pointer register. Example: using a 16-bit counter in a function block. 1. Create a program organization unit (POU) in ISPSoft. _4 2. Create a function block which is called FB0. 3. Declare the variable in the function block FB0. Choose VAR_IN_OUT as the declaration type, CPoint1 as the identifier, C_POINTER as the data type. The variable is a 16-bit counter pointer register. 4. The program in the function block FB0 appears as shown below: 5.
Declare the variable in the program organization unit (POU). The data type of CVar1 should be COUNTER. 6. Call the function block FB0 in the program organization unit (POU). 4-14