Dynomotion

Group: DynoMotion Message: 6100 From: daveymahomh600e Date: 11/16/2012
Subject: Entering User Data into a C Program
Hello All,

I am working on building a C probing routine for my lathe and need some help with the coding.

There needs to be input from the user for width, pullback and stepover of the area to be probed. The ideal way would be with a window where the data is entered, which I believe is then passed as UserData somehow to the program.

If someone could point me toward some sample code which I could modify to suit my application, it would be most appreciated.

With many thanks,
David.
Group: DynoMotion Message: 6105 From: Tom Kerekes Date: 11/16/2012
Subject: Re: Entering User Data into a C Program
Hi David,

I can't think of an easy way to do this without modifying KMotionCNC.  Here are some thoughts:

#1 - the easiest would be to just have the operator specify the parameters in G Code.  Something like how Rigid tapping is performed:

(Call a Rigid Tap Sequence)
#10=20 (TPI - Threads per inch)
#11=700 (Forward Cutting RPM)
#12=1000 (Retract RPM)
#13=0.75 (Z depth Total inches)
#14=0.2 (Z depth Forward per Motion)
#15=0.05 (Z depth Retract per Motion)
M100

#2 You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit.  This .exe could be Launched from a KMotionCNC User Button.

#3 Modify KMotionCNC.  You might copy the "Set X" button technique which creates a dialog window, allows the operator to enter a value, then does something with it.  KMotionCNC is written in Microsoft MFC which is very flexible but somewhat difficult to do what you would think of as a common task such as a dialog window.  You need to create a dialog class, add member variables, and so forth.

HTH
TK



Group: DynoMotion Message: 6109 From: daveymahomh600e Date: 11/16/2012
Subject: Re: Entering User Data into a C Program
Thanks Tom.

I guess as long as the input into Gcode made sense it would suffice. How does one build that into the Gcode? Are there some examples around?

David

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> I can't think of an easy way to do this without modifying KMotionCNC.  Here are some thoughts:
>
> #1 - the easiest would be to just have the operator specify the parameters in G Code.  Something like how Rigid tapping is performed:
>
> (Call a Rigid Tap Sequence)
> #10=20 (TPI - Threads per inch)
> #11=700 (Forward Cutting RPM)
> #12=1000 (Retract RPM)
> #13=0.75 (Z depth Total inches)
> #14=0.2 (Z depth Forward per Motion)
> #15=0.05 (Z depth Retract per Motion)
> M100
>
> #2 You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit.  This .exe could be Launched from a KMotionCNC User Button.
>
> #3 Modify KMotionCNC.  You might copy the "Set X" button technique which creates a dialog window, allows the operator to enter a value, then does something with it.  KMotionCNC is written in Microsoft MFC which is very flexible but somewhat difficult to do what you would think of as a common task such as a dialog window.  You need to create a dialog class, add member variables, and so forth.
>
> HTH
> TK
>
>
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 16, 2012 5:53 AM
> Subject: [DynoMotion] Entering User Data into a C Program
>
>
>  
> Hello All,
>
> I am working on building a C probing routine for my lathe and need some help with the coding.
>
> There needs to be input from the user for width, pullback and stepover of the area to be probed. The ideal way would be with a window where the data is entered, which I believe is then passed as UserData somehow to the program.
>
> If someone could point me toward some sample code which I could modify to suit my application, it would be most appreciated.
>
> With many thanks,
> David.
>
Group: DynoMotion Message: 6110 From: Tom Kerekes Date: 11/16/2012
Subject: Re: Entering User Data into a C Program
Hi David,

Not sure what you mean by "build that into the Gcode".  You or your operator would have to generate the GCode.

The M100 would be configured to run your KFLOP Probe C program.

Your C Probe Program would download the parameters as shown in the example:

KFLOPtoPCCmdExamples.c

use a call like:

GetVars(100,3,13);  // Download 3 from GCode 100 to persist 13

Regards
TK

Group: DynoMotion Message: 6111 From: daveymahomh600e Date: 11/16/2012
Subject: Re: Entering User Data into a C Program
Thanks Tom.

I will get into the example program and see what I can come up with.

David

--- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@...> wrote:
>
> Hi David,
>
> Not sure what you mean by "build that into the Gcode".  You or your operator would have to generate the GCode.
>
> The M100 would be configured to run your KFLOP Probe C program.
>
> Your C Probe Program would download the parameters as shown in the example:
>
> KFLOPtoPCCmdExamples.c
>
> use a call like:
>
> GetVars(100,3,13);  // Download 3 from GCode 100 to persist 13
>
>
> Regards
> TK
>
>
>
> ________________________________
> From: daveymahomh600e <david.m.stevenson@...>
> To: DynoMotion@yahoogroups.com
> Sent: Friday, November 16, 2012 10:23 AM
> Subject: [DynoMotion] Re: Entering User Data into a C Program
>
>
>  
> Thanks Tom.
>
> I guess as long as the input into Gcode made sense it would suffice. How does one build that into the Gcode? Are there some examples around?
>
> David
>
> --- In DynoMotion@yahoogroups.com, Tom Kerekes <tk@> wrote:
> >
> > Hi David,
> >
> > I can't think of an easy way to do this without modifying KMotionCNC.  Here are some thoughts:
> >
> > #1 - the easiest would be to just have the operator specify the parameters in G Code.  Something like how Rigid tapping is performed:
> >
> > (Call a Rigid Tap Sequence)
> > #10=20 (TPI - Threads per inch)
> > #11=700 (Forward Cutting RPM)
> > #12=1000 (Retract RPM)
> > #13=0.75 (Z depth Total inches)
> > #14=0.2 (Z depth Forward per Motion)
> > #15=0.05 (Z depth Retract per Motion)
> > M100
> >
> > #2 You could write a simple Windows .exe application in VB or C# to display a dialog, get the values, then set them in KFLOP UserData variables, then launch a C program and exit.  This .exe could be Launched from a KMotionCNC User Button.
> >
> > #3 Modify KMotionCNC.  You might copy the "Set X" button technique which creates a dialog window, allows the operator to enter a value, then does something with it.  KMotionCNC is written in Microsoft MFC which is very flexible but somewhat difficult to do what you would think of as a common task such as a dialog window.  You need to create a dialog class, add member variables, and so forth.
> >
> > HTH
> > TK
> >
> >
> >
> >
> >
> > ________________________________
> > From: daveymahomh600e <david.m.stevenson@>
> > To: DynoMotion@yahoogroups.com
> > Sent: Friday, November 16, 2012 5:53 AM
> > Subject: [DynoMotion] Entering User Data into a C Program
> >
> >
> >  
> > Hello All,
> >
> > I am working on building a C probing routine for my lathe and need some help with the coding.
> >
> > There needs to be input from the user for width, pullback and stepover of the area to be probed. The ideal way would be with a window where the data is entered, which I believe is then passed as UserData somehow to the program.
> >
> > If someone could point me toward some sample code which I could modify to suit my application, it would be most appreciated.
> >
> > With many thanks,
> > David.
> >
>