Am 08.08.2012 um 01:13 schrieb Kenneth Lerman:
>> 
> Think of the following as a stream of thought. (That means that the 
> mouth is going without much thought.)
> 
> I think I would add a new optional feature to the language. The first 
> character of a line would tell which machines the line related to. So, 
> if it was a 1, machine 1 would execute it. If it was a 2, machine 2 
> would execute it. If it is a zero, all machines execute it.
> 
> The I would add an Mcode that provided synchronization. It would have an 
> argument telling which machines to sync with. The machine (or all 
> machines if machine 0 is specified) for which this line was executed 
> would wait for all of the machines listed in the argument to reach the 
> line. It would then continue.
> 
> Generating this code might require a special processor to interleave the 
> components. (Actually, since the interpreter doesn't take any time, all 
> of the commands for a hunk of work for a particular machine could be 
> consecutive.)

Let me give a quick rundown what is already possible now (master). I assuming 
few have the patience of reading and understanding all of the commits I slid in 
when merging the remap work, and I understand them:

- you can define arbitrary M/G-codes with arbitrary numeric parameters.
- normally, these would cause interpretation-time execution of a oword or 
Python 'remap' subroutine.
- however, a remap Python method might choose to freeze a method name and set 
of arbitrary parameters, and pass it downstream pickled in a EMC_PLUGIN_CALL 
message.
- (I took the liberty to - optionally - take out iocontrol and assorted 
messaging, and replace it and much of the task backend by an embedded Python 
class)
- the latter Python class eventually gets handed the frozen method+parameters 
and executes it - at 'motion time' synched with the rest of them
- this method could well be an arbitrary messaging or synchronization primitive.
- by making the interpretation-time remap subroutine a queuebuster, one can 
even evaluate results and change control flow depending on it.

iow: at interpretation time you bind name and parameters, pass it down the 
queue, and execute it at motion time; optionally evaluate results. Look Ma, no 
source changes!

I admit it is a bit esoteric and undocumented, and more an experiment than a 
feature, but it works. And if Viesturs is *really* hard pressed..

-m

ps: for the mindlessly determined here's the config example ;)  

master, configs/sim/remap/iocontrol-removed
example for a queued Python call which could be triggered from a remapped M/G 
code:
http://git.linuxcnc.org/gitweb?p=linuxcnc.git;a=blob;f=configs/sim/remap/iocontrol-removed/python/oword.py;h=87a61eb0e8d7e264dd6f7e6551d537b9ac94d43a;hb=825b7d394928f0fda1bcfb188952410e7a786578#l74





------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Emc-developers mailing list
Emc-developers@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-developers

Reply via email to