On 02/01/2012 10:01 AM, BRIAN GLACKIN wrote:
> Hi all.
>
> I tried to ask this question on IRC last eve and had trouble staying in
> channel.
>
> equipment - 25" X 49" X 4" gantry router  for wookwork - all cutting is 2.5D
>
> I have a subroutine o100 that at present, I pass three values too
> Value 1 is the total depth of cut
> Value 2 is the incremental depth of cut
> Value 3 is the feed rate
>
> My past practice has been to cut and paste the gcode of a part into this
> subroutine.  This has been fine for multiples of a single part.  I recently
> started calling a gcode file directly from inside the subroutine which
> worked fine.
>
> What I would like avoid constantly cutting and pasting code (or
> filenames) into my "parts program" subroutine. I thought I could send via
> the subroutine a fourth value with the file name.  The thought being that I
> can have a series of calls for different parts that I can cut out from the
> same sheet without having to mash up a massive gcode file.
>
> So I modified the O100 to add that fourth value.
>
> In the subroutine, I tried calling the file with O<#4>  call.
>
> ON loading the code into Linuxcnc, I get the error "Near Line XXX urnary
> operation expected ....."  Or something to that effect.  I typed the exact
> error in IRC channel last eve if anyone saw that.
>
>
> Can I pass a filename through a subroutine call??
>
> I did try renaming the file to a numer (10000.ngc)  and tried passing both
> 10000 and 10000.ngc.

I believe the answer is yes (I've done it in the past).

You can pass a numeric argument. Then:
O#4 call ...
Will call O100 if argument 4 is 100. When this is called, I believe the 
interpreter will look for O100 in the usual way. That includes looking 
for o100 in a file named o100.ngc (I think). I believe that the o in 
o100 must be lower case because the interpret converts everything to 
lowercase as the first step in the parsing. At any rate, the O#4 should 
be treated EXACTLY as if the code was written as O100 call if #4 has the 
value 100.

BTW: That's another place where it would be nice to have variables with 
string values.

Ken
>
> Brian
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> Emc-users mailing list
> Emc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/emc-users

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to