alan wrote:
> Hello everyone,
>
> I asked the two questions written below on the forum at linuxcnc.org and
> was advised that this group would be more likely to give me an answer.
>
> I understand that the user defined commands M100 etc allow me to run an
> external program but would it be possible to set up a command that would
> send its parameters down a named pipe or down a socket? The reason I ask
> this is that I want to use height values from a large 2D array
> representing a profile (say 360 degrees range at 0.1 degree intervals or
> less), or from an even larger 3D array representing a surface. It would
> be sensible to write a server that only loaded its surface data once and
> then responded to height requests. I know that I could write a bash
> script to pass its parameters onto the server and returning the result
> but I wondered if this intermediary step could be eliminated and would
> there be any benefit? Also just out of interest how could I pass a third
> value in an M100 command as only two parameters P and Q are mentioned in
> the documentation?
>    
You would have to modify the G-code interpreter to add parameters to the 
M1xx calls, which would not be trivial.

Note also that the M1xx programs do not return any values to the 
interpreter.  If your intent is to load a value into a #parameter, that 
isn't possible with the existing mechanism.  M1xx programs also can't 
modify the running G-code - ie, you can't use an external program to 
feed code to the interpreter.
> Secondly, I have written a couple of g code subroutines that use the
> variables #1000 onwards as profile data prior to writing the server
> mentioned above. (ultimately still not enough space). Originally I had
> each sub in its own file but noticed as the program ran the window
> heading in axis keeps changing to reflect the sub thats running so I
> assumed that emc was loading the sub each time I called it in my
> program. Is this correct or does emc load them 1 off into a cache?  If
> subs are loaded each time they are called is there some equivalent to
> #include that I could use which would cause them to be loaded only once?
>    I would ultimately like to use library code in several gcode programs
> without the necessity of copying them textually each time is this
> possible? (Sorry if its a simple question and the answer is in the
> documentation and if it is my apologies I just havent found it yet)
>    
EMC doesn't do any caching on its own, but Linux is very good at that.  
Opening and closing files are lightweight tasks on Linux, and the Linux 
disk cache works very well.  Once the file has been read off the disk 
the first time, it's very likely that it will be read from memory after 
that.

- Steve


------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to