Delta AH500 — 4.6 Pointer Registers of 16-bit Counters

AH500 Programming Manual 6. Call the function block FB0 in the program organization unit (POU). 7. The program in the program organization unit (POU) Network 1: When StartBit[0] is ON, the address of T1920 is transmitted to TPoint1 in FB0. When VarBit1 in the FB0 is ON, the instruction TMR is executed, and TPoint1 (T1920) starts counting. When the value of TPoint1 matches the setting value, VarOut is ON. Network 2: When StartBit[1] is ON, the address of CVar1[0] is transmitted to TPoint1 in FB0. When VarBit1 in FB0 is ON, the instruction TMR is executed, and TPoint (CVar1) starts counting. When the value of TPoint1 matches the setting value, VarOut is ON.

4.6 Pointer Registers of 16-bit Counters  ISPSoft supports the function blocks. If users want to use the 16-bit counter in the function block, they have to declare a pointer register of the 16-bit counter in the function block. The address of the 16-bit counter is transmitted to the pointer register of the 16-bit counter 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 pointer register of the 16-bit counter. The value in the pointer register of the 16-bit counter can refer directly to the value stored in the device T or in the variable which is the counter in ISPSoft.

 Users can declare 8 pointer registers of the 16-bit counters in every function block. The range is CR0~CR7.  If users want to use an instruction in the function block, and the counter is supported among the operands, users have to use the pointer register of the 16-bit counter. Example: 1. Establish a program organization unit (POU) in ISPSoft first. 2. Establish a function block which is called FB0. 3. Declare the varaible 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 the pointer register of the 16-bit counter. 4-10