Delta AH500 Programming Manual page 645

Hide thumbs Also See for AH500:
Table of Contents

Advertisement

API
Instruction code
2112
$LEFT
Device X
Y
M
S
n
D
Symbol:
Explanation:
1.
The instruction is used to retrieve n characters in the string in S from the left, and the
characters which are retrieved are stored in D.
2.
If n is 0, the value in D is 0.
b15
b8
Second ASCII code
S
F our th ASCII code
S
+1
n-1
t h
A SCII code from the last
n+1
AS CII c ode from the last
t h
16#00
If the data in S is ABCDEF12345 and n is 7, seven characters in the string in S are retrieved
from the left. The conversion result is as follows.
b15
S
S
+1
ABCDEF 12345
S
+2
S
+3
S
+4
S
+5
Example:
When M0 is ON, the instruction $LEFT is executed. The six characters starting from the character in
D100 are retrieved, and stored in D10~D12.
Operand
P
S, n, D
S
T
C
HC
D
Pulse instruction
AH500
S : String
Number of characters which are
n :
retrieved
Device in which the characters
D :
retrieved are stored
b7
b0
F irst ASCII code
T hi rd A SCII c ode
n-2
A SCII code from the last
t h
n
ASCII c ode from the l as t
t h
Last A SCII c ode
b8
b7
16#42(B)
16#41( A)
16#
44(D)
16#
43(C)
16#
46(F )
16#
45(E)
16#
32(2)
16#
31(1)
16#
34(4)
16#
33(3)
16#
00
16#
35(5)
Ch a pt er 6 Ap p l i ed I ns t r uc t i ons
The retrieve of the characters in the
string begins from the left.
L
SM SR
E
PR
16-bit instruction (7-13 steps)
AH500
b15
b8
b7
b0
Second ASCII code
F our th ASCII code
n-1
A SCII code from the last
t h
n-2
16#00
b0
b15
16#
42(B)
16#
44(D)
16#
46(F )
16#
00
Seventh c haracter
Function
K
16# "$"
DF
32-bit instruction
-
Word
Word
Word
F irst ASCII code
D
T hi rd A SCII c ode
D
+1
t h
A SCII code from the last
n
t h
ASCII c ode from the l as t
b8
b7
b0
16#41( A)
D
+1
16#
43(C)
D
+2
16#
45(E)
D
+3
D
16#
31(1)
6 - 4 7 7

Advertisement

Table of Contents
loading

Table of Contents