Delta AH500 Programming Manual page 625

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

API
Instruction code
2106
$LEN
Device X
Y
M
S
D
Symbol:
Explanation:
1.
The length of the string in S is calculated, exclusive of 16#00 with which the string ends. The
length of the string is stored in D.
2.
The value stored in D should be within the range between 0 and 65535.
If the number of characters contained in the string is 65536, which is equal to 16#10000, the
value in D is 0.
If the number of characters contained in the string is 65537, which is equal to 16#10001, the
value in D is 0.
b15
Second c haracter
S
F our th character
S+1
Six th character
S+2
16#00
(
End ind c harac te r
S+n
If the data in S~S+4 is ABCDEFGHI, the calculation result is as follows.
b15
S
16#42( B)
16#44( D)
S+1
16#46( F)
S+2
16#48( H)
S+3
16#00
S+4
(
En di ng cha ra cter
Example 1:
Suppose S is the string "DELTA". When the PLC runs, the value in D0 is 5.
Operand
P
S, D
S
T
C
HC
D
Pulse instruction 16-bit instruction (5-11 steps) 32-bit instruction
AH500
S : String
D : Length of the string
b8
b7
b0
F irst character
T hi rd c har acter
F ifth character
n charac ter
t h
)
b8
b7
b0
16#41( A)
16#43( C)
ABCDEF GHI
16#45( E)
16#47( G)
16#49( I)
)
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons
Calculating the length of the string
L
SM SR
E
PR
AH500
Word/Double word
Word/Double word
b15
n
Length of the string
b15
9
Function
K
16# "$"
DF
-
b0
D
b0
D
6 - 4 5 7

Advertisement

Table of Contents
loading

Table of Contents