- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I tried this over on Fusion Mfg forum but no help. See below please.
ManualNC and PassThru on Generic Haas ST20Y post
ManualNC Multiline passthrough is leaving fragments of the Passthrough G-Code in several places after the initial entry. The onClose section is picking up random lines of the preexisting passthru buffer.
Here is my "test" passthru - Just make believe stuff so I can easily identify it.
(PASS THRU TEST)
M30
M1
P4
Here is the section it puts it in, exactly where I want it.
N1980 G53 Y0.
N1990 G53 X-4.
N2000 G53 Z-15.
N2010 (PASS THRU TEST)
N2020 M30
N2030 M1
N2040 P4
(Cleanup Profile)
N2050 M1
N2060 T202
Now, here are the comments further down:
N2250 M30
N2260 P4
(Test after tool change and then empty bin)
And even further down:
N2440 G53 G0 Y0.
N2450 P4
(End of Program)
N2460 M30
%
Here is the ExecuteNc function.
/** 3/5/2024 RWS added Buffer Manual NC commands for processing later */ var manualNC = []; function onManualNC(command, value) { manualNC.push({command:command, value:value}); } /** Processes the Manual NC commands Pass the desired command to process or leave argument list blank to process all buffered commands */ function executeManualNC(command) { for (var i = 0; i < manualNC.length; ++i) { //for (var i = manualNC.length -1; i >= 0; --i) { // <<< ADD THIS LINE - Didn't work, made all my passthru code backwards if (!command || (command == manualNC[i].command)) { switch(manualNC[i].command) { case COMMAND_DISPLAY_MESSAGE: // sample on explicit execution of Manual NC command writeComment("MSG, " + manualNC[i].value); break; case COMMAND_STOP: writeBlock(mFormat.format(0)); break; case COMMAND_COMMENT: writeComment(manualNC[i].value); break; case COMMAND_PASS_THROUGH: var newLine = ";"; var commands = String(manualNC[i].value).split(newLine); //var commands = String(manualNC[i].value).split(","); for (text in commands) { writeBlock(commands[text]); } break; default: expandManualNC(manualNC[i].command, manualNC[i].value); } } } for (var i = 0; i < manualNC.length; ++i) { if (!command || (command == manualNC[i].command)) { manualNC.splice(i, 1); } } }
Solved! Go to Solution.