BCD data

BCD is an acronym for binary-coded decimal, and means that each digit of a decimal number is expressed as a binary number.

Decimal number

6

4

5

¯

¯

¯

¯

BCD (binary-coded decimal)

0110

0100

0101

Handling BCD data in the PLC

When inputting data from a digital switch to the PLC or outputting data to a 7-segment display (with a decoder), the data must be in BCD format. In such cases, use a data conversion instruction as shown in the examples at below.

BCD arithmetic instructions (F40 to F58) allow BCD data to be used directly. However, since PLCs compute in binary format, BIN operation instructions (F20 to F38) are more convenient.

Input from a digital switch

Use the BCD to BIN conversion instruction F81_BIN.

  1.  (1) Digital switch
  2.  (2) PLC using F81_BIN
  3.  (3) BCD data input
  4.  (4) BIN data that can be processed in the PLC
  5.  (5) converted to 2018 in decimal data

Output to a 7-segment display (with decoder)

Use the BIN to BCD conversion instruction F80_BCD.

  1.  (1) PLC using F80_BCD
  2.  (2) BIN data that can be processed in the PLC
  3.  (3) BCD data output
Related topics:

Modified on: 2019-01-26Feedback on this pagePanasonic hotline