Page 1 of 1

Forward / Reverse buttons

Posted: Fri Jan 18, 2019 9:09 am
by marker
Hello

On the main KmotionCNC screen there is a button "FEED HOLD".
When you press it, the G code stops running and 2 additional Forward / Reverse buttons appear.

I need to manage these commands from the C program.

To stop / start, I use the command:

if (ReadBit (33)) // Watch an external input switch
{
StopCoordinatedMotion (); // feedhold
}
else ResumeCoordinatedMotion (); // resume feedhold


Question: how to manage forward / reverse commands


There is a command to control the steps in the G code:
DoPC (PC_COMM_SINGLE_STEP);

But it works only forward, how to implement the reverse?

Thanks for answers. (Sorry for my English)

Re: Forward / Reverse buttons

Posted: Tue Jan 22, 2019 5:17 pm
by TomKerekes
Hello marker,

Sorry I somehow missed this.

You can command forward and reverse motion within KFLOP along a path by calling the function:

void SetFROTemp(float FRO); // Temporarily change from current to the specified FRO using a nominal rate, override FeedHold, don't save as LastFRO

With something like SetFROTemp(0.2); or SetFROTemp(-0.2);

Regarding DoPC (PC_COMM_SINGLE_STEP); - there isn't any command for single stepping GCode in reverse. However when reverse feeding the GCode Line number that created the motion should update automatically.

Re: Forward / Reverse buttons

Posted: Wed Jan 23, 2019 5:49 am
by marker
Thanks for the answer

Works great