Delta AH500 — 6.21.2 Explanation of String Processing Instructions

AH500 Programming Manual Symbol: S : String Word n : Number of characters which are retrieved Word D : Device in which the characters retrieved are stored Word Explanation: 1. The instruction is used to retrieve n characters in the string in S from the right, and the characters which are retrieved are stored in D . 2. If n is 0, the value in D is 0. b15 b0 b7 b8 S +1 S ..................... ~ ~ D +1 D ..................... ~ If the data in S is ABCDEF12345 and n is 5, five characters in the string in S are retrieved from the right. The conversion result is as follows.

b15 b0 b7 b8 b15 b0 b7 b8 S +1 S D +1 D ABCDE F12345 +2 S +2 D +3 S +4 S +5 S 6-476 API Instruction code Operand Function 2111 $RIGHT P S, n, D The retrieve of the characters in the string begins from the right.

Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S          n            D        Pulse instructio n 16-bit instruction (7-13 steps) 32-bit instruction AH500 AH500 - Second A SCII code First ASCII code Fourth ASCII code Third AS CII code n-1 th A SCII code from the last n th ASCII code from the last n-3 th A SCII code from the last n-2 th A SCII code from the last Second ASCII code from the last Third AS CII code from the last 16#00 First ASCII code from the last n-1 th A SCII code from the last n th ASCII code from the last n-3 th A SCII code from the last n-2 th A SCII code from the last Second ASCII code from the last Third AS CII code from the last 16#00 First ASCII code from the last 16#42(B) 16#41(A) 16#32(2) 16#31(1) 16#44(D) 16#43(C) 16#34(4) 16#33(3) 16#46(F) 16#45(E) 16#00 16#35(5) 16#32(2) 16#31(1) The 16#34(4) 16#33(3) 16#00 16#35(5)