You are on page 1of 5

22/07/2020 PLC: Difference between Binary and BCD Forms | FAQ | Australia | Omron IA

Omron uses cookies to improve your experience on this website. By continuing to use the website, you hereby agree to our Privacy and Cookie Policy ✕

Australia Contact Login / Signup Search

Home Products Solutions Service & Support About Us Search Sales Network

Home > Service & Support > FAQ > Automation Systems > Programmable Controllers

FAQ

Automation Systems PLC: Difference between Binary and BCD


Forms
Machine Automation Controllers

Programmable Controllers FAQ No. FAQ02069


Question
Networks
What is the difference between the binary and BCD forms of math instructions?
Programmable Terminals
Answer
RFID Systems The Internal Code of Math Instructions

When using CX-Programmer FA Integrated Tool Package, as shown in the ladder program in Figure 1, both BINARY ADD
Automation Centre (ATC) instructions and BCD ADD instructions can be input and displayed in decimal form. The data conversion function of CX-
Programmer makes this possible. You can see by looking at the internal code in the Watch Window in Figure 1 or the numeral
Download Centre data in Figure 2, that the internal code processed by the CPU Unit is actually binary.

Customer Service

Repair Service

Training

Technical Guide

FAQ

Standards Certification

www.omron.com.au/service_support/FAQ/FAQ02069/index.asp 1/5
22/07/2020 PLC: Difference between Binary and BCD Forms | FAQ | Australia | Omron IA

Programming: CS1/CJ1-series Programmable Controller


Figure1. Ladder Program and Watch Window

Figure2. DM Area Monitor Display for Programmable Controller Memory (Binary Mode)

The BINARY ADD instructions can handle a range of values 3.27 times that of the BCD ADD instructions.

www.omron.com.au/service_support/FAQ/FAQ02069/index.asp 2/5
22/07/2020 PLC: Difference between Binary and BCD Forms | FAQ | Australia | Omron IA

Choosing an Instruction: Checkpoint 1

As previously described, the internal code for the instructions is either binary or BCD format. The value ranges for the
instructions are shown in Table 1.

Mnemonic Instruction name Data type Value range


+ SIGNED BINARY ADD WITH CARRY INT -32768 to 32767
+B BCD ADD WITHOUT CARRY UNIT_BCD 0 to 9999

Table 1

As shown in Table 1, the difference between the "+" instruction and the +B instruction is whether the values are signed or
unsigned. It can also be seen that the "+" instruction can handle a range of values 3.27 times that of the +B instruction even
when the value range is limited to positive numbers. This difference in the range of values that can be handled is an important
factor when selecting math instructions.

Considering the I/O Values of Programmable Controllers

Choosing an Instruction: Checkpoint 2

Should binary or BCD format be selected? One more important point to be considered when selecting the instruction is the form
of the numeric inputs for the math instruction. Table 2 shows a list of common I/O signals used by Programmable Controllers
and the main code (BCD or binary) that would be used for math processing.

Item BCD BIN


Thumbwheel switches Yes
Ten-key switches Yes
Input Parallel transfer data Yes Yes
Serial communications data (ASCll) Yes Yes
A/D conversion data Yes
Digital display units Yes
Printers (ASCll) Yes
Output Parallel transfer data Yes Yes
Serial communications data (ASCll) Yes Yes
D/A conversion data Yes

Table2. I/O Signals for Programmable Controllers

Case Study of Selecting Math Instructions (Overview)


www.omron.com.au/service_support/FAQ/FAQ02069/index.asp 3/5
22/07/2020 PLC: Difference between Binary and BCD Forms | FAQ | Australia | Omron IA

To summarize the above, the two checkpoints for math instruction selection are as follows:

1. The difference in range of values handled by binary instructions and BCD instructions
2. I/O format for math formulas

Here we will give some examples of how to decide math instructions using checkpoints 1 and 2.

Example 1: Relatively Simple Calculation

Use BINARY ADD

An internal offset value is added to a 4-digit BCD input value from a thumbwheel switch, and the result is output as a 4-digit
BCD value to a digital display unit.

Use BINARY DIVIDE


A 12-bit binary value from an A/D conversion unit is divided by an internal variable, and a 12-bit binary value is output to a D/A
conversion unit after scaling.

Example 2: Comparatively Complex Calculation with Multiple Input Parameters

When there are multiple input parameters, depending on the input device and communications control specifications, BCD data
and binary data may both exist. When this occurs consider the following two questions as a general guide to select the math
instruction:
1. What is the form of the output value?
2. What is the value range during calculation processing?
After the instruction has been decided, other data in other forms will be converted into binary or BCD using the binary or BCD
conversation instructions.

Other Programmable Controllers FAQ

What is the difference between the different operating modes of the Programmable Controller's CPU Unit (i.e., PROGRAM
mode, RUN mode, and MONITOR mode)?

Is there an instruction that can be used in a subroutine to turn OFF an output bit that was turned ON in the main program?

Will interrupt tasks and interrupt subroutines work properly during overhead processing, I/O refreshing, and peripheral
servicing if C200HS-INT01 Interrupt Input Units are used in CS1 or CS200HX/HG/HE Programmable Controllers?

www.omron.com.au/service_support/FAQ/FAQ02069/index.asp 4/5
22/07/2020 PLC: Difference between Binary and BCD Forms | FAQ | Australia | Omron IA
Top

OMRON Asia Pacific OMRON Corporation Copyright Statement Sitemap Terms and Conditions Privacy Policy
Warranty and Limitation
© Copyright OMRON Corporation 2000-2020. All Rights Reserved.

www.omron.com.au/service_support/FAQ/FAQ02069/index.asp 5/5

You might also like