17 #ifndef TGM_CNC_H_FILE_INCLUDED 18 #define TGM_CNC_H_FILE_INCLUDED 21 #define COMM_DLL_VERSION 355 29 #define _USE_MATH_DEFINES 33 #pragma GCC diagnostic push 34 #pragma GCC diagnostic ignored "-pedantic" // disable warning about nameless structs 37 # pragma warning(disable : 4201) // disable warning: nameless struct/union.... 38 # if _MSC_VER < 1800 // below Visual Studio 2013 39 # pragma warning(disable: 4480) // Visual Studio 2010 emits warning for enum with type specified 48 # define MAX_FLOAT 3.402823466e+38 53 # define INVALID_VALUE (MAX_FLOAT / 2.) 58 # define _countof(array) (sizeof(array)/sizeof(array[0])) 63 #ifndef UNREFERENCED_PARAM 64 # define UNREFERENCED_PARAM(P) \ 71 #define MAX_FUNC_ADDRESSES ('Z' - 'A' + 1) 74 #if defined __linux__ && !defined UNDER_RTSS 76 # if defined(SF_TCH_LIBRARY) 77 # define TOOLCHAIN_DLL_EXPORT __attribute__((visibility("default"))) 78 # define CNC_CALC_DLL_EXPORT __attribute__((visibility("default"))) // swapped! 80 # define TOOLCHAIN_DLL_EXPORT __attribute__((visibility("default"))) 81 # define CNC_CALC_DLL_EXPORT __attribute__((visibility("default"))) // swapped! 83 # define TOOLCHAIN_CALLTYPE 89 # define TGM_LPCTSTR TGM_LPCTSTR 94 # define TGM_LPTSTR TGM_LPTSTR 100 # define TGM_LPCSTR TGM_LPCSTR 104 #elif defined WIN32 // !__linux__ 107 # define TOOLCHAIN_DLL_EXPORT 108 # elif defined(SF_TCH_LIBRARY) 109 # define TOOLCHAIN_DLL_EXPORT __declspec(dllexport) 110 # define CNC_CALC_DLL_EXPORT __declspec(dllimport) // swapped! 112 # define TOOLCHAIN_DLL_EXPORT __declspec(dllimport) 113 # define CNC_CALC_DLL_EXPORT __declspec(dllexport) // swapped! 115 # define TOOLCHAIN_CALLTYPE __cdecl 117 # if !defined _UNICODE 118 # error "_UNICODE must be defined for WIN32" 124 # define TGM_LPCTSTR TGM_LPCTSTR 130 # define TGM_LPTSTR TGM_LPTSTR 136 # define TGM_LPCSTR TGM_LPCSTR 141 #else // ARM or Xenomai 145 # define TGM_LPCTSTR TGM_LPCTSTR 150 # define TGM_LPTSTR TGM_LPTSTR 156 # define TGM_LPCSTR TGM_LPCSTR 160 # define TOOLCHAIN_DLL_EXPORT 161 # define CNC_CALC_DLL_EXPORT 162 # define TOOLCHAIN_CALLTYPE 169 #define TOOL_CHAIN_BAD_INTR_INDEX (-2) 170 #define TOOL_CHAIN_ERROR (-1) 171 #define TOOL_CHAIN_SUCCESS 0 172 #define TOOL_CHAIN_XEXEC 1 173 #define TOOL_CHAIN_XBREAK 2 175 #define ACTUAL_N_AXES (sizeof(P10DOUBLE) / sizeof(double)) 179 #define START_CNC_SIMULATION 10 180 #define START_CNC_TEST 20 181 #define START_CNC_FORWARD 30 182 #define START_CNC_FORWARD_NO_MFUNC 31 183 #define START_CNC_BACKWARD 32 184 #define START_CNC_FORWARD_SKIP_FIRST_M 33 185 #define START_CNC_CONNECT 40 186 #define START_CNC_CONNECT_MOVE 41 187 #define START_CNC_GOTO_POSITION 50 188 #define START_CNC_CALCULATING 60 189 #define START_CNC_HELP 999 191 #define RESET_CNC_NO_G92 1 194 #ifndef MAX_DECLARED_PARAMS 195 # define NUMBER_OF_VARIABLES 100 199 # define MAX_DECLARED_PARAMS (NUMBER_OF_VARIABLES + SUB_PARS) 201 # define MAXLABELLENGTH 40 213 #define MAX_M_FUNC_IN_G (4) 217 # define ADDR_IDX(w) ((w) - 'A') 218 # define G_FUNC_IDX ADDR_IDX('G') 219 # define M_FUNC_IDX ADDR_IDX('M') 220 # define X_ADDR_IDX ADDR_IDX('X') 221 # define Y_ADDR_IDX ADDR_IDX('Y') 222 # define Z_ADDR_IDX ADDR_IDX('Z') 223 # define C_ADDR_IDX ADDR_IDX('C') 224 # define F_ADDR_IDX ADDR_IDX('F') 225 # define S_ADDR_IDX ADDR_IDX('S') 500 double xyzcbuvwao[10];
514 P10DOUBLE(
double xVal,
double yVal,
double zVal,
double cVal,
515 double bVal = 0.0,
double uVal = 0.0,
double vVal = 0.0,
516 double wVal = 0.0,
double aVal = 0.0,
double oVal = 0.0)
538 UNREFERENCED_PARAM(bNoInit);
571 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
579 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
585 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
591 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
597 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
602 int operator<(
const double n)
const 604 return x_axis < n && y_axis < n && z_axis < n && c_axis < n &&
605 b_axis < n && u_axis < n && v_axis < n &&
606 w_axis < n && a_axis < n && o_axis < n;
612 assert(fabs(val) >= 1e-12);
614 if (fabs(val) >= 1e-12)
618 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
619 xyzcbuvwao[i] *= val1x;
626 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
627 xyzcbuvwao[i] *= val;
690 intptr_t IsNearToAll(
const P10DOUBLE &a,
double threshold)
const;
691 intptr_t IsNearToAllByPlane(
const P10DOUBLE &a,
double threshold, intptr_t plane)
const;
692 intptr_t IsNearToAll_CheckInvalidValue(
const P10DOUBLE &a,
const P10DOUBLE &threshold)
const;
693 intptr_t IsNearToAll_CheckInvalidValue(
const P10DOUBLE &a,
double threshold)
const;
694 intptr_t IsNearToXYZC(
const P10DOUBLE &a,
double threshold)
const;
695 intptr_t IsNearToXYZ(
const P10DOUBLE &a,
double threshold)
const;
696 intptr_t IsNearToZCBUVWAO(
const P10DOUBLE &a,
double threshold)
const;
697 intptr_t IsNearToXY(
const P10DOUBLE &a,
double threshold)
const;
698 intptr_t IsOutOfXY(
const P10DOUBLE &a,
double threshold)
const;
700 void ResetInvalidPositions();
702 double Length()
const 704 double squareLen = 0.0;
705 for (
size_t i = 0; i <
_countof(xyzcbuvwao); i++)
707 squareLen += xyzcbuvwao[i] * xyzcbuvwao[i];
709 return sqrt(squareLen);
714 double dx = 0.0, dy = 0.0, dz = 0.0, dc = 0.0;
715 double d0 = 0.0, d1 = 0.0, d2 = 0.0, d3 = 0.0, d4 = 0.0, d5 = 0.0;
736 return sqrt(dx * dx + dy * dy + dz * dz + dc * dc + d0 * d0 + d1 * d1 + d2 * d2 + d3 * d3 +
740 double SquareLength(
const P10DOUBLE &n)
const;
741 double SquareLengthXYZCBU(
const P10DOUBLE &n)
const;
742 double SquareLengthXYZ_BU_NoC(
const P10DOUBLE &n)
const;
743 double SquareLengthXYZC(
const P10DOUBLE &n)
const;
744 double SquareLengthXYZ(
const P10DOUBLE &n)
const;
745 double SquareLengthXY(
const P10DOUBLE &n)
const;
747 void Round(
double accuracy,
double accuracy1x);
748 void RoundXY(
double accuracy,
double accuracy1x);
774 int32_t xyzcbuvwao[10];
786 P10BOOL(int32_t _x, int32_t _y, int32_t _z, int32_t _c,
787 int32_t _b, int32_t _u, int32_t _v, int32_t _w, int32_t _a, int32_t _o)
809 memcpy(
this, &n,
sizeof(
P10BOOL));
826 P4CIRCLE(
double _x,
double _y,
double _z,
double _c) : x(_x), y(_y), z(_z), c(_c) {}
828 P4CIRCLE() { memset(
this, 0,
sizeof(P4CIRCLE)); }
830 explicit P4CIRCLE(
bool bNoInit)
832 UNREFERENCED_PARAM(bNoInit);
835 P4CIRCLE(
const P4CIRCLE &n) { memcpy(
this, &n,
sizeof(P4CIRCLE)); }
837 P4CIRCLE &operator=(
const P4CIRCLE &n)
840 memcpy(
this, &n,
sizeof(P4CIRCLE));
844 void SetToZero() { memset(
this, 0,
sizeof(P4CIRCLE)); }
846 inline P4CIRCLE &operator+=(
const P4CIRCLE &n)
848 x += n.x; y += n.y; z += n.z; c += n.c;
852 inline P4CIRCLE &operator+=(
const double n)
854 x += n; y += n; z += n; c += n;
857 inline P4CIRCLE &operator-=(
const P4CIRCLE &n)
859 x -= n.x; y -= n.y; z -= n.z; c -= n.c;
863 inline P4CIRCLE &operator-=(
const double n)
865 x -= n; y -= n; z -= n; c -= n;
869 inline int operator<(
const double n) {
return x < n && y < n && z < n && c < n; }
872 inline P4CIRCLE &operator/=(
const double val)
874 assert(fabs(val) >= 1e-12);
875 if (fabs(val) >= 1e-12)
877 double val1x = 1.0 / val;
878 x *= val1x; y *= val1x; z *= val1x; c *= val1x;
884 inline P4CIRCLE &operator*=(
const double val)
886 x *= val; y *= val; z *= val;c *= val;
891 friend inline P4CIRCLE operator+(
const P4CIRCLE &a,
const P4CIRCLE &b)
893 return P4CIRCLE(a.x + b.x, a.y + b.y, a.z + b.z, a.c + b.c);
896 friend inline P4CIRCLE operator-(
const P4CIRCLE &a,
const P4CIRCLE &b)
898 return P4CIRCLE(a.x - b.x, a.y - b.y, a.z - b.z, a.c - b.c);
901 friend inline P4CIRCLE operator-(
const P4CIRCLE &a)
903 return P4CIRCLE(-a.x, -a.y, -a.z, -a.c);
906 friend inline P4CIRCLE operator*(
const P4CIRCLE &a,
const double val)
908 return P4CIRCLE(a.x * val, a.y * val, a.z * val, a.c * val);
911 void SetAllToValue(
double val) { x = y = z = c = val; }
913 intptr_t IsNearToAll(
const P10DOUBLE &a,
double threshold)
const;
914 intptr_t IsNearToAll(
const P4CIRCLE &a,
double threshold)
const;
915 intptr_t IsNearToAllByPlane(
const P10DOUBLE &a,
double threshold, intptr_t plane)
const;
916 intptr_t IsNearToAll_CheckInvalidValue(
const P10DOUBLE &a,
const P10DOUBLE &threshold)
const;
917 intptr_t IsNearToAll_CheckInvalidValue(
const P10DOUBLE &a,
double threshold)
const;
918 intptr_t IsNearToXYZC(
const P10DOUBLE &a,
double threshold)
const;
919 intptr_t IsNearToXYZ(
const P10DOUBLE &a,
double threshold)
const;
920 intptr_t IsNearToXY(
const P10DOUBLE &a,
double threshold)
const;
921 intptr_t IsOutOfXY(
const P10DOUBLE &a,
double threshold)
const;
922 void ResetInvalidPositions();
923 double Length()
const {
return sqrt(x * x + y * y + z * z + c * c); }
925 double SquareLength(
const P10DOUBLE &n)
const;
926 double SquareLengthXYZC(
const P10DOUBLE &n)
const;
927 double SquareLengthXYZ(
const P10DOUBLE &n)
const;
928 double SquareLengthXY(
const P10DOUBLE &n)
const;
929 void Round(
double accuracy,
double accuracy1x);
930 void RoundXY(
double accuracy,
double accuracy1x);
933 int64_t roundTo64bitInt(
double v)
935 return static_cast<int64_t
>(v >= 0.0 ? v + 0.5 : v - 0.5);
979 UNREFERENCED_PARAM(bNoInit);
1007 #endif // __cplusplus 1051 int32_t m_bFeedIsMin;
1098 static_assert(
sizeof(m_pars) ==
sizeof(n.
m_pars),
1099 "Size of SIMPLE_GM_PARAMS_BASE::m_pars and SIMPLE_GM_PARAMS_WIN32::m_pars must be the same");
1109 memcpy(m_pars, n.
m_pars,
sizeof(m_pars));
1120 void Func(
const int32_t f)
1125 void Feed(
const double f,
const int32_t bIsMin)
1127 m_pars[F_ADDR_IDX] =
static_cast<float>(f);
1134 void Spindle(
const double s)
1136 m_pars[S_ADDR_IDX] =
static_cast<float>(s);
1139 void AssignmentIdx(
const int32_t p)
1144 void GCodeIndex(
const int32_t idx)
1195 CALLBACK_INFO() : stringId(-1), nLines(0), actLine(0), fileIdx(-1)
1197 m_fullError =
nullptr;
1198 m_errorArguments =
nullptr;
1200 CALLBACK_INFO(
int _stringId) : stringId(_stringId), nLines(0), actLine(0), fileIdx(-1)
1202 m_fullError =
nullptr;
1203 m_errorArguments =
nullptr;
1273 #define CORR_STRATEGY_G41_ALREADY_CORRECTED 0 1274 #define CORR_STRATEGY_G41_STARTS_CORRECTION 1 1276 #define CORR_STRATEGY_MASK 0xFF 1281 #define CORR_STRATEGY_OLD_VERSION 0x80000000 1284 #define CORR_STRATEGY_G00_WITHOUT_CORR 0x40000000 1288 #define CORR_STRATEGY_FORCE_TO_CONTINUE 0x20000000 1291 #define CORR_STRATEGY_CHECK_ORIGINAL_GCODE 0x02000000 1294 #define CORR_STRATEGY_REMOVE_LAST_ARC 0x01000000 1297 #define CORR_STRATEGY_REMOVE_FIRST_ARC 0x00800000 1301 #define CORR_STRATEGY_NO_ADD_R 0x00400000 1306 #define CORR_STRATEGY_REMOVE_SMALL_ARCS 0x00200000 1309 #define CORR_STRATEGY_ALLOW_REVERSE_LINES 0x00100000 1312 #define CORR_STRATEGY_REMOVE_CROSSES 0x00080000 1315 #define CORR_STRATEGY_CONNECT_WRONG_BY_G1 0x00040000 1319 #define CORR_STRATEGY_CONNECT_WRONG_BY_MOVE 0x00020000 1322 #define CORR_STRATEGY_ALLOW_FIRST_LAST_CROSS 0x00010000 1324 #define CORR_STRATEGY_SEARCH_MASK 0x00000700 1327 #define CORR_STRATEGY_SEARCH_DEEP_10 0x00000100 1328 #define CORR_STRATEGY_SEARCH_DEEP_50 0x00000200 1330 #define CORR_STRATEGY_SEARCH_DEEP_100 0x00000300 1332 #define CORR_STRATEGY_SEARCH_DEEP_500 0x00000400 1334 #define CORR_STRATEGY_SEARCH_DEEP_1000 0x00000500 1336 #define CORR_STRATEGY_SEARCH_DEEP_2000 0x00000600 1338 #define CORR_STRATEGY_SEARCH_DEEP_ALL 0x00000700 1342 #define CORR_STRATEGY_DEFAULT_DEEP 1000 1343 #define CORR_STRATEGY_MIN_DEEP 10 1400 #define F_BY_GCODE 0 1401 #define F_BY_PARAMETERS 1 1403 #define F_BY_PARAMETERS_FP_BY_GCODE 2 1421 #define DEF_GCODE_FEED_G00 0 1422 #define DEF_GCODE_FEED_G01 1 1423 #define DEF_GCODE_FEED_REVERSE 2 1424 #define DEF_GCODE_FEED_CONNECT 3 1425 #define DEF_GCODE_FEED_WITHOUT_M 4 1426 #define DEF_GCODE_FEED_GOTO_POSITION 5 1427 #define DEF_GCODE_FEED_NORMAL_STOP 6 1428 #define DEF_GCODE_FEED_EMERGENCY_STOP 7 1597 #define DISABLE_OPCODE_CALL 0x00000001 1598 #define DISABLE_ASSIGN_CALL 0x00000002 1599 #define DISABLE_REFRESH_ALL_PARAMS_CALL 0x00000004 1642 double dynamicG41Correction_percent;
1650 #define GCODE_ALLOWED_CIRC_CENTER_ACCURACY 0 1651 #define GCODE_CROSSING_ACCURACY 1 1652 #define GCODE_ANGULAR_PRECISION 2 1653 #define GCODE_ANGULAR_DISTANCE_PRECISION 3 1654 #define GCODE_MINIMAL_ALLOWED_ARC_R 4 1655 #define GCODE_NO_ADD_R_MULTIPLIER 5 1656 #define GCODE_SOURCE_PRECISION 6 1657 #define GCODE_MINIMAL_ALLOWED_LINE_LENGTH 7 1659 double tolerance[10];
1679 M02_programEnd1 = 2;
1680 M30_programEnd2 = 30;
1681 M03_startSpindleCW = 3;
1682 M04_startSpindleCCW = 4;
1683 M05_stopSpindle = 5;
1699 insertArcToleranceRMax = 0.03;
1700 insertArcToleranceRMin = 0.03;
1703 tolerance[GCODE_CROSSING_ACCURACY] = 0.001;
1704 tolerance[GCODE_ANGULAR_PRECISION] = 0.03;
1705 tolerance[GCODE_ANGULAR_DISTANCE_PRECISION] = 0.005;
1706 tolerance[GCODE_NO_ADD_R_MULTIPLIER] = 3.0;
1707 tolerance[GCODE_SOURCE_PRECISION] = 0.01;
1709 #endif // __cplusplus 1726 void SetStartPos(
const P10DOUBLE &start);
1728 void MinMaxCirc(
const int type,
const int plane,
const P10DOUBLE &start,
const P10DOUBLE &end,
1729 const P4CIRCLE &cc);
1732 int angleQuadrant(
double x,
double y,
int type)
const;
1733 void getMinMax(
const int type,
const int plane,
double &minX,
double &minY,
double &minZ,
1734 double &maxX,
double &maxY,
double &maxZ,
const P4CIRCLE &cc,
int fq,
1742 #define GCODE_SIZE_ORIGINAL_IDX 0 1743 #define GCODE_SIZE_CORRECTED_IDX 1 1744 #define GCODE_SIZE_ROTATED_IDX 2 1745 #define GCODE_SIZE_ROTATED_CORRECTED 3 1766 #define LOCAL_CORE_MODE_TGM 0 1767 #define LOCAL_CORE_MODE_DLL 1 1768 #define LOCAL_CORE_MODE_OFFLINE 2 1792 uint32_t enhancedInterpolatorParameters;
1803 #define INTERPOLATOR_LINEAR_FUNC 1 // @flag 1 | <f Interpolator_Linear> 1804 #define INTERPOLATOR_ARC_CW_FUNC 2 // @flag 2 | <f Interpolator_Arc> CW 1805 #define INTERPOLATOR_ARC_CCW_FUNC 3 // @flag 3 | Interpolator_Arc CCW 1806 #define INTERPOLATOR_CLEAR_FUNC 4 1807 #define INTERPOLATOR_GENERIC_FUNC 5 // any generic G-function 1808 #define INTERPOLATOR_G0_FUNC 10 // G0 1809 #define INTERPOLATOR_STOP_FUNC 30 // @flag 30 | <f Interpolator_Stop> 1810 #define INTERPOLATOR_START_FUNC 31 // @flag 31 | <f Interpolator_Start> 1811 #define INTERPOLATOR_NORMAL_STOP_FUNC 32 // @flag 32 | <f Interpolator_NormalStop> 1812 #define INTERPOLATOR_SET_COORDS_FUNC 92 // @flag 92 | <f Interpolator_SetCoords> 1813 #define INTERPOLATOR_SET_PARAMS_FUNC 93 // @flag 93 | <f Interpolator_SetParams> 1814 #define INTERPOLATOR_SET_MACHINE_PARAMS_FUNC 94 // @flag 94 | SetMachineParams (called via SetParams) 1815 #define INTERPOLATOR_SET_DOUBLE_INTEGER_PARS 95 // @flag 95 1816 #define INTERPOLATOR_CONTINUOUS_M_FUNC 999 // @flag 999 | prubezna M funkce 1817 #define INTERPOLATOR_M_FUNC 1000 // @flag 1000 | M funkce s cekanim 1819 #define INTERPOLATOR_MAX_N_USER_PARAMS 26 // max supported number of M function addresses 1843 double arcCenter[3];
1845 uint32_t arcAxis[2];
1852 float fltMParams[INTERPOLATOR_MAX_N_USER_PARAMS];
1861 double minimal_feed;
1894 #define CALLBACK_CALLTYPE TOOLCHAIN_CALLTYPE 1899 #define DEVICE_ERROR_OUT_TAB 0 1900 #define CNC_OUT_TAB 1 1901 #define M29_OUT_TAB 2 1902 #define STATUS_LINE_ONLY 3 1903 #define ACTIVATE_TAB 0x100 1904 #define PREFIX_TIME 0x200 1905 #define HIDE_OUTPUT_VIEW 0x400 1908 #define APP_AddOutputLogFunc 1 1928 #define APP_SetStatusBarTextFunc 2 1942 #define APP_IsDebugModeFunc 3 1952 #define APP_IsVerboseModeFunc 4 1962 #define APP_GetLibPathFunc 5 1970 #define APP_GetToolPathFunc 6 1978 #define APP_GetSystemPathFunc 7 1987 #define APP_GetFileTimeStampFunc 10 1996 #define APP_DoYieldFunc 11 2005 #define APP_ReadIniStringFunc 12 2020 uint32_t bufferSizeInCharacters);
2023 #define APP_ReadIniDoubleFunc 13 2038 #define APP_ReadIniIntFunc 14 2053 #define APP_DispRunInfoAndWaitFunc 15 2066 uint32_t editorLine,
2069 int32_t bNoBreakpoints,
2070 int32_t bForceToWait,
2071 const double *params,
2072 const uint32_t maxParams);
2075 #define APP_DispRunInfoFunc 16 2085 uint32_t editorLine,
2091 #define APP_IsBreakpointFunc 17 2100 uint32_t editorLine,
2104 #define APP_DispAndLocateErrorFunc 18 2117 uint32_t editorLine,
2123 #define APP_DispLastInfoFunc 19 2131 #define APP_IsStepModeFunc 20 2138 #define APP_IsHandControlFunc 21 2145 #define APP_SetRegimeFromUserKeyFunc 22 2153 #define APP_ExecMenuCommandFromUserKeyFunc 23 2162 #define APP_MaxFuncNumber 1000 2166 #define DRV_InitializeFunc 1001 2182 #define DRV_GFunc 1002 2190 #define DRV_MFunc 1003 2198 #define ConnectPointCalcStartFuncNumber 1004 2210 const int32_t nType,
2211 const uint32_t nCoords,
2212 const double *coords,
2213 const uint32_t bitCodedAxesForCalc);
2216 #define ConnectPointCalcFunc_UseReturnValues 1 2219 #define ConnectPointCalcFuncNumber 1005 2242 double *calcSquareDistanceFromCoords,
2246 #define ConnectPointCalcEndFuncNumber 1006 2264 #define DRV_MaxFuncNumber 2000 2267 #define MATH_WarningFunc 2001 2277 #define MATH_MaxFuncNumber 3000 // last function in DRV group 2304 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_INIT(
DLL_INIT_STRUCT *pInitValues);
2334 int32_t *pnMaxCores);
2335 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_LOADFROMINI(int32_t intIdx,
2337 int32_t *pnMaxCores);
2345 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_DESTROYCNC(int32_t intIdx);
2361 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_SETGCODEPARAMETERS(int32_t intIdx,
2374 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETGCODEPARAMETERS(int32_t intIdx,
2412 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_STATUSCNC(int32_t intIdx);
2434 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETPOS(int32_t intIdx,
2453 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_COMPILEFROMFILE(int32_t intIdx,
2473 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_COMPILEFROMMEMORY(int32_t intIdx,
2481 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_ISBUSY(int32_t intIdx);
2509 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_STARTCNCEX(int32_t intIdx,
2533 const uint32_t nCoords,
2534 const double *coords);
2535 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_RESETCNC(int32_t intIdx,
2537 const uint32_t nCoords,
2538 const double *coords);
2557 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_STOPCNCEX(int32_t intIdx,
TGM_LPCSTR strAddCode);
2611 const uint32_t nCoords,
2612 const double *coords,
2614 uint32_t bitCodedAxesForCalc,
2615 uint32_t bitCodedAxesForConnect,
2616 int32_t trajectoryStateAfterConnect);
2617 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_CONNECTCNCEX_PLANE(int32_t intIdx,
2619 const uint32_t nCoords,
2620 const double *coords,
2622 uint32_t bitCodedAxesForCalc,
2623 uint32_t bitCodedAxesForConnect,
2624 int32_t trajectoryStateAfterConnect);
2640 const uint32_t nCoords,
2641 const double *coords);
2642 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GOTOPOSITION(int32_t intIdx,
2643 const uint32_t nCoords,
2644 const double *coords);
2667 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GOTOPOSITIONEX(int32_t intIdx,
2685 int32_t bDirectToPLC);
2686 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_MFUNC(int32_t intIdx,
2688 int32_t bDirectToPLC);
2705 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_FILETOIDX(int32_t intIdx,
2720 typedef TGM_LPCTSTR TOOLCHAIN_CALLTYPE TOOLCHAINCORE_IDXTOFILE(int32_t intIdx,
2734 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_SETRELFEED(int32_t intIdx,
2756 intptr_t dwUserData,
2758 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_SETCALLBACK(int32_t intIdx,
2760 intptr_t dwUserData,
2780 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETLASTERROR(int32_t intIdx,
2795 uint32_t editorLine,
2797 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_SETBREAKPOINT(int32_t intIdx,
2798 uint32_t editorLine,
2813 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETGCODESIZEINFO(int32_t intIdx,
2835 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETSTRUCTURESSIZE(int32_t intIdx,
2844 typedef TGM_LPCTSTR TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETVERSIONSTRING(int32_t intIdx);
2859 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_GETMACHINEPARAMETERS(int32_t intIdx,
2876 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_SETMACHINEPARAMETERS(int32_t intIdx,
2879 #define CNC_CALC_LOAD_ALL 0 2880 #define CNC_CALC_LOAD_DLL_ONLY 1 2881 #define CNC_CALC_LOAD_TGM_ONLY 2 2921 typedef int32_t TOOLCHAIN_CALLTYPE TOOLCHAINCORE_LOADCNCCALCPLUGIN(
TGM_LPCTSTR fileName, uint32_t loadFlags, int64_t userValue);
2948 #define TGM_COM_CALLTYPE 2950 #define TGM_COM_CALLTYPE __cdecl 2955 # if !defined(_UNICODE) 2956 # error "_UNICODE must be defined for WIN32" 2959 typedef const wchar_t * CNC_CONST_STRING;
2965 typedef const char * CNC_CONST_STRING;
2975 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_I32(uint32_t memoryType, uint32_t offset, int32_t *pValue);
2976 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_I64(uint32_t memoryType, uint32_t offset, int64_t *pValue);
2977 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_double(uint32_t memoryType, uint32_t offset,
double *pValue);
2978 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_BLOCK(uint32_t memoryType, uint32_t offset,
void *buffer, uint32_t bufferLength);
2979 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_I32(uint32_t memoryType, uint32_t offset, int32_t Value);
2980 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_I64(uint32_t memoryType, uint32_t offset, int64_t Value);
2981 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_double(uint32_t memoryType, uint32_t offset,
double Value);
2982 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_BLOCK(uint32_t memoryType, uint32_t offset,
const void *buffer, uint32_t bufferLength);
2983 typedef int32_t TGM_COM_CALLTYPE TGM_COM_SET_BIT_I32(uint32_t memoryType, uint32_t offset, int32_t Value);
2984 typedef int32_t TGM_COM_CALLTYPE TGM_COM_SET_BIT_I64(uint32_t memoryType, uint32_t offset, int64_t Value);
2985 typedef int32_t TGM_COM_CALLTYPE TGM_COM_CLR_BIT_I32(uint32_t memoryType, uint32_t offset, int32_t Value);
2986 typedef int32_t TGM_COM_CALLTYPE TGM_COM_CLR_BIT_I64(uint32_t memoryType, uint32_t offset, int64_t Value);
2987 typedef int32_t TGM_COM_CALLTYPE TGM_COM_TGL_BIT_I32(uint32_t memoryType, uint32_t offset, int32_t Value);
2988 typedef int32_t TGM_COM_CALLTYPE TGM_COM_TGL_BIT_I64(uint32_t memoryType, uint32_t offset, int64_t Value);
2989 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_I32_DIRECT(uint32_t memoryType, uint32_t offset, int32_t *pValue);
2990 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_I64_DIRECT(uint32_t memoryType, uint32_t offset, int64_t *pValue);
2991 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_double_DIRECT(uint32_t memoryType, uint32_t offset,
double *pValue);
2992 typedef int32_t TGM_COM_CALLTYPE TGM_COM_READ_BLOCK_DIRECT(uint32_t memoryType, uint32_t offset,
void *buffer, uint32_t bufferLength);
2993 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_I32_DIRECT(uint32_t memoryType, uint32_t offset, int32_t Value);
2994 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_I64_DIRECT(uint32_t memoryType, uint32_t offset, int64_t Value);
2995 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_double_DIRECT(uint32_t memoryType, uint32_t offset,
double Value);
2996 typedef int32_t TGM_COM_CALLTYPE TGM_COM_WRITE_BLOCK_DIRECT(uint32_t memoryType, uint32_t offset,
const void *buffer, uint32_t bufferLength);
2997 typedef int32_t TGM_COM_CALLTYPE TGM_COM_SET_BIT_I32_DIRECT(uint32_t memoryType, uint32_t offset, int32_t Value);
2998 typedef int32_t TGM_COM_CALLTYPE TGM_COM_SET_BIT_I64_DIRECT(uint32_t memoryType, uint32_t offset, int64_t Value);
2999 typedef int32_t TGM_COM_CALLTYPE TGM_COM_CLR_BIT_I32_DIRECT(uint32_t memoryType, uint32_t offset, int32_t Value);
3000 typedef int32_t TGM_COM_CALLTYPE TGM_COM_CLR_BIT_I64_DIRECT(uint32_t memoryType, uint32_t offset, int64_t Value);
3001 typedef int32_t TGM_COM_CALLTYPE TGM_COM_TGL_BIT_I32_DIRECT(uint32_t memoryType, uint32_t offset, int32_t Value);
3002 typedef int32_t TGM_COM_CALLTYPE TGM_COM_TGL_BIT_I64_DIRECT(uint32_t memoryType, uint32_t offset, int64_t Value);
3003 typedef int32_t TGM_COM_CALLTYPE TGM_COM_FLUSH_BUFFER();
3005 typedef int32_t TGM_COM_CALLTYPE TGM_RTWPRINTF_EX(int32_t severity, CNC_CONST_STRING strFormat, ...);
3014 TGM_COM_READ_I32 *pReadI32;
3015 TGM_COM_READ_I64 *pReadI64;
3016 TGM_COM_READ_double *pReadDouble;
3017 TGM_COM_READ_BLOCK *pReadBlock;
3018 TGM_COM_WRITE_I32 *pWriteI32;
3019 TGM_COM_WRITE_I64 *pWriteI64;
3020 TGM_COM_WRITE_double *pWriteDouble;
3021 TGM_COM_WRITE_BLOCK *pWriteBlock;
3022 TGM_COM_SET_BIT_I32 *pSetBitI32;
3023 TGM_COM_SET_BIT_I64 *pSetBitI64;
3024 TGM_COM_CLR_BIT_I32 *pClrBitI32;
3025 TGM_COM_CLR_BIT_I64 *pClrBitI64;
3026 TGM_COM_TGL_BIT_I32 *pTglBitI32;
3027 TGM_COM_TGL_BIT_I64 *pTglBitI64;
3028 TGM_COM_READ_I32_DIRECT *pReadI32Direct;
3029 TGM_COM_READ_I64_DIRECT *pReadI64Direct;
3030 TGM_COM_READ_double_DIRECT *pReadDoubleDirect;
3031 TGM_COM_READ_BLOCK_DIRECT *pReadBlockDirect;
3032 TGM_COM_WRITE_I32_DIRECT *pWriteI32Direct;
3033 TGM_COM_WRITE_I64_DIRECT *pWriteI64Direct;
3034 TGM_COM_WRITE_double_DIRECT *pWriteDoubleDirect;
3035 TGM_COM_WRITE_BLOCK_DIRECT *pWriteBlockDirect;
3036 TGM_COM_SET_BIT_I32_DIRECT *pSetBitI32Direct;
3037 TGM_COM_SET_BIT_I64_DIRECT *pSetBitI64Direct;
3038 TGM_COM_CLR_BIT_I32_DIRECT *pClrBitI32Direct;
3039 TGM_COM_CLR_BIT_I64_DIRECT *pClrBitI64Direct;
3040 TGM_COM_TGL_BIT_I32_DIRECT *pTglBitI32Direct;
3041 TGM_COM_TGL_BIT_I64_DIRECT *pTglBitI64Direct;
3042 TGM_COM_FLUSH_BUFFER *pFlushBuffer;
3043 TGM_RTWPRINTF_EX *pPrintf;
3052 #define CNC_CALC_MFUNC_OFFSET 10000 3054 #define CNC_CALC_DISABLE_AUTOMATIC_GCODEINDEX_UPDATE_BIT 0x01 3056 #define CNC_CALC_MAX_STATIC_RETURNED_PARTS 8 3070 uint32_t nEntriesInPart0;
3080 #define CNC_CALC_RETURN_ERROR (-1) 3083 #define CNC_CALC_RETURN_IGNORE 0 3086 #define CNC_CALC_RETURN_USE 1 3089 #define CNC_CALC_RETURN_OK 1 3092 #define CNC_CALC_RETURN_FEED_ONLY 2 3104 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_LOAD(
const CNC_CALC_INIT_DATA *pInitData);
3110 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_UNLOAD();
3112 #define CNC_CALC_IDX_INIT_DATA_STRUCT 0 3113 #define CNC_CALC_IDX_SIMPLE_GM_PARAMS_BASE_STRUCT 1 3114 #define CNC_CALC_IDX_RETURN_VALUE_STRUCT 2 3145 typedef uint32_t TOOLCHAIN_CALLTYPE CNC_CALC_GET_STRUCTURES_SIZE(uint32_t structureIdx);
3170 uint32_t *pID_MEMORY_COMPATIBILITY,
3171 uint32_t *pID_CNC_COMPATIBILITY);
3172 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_GET_COMPATIBILITY_IDS(uint32_t *pID_COMPATIBILITY,
3173 uint32_t *pID_MEMORY_COMPATIBILITY,
3174 uint32_t *pID_CNC_COMPATIBILITY);
3200 CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE
CNC_Calc_Start(uint32_t intIdx,
3204 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_START(uint32_t intIdx,
3306 CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE
CNC_Calc_GFunc(uint32_t intIdx,
3310 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_GFUNC(uint32_t intIdx,
3328 CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE
CNC_Calc_MFunc(uint32_t intIdx,
3332 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_MFUNC(uint32_t intIdx,
3342 CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE
CNC_Calc_Finish(uint32_t intIdx,
3346 typedef int32_t TOOLCHAIN_CALLTYPE CNC_CALC_FINISH(uint32_t intIdx,
3359 #define G_FUNC_SETTINGS 900 3361 #define G_FUNC_SETTINGS_PUSH 1 3362 #define G_FUNC_SETTINGS_POP 2 3363 #define G_FUNC_SETTINGS_SET_AXIS_LIMITS 7 3364 #define G_FUNC_SETTINGS_SET_MUTUAL_ANGLES 9 3365 #define G_FUNC_SETTINGS_ENA_MUTUAL_ANGLES 10 3366 #define G_FUNC_SETTINGS_ENA_FEED_CALC 11 3367 #define G_FUNC_SETTINGS_SET_ANGLE_MODE 12 3368 #define G_FUNC_SETTINGS_IGNORE_ARC_FEED_TBL 13 3369 #define G_FUNC_SETTINGS_FEED_G00 20 3370 #define G_FUNC_SETTINGS_FEED_FORWARD 30 3371 #define G_FUNC_SETTINGS_FEED_FORWARD_NO_M 31 3372 #define G_FUNC_SETTINGS_FEED_BACKWARD 32 3373 #define G_FUNC_SETTINGS_FEED_CONNECT 40 3374 #define G_FUNC_SETTINGS_FEED_GOTO 50 3375 #define G_FUNC_SETTINGS_FEED_NORMAL_STOP 60 3376 #define G_FUNC_SETTINGS_FEED_EMERGENCY_STOP 70 3744 # pragma GCC diagnostic pop 3746 # pragma warning(pop) 3750 #endif // TGM_CNC_H_FILE_INCLUDED CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_Unload()
Plug-in DLL cleanup.
int32_t CALLBACK_CALLTYPE DriverMFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v)
Called to simulate M function.
P10DOUBLE(bool bNoInit)
no init contructor - members will be initialized afterwards, use with care
uint32_t timeout
timeout pro cekaci M funkci
P10DOUBLE m_zero
actual zero offset (G54 - G57)
Definition of default feeds.
P10DOUBLE m_e
absolute end position (original)
P10DOUBLE m_e
absolute end position (original)
#define _countof(array)
determine number of elements in an array (not bytes)
TGM_LPCTSTR CALLBACK_CALLTYPE GetSystemPathFunc(intptr_t dwUserData)
Returns path to system files. Not yet used by CNC module.
int32_t reserved2
reserved
uint32_t fileIdx
index souboru
P10DOUBLE m_startPos
Initial position.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_CompileFromMemory(int32_t intIdx, TGM_LPCTSTR fileName, TGM_LPCSTR mainCode)
Compiles G-code from string in memory.
double m_actPartRemain
remaining length of section in progress (changes continuously)
Initialization structure. Used by ToolChainCore_Init.
P10BOOL & operator=(const P10BOOL &n)
Assignment operator.
uint32_t nDynamicEntriesInPart1
number of entries in the dParts1 array
int32_t M04_startSpindleCCW
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetMachineParameters(int32_t intIdx, MACHINE_PARAMETERS *pParameters)
Returns actual values of MACHINE_PARAMETERS.
const char * TGM_LPCSTR
explicit const UTF-8 (8bit ANSI) string type
int32_t mFunc
No. of M function or 0 (if 0 not used)
Extended actual parameters.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_ConnectCNCEx_Plane(int32_t intIdx, int32_t nType, const uint32_t nCoords, const double *coords, TGM_LPCSTR strAddCode, uint32_t bitCodedAxesForCalc, uint32_t bitCodedAxesForConnect, int32_t trajectoryStateAfterConnect)
Move to the nearest point of trajectory of G-code with possibility of M function insertion after the ...
-2: remote device not connected (TGMmini, TGM_REMOTE)
#define START_CNC_CALCULATING
Internal calculations are performed. No movement.
TOOLCHAIN_DLL_EXPORT TGM_LPCTSTR TOOLCHAIN_CALLTYPE ToolChainCore_IdxToFile(int32_t intIdx, int32_t fileIdx)
Returns the complete filename of file with relevant number (index).
int32_t CALLBACK_CALLTYPE ConnectPointCalcStartFunc(intptr_t dwUserData, const int32_t nType, const uint32_t nCoords, const double *coords, const uint32_t bitCodedAxesForCalc)
Initiate user connection calculation.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetGCodeSizeInfo(int32_t intIdx, GCODE_INFO *pInfo)
Identifies size (dimension) of G-code.
#define INVALID_VALUE
this "nonsense" value is used for not used G-code addresses.
TGM_LPCTSTR CALLBACK_CALLTYPE GetToolPathFunc(intptr_t dwUserData)
Returns path to files describing tools geometry. Only for lathe.
-21: Test broken by ToolChainCore_StopCNCEx
float m_fp
actual value of FP address (percent of F), usually 1.0
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetPos(int32_t intIdx, int32_t regime, SIMPLE_GM_PARAMS_WIN32 *pos, GM_PARAMS_ENHANCED *enhParams)
Returns current position of machine axes together with additonal informations.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_LoadFromIni(int32_t intIdx, TGM_LPCTSTR iniFile, int32_t *pnMaxCores)
Loads DLL chain from INI file.
int32_t CALLBACK_CALLTYPE SetRegimeFromUserKeyFunc(intptr_t dwUserData, int32_t key)
Reserved.
int32_t m_nG00Counter
counter of fastfeeds (G0)
double size
Size of correction (tool radius) for gCode correction, if negative, the meanings of G41/G42 are switc...
int32_t m_fileIdx
File index.
-33: Stop on trajectory by M0 function
int32_t CALLBACK_CALLTYPE IsDebugModeFunc(intptr_t dwUserData)
Ask if debug regime is enabled.
int32_t CALLBACK_CALLTYPE SetStatusBarTextFunc(intptr_t dwUserData, int32_t pane, TGM_LPCTSTR strText, CALLBACK_INFO *callBackInfo)
Display informational text in the status line of the application.
int32_t m_nWorkCounter
counter of cutting parts (G1, G2, G3)
double relFeed
<0.01;1.0>. Cannot be used for inserting M function before G00.
P10DOUBLE m_endPos
End position.
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_GFunc(uint32_t intIdx, const SIMPLE_GM_PARAMS_BASE *pGFunc, CNC_CALC_RETURN_VALUE *pChangedParts)
Called for any G function inside G-code.
#define MAX_FUNC_ADDRESSES
number of letters in alphabet, i.e. all the G-code addresses
-3: sending compiled G-code to TGMmini or TGM_REMOTE, percent progress in GCodeIndex ...
double dynamicG42Correction_mm
uint32_t m_editorLine
Line in G-code.
double maxFeed
Max allowed feed.
double dynamicG41Correction_mm
Initial position, end position and size.
const wchar_t * TGM_LPCTSTR
default const string type: Win UNICODE (16bit), Linux UTF-8 (8bit)
int32_t CALLBACK_CALLTYPE ReadIniIntFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, int32_t defValue)
Read integer value from .INI file.
Structure similar to P10DOUBLE, using integers. Its use is for setting additional flags to axes...
int32_t CALLBACK_CALLTYPE DoYieldFunc(intptr_t dwUserData, int32_t messageOnly)
Switch control to other thread. LOCAL_CORE_MODE_DLL only.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_FileToIdx(int32_t intIdx, TGM_LPCTSTR fileName)
Returns index number of the file with a given name. If the file name is new, it returns a new number...
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_StatusCNC(int32_t intIdx)
Actual CNC module state.
uint32_t m_reserved
Internal reseved value.
int32_t m_nMCounter
M functions counter.
double CALLBACK_CALLTYPE ReadIniDoubleFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, double defValue)
Read double value from .INI file.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_LoadCNCCalcPlugIn(TGM_LPCTSTR fileName, uint32_t loadFlags, int64_t userValue)
Load CNC Calc plugin (see CNC Calc plug-in exported functions)
-1234: Invalid nonsense value
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_MFunc(uint32_t intIdx, const SIMPLE_GM_PARAMS_BASE *pMFunc, CNC_CALC_RETURN_VALUE *pChangedParts)
Called for any M function inside G-code.
90: Extra connecion M functions are sending
double dec
deceleration, if negative then it is specified as time in [s]
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_IsBusy(int32_t intIdx)
Checks if the machine is executing G-code.
int32_t m_func
Number of G or M function.
int32_t m_speedPreference
strategie dosahovani rezne rychlosti
int32_t CALLBACK_CALLTYPE ConnectPointCalcEndFunc(intptr_t dwUserData, SIMPLE_GM_PARAMS_WIN32 *partToBeConnectedTo, P10DOUBLE *connectPosToBeMovedTo)
End of connection calculation.
int32_t CALLBACK_CALLTYPE DispRunInfoAndWaitFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx, TGM_LPCTSTR statusInfo, int32_t bNoBreakpoints, int32_t bForceToWait, const double *params, const uint32_t maxParams)
Display info about the actual G-code part.
void CopyFrom(const P10DOUBLE &n)
no-check copy
Auxiliary G-code functions use this structure.
double m_actPartLen
total length of section in progress (changes between sections)
#define ACTUAL_N_AXES
number of axes used in CNC module (currently 10)
40: Calculation of connection point
Describes one G-code part.
int32_t m_gCodeIndex
unique G-code part index
P10DOUBLE m_minimalPos
Minimum.
uint32_t correction
aktualni korekce
50: Out of trajectory movement (ToolChainCore_GoToPosition)
-32: End of trajectory, system stops
#define START_CNC_FORWARD_SKIP_FIRST_M
Start CNC module forward. The first M function is skipped, then continue like in regime 30...
double buvwao[6]
other axes (B, U, V, W, A, O)
P10DOUBLE & operator=(const P10DOUBLE &n)
Assignment operator.
int32_t CALLBACK_CALLTYPE FuncPrototype(intptr_t dwUserData)
Generic callback function prototype.
void SetAllToValue(double val)
set all members to given value
int32_t reserved2
reserved
P10DOUBLE m_calcE
absolute end position recalculated
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetLastError(int32_t intIdx, CALLBACK_INFO *pLastErrorInfo)
Returns the last error, if any.
int32_t disableG0FeedOverride
double acc
acceleration, if negative then it is specified as time in [s]
int32_t reserved1
reserved
uint32_t editorLine
cislo radku ve zdrojovem textu
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_Finish(uint32_t intIdx, const SIMPLE_GM_PARAMS_BASE *pFinishMFunc, CNC_CALC_RETURN_VALUE *pChangedParts)
Called as the last function of the G-code.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_MFunc(int32_t intIdx, const SIMPLE_GM_PARAMS_WIN32 &fun, int32_t bDirectToPLC)
Send M function directly to system.
int64_t CALLBACK_CALLTYPE GetFileTimeStampFunc(intptr_t dwUserData, uint32_t fileIdx)
returns time stamp of a given file (usually time in ms since epoch)
int32_t CALLBACK_CALLTYPE IsBreakpointFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx)
Determines if there is a breakpoint on given G-code file line.
int32_t gCodeIdx
cislo useku, pro specialni prikazy muze byt zaporne
double m_setFeed
Required feed in mm/min.
int32_t m_nG00ToWorkChanges
counter of transitions: fastfeed -> cutting part
Definition of corrections.
Values of inserted M functions.
double m_actWorkPartsLen
current total length of all cutting parts (G1, G2, G3) - (changes continuously during movement) ...
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetStructuresSize(int32_t intIdx, uint32_t nItems, uint32_t *items)
Returns bytes sizes of internal structures.
TGM_LPCTSTR CALLBACK_CALLTYPE GetLibPathFunc(intptr_t dwUserData)
Returns path to external G functions stored as G-code on the disk.
32: Backward movement on trajectory
int32_t CALLBACK_CALLTYPE MathWarningFunc(intptr_t dwUserData, CALLBACK_INFO *pCallbackInfo)
Called in case of warning issued during tool diameter compensation calculation.
wchar_t * TGM_LPTSTR
default string type: Win UNICODE (16bit), Linux UTF-8 (8bit)
int32_t M03_startSpindleCW
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GoToPositionEx(int32_t intIdx, const SIMPLE_GM_PARAMS_WIN32 *pDest)
Extended manual control.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_SetGCodeParameters(int32_t intIdx, const GCODE_PARAMETERS *params)
Sets parameters (properties) of G-code.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GoToPosition(int32_t intIdx, const uint32_t nCoords, const double *coords)
Manual control.
double xyzcbuvwao[10]
all axes as an array -> use in loops
-1: Compile finished (with success or error)
int32_t CALLBACK_CALLTYPE ConnectPointCalcFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *part, double *calcSquareDistanceFromCoords, P10DOUBLE *calcConnectPoint)
Calculate distance from initial tool point to a give G-code part.
P10DOUBLE m_calcE
absolute end position recalculated
double m_relFeed
relative feed
int32_t callbackWarningsInvokeMode
30: Normal forward movement on trajectory
One direct command to interpolator.
uint32_t m_reserved
Internal reseved value.
P10BOOL()
default constructor
P10DOUBLE backlash
Backlash in axes in mm.
P10DOUBLE m_s
absolute initial position (original) of type P10DOUBLE
10: Simulation is in progress
-11: Simulation broken by ToolChainCore_StopCNCEx
60: Internal calculation is in progress
P10DOUBLE m_maximalPos
Maximum.
-10: Simulation finished (OK or NOK)
P10BOOL(int32_t _x, int32_t _y, int32_t _z, int32_t _c, int32_t _b, int32_t _u, int32_t _v, int32_t _w, int32_t _a, int32_t _o)
constructor
int32_t gCode
Number of G function for correction (41, 42,...), not yet used.
void SetToZero()
explicitly set all the members to zero
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_SetBreakpoint(int32_t intIdx, uint32_t editorLine, int32_t fileIdx)
Set breakpoint in the G-code.
TGM_LPCTSTR Macros_Dir
path to CNC macros (external G and M functions written in G-code)
int32_t CALLBACK_CALLTYPE DispLastInfoFunc(intptr_t dwUserData)
Called when G-code execution finished (OK and NOK)
TGM_LPCTSTR Comm_Int2_Dir
path to communication library
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_StartCNCEx(int32_t intIdx, int32_t regime, TGM_LPCSTR strAddGCode)
Start or continue G-code.
int32_t backlashValuesSource
double m_actG00PartsLen
current total length of all fastfeeds (G0) - (changes continuously within fastfeed) ...
P10DOUBLE minCoords
Minimal allowed coordinates.
#define START_CNC_FORWARD
Start CNC module forward (normal and most used mode)
Structure for setting G-code properties.
double feed
rychlost pohybu
SIMPLE_GM_PARAMS_BASE * dParts1
pointer to user given array for modified parts. The plug-in is responsible of freeing memory (if need...
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_SetCallBack(int32_t intIdx, int32_t fceNo, intptr_t dwUserData, FuncPrototype *funcPtr)
Sets callback function.
P10DOUBLE(double xVal, double yVal, double zVal, double cVal, double bVal=0.0, double uVal=0.0, double vVal=0.0, double wVal=0.0, double aVal=0.0, double oVal=0.0)
constructor
P10DOUBLE m_calcS
absolute initial position recalculated (tool size compensation) or actual position (ToolChainCore_Get...
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_Start(uint32_t intIdx, int32_t regime, const SIMPLE_GM_PARAMS_BASE *pInitPos, CNC_CALC_RETURN_VALUE *pChangedParts)
Called before the G-code execution.
double maxConnectionDistance
float m_pars[MAX_FUNC_ADDRESSES]
the G-code or value is > 1e38 (address not included in the G-code function)
1: Compile is in progress
int32_t CALLBACK_CALLTYPE IsHandControlFunc(intptr_t dwUserData)
Ask if application is in hand control (service mode). Not yet used.
int32_t m_MasterFileIdx
master file index
uint32_t nCoords
pocet platnych souradnic v coords
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_SetRelFeed(int32_t intIdx, double relFeed)
Sets the feed override (relative speed).
80: Extra final M function are sending
double dynamicG42Correction_percent
int32_t CALLBACK_CALLTYPE DriverInitializeFunc(intptr_t dwUserData, double *params, uint32_t nParams, int32_t bTestMode)
Called always before G-code execution.
int32_t rampType
type of ramp: 1 - trapezoid, 2 - sin
int32_t correctionStrategy
int32_t interpolatorConfig0
31: Forward movement without M functions (which are skipped)
uint32_t nFunc
command number:
double m_actPartsLen
current total length of motion sections (i.e. all G funcs without waiting M funcs) ...
double insertArcToleranceRMax
P10DOUBLE m_s
absolute initial position (original) of type P10DOUBLE
int32_t CALLBACK_CALLTYPE DispAndLocateErrorFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx, TGM_LPCTSTR errString, CALLBACK_INFO *callBackInfo)
This function is called in case of an error.
void CALLBACK_CALLTYPE ReadIniStringFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, TGM_LPCTSTR defValue, TGM_LPTSTR buffer, uint32_t bufferSizeInCharacters)
Read string from .INI file.
Structure for transmitting information for the function ToolChainCore_GetLastError and for the callba...
-50: System is stopped and positioned out of trajectory
This structure defines 10 coordinates of double type (8 bytes)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_CompileFromFile(int32_t intIdx, TGM_LPCTSTR fileName)
Compiles G-code from file.
TOOLCHAIN_DLL_EXPORT TGM_LPCTSTR TOOLCHAIN_CALLTYPE ToolChainCore_GetVersionString(int32_t intIdx)
Returns the DLLs version number and the date and time of compilation.
int32_t CALLBACK_CALLTYPE IsStepModeFunc(intptr_t dwUserData)
Ask if execute G-code step by step (part by part). Not yet used.
70: Extra initial M functions are sending
Initialization structure.
double maxDec
Max allowed deceleration.
int32_t CALLBACK_CALLTYPE DispRunInfoFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx, TGM_LPCTSTR statusInfo, const SIMPLE_GM_PARAMS_WIN32 *pCmd)
Display info about the actual G-code part.
int32_t CALLBACK_CALLTYPE DriverGFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v)
Called to simulate G function.
CNC_CALC_DLL_EXPORT uint32_t TOOLCHAIN_CALLTYPE CNC_Calc_Get_Structures_Size(uint32_t structureIdx)
Check structure sizes - test for compatibility.
P10BOOL(const P10BOOL &n)
copy constructor
int32_t CALLBACK_CALLTYPE ExecMenuCommandFromUserKeyFunc(intptr_t dwUserData, int key)
Reserved.
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_DestroyCNC(int32_t intIdx)
Finishes work with DLLs and frees all the alloctaed memry.
-20: Test finished (OK or NOK)
P10BOOL enableMask
Mask to enable testing of limits for individual axes.
double centripetalAcc
Maximum allowed centripetal acceleration for arcs (not yet implemented)
P10DOUBLE(const P10DOUBLE &n)
copy constructor
double m_calcFeed
Calculated feed in mm/min.
P10DOUBLE m_calcS
absolute initial position recalculated (tool size compensation)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_GetGCodeParameters(int32_t intIdx, GCODE_PARAMETERS *params)
Obtains values set with ToolChainCore_SetGCodeParameters, or read from .INI file during startup...
no axis is specified (marker for all axes)
P10DOUBLE refCoords
Reference point for min max coords.
connect_type
Connection modes (ToolChainCore_ConnectCNCEx_Plane)
uint32_t m_editorLine
text row in the soyrce file
cnc_status
StatusCNC return codes.
#define START_CNC_SIMULATION
Available CNC module regimes:
P10DOUBLE backlashInc
Backlash change in mm per 100us.
#define CNC_CALC_MAX_STATIC_RETURNED_PARTS
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_Get_Compatibility_IDs(uint32_t *pID_COMPATIBILITY, uint32_t *pID_MEMORY_COMPATIBILITY, uint32_t *pID_CNC_COMPATIBILITY)
Returns compatibility numbers at the time of plug-in build.
double m_cncRunTime
G-code runtime.
Describes one G-code part.
#define START_CNC_FORWARD_NO_MFUNC
Start CNC module forward, but all the M functions are ignored (skipped)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_SetMachineParameters(int32_t intIdx, const MACHINE_PARAMETERS *pParameters)
Sets new values of MACHINE_PARAMETERS.
int32_t m_nWorkToG00Changes
counter of transitions: cutting part -> fastfeed
int32_t m_fileIdx
File index.
uint32_t structSize
CNC_Calc_Load() function should check this value.
int32_t m_statusCNC
copy of statusCNC, i.e. ToolChainCore_StatusCNC() function
double c
Axis C (e.g. turntable or parting machine)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_ResetCNC(int32_t intIdx, int32_t regime, const uint32_t nCoords, const double *coords)
Sets the initial position for G-code.
int32_t c
Axis C (e.g. turntable or parting machine)
P10DOUBLE maxCoords
Maximal allowed coordinates.
int32_t disableAdditionalProgramFlowInfo
P4CIRCLE m_cc
arc centre (m_cc.x m_cc.y m_cc.z) and radius (in m_cc.c variable)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_Init(DLL_INIT_STRUCT *pInitValues)
Init the CNC module.
Table of speeds, relative arc speeds in relation to radius.
int32_t CALLBACK_CALLTYPE AddOutputLogFunc(intptr_t dwUserData, int32_t tab, TGM_LPCTSTR info, CALLBACK_INFO *callBackInfo)
Writes text to output log.
double m_relFeed
Feed override(0.5 = 50%, 1.0 = 100%, etc.)
P10DOUBLE()
default constructor - zero all the members
double maxAcc
Max allowed acceleration.
-30: System is on start of trajectory
uint32_t feedTypeToolNumber
typ posuvu (ve spodnich 8 bitech)
uint32_t m_editorLine
Line in G-code.
uint32_t m_MasterEditorLine
actual line in master file
#define START_CNC_BACKWARD
Start CNC module in backward direction. The backward movement buffer is limited to 1000 parts...
#define GCODE_ALLOWED_CIRC_CENTER_ACCURACY
TGM_LPCTSTR CNC_Dll_Dir
path to the directory with CNC libraries (.dll or .so)
TOOLCHAIN_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE ToolChainCore_StopCNCEx(int32_t intIdx, TGM_LPCSTR strAddCode)
Stops motion or connecting (break).
float m_fp
actual value of FP address (percent of F), usually 1.0
int32_t funcNumber
M function number.
int32_t m_fileIdx
index to file, can be negative (special file numbers)
#define CALLBACK_CALLTYPE
Callbacks uses the same calling convention as exported functions.
int32_t CALLBACK_CALLTYPE IsVerboseModeFunc(intptr_t dwUserData)
Ask if verbose regime is enabled.
41: Movement to connection point is in progress
double insertArcToleranceRMin
#define START_CNC_TEST
Start CNC module in test mode (for the time being identical to simulation mode)
double m_actFeed
Current speed (m_calcFeed * m_relFeed)
CNC_CALC_DLL_EXPORT int32_t TOOLCHAIN_CALLTYPE CNC_Calc_Load(const CNC_CALC_INIT_DATA *pInitData)
Plug-in DLL initialization.
P10DOUBLE m_cc
arc centre (m_cc.x m_cc.y m_cc.z) and radius (in m_cc.c variable), other m_cc variables not yet used ...
0: Initial state, no G-code loaded
axis_idx
Axes numbers, together with special axis types. Assignment of the axes to array indexes is fixed...
Holds changed G-code parts.