Introduction – Lenze PM94P01C User Manual

Page 35

Advertising
background image

PM94P01C

33

Introduction

Events - Define Event name, Trigger and Program Statements

;***************************** Events **************************************
EVENT SPRAY_GUNS_ON APOS > V1 ;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 > V2 ;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 that the ENABLE input is made before continuing

ENABLE

;Enable output from drive to motor

PROGRAM_START:

;Place holder for main program loop

EVENT

SPRAY_GUNS_ON ON ;Enable the ‘spray guns on’ event

EVENT

SPRAY_GUNS_OFF ON ;Enable the ‘spray guns off’ event

WAIT UNTIL IN_A4==1

;Make sure Arm is retracted before starting the program

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

;Loop back and continuously execute main program loop

END

Sub-Routine - Any and 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