7 events, Introduction – Lenze PM94P01C User Manual

Page 24

Advertising
background image

PM94P01C

22

Introduction

Figure 7: Digital IO Folder

1.7

Events

A Scanned Event is a small program that runs independently of the main program. An event statement establishes a
condition that is scanned on a regular basis. Once established, the scanned event can be enabled and disabled in the
main program. If condition becomes true and EVENT is enabled, the code placed between EVENT and ENDEVENT
executes. Scanned events are used to trigger the actions independently of the main program.
In the following example the Event “

SPRAY_GUNS_ON” will be setup to turn Output 3 on when the drive’s position

becomes greater than 25. Note: the event will be triggered only at the instant when the drive position becomes greater
than 25. It will not continue to execute while the position is greater than 25. (i.e. the event is triggered by the transition
in logic from false to true). Note also that main program doesn’t need to be interrupted to perform this action.
;*********************** EVENT SETUP ***************************************
EVENT SPRAY_GUNS_ON APOS>25 ;Event will trigger as position passes 25 in pos dir.
OUT3=1

;Turn on the spray guns (out 3 on)

ENDEVENT

;End event

;***************************************************************************
Enter the Event code in the EVENT SETUP section of the program. To Setup an Event, the

“EVENT” command must

be entered. This is followed by the Event Name

“SPRAY_GUNS_ON” and the triggering mechanism, “APOS>25”.

After that a sequence of programming statements can be entered once the event is triggered. In our case, we will turn
on output 3. To end the Event, the

“ENDEVENT” command must be used. Events can be activated (turned on) and

deactivated (turned off) throughout the program. To turn on an Event, the “

EVENT” command is entered, followed by the

Event Name “

SPRAY_GUNS_ON”. This is completed by the desired state of the Event, “ON” or “OFF”. Refer to Section

2.10 for more on Scanned Events.
;***************************************************************************
EVENT SPRAY_GUNS_ON ON

;Enable ‘spray guns on’ event

;***************************************************************************
Two Scanned Events have been added to the Pick and Place program below to trigger a spray gun on and off. The
Event will be triggered after the part has been picked up and is passing in front of the spray guns (position greater than
25). Once the part is in position, output 3 is turned on to activate the spray guns. When the part has passed by the spray
guns, (position greater than 75), output 3 is turned off, deactivating the spray guns.

Advertising