Get Offset values method?
Moderators: TomKerekes, dynomotion
-
- Posts: 85
- Joined: Fri Apr 27, 2018 12:44 pm
Get Offset values method?
Is there a dotnet method for returning the current position that is equivalent to the values in the DROs when the KMotionCNC's Machine Coord checkbox is unchecked?
- TomKerekes
- Posts: 2676
- Joined: Mon Dec 04, 2017 1:49 am
Re: Get Offset values method?
Hi Sam,
Machine coordinates can be converted to GCode coordinates like this:
Machine coordinates can be converted to GCode coordinates like this:
Code: Select all
// Get Absolute Machine Coordinates and convert to GCode Coordinates
double x=0, y=0, z=0, a=0, b=0, c=0;
KM.CoordMotion.UpdateCurrentPositionsABS(ref x, ref y, ref z, ref a, ref b, ref c, false);
double xg = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsX(x);
double yg = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsY(y);
double zg = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsZ(z);
double ag = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsA(a);
double bg = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsB(b);
double cg = KM.CoordMotion.Interpreter.ConvertAbsToUserUnitsC(b);
Regards,
Tom Kerekes
Dynomotion, Inc.
Tom Kerekes
Dynomotion, Inc.
-
- Posts: 85
- Joined: Fri Apr 27, 2018 12:44 pm
Re: Get Offset values method?
Thanks Tom, I'll try that.