AH500 Programming Manual
6-33
API Instruction code Operand
Function
0065 CHKADR
S, n, D
Checking the address of the contact
type of pointer register
Device
X Y M S T C HC D L SM SR E PR K 16# “$” DF
16-bit instruction (7 steps)
AH500
Symbol:
S
:
Pointer register
POINTER/T_POINTER/
C_POINTER/HC_POINTER
n
:
Number of devices Word
D
:
Check result Bit
Explanation:
1. The instruction CHKADR is used to check whether the value in S and (the value in S)+n-1
exceed the device range. If the check result is that the value in S and (the value in S)+n-1 do
not exceed the device range, the device D will be ON. Otherwise, it will be OFF.
2. S supports the pointer registers PR, TR, CR, and HCR.
3. The operand n should be within the range between 1 and 1024.
4. The instruction CHKADR only can be used in the function block.
Example:
1. Establish a program and a function block in ISPSoft.
Declare two variables in the program.
2. Declare VarPR1, VarTR1, VarCR1, and VarHCR1 in the function block, and assign the data
types POINTER, T_POINTER, C_POINTER, and HC_POINTER to them respectively.