Hello guys, it's my first post around here. I have some questions concerning the M6 macro and i'll be pointing them below:
1) When the M6 macro finishes, let's say my custom M6 finishes in a safe Z position, it will automatically return to the original position it left on my part to make the change ?
And this command here plays what part in the code to return to the original position?
x = GetToolChangeStart(0) 'X igual a 0
y = GetToolChangeStart(1) 'Y igual a 0
z = GetToolChangeStart(2) 'Z igual a 0
a = GetToolChangeStart(3) 'A igual a 0
2) When the M6 is called, the cycle that i am running stops ? If it does, i need to write something to call for a cycle start in the end of the M6 custom macro or it will automatically resume the part ?
3) In my custom M6 i am using an OUTPUT of my BREAKOUT BOARD to let the program know if there is a tool loaded already in the SPINDLE, but i see some flaws that i would like to point:
- To activate the OUTPUT, the function that loads the tool in M6 macro needs to be run a first time
DOWNSIDE: If there is already a tool in the spindle, it will end crashing. Likewise, if i accidentally turn off the machine, i will need to remove the tool..
Why the machine needs to load the first tool? Because i have a mechanical unloader/loader, so some positions/tightening torque needs to be in "phase", so the arm will take care of both unload and load.
So i am wondering, is there a way to mark deep down in mach memory, in a variable or anything else that a tool has already been loaded?
To that solution there is already a flaw, if with the machine off i remove the tool from the spindle, it will think there is a tool there, BUT it will try to unload a non existing tool so it won't crash (SAFER)
So there is a way ?
4) Let's say i have the following structure:
Sub Main()
Dim NewTool As Integer
Dim OldTool As Integer
OldTool = GetOEMDRO(1200)
NewTool = GetSelectedTool()
If NewTool = OldTool Then
Exit Sub
End If
If IsActive(OUTPUT1) Then
Call Unload_Tool
Else
Call Load_Tool
End If
End Sub
Function Unload_Tool()
End Function
Function Load_Tool()
End Function
I presume it will work like this:
- It will check first if the tool CALLED is equal to the tool IN USE.
- If it is, then it will exit the M6 macro.
Or it will work like this:
- It will check first if the tool CALLED is equal to the tool IN USE.
- If it is, it will exit the MAIN SUB and push forward the macro calling one function after the other.
Which one ?