Greetings,
I am wondering is there is a C function to move my CNC machine to an XYZ location? Using the Move function is based off Machine Coordinates. Do I have to communicate with the KMotionCNC to determine the fixture offset and do something like this?
Move(desired Axis) = Desired Position- Current Position - Fixture Offset?
Can anyone think of an easier way to do this? If not do I use the "KFlopToKMotionCNCFunctions.c" file? I dont see fixture offset in that file.
Thanks,
Scott
C Program - Move to XYZ Location
Moderators: TomKerekes, dynomotion
Re: C Program - Move to XYZ Location
You are correct in that you need to use an alternative method, as KFlop only works in axis counts and has no idea regarding the XYZ positions.
The simplest method I can think of, is to use KflopToKMotionCNCFunctions.c, and the MDI function.
Here's a quick example from a C program I've been working on -
The simplest method I can think of, is to use KflopToKMotionCNCFunctions.c, and the MDI function.
Here's a quick example from a C program I've been working on -
Code: Select all
double x = 0.0;
double y 0.0;
gcode = 53;
char s[80];
sprintf(s,"G%f G1 X%f Y%f\n", gcode, d[0], d[1]);
printf(s);
//printf("\nMDI time:%f\n", Time_sec());
//printf("MDI sent,%f\n", Time_sec());
MDI(s);