Okay great, I'll check that out right now and yes M91 and M92 are the pallet change codes
Look in parameters 6071 to 6079 for the numbers 91 and 92. Program number O9001 is a program number associated with an "M" code to call the program as a Subprogram and not as a Macro program. Parameters 6071 to 6079 are the parameters associated with Program Numbers O9001 to O9009 respectively. You should have another Subprogram that is called by M92. If you don't already know the Program Number of this program, you will be able to determine it by observing the values registered in parameters 6071 to 6079.
To check whats happening in your O9001 Subprogram do as follows:
1. Set bit 4 of parameter 3202 to "0". This will ensure that program O9001 is visible to you in operation.
2. Setting the above bit will also allow you to edit the program.
3. Set bit 5 of parameter 6000 to "1". This will allow the Subprogram to be executed in Single Block Mode, and the program halt after Macro Statement blocks, otherwise the following blocks will be read with one press of the Cycle Start Button without 6000.5 being set.
#131=4003;
IF[#1012 EQ1] GOTO102;
IF[#1013 EQ1] GOTO103;
GOTO 101;
4. Edit Subprogram O9001 as follows:
O9001;(M91 pallet change)
N101;
#131=4003;
#1=#1012
M00 (Check value of #1 in Macro Variable Pages)
IF[#1012 EQ1] GOTO102;
#1=#1013
M00 (Check value of #1 in Macro Variable Pages)
IF[#1013 EQ1] GOTO103;
GOTO 101;
N102;
G91 G28 Z0 M05;
G30 X0 Y0;
M91;
N103;
G#131;
M99;
Making the above checks will allow you to know where in the program Control is going to Jump.
GOTO101 is just forcing the program to idle until either #1012 or #1013 change to logic "1". If #1013 is logic "1", the program will fall though to N103 and bypass a Pallet Change. It could very well be that the Pallet being called by M91(Pallet 1) is already in position, and therefore, no Pallet change is made. Have you tried executing M92?
For the above program to execute a Pallet change, the logic state of I/O Interface Variables #1012 and #1013 would have to be "1" and "0" respectively. If you look in the Subprogram called with M92, you will find that the logic of these two Variable will be reversed to have a Pallet change occur.
When a Subprogram is called by an "M" Code (M91), the occurrence of an "M" Code in the called program will be treated as a normal "M" Code, and another iteration of the Subprogram doesn't result. In most cases with Pallet change programs, the requirement to press, or the fact that Pallet Ready Button has already been pressed, is dealt with in the PLC, and NOT at NC program level. Accordingly, I doubt that #1012 and #1013 have anything to do with the Pallet Ready button, but more to determine if the requested pallet is in place, or not.
Doing the above tests will give you a good idea of whats going on, and why the Pallet is not changing.
Once finished testing, make sure you change programs and parameters back to pretest states.
Regards,
Bill