Chapter 6 Applied Instructions Symbol S : Data source D : Conversion result Explanation 1. This instruction converts thee single-precision floating-point number in the register specified by S into the decimal floating-point number, and stores the conversion result in the register specified by D . 6_ 2. The floating-point operation in the PLC is based on single-precision floating-point numbers. Use the FBCD instruction to convert a single-precision floating-point number into a decimal floating-point number. 3. Instruction flags:
SM600 (zero flag), SM601 (borrow flag), and SM602 (carry flag) When the absolute value of the conversion result is larger than the value that can be represented by the maximum floating-point number, SM602 is ON. When the absolute value of the conversion result is less than the value that can be represented by the minimum floating-point number, SM601 is ON. When the conversion result is zero, SM600 is ON. Example When X0.0 is ON, the instruction converts the single-precision floating-point number in (D1, D0) into the decimal floating-point number, and stores the conversion result in (D3, D2).
6-99 API Instruction code Operand Function 0212 FBCD P S, D Converting a binary floating-point number into a decimal floating-point number Device X Y M S T C HC D FR SM SR E K 16# “$” F S D BOOL WORD DWORD LWORD UINT INT DINT LINT REAL LREAL TMR CNT STRING Data type S D Pulse instruction 16-bit instruction 32-bit instruction AS - AS