Reference – Lenze PM94P01C User Manual

Page 91

Advertising
background image

PM94P01C

89

Reference

Table 34: EVENTS ON/OFF

EVENTS OFF/ON Globally Disables/enables events

Statement

Purpose

EVENTS OFF command when executed will disable any events currently enabled (running). EVENTS
ON Command re-enables any events previously disabled through the events off command. EVENTS
ON is not a global enable of all declared events. Events status is indicated through bit #30 of the
DSTATUS register or by system flag ‘F_EVENTSOFF’. EVENTS OFF/ON allows for easy disable and
re-activation of events in sections of the main program or subroutines that the programmer doesn’t
want interrupted by event code.

Syntax

EVENTS OFF

Disables execution of all events

EVENTS ON

Restores execution of previously enabled events.

Remarks

Events are globally disabled after a reset is made. Events are re-enable by executing the individual
EVENT <name> ON statement.

See Also

EVENT

Example:
********************************************************************************

EVENT SKIPOUT IN_B4 RISE

;check for rising edge of input B4

JUMP TOGGLE

;redirect code execution to TOGGLE

ENDEVENT

;end the event

EVENT OVERSHOOT IN_B3 RISE

;check for rising edge of input B3

JUMP SHUTDOWN

;redirect code execution to SHUTDOWN

ENDEVENT

;end the event

********************************************************************************

EVENT SKIPOUT ON

EVENT OVERSHOOOT ON

********************************************************************************

……….…User code……………..

EVENTS OFF

;turns off all events

……….…User code……………..

EVENTS ON

;turns on any event previously activated

Table 35: FAULT

FAULT

User generated fault

Statement

Purpose

Allows the user program to set a custom system fault. This is useful when the programmer needs to
define a fault code and fault process for custom conditions like data supplied by interface out of range
etc. Custom fault numbers must be in region of 128 to 240 (decimal)

Syntax

FAULT FaultNumber

Sets system fault.
Faultnumber - constant in range 128-240
Variables are not allowed in this statement.

Remarks

Custom fault will be processed as any regular fault. There will be a record in the fault log.

See Also

ON FAULT

Example:

FAULT 200

;Sets fault #200

V0=200
FAULT V0

;Not valid. Variables are not allowed here

Advertising