Reference – Lenze E94P PositionServo with MVOB User Manual

Page 101

Advertising
background image

PM94H201B_13xxxxxx_EN

L

99

Reference

Table 55: RESUME

RESUME

Resume

Statement

Purpose

This statement redirects the code execution form the Fault Handler routine back to in the User
Program. The specific line in the User Program to be directed to is called out in the argument <label>
of the “RESUME” statement. This statement is only allowed in the fault handler routine.

Syntax

RESUME <label>
<label>

Label in User Program to recommence program execution

See Also

ON FAULT

Example:

;Main Program Section
…{statements}
FaultRecovery:
…{statements}
END

;Fault Handler Section

ON FAULT

;Once fault occurs program is directed here

…{statements}

;code to deal with fault

RESUME FaultRecovery ;Execution of RESUME ends Fault Handler and directs

;execution back the “FaultRecovery” label in the User

;Program.

ENDFAULT

;If RESUME is omitted the program will terminate here.

;Fault routine must end with a ENDFAULT statement

Table 56: RETURN

RETURN

Return from subroutine

Statement

Purpose

This statement will return the code execution back from a subroutine to the point in the main program
from where the subroutine was called. If this statement is executed without a previous call to
subroutine, (GOSUB), fault #21 “Subroutine stack underflow” will result.

Syntax

RETURN

See Also

GOSUB

Example:

;Main Program Section
…{statements}…
GOSUB MySub

;Program jumps to Subroutine “MySub”

MOVED 10

;Move to be performed once the Subroutine has executed

…{statements}
END

;main program end

;Subroutine Section

MySub:

;Subroutine called out from User Program

…{statements}

;Code to be executed in subroutine

RETURN

;Returns execution to the line of code under the “GOSUB”

;command, (MOVED 10 statement).

Advertising