Sel language – IAI America DS-S-C1 User Manual

Page 38

Advertising
background image

36

12. SEL Language

[Function]

Divides the contents of the variable in operand 1 by the value in operand 2, then stores
the remainder in the variable in operand 1. The output turns ON when the result of the
operation is 0.

Note:

The MOD command is used with respect to an integer type variable.

[Example1]

LET

1

7

Assign 7 to variable 1.

MOD

1

3

Figure the remainder when 7 (content of variable 1)is divided by 3.

7

÷

3 is 2 with a remainder of 1 which is entered in variable 1.

[Example 2]

LET

1

2

Assign 2 to variable 1.

LET

2

3

Assign 7 to variable 2.

LET

3

3

Assign 3 to variable 3.

MOD

*1 *2

Figure the remainder when variable 2 (content of variable 1).

7

÷

3 is 2 with a remainder of 1 which is entered in variable 1.

n

o

i

s

n

a

p

x

E

n

o

i

t

i

d

n

o

c

)

R

O

·

D

N

A

(

t

u

p

n

I

n

o

i

t

i

d

n

o

c

)

g

a

l

F

·

O

/

I

(

d

n

a

m

m

o

C

t

s

o

P

)

g

a

l

F

·

t

r

o

p

t

u

p

t

u

O

(

d

n

a

m

m

o

C

1

d

n

a

r

e

p

O

2

d

n

a

r

e

p

O

l

a

n

o

i

t

p

O

l

a

n

o

i

t

p

O

D

O

M

.

o

N

e

l

b

a

i

r

a

V

a

t

a

D

R

Z

MOD (Remainder)

Advertising