IDEC MicroSmart User Manual

Page 242

Advertising
background image

12: B

OOLEAN

C

OMPUTATION

I

NSTRUCTIONS

12-2

« FC4A M

ICRO

S

MART

U

SER

S

M

ANUAL

»

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 Boolean computation 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

Example: XORW

To convert optional output status among a series of 10 output points, use the XORW instruction in combination with 10
internal relay points.

Operand

Function

I

Q

M

R

T

C

D

Constant

Repeat

S1 (Source 1)

Data for computation

X

X

X

X

X

X

X

X

1-99

S2 (Source 2)

Data for computation

X

X

X

X

X

X

X

X

1-99

D1 (Destination 1)

Destination to store results

X

▲ X

X

X

X

1-99

W (word)

I (integer)

X

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.

M8120

Ten outputs Q0 through Q11 are assigned to 10 internal
relays M0 through M11.

Five internal relays M0, M2, M4, M6, and M10 are set by
initialize pulse special internal relay M8120.

When input I1 is turned on, the XORW instruction is exe-
cuted to inver t the status of outputs Q0, Q2, Q4, Q6,
and Q10.

0

0 0

0

0 0

1

1

0

0 1 0 1

0 1 0

Q0

Q7

Q10

Q11

10 points

This program will inver t the status of the shaded outputs at the
left from on to off, and those not shaded from off to on.

REP

S1 –

M0

S2 –

Q0

D1 –

Q0

SOTU

I1

M0

M7

M10

M17

XORW(W)

M0

S

M2

S

M4

S

M6

S

M10

S

Advertising