Here's what we use; (below)
The main pallet change program references a system variable (#1032) and rewrites its bit value to decimal, and writes that to a common variable (#547)
Now, the trick is to ensure that your ladder is using one of the "User I/O Interface" bits when it looks at the pallets.
In our case, the ladder writes to a register R2801.4 ("UI012") "A pallet" and R2801.5 ("UI013") "B pallet".
In the pallet change program, these bits are referenced using system variable (word) #1032.
If you look at the program, if the system variable (#1032) is equivilant to 2048 (12th bit ON) then write #547=1
If it equals 4096 (13th bit ON) then #547=2.
 The main pallet change program references a system variable (#1032) and rewrites its bit value to decimal, and writes that to a common variable (#547)
Now, the trick is to ensure that your ladder is using one of the "User I/O Interface" bits when it looks at the pallets.
In our case, the ladder writes to a register R2801.4 ("UI012") "A pallet" and R2801.5 ("UI013") "B pallet".
In the pallet change program, these bits are referenced using system variable (word) #1032.
If you look at the program, if the system variable (#1032) is equivilant to 2048 (12th bit ON) then write #547=1
If it equals 4096 (13th bit ON) then #547=2.
*******************
 %
 O9001(PALLET SHUTTLE)
 G0G80G94G98M15
 G91
 G28Z0
 G30X0Y0P4
 G28B0
 G30Z0P4
 M60
 M181
 #547=#1032
 M182
 (CHECK #547 IS 1 OR 2)
 IF[#547EQ2048.]#547=1
 IF[#547EQ4096.]#547=2
 (CHECK #1 OR #2)
 IF[#547EQ1]GOTO777
 IF[#547EQ2]GOTO777
 #3000=182(PALLET # ERROR)
 N777
 G0G90D0H0
 SETVN547(PALLET #)
 M99
 %
******************
 O0001(MAIN PALLET PROGRAM)
 N1
 IF[#547EQ2]GOTO2
 M192(PALLET 1 CHECK)
 M98P0100 (FIRST PALLET PROGRAM CALL)
 M60
N2
 M193(PALLET 2 CHECK)
 M98P9999 (SECOND PALLET PROGRAM CALL)
 M60
 M99
 %
 O9999(DUMMY PROGRAM)
 G4X20.
 M99
 %
 
 
 
 
0 comments:
Post a Comment