Working with the current DN/Doosan Fanuc MillTurn post.
Long story short, I am trying to replace an entire section of the output code with some custom code. I have the custom code figured out. I am running into issues with tail ends of code from onSection() and onSectionEnd() still being output.
For example, lets say I want to output something like this and have my custom code overwrite a parting operation:
N1(Turn)
XZblahblah
M5
M9
G0 G28 U0V0W0
M1
Custom Code Here
N3(Turn)
...
But I keep Ending Up with
N1(Turn)
XZblahblah
M5
M9
G0 G28 U0V0W0
M1
M5 <<<"duplicate" (from "end" of skipped section / start of onSection or from onSectionEnd)
M9
G0 G28 U0V0W0
M1
Custom Code Here
N3(Turn)
...
I have tried strategies like: if(getParameter("operation-strategy") == "turningPart") { skipRemainingSection();}
and also trying to get rid of code after the fact such as: if(!isFirstSection() && getPreviousSection().getParameter("operation-strategy) == "turningPart" )
but nothing has quite worked so far.
Edit to add: I did notice that the note for skipRemainingSection() doesnt work on onSectionEnd(), so I tried getting around that section with if statements. Still not quite working for me.
I realize I am asking this in vague terms, but I am looking for suggestions on strategies to accomplish this, not necessarily someone to write the exact code for me.
Thanks
I have attached a test file and a modified post. In the test file, I have two action commands, one to turn off all modifications, the other one to toggle where I am currently getting stuck. Edits are marked with //m4.
Also included some code screenshots, as the max attachment limit is 3. When I try to remove the end lines of code, the start lines from (FACESUB) are also removed, as well as G350 (CONFIRM CUTOFF) pops up. (Maybe it still thinks machineState.stockTransferIsActive = true. )
"OFF"
X0.0819 Z0.0566
G0 X2.7
Z0.1969
G97 S2122 M3 P11
M9
G28 U0. V0.
G28 W0.
M110
M1
(Skip onSectionEnd for turningPart)
(Part Handling Skipped Here)
(Skip onSectionEnd for turningSecondarySpindleGrab)
(Part Handling Skipped Here)
(Skip onSectionEnd for turningSecondarySpindleReturn)
G0 G28 U0. V0. (*** WANT TO GET RID OF THESE LINES)
G28 W0.
M110
M1
N2(FACESUB)
G0 G28 G53 B0. (SUB SPINDLE RETURN)
G28 U0. V0.
G28 W0.
M5 P11
M190
G55
G99 G18 M134
G50 S5000
T1444
M8
G97 S2122 M3 P13
G0 Z-0.1969
X2.7 Y0.
G96 S1500 M3 P13
Z-0.0566
X1.9
G1 X1.6131 F0.012
X1.5 Z0.
X-0.0312
X0.0819 Z-0.0566
G0 X2.7
Z-0.1969
G97 S2122 M3 P13
M5 P13
M9
"ON"
X0.0819 Z0.0566
G0 X2.7
Z0.1969
G97 S2122 M3 P11
M9
G28 U0. V0.
G28 W0.
M110
M1
(Skip onSectionEnd for turningPart)
(Part Handling Skipped Here)
(Skip onSectionEnd for turningSecondarySpindleGrab)
(Part Handling Skipped Here)
(Skip onSectionEnd for turningSecondarySpindleReturn)
(Skipping onSection Top Half for turningFace)
(FACESUB)
M190 (*** ISSUE HERE)
G55
M134
M8
G97 S2122 M3 P13
G0 Z-0.1969
X2.7 Y0.
G96 S1500 M3 P13
Z-0.0566
X1.9
G1 X1.6131 F0.012
X1.5 Z0.
X-0.0312
X0.0819 Z-0.0566
G0 X2.7
Z-0.1969
G97 S2122 M3 P13
G350 (CONFIRM CUTOFF) (***ISSUE HERE)
G4 U0.5
M5 P0
M9
I think I found the main source of my issues. Gonna work through the edge cases tomorrow.
Can't find what you're looking for? Ask the community or share your knowledge.