![]() |
TG Motion
version 502 - 4034/906 cnc 126
|
Typedefs | |
typedef int32_t | cnc::FuncPrototype(intptr_t dwUserData) |
Generic callback function prototype. | |
typedef int32_t | cnc::AddOutputLogFunc(intptr_t dwUserData, uint32_t tab, TGM_LPCTSTR info, CALLBACK_INFO *callBackInfo) |
Writes text to output log. More... | |
typedef int32_t | cnc::SetStatusBarTextFunc(intptr_t dwUserData, uint32_t pane, TGM_LPCTSTR strText, CALLBACK_INFO *callBackInfo) |
Display informational text in the status line of the application. More... | |
typedef int32_t | cnc::IsDebugModeFunc(intptr_t dwUserData) |
Ask if debug regime is enabled. More... | |
typedef int32_t | cnc::IsVerboseModeFunc(intptr_t dwUserData) |
Ask if verbose regime is enabled. More... | |
typedef TGM_LPCTSTR | cnc::GetLibPathFunc(intptr_t dwUserData) |
Returns path to external G functions stored as G-code on the disk. More... | |
typedef TGM_LPCTSTR | cnc::GetToolPathFunc(intptr_t dwUserData) |
Returns path to files describing tools geometry. Only for lathe. More... | |
typedef TGM_LPCTSTR | cnc::GetSystemPathFunc(intptr_t dwUserData) |
Returns path to system files. Not yet used by CNC module. More... | |
typedef int64_t | cnc::GetFileTimeStampFunc(intptr_t dwUserData, int32_t fileIdx) |
returns time stamp of a given file (usually time in ms since epoch) More... | |
typedef int32_t | cnc::DoYieldFunc(intptr_t dwUserData, int32_t messageOnly) |
Switch control to other thread. LOCAL_CORE_MODE_DLL only. More... | |
typedef void | cnc::ReadIniStringFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, TGM_LPCTSTR defValue, TGM_LPTSTR buffer, uint32_t bufferSizeInCharacters) |
Read string from .INI file. More... | |
typedef float64_t | cnc::ReadIniDoubleFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, float64_t defValue) |
Read float64_t value from .INI file. More... | |
typedef int32_t | cnc::ReadIniIntFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, int32_t defValue) |
Read integer value from .INI file. More... | |
typedef int32_t | cnc::IsBreakpointFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx) |
Determines if there is a breakpoint on given G-code file line. More... | |
typedef int32_t | cnc::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. More... | |
typedef void | cnc::DispRunInfoFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *pCmd) |
typedef int32_t | cnc::AddOutputLogWithMsgBoxFunc(intptr_t dwUserData, uint32_t tab, uint32_t buttons, TGM_LPCTSTR info, CALLBACK_INFO *callBackInfo) |
Writes text to output log and optionally displays it in message box dialog panel (OS dependent) More... | |
typedef int32_t | cnc::SetStatusBarProgressFunc(intptr_t dwUserData, uint32_t progress) |
Display progress bar. More... | |
typedef int32_t | cnc::DriverInitializeFunc(intptr_t dwUserData, float64_t *params, uint32_t nParams, cnc_status nRunMode) |
Called always before G-code execution. More... | |
typedef int32_t | cnc::DriverGFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v) |
Called to simulate G function. More... | |
typedef int32_t | cnc::DriverMFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v) |
Called to simulate M function. More... | |
typedef int32_t | cnc::ConnectPointCalcStartFunc(intptr_t dwUserData, const uint32_t nType, const uint32_t nCoords, const float64_t *coords, const uint32_t bitCodedAxesForCalc) |
Initiate user connection calculation. More... | |
typedef int32_t | cnc::ConnectPointCalcFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *part, float64_t *calcSquareDistanceFromCoords, P10DOUBLE *calcConnectPoint) |
Calculate distance from initial tool point to a give G-code part. More... | |
typedef int32_t | cnc::ConnectPointCalcEndFunc(intptr_t dwUserData, SIMPLE_GM_PARAMS_WIN32 *partToBeConnectedTo, P10DOUBLE *connectPosToBeMovedTo) |
End of connection calculation. More... | |
typedef int32_t | cnc::DriverEnd(intptr_t dwUserData) |
Called when the G-code simulation finishes. More... | |
typedef int32_t | cnc::MathWarningFunc(intptr_t dwUserData, CALLBACK_INFO *pCallbackInfo) |
Called in case of warning issued during tool diameter compensation calculation. More... | |
Variables | |
constexpr uint32_t | cnc::DEVICE_ERROR_OUT_TAB { 0U } |
add log message to specific log window if possible | |
constexpr uint32_t | cnc::CNC_OUT_TAB { 1U } |
add log message to specific log window if possible | |
constexpr uint32_t | cnc::M29_OUT_TAB { 2U } |
add log message to specific log window if possible | |
constexpr uint32_t | cnc::STATUS_LINE_ONLY { 3U } |
add log message to specific log window if possible | |
constexpr uint32_t | cnc::ACTIVATE_TAB { 0x100U } |
activate the selected tab | |
constexpr uint32_t | cnc::PREFIX_TIME { 0x200U } |
prefix the message with time | |
constexpr uint32_t | cnc::APP_AddOutputLogFunc { 1U } |
callback index number | |
constexpr uint32_t | cnc::APP_SetStatusBarTextFunc { 2U } |
callback index number | |
constexpr uint32_t | cnc::APP_IsDebugModeFunc { 3U } |
callback index number | |
constexpr uint32_t | cnc::APP_IsVerboseModeFunc { 4U } |
callback index number | |
constexpr uint32_t | cnc::APP_GetLibPathFunc { 5U } |
callback index number | |
constexpr uint32_t | cnc::APP_GetToolPathFunc { 6U } |
callback index number | |
constexpr uint32_t | cnc::APP_GetSystemPathFunc { 7U } |
callback index number | |
constexpr uint32_t | cnc::APP_GetFileTimeStampFunc { 10U } |
callback index number | |
constexpr uint32_t | cnc::APP_DoYieldFunc { 11U } |
callback index number | |
constexpr uint32_t | cnc::APP_ReadIniStringFunc { 12U } |
callback index number | |
constexpr uint32_t | cnc::APP_ReadIniDoubleFunc { 13U } |
callback index number | |
constexpr uint32_t | cnc::APP_ReadIniIntFunc { 14U } |
callback index number | |
constexpr uint32_t | cnc::APP_IsBreakpointFunc { 17U } |
callback index number | |
constexpr uint32_t | cnc::APP_DispAndLocateErrorFunc { 18U } |
callback index number | |
constexpr uint32_t | cnc::APP_DispRunInfo { 19U } |
constexpr uint32_t | cnc::APP_SetStatusBarProgressFunc { 32U } |
callback index number | |
constexpr uint32_t | cnc::APP_MaxFuncNumber { 1000U } |
last function in APP group | |
constexpr uint32_t | cnc::DRV_InitializeFunc { 1001U } |
callback index number | |
constexpr uint32_t | cnc::DRV_GFunc { 1002U } |
callback index number | |
constexpr uint32_t | cnc::DRV_MFunc { 1003U } |
callback index number | |
constexpr uint32_t | cnc::ConnectPointCalcStartFuncNumber { 1004U } |
callback index number | |
constexpr uint32_t | cnc::ConnectPointCalcFunc_UseReturnValues { 1U } |
Return value of ConnectPointCalcFunc or ConnectPointCalcEndFunc values are used. | |
constexpr uint32_t | cnc::ConnectPointCalcFuncNumber { 1005U } |
callback index number | |
constexpr uint32_t | cnc::ConnectPointCalcEndFuncNumber { 1006U } |
callback index number | |
constexpr uint32_t | cnc::DRV_End { 1007U } |
callback index number | |
typedef int32_t cnc::AddOutputLogFunc(intptr_t dwUserData, uint32_t tab, TGM_LPCTSTR info, CALLBACK_INFO *callBackInfo) |
Writes text to output log.
dwUserData | User data given by ToolChainCore_SetCallBack function | ||||||||||||
tab | indicates severity of the text. Log output may be directed to:
| ||||||||||||
info | Text to be displayed | ||||||||||||
callBackInfo | Pointer to CALLBACK_INFO with additional text informations |
typedef int32_t cnc::AddOutputLogWithMsgBoxFunc(intptr_t dwUserData, uint32_t tab, uint32_t buttons, TGM_LPCTSTR info, CALLBACK_INFO *callBackInfo) |
Writes text to output log and optionally displays it in message box dialog panel (OS dependent)
dwUserData | User data given by ToolChainCore_SetCallBack function | ||||||||||||
tab | indicates severity of the text. Log output may be directed to:
| ||||||||||||
buttons | Windows MessageBox buttons constants (IDOK, IDCANCEL, etc...) | ||||||||||||
info | Text to be displayed | ||||||||||||
callBackInfo | Pointer to CALLBACK_INFO with additional text informations |
typedef int32_t cnc::ConnectPointCalcEndFunc(intptr_t dwUserData, SIMPLE_GM_PARAMS_WIN32 *partToBeConnectedTo, P10DOUBLE *connectPosToBeMovedTo) |
End of connection calculation.
The user application can e.g. store all the movement parts passed in the ConnectPointCalcFunc and calculate the final connection point and part during this callback.
dwUserData | User data given by ToolChainCore_SetCallBack function |
partToBeConnectedTo | Chosen part of the G-code where the connection shall proceed. The user application can modify this parameter and set to it any other valid part of the G-code. |
connectPosToBeMovedTo | Position where the tool should go. The point must be on the partToBeConnectedTo . |
Value | Description |
---|---|
0 | Returned values are ignored |
1 | The partToBeConnectedTo and connectPosToBeMovedTo contain valid values and will be used |
typedef int32_t cnc::ConnectPointCalcFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *part, float64_t *calcSquareDistanceFromCoords, P10DOUBLE *calcConnectPoint) |
Calculate distance from initial tool point to a give G-code part.
This callback is periodically called for all the move parts of the G-code (G0, G1, G2, G3). The user application can modify the values calculated by the system. This could be useful for machines with axes which form non-Cartesian space (e.g. some axes are linear, some are rotational).
dwUserData | User data given by ToolChainCore_SetCallBack function |
part | Actual part to be calculated. Input only. |
calcSquareDistanceFromCoords | The system calculates the squared distance from coords to part and gives it in the calcSquareDistanceFromCoords parameter. The callback function can modify this value and return it back. The value could be > 1e38, in that case the distance is larger than the threshold given in cnc::GCODE_PARAMETERS::maxConnectionDistance. |
calcConnectPoint | The system calculates the point on the part which would be the coordinates where the tool shall go to as a result of the connection (in the case the part is used as the connection part). The callback function can modify this parameter and return back different values. Only nCoords are valid. |
Value | Description |
---|---|
0 | Returned values are ignored |
1 | The calculatedDistanceFromCoords and calculatedCrossPoint contain valid values and will be used |
typedef int32_t cnc::ConnectPointCalcStartFunc(intptr_t dwUserData, const uint32_t nType, const uint32_t nCoords, const float64_t *coords, const uint32_t bitCodedAxesForCalc) |
Initiate user connection calculation.
This function is called at the start of connection calculation. It transfers the parameters given in the ToolChainCore_ConnectCNCEx_Plane function to the user application space.
nType | Connection type (see also enum cnc::connect_type). Only connectBY_COORD (0), connectBY_COORD_GO (10), connectBY_COORD_GO_BUFFERED(40) are used. |
dwUserData | User data given by ToolChainCore_SetCallBack function |
nCoords | Number of valid values in the coords parameter. Input only. |
coords | Coordinates of the point from which is the connection function calculated. It is a copy of coords parameter of the ToolChainCore_ConnectCNCEx_Plane function. Input only. |
bitCodedAxesForCalc | Copy of bitCodedAxesForCalc parameter of the ToolChainCore_ConnectCNCEx_Plane function. |
typedef int32_t cnc::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.
Set this callback very early during application startup, preferably before ToolChainCore_LoadFromIni function.
dwUserData | User data given by ToolChainCore_SetCallBack function |
editorLine | Line of text with error. Could be 0 for some type of errors. |
fileIdx | Index of the G-code file with the error. Could be negative for some type of errors. |
errString | Error text, always in English. Translations to other languages can be made with the help of information given in callBackInfo parameter |
callBackInfo | Pointer to CALLBACK_INFO with additional error information (error number, error arguments, etc...) |
typedef int32_t cnc::DoYieldFunc(intptr_t dwUserData, int32_t messageOnly) |
Switch control to other thread. LOCAL_CORE_MODE_DLL only.
dwUserData | User data given by ToolChainCore_SetCallBack function |
messageOnly | Can be -1 for all OS messages or a specific message (e.g. WM_TIMER in Windows) |
typedef int32_t cnc::DriverEnd(intptr_t dwUserData) |
Called when the G-code simulation finishes.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef int32_t cnc::DriverGFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v) |
Called to simulate G function.
dwUserData | User data given by ToolChainCore_SetCallBack function |
v | | Pointer to SIMPLE_GM_PARAMS_WIN32 with relevant actual G function information |
typedef int32_t cnc::DriverInitializeFunc(intptr_t dwUserData, float64_t *params, uint32_t nParams, cnc_status nRunMode) |
Called always before G-code execution.
In simulation or test mode (regimes 10 or 20), the driver callbacks are called. With help of these callbacks, complete simulation of G-code can be created in the application. The drive callbacks can be set after the call of ToolChainCore_LoadFromIni function.
dwUserData | User data given by ToolChainCore_SetCallBack function |
params | pointer to array of doubles to be filled with desired values |
nParams | Number of items in the array |
nRunMode | Actual run mode |
typedef int32_t cnc::DriverMFunc(intptr_t dwUserData, const SIMPLE_GM_PARAMS_WIN32 *v) |
Called to simulate M function.
dwUserData | User data given by ToolChainCore_SetCallBack function |
v | | Pointer to SIMPLE_GM_PARAMS_WIN32 with relevant actual M function information |
typedef int64_t cnc::GetFileTimeStampFunc(intptr_t dwUserData, int32_t fileIdx) |
returns time stamp of a given file (usually time in ms since epoch)
dwUserData | User data given by ToolChainCore_SetCallBack function |
fileIdx | Index of the file. File name and path must be taken by ToolChainCore_IdxToFile. |
typedef TGM_LPCTSTR cnc::GetLibPathFunc(intptr_t dwUserData) |
Returns path to external G functions stored as G-code on the disk.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef TGM_LPCTSTR cnc::GetSystemPathFunc(intptr_t dwUserData) |
Returns path to system files. Not yet used by CNC module.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef TGM_LPCTSTR cnc::GetToolPathFunc(intptr_t dwUserData) |
Returns path to files describing tools geometry. Only for lathe.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef int32_t cnc::IsBreakpointFunc(intptr_t dwUserData, uint32_t editorLine, int32_t fileIdx) |
Determines if there is a breakpoint on given G-code file line.
CNC system has built-in support for exactly one breakpoint. If there is a need for multiple breakpoints, this callback must be implemented.
dwUserData | User data given by ToolChainCore_SetCallBack function |
editorLine | Line to be checked |
fileIdx | File index of the G-code. File name can be get by ToolChainCore_IdxToFile. |
typedef int32_t cnc::IsDebugModeFunc(intptr_t dwUserData) |
Ask if debug regime is enabled.
Debug regime displays a lot of information to debug view (or terminal), produces helper files (results of compilation and G-code execution) and slow down the whole CNC module. Can be enabled also by .INI file.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef int32_t cnc::IsVerboseModeFunc(intptr_t dwUserData) |
Ask if verbose regime is enabled.
Verbose regime adds additional information to debug mode, displayed in debug output or terminal. Slows down the CNC module significantly (especially for large G-code files) Can be enabled also by .INI file.
dwUserData | User data given by ToolChainCore_SetCallBack function |
typedef int32_t cnc::MathWarningFunc(intptr_t dwUserData, CALLBACK_INFO *pCallbackInfo) |
Called in case of warning issued during tool diameter compensation calculation.
Depending on G-code, there could be very large number of calls of this function.
dwUserData | User data given by ToolChainCore_SetCallBack function |
pCallbackInfo | Pointer to CALLBACK_INFO with informations about the warning |
typedef float64_t cnc::ReadIniDoubleFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, float64_t defValue) |
Read float64_t value from .INI file.
Follows Windows .INI file syntax.
dwUserData | User data given by ToolChainCore_SetCallBack function |
section | File section (in square brackets) |
key | Key name (text in front of the equal sign) |
defValue | Default value if key not found |
typedef int32_t cnc::ReadIniIntFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, int32_t defValue) |
Read integer value from .INI file.
Follows Windows .INI file syntax.
dwUserData | User data given by ToolChainCore_SetCallBack function |
section | File section (in square brackets) |
key | Key name (text in front of the equal sign) |
defValue | Default value if key not found |
typedef void cnc::ReadIniStringFunc(intptr_t dwUserData, TGM_LPCTSTR section, TGM_LPCTSTR key, TGM_LPCTSTR defValue, TGM_LPTSTR buffer, uint32_t bufferSizeInCharacters) |
Read string from .INI file.
Follows Windows .INI file syntax.
dwUserData | User data given by ToolChainCore_SetCallBack function |
section | File section (in square brackets) |
key | Key name (text in front of the equal sign) |
defValue | Default text value if key not found |
buffer | buffer where to copy string from .INI file |
bufferSizeInCharacters | Size of the buffer in characters (not bytes) |
typedef int32_t cnc::SetStatusBarProgressFunc(intptr_t dwUserData, uint32_t progress) |
Display progress bar.
Called during long operations like compilation, etc.
dwUserData | User data given by ToolChainCore_SetCallBack function |
progress | Percentage value of the progress, in the range 0 - 100 |
typedef int32_t cnc::SetStatusBarTextFunc(intptr_t dwUserData, uint32_t pane, TGM_LPCTSTR strText, CALLBACK_INFO *callBackInfo) |
Display informational text in the status line of the application.
Called during long operations like compilation, etc.
dwUserData | User data given by ToolChainCore_SetCallBack function |
pane | reserved, use always 0 |
strText | Text to be displayed in a status line of the application |
callBackInfo | Pointer to CALLBACK_INFO with additional text information |