KFlopWebNC M commands and 8 axis control
Hey Tom,
I have just been experiencing a problem in KFlopWebNC. The M-commands 3 through 9 work correctly but 100 through 119 do not seem to be detected (or executed) while running a G Code. Any ideas?
I was also wondering how I could map G-Code commands to multiple axis. For this application I am using all 8 kmotion channels but two of these channels (6 and 7) are mirrors of other channels (4 and 5). This would be easy enough by itself but I also need to be able to stop and start these axis individually (assuming channels 4 and 6 are both the B axis I want to be able to turn off 6 whilst leaving 4 on and vice versa). I have tried disabling and re-enabling the channels but this causes an immediate abort of the G Code while using Kmotion.
Thanks for all the help so far, I think I'm close to finishing my app!
Mike
Re: KFlopWebNC M commands and 8 axis control
Just a quick update.
Through debugging the M command functionality I have found that I am successfully calling the function
_Controller.CoordMotion.Interpreter.SetMcodeAction (
command.Index, command.Type, p0, p1, p2, p3, p4, sdata);
which sets all of the M commands, M3-M9 which function correctly are set, as well as M100-M119, which do not work during running of the G Code.
I'm assuming that in order to call the M command with the name M100, which is the name recorded in the InterpreterData.xml file, I can simply have a G Code line M100? I'm not really sure what I'm doing wrong currently.
I have updated the M command in the KFlopWebNC settings menu, does it need to also be updated elsewhere?
Thanks
Mike
Re: KFlopWebNC M commands and 8 axis control
Hi Mike,
Sorry for the delay it took a while to find the bug. I think the issue is that the Actions for M3-M9, User Buttons, M100-M119, and Specials are all packed into an array. The M100 Actions start at Index 21 not Index 100.
In file DeviceInteropHandler Interpreter.cs change this code:
Code:
if (init)
{
_Controller.CoordMotion.Interpreter.SetMcodeAction(
command.Index, command.Type, p0, p1, p2, p3, p4, sdata);
}
to this:
Code:
if (init)
{
int MCODE_ACTIONS_M100_OFFSET = 21; // start of M100 Actions Packed into Array
int ArrayIndex = command.Index;
if (ArrayIndex >= 100 && ArrayIndex <= 119) ArrayIndex += MCODE_ACTIONS_M100_OFFSET - 100;
_Controller.CoordMotion.Interpreter.SetMcodeAction(
ArrayIndex, command.Type, p0, p1, p2, p3, p4, sdata);
}
HTH
Regards
Re: KFlopWebNC M commands and 8 axis control
Thanks Tom! worked flawlessly