-
Custom Macro Programming
I am stuck. I'm working with a new horizontal with a 31i control. I am writing a program and need to look at the tool in the waiting station. I'm wondering if anyone knows if there is a # variable related to the next tool. I know #4120 is the last T code specified, but that is not necessarily the tool in the set up station. Any help would be greatly appreciated!
-
This a lot of times is determined by the MTB. I would check the documentation from them to see if they built a system variable for the tool that is currently in the wait arm. If no documentation shows this there is a few ways you can approach this.
I usually write the current tool and the tool at wait into the common variables. If you do a tool call and the machine does not put the tool back in the magazine once it finishes changing tools you could program the variables to keep track of this with a few lines in your tool change macro. If your machine does not use a tool change macro and runs from ladder you can set one up so it calls with the M6 code.
Set variable #519 equal to the tool in the spindle and #520 to the tool in the wait arm. You can use any parameters that you want but make sure you use above #500 so they don’t clear at power down.
M6T6
O9020(tool change macro)
#20=#4120
…
…
M6
#520=#519
#519=#20
M99
There is a chance that the MTB set up a system variable that is the tool in the wait arm. I like to run this short program to see what all the system variables are used for if I don’t have a list. I have had machines with the current tool being used with your input output variables. Your input signals are parameters 1000-1035 and your output signals are 1100-1135 (thats what they are on my controls, not sure about the 31i). Put a tool in the wait arm then run this program. See if any of the variables matches the tool in the wait arm. If so then put a different tool in the wait arm and run the same program. If the variables match then you can be sure that the system variable is for the wait tool.
O0004
#1=0
#2=0
WHILE[#1LT35]DO1
#[100+#2]=#[1000+#2]--(#100-#135 will be equal to #1000-#1035 in seq. )order
#[136+#2]=#[1100+#2]--(#136-#171 will be equal to #1100-#1135 in seq. )order
#1=#1+1
#2=#2+1
END1
M30
Stevo