Page 1 of 1

Rapid / Feed override

Posted: Fri Oct 08, 2021 2:02 pm
by cemoa9
Hello Tom,

I am trying to get an easy access to rapid or feed override without clicking on the buttons everytime, is there a way to (2 options that I see for my set-up) :

1) have both on them on screen, but I could read somewhere that we cannot add sliders, si may not work
2) have the sliders changing from rapid to feed by an external button (which I am already using to select what stuff to do with the MPG)

Cordially

Francois

Re: Rapid / Feed override

Posted: Fri Oct 08, 2021 3:59 pm
by TomKerekes
Hi Francois,

I'm not sure I understand.

But you can select FRO Rapid or Feed by executing Screen Script from a C Program.

Here is an example to select Feed

Code: Select all

#include "KMotionDef.h"

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

void main()
{
	if (ScreenScript("WinMsg:DlgName;IDC_Feed;BM_CLICK;"))
		printf("Screen Script Failed\n");
	else
		printf("Screen Script Success\n");
}

And for Rapid

Code: Select all

#include "KMotionDef.h"

#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"

void main()
{
	if (ScreenScript("WinMsg:DlgName;IDC_Rapid;BM_CLICK;"))
		printf("Screen Script Failed\n");
	else
		printf("Screen Script Success\n");
}
You can also change the FRO and RRO using external commands:

#define PC_COMM_SET_FRO 5 // Persist+1 is the FRO as a float
#define PC_COMM_SET_FRO_INC 6 // Persist+1 is the factor to change it as float

#define PC_COMM_SET_RRO 54 // Persist+1 is the RRO (Rapid Rate Override) as a float
#define PC_COMM_SET_RRO_INC 55 // Persist+1 is RRO (Rapid Rate Override) the factor to change it as float

HTH

Re: Rapid / Feed override

Posted: Sat Oct 09, 2021 3:18 pm
by cemoa9
Hello Tom,

Thanks, the two code samples will be perfect, to let you understand, I have a 10 positions switch (X, Y, Z, A, G1, G0, spindle) and a MPG, depending on the switch position the MPG will move the axis or change the feedrate, rapid or spindle, now with your code the slider will change automatically to the selected one.

Cordially

Francois

Re: Rapid / Feed override

Posted: Thu Oct 21, 2021 8:17 am
by cemoa9
Hello Tom,

Well, unfortunately it does not work, I will try to be clearer, that may help :oops:

As mentionned I change FRO and RRO via a unique MPG, FRO or RRO are selected by a switch, target is that when the switch is on the FRO position, then FRO slider is active and shown on the screen, and when RRO is selected then to have RRO active and shown.

I tried that code : ScreenScript("WinMsg:DlgName;IDC_Feed;BM_CLICK;");

But it did not work.

Cordially

Francois

Re: Rapid / Feed override

Posted: Thu Oct 21, 2021 4:01 pm
by TomKerekes
Hi Francois,

What happened? Post the program you tried. What was printed on the Console? What Version are you using?

Re: Rapid / Feed override

Posted: Tue Oct 26, 2021 1:18 pm
by cemoa9
Hello Tom,

Well nothing happens, console would write "Screen Script Success" but the Feed or Rapid slider is not getting selected. I am using 4.35f version, I attached the init file, concerned lines from 570.

Cordially

Francois

Re: Rapid / Feed override

Posted: Tue Oct 26, 2021 5:46 pm
by TomKerekes
Hi Francois,

For Screen Script to work a Screen Script Screen must be active. Have you configured a Screen Script Screen to be used? Or are you using a standard screen Face?

Re: Rapid / Feed override

Posted: Wed Oct 27, 2021 1:24 pm
by cemoa9
Hi Tom,

Changed the screen script to a custom one, works now perfectly!

Thanks.

Francois

Re: Rapid / Feed override

Posted: Wed Oct 27, 2021 5:41 pm
by TomKerekes
Hi Francois,

Great. btw you should really change the C Program to only send the button click once when it changes or only so often rather than constantly while the bit is set.

Re: Rapid / Feed override

Posted: Wed Nov 03, 2021 9:05 pm
by cemoa9
Performed as recommanded, thanks Tom !