Chapter 4 Instruction Structure 7. The program in the program organization unit (POU) operates as shown below. Network 1: When StartBit[0] is ON, the address of C0 is transmitted to CPoint1 in FB0. When VarBit1 in FB0 is ON, CPoint1 (C0) is ON. Network 2: When StartBit[1] is ON, the address of CVar1 is transmitted to CPoint1 in FB0. 4_ When VarBit1 in FB0 is ON, CPoint1 (CVar1) is ON. 4.8 Pointer Registers for 32-bit Counters ISPSoft supports function blocks. If you want to use a 32-bit counter in the function block, you must declare a 32-bit counter pointer register in the function block.
The address of the 32-bit counter is transmitted to the 32-bit counter pointer register when the function block is called. When the variable declaration type is VAR_IN_OUT, and the data type is HC_POINTER, the variable is a 32-bit counter pointer register. The value in a 32-bit counter pointer register can refer directly to the value stored in the device HC or in the variable which is the counter in ISPSoft. You can declare up to eight 32-bit counter pointer registers in every function block. The range is HCR0–HCR7. If you want to use an instruction in the function block, and the 32-bit counter is supported by the operands, you must use the 32-bit counter pointer register. Example:
using a 32-bit counter in a function block. 1. Create a function block called FB0. 2. Declare the variable in the function block FB0. Choose VAR_IN_OUT as the declaration type, HCPoint1 as the identifier, HC_POINTER as the data type. The variable is a 32-bit counter pointer register. 4-15