Reference – Lenze PM94P01C User Manual
Page 101
PM94P01C
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
Syntax
RESUME
See Also
ON FAULT
Example:
…{statements}
FaultRecovery:
…{statements}
END
ON FAULT
;Once fault occurs program is directed here
…{statements}
;Any 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 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
GOTO, GOSUB
Example:
…{statements}…
GOSUB MySub
;Program jumps to Subroutine “MySub”
MOVED 10
;Move to be executed once the Subroutine has executed
;the RETURN statement.
…{statements}
END
;main program end
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).