11: BINARY ARITHMETIC INSTRUCTIONS
11-2 « FC4A MICROSMART USER’S MANUAL »
Valid Operands
For the valid operand number range, see pages 6-1 and 6-2.
▲ Internal relays M0 through M1277 can be designated as D1. Special internal relays cannot be designated as D1.
When T (timer) or C (counter) is used as S1 or S2, the timer/counter current value is read out. When T (timer) or C
(counter) is used as D1, the data is written in as a preset value which can be 0 through 65535.
Since the binary arithmetic instructions are executed in each scan while input is on, a pulse input from a SOTU or SOTD
instruction should be used as required.
Valid Data Types
Using Carry or Borrow Signals
When the D1 (destination) data is out of the valid data range as a result of addition, a carry occurs, and special internal
relay M8003 is turned on. When the D1 (destination) data is out of the valid data range as a result of subtraction, a borrow
occurs, and special internal relay M8003 is turned on.
There are three ways to program the carrying process (see examples below). If a carry never goes on, the program does not
have to include internal relay M8003 to process carrying. If a carry goes on unexpectedly, an output can be programmed to
be set as a warning indicator. If a carry goes on, the number of times a carry occurs can be added to be used as one word
data in a specified register.
Examples: ADD
• Data Type: Word
This example demonstrates the use of a carry signal from special internal relay M8003 to set an alarm signal.
• Data Type: Integer
Operand Function I Q M R T C D Constant Repeat
S1 (Source 1) Data for calculation XXXXXXX X 1-99
S2 (Source 2) Data for calculation XXXXXXX X 1-99
D1 (Destination 1) Destination to store results — X ▲ XXXX — 1-99
W (word) I (integer)
XX
Data Type Carry occurs when D1 is Borrow occurs when D1 is
W (word) over 65,535 below 0
I (integer) below –32,768 or over 32,767 below –32,768 or over 32,767
When a bit operand such as I (input), Q (output), M (internal relay), or R (shift register) is
designated as the source or destination, 16 points are used. When repeat is designated for a
bit operand, the quantity of operand bits increases in 16-point increments.
source or destination, 1 point is used. When repeat is designated for a word operand, the
quantity of operand words increases in 1-point increments.