Chapter 6 Applied Instructions If the data in S is ABCDEF12345 and n is 5, the instruction retrieves five characters in the string in S from the right. The conversion result is as follows. b15 b0 b7 b8 b15 b0 b7 b8 S D ABCDE F12345 +1 S +2 S +2 D +1 D +3 S +4 S +5 S The fifth character from the last Example D0 b15 b0 b7 b8 b15 b0 b7 b8 D10 D1 D11 D2 D3 The fourth character from the last D12 D4 6_ Additional remarks 1. If the operand S is not a string ($) but a device with a string, the string in S can be up to 256 characters (16#00 ending character included). If the string in S does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E. 2.
If n is less than 0, it is processed as 0. If n is greater than the length of the string in S , it is processed as the length of the string is S . 3. If D is not sufficient to contain n characters, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 6-661 16#42(B) 16#41(A) 16#44(D) 16#43(C) 16#46(F) 16#45(E) 16#32(2) 16#31(1) The 16#34(4) 16#33(3) 16#00 16#35(5) 16#32(2) 16#31(1) 16#34(4) 16#33(3) 16#00 16#35(5) 16#42(B) 16#41(A) The four 16#44(D) 16#43(C) 16#46(F) 16#45(E) 16#48(H) 16#47(G) 16#00 16#46(F) 16#45(E) 16#48(H) 16#47(G) 16#00