Thanks a lot for you reply, you enlightened me.
So, if I understand correctly, changing the PWM output using an S code or even the state of an output using M11/M10 will break the continuous velocity mode and will force to wait between each movements?
I understand that this is required because, else, some S or M calls could be executed while the machine is not at the right position due to the look ahead.
Then, would it be possible to spawn a new independent process that would look at the current position of the machine and send commands to activate or deactivate and output in function of the position. We could pre-calculate all the positions at which an output needs to be enable or disabled and then this independant process would take care of doing it. Do you think we could do using the embedded LUA interpreter? Would something very similar to an infinite loop create problems with the G-Code interpretation? I think that the embedded LUA instance does not support multi-threading and thus, every other LUA part (the UI for example) would be jammed until our LUA loop finishes.
I know the concept is feasible in theory since other laser control programs are able to do it.
Thanks a lot for your time,
Phil