Chapter 6 Applied Instructions 4. The 3 rd program: merge the 1 st string D0=“abcd,1234,5.67” and 2 nd string ”,” together and put a splitter “0” in between (merge the string 1 and 2 directly) and then store the result in the registers starting from D0. The merged result: D0~D7= “abcd,1234,5.67;”; the quantity of merged strings: D100=15. Additional remarks 1. If the string in S 1 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E. 2. If the string in S 2 does not end with 16#00, SM0 is ON, and the error code in SR0 is 16#200E. 3. If D 1 + ( D 2 +1)/2 – 1 exceeds the device range, the instruction is not executed, SM0 is ON, and the error code in SR0 is 16#2003. 4.
Ending character 16#00 or 16#0000 will be added behind the merged string. See the examples above. 6_ 6-687 Device D0 D1 D2 D3 D4 D5 D6 D7 HEX 6261 6463 312C 3332 2C34 2E35 3736 003B String “ba” “dc” “1,” “32” “,4” “.5” “76” Upper 8-byte: 16#00 ; lower 8-byte: “;”