beautypg.com

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

Page 82

background image

80

12. SEL Language

[Function]

Compares the contents of the variable in operand 1 and the value in operand 2. When the condition is estab-
lished, the program proceeds to the next step. When the condition is not established, if there is a
corresponding ELSE command, the program proceeds to the next step after that. If not, it proceeds to the next
step after the corresponding EDIF command. When the input condition is not established and there is no IF

XX

command executed, the program proceeds to the step following the corresponding EDIF. Up to 15 levels of
nesting are available when IS

XX

and DW

XX

are combined.

12.14

Structured IF Commands

IF

XX

EQ

· · ·

Operand 1 = Operand 2

NE

· · ·

Operand 1

Operand 2

GT

· · ·

Operand 1 > Operand 2

GE

· · ·

Operand 1

Operand 2

LT

· · ·

Operand 1 < Operand 2

LE

· · ·

Operand 1

Operand 2

[Example]

600

IFEQ

1

1

Select axis

IFGE

2

0

Select moving direction

JFWN

01

5

Move Axis 1 forward

ELSE
JBWN 01

5

Move Axis 1 backward

EDIF
ELSE
IFNE

2

1

Select moving direction

JFWN

10

5

Move Axis 2 forward

ELSE
JBWN 10

5

Move Axis 2 backward

EDIF
EDIF
Variable 1 selects Axis 1 or Axis 2. Variable 2 selects forward or backward to jog.
When flag 600 is OFF, nothing is done and the program proceeds to the step after the last EDIF.

*Do not use GOTO (TAG) in between IFXX and EDIF.

IFXX (Structured IF)

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

X

X

F

I

.

o

N

e

l

b

a

i

r

a

V

a

t

a

D