5 Categories and Use of Basic Application Instructions API 18 Operands: S : Source of data D : Conversion result Explanations: 1. The content in S (BIN value) is converted into BCD value and stored in D 2. When BCD is used as 16-bit instruction, Z device cannot be adopted; when BCD is used as 32-bit instruction, V device cannot be adopted. 3. If the conversion result exceeds the range of 0 ~ 9,999, BCD will not be executed. If the conversion result 4. BCD instruction converts the BIN data in the positioning unit into BCD data for displaying data on external exceeds the range of 0 ~ 99,999,999, DBCD will not be executed. device (e.g., 7-segment display). 5. Flags: 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). X0 2. If D10=001E (Hex) = 0030 (decimal), the result will be Y0~Y3 = 0000(BIN). DVP-PM Operation Instruction 5-34 Mnemonic Operands Function Controllers 20PM 10PM D BCD P Convert BIN to BCD Type OP Bit Devices Word Devices Program Steps X Y M S K H KnX KnY KnM KnS T C D V Z BCD, BCDP: 5 steps DBCD, DBCDP: 6 steps S * * * * * * * * * D D * * * * * * * * OX O100 Operation error M1793 M1953 BCD D10 K1Y0