Chapter 6 Applied Instructions 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 WORDs and 2 WORDs equals to 4 bytes. And that means a string can contain 3 characters and 1 ending character (16#00). The setting range for S 4 is 1-100. (If the input value is out of the range, the value will be seen as the minimum or the maximum during operation and PLC does not send any error message.) 5. D 2 is the sum of all the split strings. 6. The result of D 1 ~ D 1 + S 4 *D 2 –1 is the D devices that are occupied.
and the 3 rd string will be stored in D 1 + S 4 x2. For example, if D 2 is 3, that means the 1 st string will be stored from D 1 +0 and the 2 nd string will be stored in D 1 + S 4 7. The instruction looks for a string for a length defined in S 4 (WORD) till there is an ending character or a splitter. Add 1 to the value in D 2 . Whenever one string is found, 8. Up to 256 characters can be stored in S 1 and up to 20 sets of strings can be stored in D 2 . When any of the limitation is reached even when there is no ending character, the splitting stops. Example Use “,” as a splitter to split a string “abcd,1234,5.67,8910;ef” and use “;” as an ending character that stored in D0-D11.
And store the results in the register starting from D100 in a unit of 10 WORDs. 6_ Note: the string to be split does not include the characters “”. Explanation 1. The results of this example D0~D11=“abcd,1234,5.67,89103;edf”. 6-699 Device Value String D0 16#6261 “ba” D1 16#6463 “dc” D2 16#312C “1,” D3 16#3332 32