Introduction – Lenze PM94P01C User Manual
Page 22
PM94P01C
20
Introduction
Table 6: Bin Location, Inputs & Index Values
Bin Location
Input State
INDEX Value
Bin 1
Input B1 is made
1
Bin 2
Input B2 is made
2
Bin 3
Inputs B1 and B2 are made
3
Bin 4
Input B3 is made
4
Bin 5
Inputs B1 and B3 are made
5
Bin 6
Inputs B2 and B3 are made
6
Bin 7
Inputs B1, B2 and B3 are made
7
The Main program has been modified to change the end place position based on the value of the “
INDEX” variable.
;************************** Main Program **********************************
ENABLE
PROGRAM_START:
WAIT UNTIL IN_A4==1
;Make sure Arm is retracted
MOVEP 0
;Move to (ABS) to Pick position
OUT1 = 1
;Turn on output 1 to extend Pick arm
WAIT UNTIL IN_A1==1
;Arm extends
OUT2 = 1
;Turn on output 2 to Engage gripper
WAIT TIME 1000
;Delay 1 sec to Pick part
OUT1 = 0
;Turn off output 1 to Retract Pick arm
WAIT UNTIL IN_A4==0
;Make sure Arm is retracted
IF INDEX==1
;In this area we use the If statement to
GOTO BIN_1
;check and see what state inputs B1, B2 & B3
ENDIF
;are in.
IF INDEX==2
;
INDEX = 1 when input B1 is made
GOTO BIN_2
;
INDEX = 2 when input B2 is made
ENDIF
;
INDEX = 3 when input B1 & B2 are made.
.
;
INDEX = 4 when input B3 is made
.
;
INDEX = 5 when input B1 & B3 are made.
.
;
INDEX = 6 when input B2 & B3 are made.
IF INDEX==7
;
INDEX = 7 when input B1, B2 & B3 are made
GOTO BIN_7
;We can now direct the program to one of seven
ENDIF
;locations based on three inputs.
BIN_1:
;Set up for Bin 1
MOVEP 10
;Move to Bin 1 location
GOTO PLACE_PART
;Jump to place part routine
BIN_2:
;Set up for Bin 2
MOVEP 20
;Move to Bin 2 location
GOTO PLACE_PART
;Jump to place part routine
BIN_7:
;Set up for Bin 7
MOVEP 70
;Move to Bin 7 location
GOTO PLACE_PART
;Jump to place part routine
PLACE_PART:
OUT1 = 1
;Turn on output 1 to extend Pick arm
WAIT UNTIL IN_A4 == 1
;Arm extends
OUT2 = 0
;Turn off output 2 to Disengage gripper
WAIT TIME 1000
;Delay 1 sec to Place part
OUT1 = 0
;Retract Pick arm
WAIT UNTIL IN_A4 == 0
;Arm is retracted
GOTO PROGRAM_START
END