5
« on: April 27, 2015, 03:19:23 AM »
TP,
The use of subs works, but there are some unusual artifacts that I have had happen.
1. The syntax: M98 (file.txt) is required, not M98 "file.txt"
It is very strange to suddenly have to think of () as something other than comments!
2. I have had 4 times during testing where I would make a valid change and it would not load. It would just stop loading. Sometimes, but not in all cases, it would show a subroutine in the code box instead of the main.
I could not make that file work. However, in all cases, I copied all of the code from the file and pasted it into another file with a different filename and it worked. I do not have a clue...
3. While testing, I detected a logic error in my code and stopped the program. It stopped showing a subroutine. I clicked "Edit G-Code" and Notepad opened with the main code. I made my edits, saved and exited Notepad. The file locked up and would not load. I clicked "Close G-Code" and reloaded it by clicking "Recent File" and opening it. It would not load.
After much searching I found the issue. The code had not been saved into the main programs file. It had overwritten the subroutine file that had been on the screen when I stopped execution of the program. Strange.
4. When executing with subroutines, the asynchronous behavior between executing G-Code and the display in the code window is very disconcerting. The code display may get a few subroutines ahead of what the path is showing on the display.
I've placed a couple dozen subroutines in the directory and have been using it, but it scares me that it sometimes does not run for no apparent reason.
An aside question: Mach4 includes support for Macro G-Codes 65, 66 and 67. Do they also support the subroutine directory? In other words, would "G65 (somefile.txt) A23.3 B14.1" work by calling the file and passing 23.3 and 14.1 to the subroutine as #1 and #2?
Thanks again for the help,
Rick