TG Motion  version 421 - 4033/904 cnc 121
Real-time system for controlling servo drives and I/O modules
TG Motion Documentation


TG Motion is universal control system. The system includes single-axis, multi-axis and CNC motion functions like:

  • point to point positioning
  • positioning to brand (indexing)
  • servomotors synchronization (electronic gearing)
  • electronic cam shaft
  • CNC interpolation
  • free programming

User can create motion and can control mechanisms like robots, manipulators, CNC machines, packaging machines, assembly machines, etc.

TG Motion runs on Windows with real-time extension or on aspecial ARM Linux computer called TGMmini.

Interface to user applications

TG Motion runs on dedicated processor core and communicates to the operating system through set of shared memories. Each user-accesible memory and its structure is documented in this manual.

Shared memories

Name Number Structure
TGM_Data 1 Flat memory for Virtual PLC
TGM_Cam_Profile 2 Flat memory for gearing
TGM_Oscilloscope 3 Stores oscilloscope data
InterpolatorWriteMemory 7 internally used by CNC module
InterpolatorReadMemory 8 internally used by CNC module
TGM_ODS 9 Serves for informational messages
TGM_CNCEX 10 Controls CNC module
TGM_GCODE 11 Stores compiled G-code
TGM_CNCEX_Local 12 local DLL memory used when CNC core runs in DLLs
TGM_CNCINI 13 copy of CNC .INI file
TGM_Universal 14 UNIVERSAL_MEMORY for general EtherCAT devices, etc.

CNC module

TG Motion includes up to 3 CNC modules (PC) or one CNC module (TGMmini). CNC module is controlled by G-code. Communication with this module is done by shared library called SF_TCh.dll (PC) or (TGMmini). The main functions exported by this library are listed here.

The system supports use of plug-in for dynamic G-code recalculation.

Sometimes the CNC module needs to communicate back to the application, for this a system of callback functions is used. This is used for displaying G-code paths, error and warning messages, etc. Callbacks are used only during simulation or test regimes.

List of main exported functions

Communication library

There is also a specialized library (TGM_Comm_Int_2.DLL on Windows or on Linux) which enables easy connection to all of these shared memories. The library functions and a complete C++ wrapper around this library is described in a class CTGM_COMM_INT_2.

Initialization functions

Informational functions

Access functions

Direct access functions

Helper function