8 Application Instructions API 100-149 API 129 Operands: S : Source device D : Converted result Explanations: 1. S occupies 2 consecutive devices. See the specifications of each model for their range of use. 2. Flags: M1020 (zero flag); M1021 (borrow flag); M1022 (carry flag) 3. The binary floating point value of the register designated by S is converted to BIN integer and stored in the register designated by D . The decimal of BIN integer is left out. 4. This instruction is the inverse operation of API 49 FLT instruction. 5. If the converstion result = 0, the zero flag M1020 = On If there is any decimal left out, the borrow flag M1021 = On.
If the result exceeds the range listed below, the carry flag M1022 = On. 16-bit instruction: -32,768 ~ 32,767 32-bit instruction: -2,147,483,648 ~ 2,147,483,647 Program Example: 1. When X0 = On, the binary floating point (D1, D0) will be converted into BIN integer and the result will be stored in (D10). The decimal of BIN integer will be left out. 2. When X1 = On, the binary floating point (D21, D20) will be converted into BIN integer and the result will be stored in (D31, D30). The decimal of BIN integer will be left out. X0 X1 Remarks: For floating point operations, see “5.3 Handling of Numeric Values”.
DVP-PLC Application Manual 8-46 Mnemonic Operands Function D INT P Float to Integer Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D E F INT, INTP: 5 steps DINT, DINTP: 9 steps S * D * PULSE 16-bit 32-bit EH3 EH3 EH3 ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 SV2 0 INT D0 D10 DINT D20 D30