Chapter 6 Applied Instructions 4. If S used in the 16-bit instruction is a string, the number of characters contained in the string should be within the range between 1 and 4. If S used in the 32-bit instruction is a string, the number of characters contained in the string should be within the range between 1 and 8. Example 1: Suppose the values in D20 and D21 are 16#3641 and 16#4633 respectively. When the PLC runs, the value in D0 is -22977. b15 b0 b7 b8 D20 D0 -22977 D21 Conversion result= A63F=-22977 16# Example 2: Suppose the values in D20, D21, D22, and D23 are 16#4634, 16#3244, 16#3738, and 16#3035 respectively. When the PLC runs, the value in (D1, D0) is 1339197264.
b15 b0 b7 b8 D20 (D1,D0) D21 Conversi on result = # 16 =1339197264 4FD28750 1339197264 D22 D24 Example 3: Suppose S is the string “A”. Since the number of characters contained in the string is less than 4, the string is regarded as “A000”. When the PLC runs, the value in D20 is -24576. Example 4: Suppose S is the string “0000000A”. When the PLC runs, the value in (D21, D20) is 10. 6-453 16#36(6) 16#41(A) 16#46(F) 16#33(3) 16#46(F) 16#34(4) 16#32(2) 16#44(D) 16#37(7) 16#38(8) 16#30(0) 16#35(5)