DVP-ES3 Series Programming Manual Symbol S : String n : Number of characters to retrieve D : Device where the characters retrieved are stored Explanation _6 1. This instruction retrieves n characters from the string in S starting from the left, and stores the retrieved characters in D . When S is a string device, the maximum length for the value in S is 31 characters; when the S is not a string device, the maximum length for the value in S is 255 characters. 2. If n is 0, the value in D is 0. S b15 b0 b7 b8 b15 b0 b7 b8 ..................... +1 S ~ ~ ~ D ........... +1 D If the data in S is ABCDEF12345 and n is 7, the instruction retrieves seven characters in the string in S from the left.
The conversion result is as follows. 6-662 API Instruction code Operand Function 2112 $LEFT P S, n, D Retrieving characters from a string beginning from the left.
Device X Y M S T C HC D FR SM SR E K 16# “$” F S n D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S n D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 - Second ASCII code First ASCII code Fourth ASCII code Third A SCII code Second ASCII code First ASCII code Fourth ASCII code Third A SCII code n-1 th A SCII code from the last n-2 th A SCII code from the last n+1 th AS CII code from the last n th ASCII code from the last n-1 th A SCII code from the last n-2 th A SCII code from the last 16#00 n th ASCII code from the last 16#00 Last A SCII code