I have a 'master' program that begins with a macro 'subprogram' that does a bunch of probing to test for parts and set offsets based on user inputs A, B and C. There are also some 'subroutines' (What I'm calling a program that is inside the master program, as opposed to a subprogram which would be saved independently on the controller)
Based on the macro results there is some logic to decide which of the subroutines I need to run; for example I may only have 1 part loaded and it needs the CW slots, or I may have 2 parts and the first needs CCW and the second needs CW...
Is there a way to call up those subroutines (located in the master) from my macro subprogram (independent from the master)?
What I can do right now is save some variables from my O5678 macro and use those to do logic inside my O1234 master, but I like the idea of making updates to the O5678 macro program and it automatically applies to all the different masters. We may have 20 different part #s running in a day (each with its own master and subroutines), which means I may have to make the same edit 20 different times... If I can call the subroutine from inside the macro then I only change it once and all 20 run the updated cycle.
Hope that makes sense, its got my head spinning this afternoon!
Example code "layout" shown here:
O1234 (MASTER PROGRAM)
G65 P5678 A1 B2 C3 (PROBING MACRO)
...
M97 P501
...
M97P502
...
M30
N501 (CLOCKWISE SLOTS)
...
M99
N501 (COUNTERCLOCKWISE SLOTS)
...
M99
O5678 (PROBING MACRO)
...
(PROBING)
...
(LOGIC)
...
I want to run P501 (CW SLOTS) from O1234 here
...
M30
Based on the macro results there is some logic to decide which of the subroutines I need to run; for example I may only have 1 part loaded and it needs the CW slots, or I may have 2 parts and the first needs CCW and the second needs CW...
Is there a way to call up those subroutines (located in the master) from my macro subprogram (independent from the master)?
What I can do right now is save some variables from my O5678 macro and use those to do logic inside my O1234 master, but I like the idea of making updates to the O5678 macro program and it automatically applies to all the different masters. We may have 20 different part #s running in a day (each with its own master and subroutines), which means I may have to make the same edit 20 different times... If I can call the subroutine from inside the macro then I only change it once and all 20 run the updated cycle.
Hope that makes sense, its got my head spinning this afternoon!
Example code "layout" shown here:
O1234 (MASTER PROGRAM)
G65 P5678 A1 B2 C3 (PROBING MACRO)
...
M97 P501
...
M97P502
...
M30
N501 (CLOCKWISE SLOTS)
...
M99
N501 (COUNTERCLOCKWISE SLOTS)
...
M99
O5678 (PROBING MACRO)
...
(PROBING)
...
(LOGIC)
...
I want to run P501 (CW SLOTS) from O1234 here
...
M30