IDEC FC4A-C10R2 User Manual page 234

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

11: B
A
INARY
RITHMETIC
Valid Operands
Operand
S1 (Source 1)
S2 (Source 2)
D1 (Destination 1)
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
W (word)
I (integer)
X
X
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.
Data Type
W (word)
I (integer)
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.
ADD(W)
SOTU
I0
M8003
Acknowledge
Pushbutton
I1
• Data Type: Integer
ADD(I)
S1 –
D10
I0
11-2
I
NSTRUCTIONS
Function
Data for calculation
Data for calculation
Destination to store results
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.
When a word operand such as T (timer), C (counter), or D (data register) is designated as the
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.
Carry occurs when D1 is
over 65,535
below –32,768 or over 32,767
S1 –
S2 –
D1 –
D2
500
D2
S2 –
D1 –
REP
D20
D30
« FC4A M
I
Q
X
X
X
X
X
D2 + 500 → D2
REP
When a carry occurs, output Q0 is set as a warning indica-
S
tor.
Q0
When the acknowledge pushbutton (input I1) is pressed,
R
Q0
the warning indicator is reset.
–4
D10
+
D20
S
U
'
M
ICRO
MART
SER
S
ANUAL
M
R
T
C
D
Constant
X
X
X
X
X
X
X
X
X
X
X
X
X
X
Borrow occurs when D1 is
below 0
below –32,768 or over 32,767
–11
D30
»
Repeat
X
1-99
X
1-99
1-99
–15

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents