Programming – Lenze E94P PositionServo with MVOB User Manual

Page 35

Advertising
background image

PM94H201B_13xxxxxx_EN

L

33

Programming

Events - Define Event name, Trigger and Program Statements

;***************************** Events **************************************

EVENT SPRAY_GUNS_ON APOS > 25 ;Event will trigger as position passes 25 in pos dir.

OUT3= Output_On

;Turn on the spray guns (out 3 on)

ENDEVENT

;End event

EVENT SPRAY_GUNS_OFF APOS > 75 ;Event will trigger as position passes 75 in pos dir.

OUT3= Output_Off

;Turn off the spray guns (out 3 off)

ENDEVENT

;End even

Main Program - Define the motion and I/O handling of the machine

;***************************** Main Program ********************************

RESET_DRIVE:

;Place holder for Fault Handler Routine

WAIT UNTIL IN_A3

;Make sure the ENABLE input is made before continuing

ENABLE

OUT1 = 0

;Initialize Pick Arm - Place in Retracted Position

WAIT UNTIL IN_A4==1

;Check Pick Arm is in Retracted Position

EVENT

SPRAY_GUNS_ON ON ;Enable the Event

EVENT

SPRAY_GUNS_OFF ON ;Enable the Event

PROGRAM_START:

MOVEP 0

;Move to position 0 to pick part

OUT1 = Output_On

;Turn on output 1 to extend Pick arm

WAIT UNTIL IN_A1==1

;Check input to make sure Arm is extended

OUT2 = Output_On

;Turn on output 2 to Engage gripper

WAIT TIME 1000

;Delay 1 sec to Pick part

OUT1 = Output_Off

;Turn off output 1 to Retract Pick arm

WAIT UNTIL IN_A4==1

;Check input to make sure Arm is retracted

MOVED 100

;Move to Place position

OUT1 = Output_On

;Turn on output 1 to extend Pick arm

WAIT UNTIL IN_A1==1

;Check input to make sure Arm is extended

OUT2 = Output_Off

;Turn off output 2 to Disengage gripper

WAIT TIME 1000

;Delay 1 sec to Place part

OUT1 = Output_Off

;Retract Pick arm

WAIT UNTIL IN_A4==1

;Check input to make sure Arm is retracted

GOTO PROGRAM_START

END

Sub-Routine - All Sub-Routine code should reside here

;************************* Sub-Routines ***********************************

;

Enter Sub-Routine code here

Fault Handler - Define what the program should do when a fault is detected

;************************* Fault Handler Routine **************************

;

Enter Fault Handler code here

ON FAULT

ENDFAULT

The

header section of the program contains description information, program name, version number, description of

process and programmers name. The

I/O List section of the program contains a listing of all the I/O used within the

application. The

Initialize and Set Variables section of the program defines the names for the user variables and

constants used in the program and provides initial setting of these and other variables.

Advertising