In the past I have thought that it would be great to have a feature in
EMC2 like the C pre-processor, that would do some automatic replacements
to allow the original G-code to be more readable. It seems like two
threads here can collide, and the solution for the thread on
substituting A for E could give us a solution to the named subroutines
problem.
the previous solution used filters in the ini file:
This is my filter section in .ini
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
PROGRAM_EXTENSION = .gcode Extruder gcode
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
gcode = E2A
This is E2A that was run from outside of AXIS before
#!/bin/bash
sed -e 's/\( E\)\([0-9]*\)/ A\2/' $1
Guru comments on this?
Here we just have to adjust our sed line to get editing scripts from a
file like so
sed -f subroutines.sed $1
now we can have scripts to replace text subroutine names with the
numbers EMC2 seems to like so much, IE:
s/rectangular-pocket/500/
s/peck-drill/501/
s/leave-a-tab/502/
Now you can use whatever names look good to you, and before EMC2 sees
the code, it will be changed to a simple number. It will only replace
the first instance of the phrase on each line, so if you put the
subroutine name in a comment at the end of the line, it will survive
sed, but will let you keep track of subroutines in AXIS.
Comments anybody?
On 06/24/2011 06:11 PM, emc-users-requ...@lists.sourceforge.net wrote:
So is it possible to create such a table? I tried to initialise
table
using code above but got an error message Parameter number out of
Range
I suspect the answer is no you can't - see later caveat.
You can of course do this sort of thing, because it is based upon
numbers and that is all a parameter can hold
/o200 sub/
/ (msg, In 200-sub)/
/o200 endsub/
/o201 sub/
/ (msg, In 201-sub)/
/o201 endsub/
/#_index = 0/
/owhile1 sub/
/ o100 while [#_index LT 2]/
/ o[200 + #_index ] call/
/ #_index = [#_index + 1]/
/ o100 endwhile/
/owhile1 endsub/
/owhile1 call/
/M2/
This is E2A that was run from outside of AXIS before
#!/bin/bash
sed -e 's/\( E\)\([0-9]*\)/ A\2/' $1
Guru comments on this?
--
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
___
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users