Chapter 6 Applied Instructions API 2121 Symbol: S 1 : Binary-coded decimal floating-point number Word S 2 : Number of places Word D : Conversion result Double word Explanation: The binary-coded decimal floating-point number in S 1 is converted into the floating-point number first, and then the decimal point in the floating-point number is moved to the left in accordance with the setting of S 2 . The final result is stored in D . Seven-digit binary-coded decimal number Sign S1 Binary-coded decimal floating-point number D +1 S1 S1 +1 +2 D Sign (Exponent) S1 +3 Exponent S1 +4 Floating-point number Number of places S2 The binary-coded decimal floating-point number format: 1.
If the binary-coded decimal floating-point number is a positive number, the value in S 1 is 0. If the binary-coded decimal floating-point number is a negative number, the value in S 1 is 1. 2. The seven-digit binary-coded decimal number is stored in ( S 1 +2, S 1 +1). 3. If the exponent is a positive number, the value in S 1 +3 is 0. If the exponent is a negative number, the value in S 1 +3 is 1. 4. S 1 +4: The exponent The value in S 1 +4 should be within the range between 0 and 38. 5. S 2 : The number of places The value in S 2 should be within the range between 0 and 7. Example:
When the conditional contact MO is ON, the binary-coded decimal floating-point number is converted into the floating-point number. 6-499 Instruction code Operand Function FREXP P S , S , D 1 2 Converting the Binary-coded decimal floating-point number into the floating-point number Device X Y M S T C HC D L SM SR E PR K 16# “$” DF S 1 S 2 D Pulse instruction 16-bit instruction (7 steps) 32-bit instruction AH500 AH500 -