DVP-ES3 Series Programming Manual Symbol S 1 : String S 2 : Part of the string to be retrieved D : Device where the characters retrieved are stored Explanation _6 1. Suppose the values in S 2 and S 2 +1 are n and m respectively. This instruction retrieves m characters starting from the n th character in the string in S 1 , and stores them in D . S1 b15 b0 b7 b8 b15 b0 b7 b8 D +1 S1 ..................... ~ ~ ~ +1 D ........... ~ 2. If the data in S 1 is ABCDEFGHIJK, the value in S 2 is 3, and the value in S 2 +1 is 7, the instruction retrieves the seven characters starting from the third characters in the string from the left. The conversion result is as follows.
6-664 API Instruction code Operand Function 2113 $MIDR P S1, S2, D Retrieving a part of a string Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 D Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 - Second ASCII code First ASCII code Fourth ASCII code Third ASCII code n+1 th ASCII code from the last n th ASCII code from the last n+3 th ASCII code from the last n+2 th ASCII code from the last n+1 th ASCII code from the last n th ASCII code from the last n+3 th ASCII code from the last n+2 th ASCII code from the last n+m-2 th ASCII code from the last n+m-3 th ASCII code from the last 16#00 n+m-1 th ASCII code from the last n+m th ASCII code from the last n+m-1 th ASCII code from the last 16#00 Last ASCII code