09-07-2017 07:48 AM
I have written a small program to eliminate whitespace, comments, and empty lines from gcode.
The resulting file will always carry the same name 'reduced.gcode' and resides in the path were the original file is located.
As the program could be executed several times during the time the main vi is active, I wanted to make sure, that old code is not simply overwritten because I fear that if the new gcode was shorter than the old one, parts of the old gcode would still be left in the text file.
To implement this I am deleting the file in the beginning.
But if I execute the vi twice in a row without closing the vi window the new gcode is merely appended to the text file. If I then close the vi and open it again and run the code for the first time a new instance of 'reduced.gcode' is saved containing only the wanted gcode.
I'm assuming I'm not handling a reference correctly.
Solved! Go to Solution.
09-07-2017 08:06 AM
09-07-2017 08:09 AM
You have an uninitialized shift register on your For Loop for the pink string wire.
Uninitialized shift registers maintain their data between calls. Wire an empty string constant to the input shift register and it will clear it on every call.