Hyundai HI4 operation manual 11.2.4.10 IF∼ELSEIF∼ELSE∼ENDIF Command, 11.2.4.11 FOR∼NEXT Commands

Models: HI4

1 427
Download 427 pages 29.73 Kb
Page 384
Image 384

11. Robot Language Explanation

------------------------------------------------------------------------------------------------

11.2.4.10 IFELSEIFELSEENDIF Command

Description

Jumps according to the Condition.

 

 

 

 

 

 

 

 

IF <Condition> THEN <Address> [ELSE <Address>]

 

 

 

IF<Condition> THEN

 

 

 

 

 

 

Syntax

[ELSEIF <Condition>

 

 

] (Several Times)

 

 

 

 

 

 

[ELSE

 

 

 

 

]

 

 

 

 

ENDIF

 

 

 

 

 

 

 

 

 

 

Condition

 

Arithmetic Equation, String Condition

If 0, false

 

file

 

If not 0, true.

Parameter

 

 

 

 

 

 

 

 

Address

 

THEN : If condition is satisfied, jump.

 

 

 

 

 

 

ELSE : If condition is not satisfied, jump.

 

 

 

 

 

 

 

 

 

 

IF V2!>SQR(V50!^2+V51!^2) THEN 150 ELSE *AGAIN (Example of simple if

 

instruction)

 

 

 

IF DI1>=10 THEN

(Example of complex if

 

instruction)

 

 

 

PRINT #0, "HIGH"

 

 

example

PRINT #1, "HR-MSG: HIGH"

 

 

 

ELSEIF DI1>=0

 

 

 

PRINT #0, "LOW"

 

 

 

ELSE

 

 

 

 

GOTO *ERR

 

 

 

 

ENDIF

 

 

 

 

 

 

 

 

 

11.2.4.11 FORNEXT Commands

Description

Repeats the block incrementing the variable value as long as it is smaller

or the same as the end value.

 

 

 

 

Syntax

FOR <Variable>=<Initial Value> TO <End Value> [STEP <Increment>]

 

NEXT

 

 

 

 

 

 

 

 

 

 

Variable

Arithmetic Variable. Variable for determining the

 

 

repetition.

 

 

 

 

 

Initial

Arithmetic Equation. Initially set value for variable

 

Parameter

Value

 

 

 

 

End Value

Arithmetic Equation. Repeats only if the variable value

 

 

is smaller or the same as the end value.

 

 

 

 

 

Increment

Arithmetic Equation. Increment value for the variable

 

 

 

 

 

 

REM -- Moves toward the shift direction gradually slowing down.

 

FOR V1!=300 TO 0 STEP -33.3

example

P1=P1+R1

 

 

 

MOVE L, P1, S=V1!mm/sec,A=3,H=1 UNTIL DI1

 

NEXT

 

 

 

 

 

 

----------------------------------------------------------------------------------------

11 - 19

Page 384
Image 384
Hyundai HI4 operation manual 11.2.4.10 IF∼ELSEIF∼ELSE∼ENDIF Command, 11.2.4.11 FOR∼NEXT Commands