Kenneth Lerman wrote:

>Stephen Wille Padnos wrote:
>  
>
>>Kenneth Lerman wrote:
>>    
>>
>>>Here is my first guess at how I would do this:
>>>
>>>1 -- First, I would "enhance" emc to support a new M code that took at 
>>>least four arguments and returned at least one variable. Lets say M999 
>>>takes arguments N, X, Y, Z. N would be the name of an external program 
>>>to run (say N=123, then ExtFn123 would be run). The other variables 
>>>would be passed as arguments. Variable #999 (or whatever) would get the 
>>>return value.
>>>    
>>>      
>>>
>>Why not enhance the existing "external M-code" feature so that it can 
>>pass multiple arguments (not just P and Q) to the called program, and 
>>which can get some sort of function return?  The returned value could 
>>even be a string that gets parsed, so the program could return something 
>>like #999=[47.2] #998="-109" ...
>>    
>>
>I hesitate to change the existing feature because I wouldn't want to 
>break existing programs. My understanding is that the values of P and Q 
>are assigned to the first and second arguments of the script. It makes 
>sense to just pass the named arguments to the script in (not necessarily 
>in the order that they occur) including the letter, the '=' and the 
>value (after evaluation of functions).
>  
>
I would leave the P and Q values as arguments, and maybe set environment 
variables for all the parameters (including P and Q - no sense leaving 
them out).

>I think that parsing the returned string value is an excellent idea. 
>That would even let you call a gcode subroutine with supplied values.
>  
>
If we could execute the returned data as g-code (basically by capturing 
whatever is printed to the console or some other file descriptor), that 
would go a long way toward implementing some macro features people have 
asked for.

> [snip]
>
>Thanks for your comments, Steve. Since I don't have a probe, I don't 
>think I'll be implementing this any time soon.
>  
>
 Me either :)

- Steve


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to