Mitsubishi — Chapter 6 Application Instructions API 00-49

6 Application Instructions API 00-49 Operands: S : Source of data D : Conversion result Explanations: 1. If S and D are used in device F, only 16-bit instruction is applicable. 2. See the specifications of each model for their range of use. 3. Flags: M1067 (operation error); M1068 (operation error); D1067 (error code) 4. The content in S (BIN value) is converted into BCD value and stored in D . 5. As a 16-bit (32-bit) instruction, when the conversion result exceeds the range of 0 ~ 9,999 (0 ~ 99,999,999), and 6. The four arithmetic operations and applications in PLC and the execution of INC and DEC instructions are M1067, M1068 = On, D1067 will record the error code 0E18 (hex).

performed in BIN format. Therefore, if the user needs to see the decimal value display, simply use this instruction to convert the BIN value into BCD value. Program Example: 1. When X0 = On, the binary value of D10 will be converted into BCD value, and the 1s digit of the conversion result will be stored in K1Y0 (Y0 ~ Y3, the 4 bit devices). 2. When D10 = 001E (hex) = 0030 (decimal), the execution result will be: Y0 ~ Y3 = 0000(BIN). DVP-PLC Application Manual 6-32 API Mnemonic Operands Function 18 D BCD P Binary Coded Decimal Type OP Bit Devices Word Devices Program Steps X Y M S K H Kn X KnY KnM KnS T C D E F BCD, BCDP: 5 steps DBCD, DBCDP:

9 steps S * * * * * * * * * D * * * * * * * * PULSE 16-bit 32-bit EH3 SV2 ES EH3 EH3 ES EX SS SA SX SC EH SV EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV SV2 SV2 X 0 BCD D10 K1Y0