Respected Sir,
Is it possible to write C program that enters Gcode program in my screen. what im trying to say is if i press a button "MOVE" then it asks for user input such as coordination value XYZ and feed rate .when i entered the above input and press ok then the Gcode "G00 X#100 Y#101 Z#102 F100" need to be entered in my gcode screen along with my inputs
Writing G and M code program via C program
Moderators: TomKerekes, dynomotion
- TomKerekes
- Posts: 2529
- Joined: Mon Dec 04, 2017 1:49 am
Re: Writing G and M code program via C program
Hi,
There isn't a method for entering text into the GCode Control.
It might be much simpler to just move the axes to a position with the C Program.
But there is an MDI command to execute one line of GCode.
You can also define an Action to execute a Program and if the extension of the file is .ngc it will be executed as GCode instead of a C Program. Screen script can be used to define the Action.
Then executed from KFLOP with:
There isn't a method for entering text into the GCode Control.
It might be much simpler to just move the axes to a position with the C Program.
But there is an MDI command to execute one line of GCode.
You can also define an Action to execute a Program and if the extension of the file is .ngc it will be executed as GCode instead of a C Program. Screen script can be used to define the Action.
Then executed from KFLOP with:
Code: Select all
#include "KMotionDef.h"
#define TMP 10 // which spare persist to use to transfer data
#include "KflopToKMotionCNCFunctions.c"
void main()
{
if (ScreenScript("Action:4;1;0;0;0;0;C:\\Temp\\GCode.ngc"))
printf("Screen Script Failed\n");
else
printf("Screen Script Success\n");
}
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.