Delta Electronics AH — 3.23 String Processing Instructions

Chapter 3 Standard Instructions Graphic expression: S : String 3_ D : Length of the string 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 b0 b7 b8 S S+1 b15 b0 D S+2 n S+n Length of the string If the data in S~S+4 is ABCDEFGHI, the calculation result is as follows.

b15 b0 b7 b8 S S+1 b15 b0 D ABCDEFGHI 9 S+3 S+2 S+4 3-513 FB/FC Instruction Operand Description FC $LEN P S, D Calculating the length of the string BOOL WORD DWORD LWORD UINT UDINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S  D     Device X Y M S T C HC/AC D L SM SR E PR K 16# “$” D F S          D          Pulse instruction 16-bit instruction 32-bit instruction AH Motion CPU AH Motion CPU - Second character First character Fourth character Third character Sixth character Fifth character 16#00 (Endind character) n th character 16#42(B) 16#41(A) 16#44(D) 16#43(C) 16#46(F) 16#45(E) 16#48(H) 16#47(G) 16#00 (Ending character) 16#49(I)