Personally our 2 pallet setup is a standard main program that does the pallet checks and calls the "normal" part programs needed on that pallet.
very simple sudo code outline to show the idea:
Code:
O0001 (main program)
#101 = 1234 (first program on pallet 1)
#102 = 0 (second program on pallet 1)
#103 = 0 (third program on pallet 1)
#201 = 3422 (first program on pallet 2)
#202 = 2515 (second program on pallet 2)
#203 = 0 (third program on pallet 2)
if [#501=2] goto 200 (manually set 501 to start on pallet 2)
(Pallet 1 check)
(skip any that are =0)
call #101
call #102
call #103
(Pallet change to 2)
M90
N200
(Pallet 2 check)
(skip any that are =0)
call #201
call #202
call #203
(Pallet change to 1)
M90
M99