Chapter 6 Applied Instructions Symbol S 1 : String 6_ S 2 : Splitter S 3 : Designated ending character of a splitter S 4 : Storing Length for a string after a splitter D 1 : Device in which the string after a splitter is stored D 2 : Device in which the quantity of split strings is stored Explanation 1. S 1 is the string source. For characters in a string, only the characters before an ending character or the value in S 3 will be used as a valid string. 2. S 2 is the splitter that separates strings. S 3 is a designated ending character of a splitter. Only values in the lower 8-byte are valid for S 2 and S 3 .
However, if you input a value other than the value in the lower 8-byte, PLC does not send any error message. When S 2 and S 3 use D devices to store values, only use lower 8-byte for values in ASCII format. Values in S 2 and S 3 can be a constant number, an ASCII or a string. 3. S 4 is the storing length for a string after a splitter; unit: WORD. The ending characters, such as 16#00 and 16#0000 should be included in the length. The maximum WORDs a string can contain is S 4 and a WORD equals to 2 bytes. An ending character 16#00 takes a byte.
For example, if S 4 is 2, the maximum WORDs a string can contain is 2 6-681 API Instruction code Operand Function 2122 SPLIT P S1,S2,S3,S4,D1,D2 Splitting a string Device X Y M S T C HC D FR SM SR E K 16# “$” F S1 S2 S3 S4 D1 D2 BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S1 S2 S3 S4 D1 D2 Pulse instruction 16-bit instruction 32-bit instruction ES3 ES3 -