TG Motion
version 421 - 4033/904 cnc 121
Real-time system for controlling servo drives and I/O modules
|
Main include file for TG Motion. Can be used as the only include for virtual PLC projects. More...
#include <stdint.h>
Go to the source code of this file.
Classes | |
struct | HEADER |
The HEADER struct - fixed size 128 bytes. More... | |
struct | MAIN |
The MAIN struct - fixed size of 4096 bytes. More... | |
struct | TIMERS |
Timers with fixed 1ms period. More... | |
struct | CHANNEL |
One oscilloscope channel definition. More... | |
struct | OSC |
Oscilloscope control. More... | |
struct | ECAT_DRIVER |
Describes which PCI device is ised as a EtherCAT device. More... | |
struct | EEPROM |
EEPROM simulation. More... | |
struct | SYSTEM |
Shared memory named "TGM_System". More... | |
struct | PG |
Profile generator. More... | |
struct | GEAR |
Gear generator. More... | |
struct | CAPTURE |
Capture position from servo. More... | |
struct | MAP_CNC |
Maps interpolator axe to servo drive. More... | |
struct | SDO |
SDO object communication. More... | |
struct | EXT_SDO |
Exteded SDO object communication (GENERAL_DEVICES only) More... | |
struct | ECAT_REGISTER |
EtherCAT registers communication. More... | |
struct | COMMAND |
Servo command. More... | |
struct | SERVO |
Describes one servo drive (or axis) More... | |
struct | DIO |
Describes one servo input/output module. More... | |
struct | UNIVERSAL_DEVICE |
Describes one general module. More... | |
struct | GENERAL_DEVICE |
Describes one general module. More... | |
struct | UNIVERSAL_MEMORY |
Universal memory contains several general structures. More... | |
struct | INTERPOLATOR_LOOK_AHEAD_ENTRY |
Stores informations about CNC code parts ahead of the actual one. More... | |
struct | INTERPOLATOR_LOOK_AHEAD_BUFFER |
Lookahead informations about the G-code. More... | |
struct | CONT_MFUNC_HISTORY |
History of continuous M functions. More... | |
struct | INTERPOLATOR |
Interface to interpolator. More... | |
struct | _PLC_IMPORT_FUNCTIONS |
Pointers to auxiliary functions usable in Virtual PLC. More... | |
struct | RECEIVE_DATA_CAN |
One entry of incoming CAN data. More... | |
struct | _PLC_DATA |
main structure for communication between TGMotion and Virtual PLC More... | |
Macros | |
#define | TGM_VERSION 421 |
Main TG Motion version. | |
#define | ID_COMPATIBILITY 4033 |
Compability number. | |
#define | ID_MEMORY_COMPATIBILITY 904 |
Memory Compatibility number. | |
#define | ID_CNC_COMPATIBILITY 121 |
CNC Compatibility ID. | |
#define | MAX_SERVO 256 |
#define | MAX_DIO 256 |
#define | MAX_INTERPOLATOR 3 |
#define | MAX_CORES 3 |
#define | MAX_INTERPOLATOR_BUFFER_SIZE 50000 |
#define | MIN_INTERPOLATOR_BUFFER_SIZE 500 |
#define | MAX_INTERPOLATOR_AXES 10 |
Maximum interpolated axes. | |
#define | MAX_TIMER_UP 64 |
Max number timers up. | |
#define | MAX_TIMER_DOWN 64 |
Max number timers down. | |
#define | TG_IO_TYPE_BASIC 0x0000 |
EtherCAT DIO types. Found automatically and set to DIO::Type variable. More... | |
#define | TG_IO_TENZOMETER 0x0008 |
digital: 8out, 8in, tenzometer: 4 | |
#define | TG_IO_TYPE_NEW 0x0014 |
digital: 40out, 48in, analog: 4out, 4in | |
#define | TG_IO_TYPE_BASIC_LITE 0x00E0 |
digital: 24out, 40in | |
#define | TG_IO_TYPE_NEW_LITE 0x00F4 |
digital: 16out, 32in, analog: 4out, 4in | |
#define | FESTO_IO_TYPE 0x0400 |
digital: up to 128out, up to 128in | |
#define | TGM_MINI_DIO_TYPE 0x1000 |
digital: 8out, 8in | |
#define | DFC_IO_TYPE 0x7B90 |
digital: 16out, 16in | |
#define | MFUNC_NUMBER_PAR 26 |
Number of M functions parameters (all the letters of English alphabet) | |
#define | N_OSC_CHANNELS 32 |
Max number of oscilloscope numbers. | |
#define | SIZE_EEPROM_MEMORY (8192 - sizeof(TIMERS) - sizeof(OSC) - 2 * sizeof(ECAT_DRIVER) - 2* sizeof(int32_t) - sizeof(RESERVE_MAIN) - sizeof(MAIN) - sizeof(HEADER)) |
Size eeprom memory [ bytes ]. | |
#define | SDO_CONTROL_FINISHED 0 |
SDO channel is ready for a next command. | |
#define | SDO_CONTROL_WRITE 1 |
Write SDO command for SDO::Control value. | |
#define | SDO_CONTROL_READ 2 |
Read SDO command for SDO::Control value. | |
#define | SDO_STATUS_OK 0 |
SDO completed OK. | |
#define | SDO_STATUS_BUSY 1 |
SDO is in progress. | |
#define | SDO_STATUS_ERR -1 |
SDO finished with error, the error code is in the SDO::Data. | |
#define | MAX_TX_RX_BUFFER_SIZE 32 |
size of TX and RX buffers for ECAT to serial converters (currently BK1120+EL6041 only) | |
#define | CONT_MFUNC_HISTORY_SIZE 8 |
holds history of continuous M functions | |
Typedefs | |
typedef int32_t PLC_FUNC_CDECL | RTWPRINTF_STRING(PLC_CONST_STRING strText) |
Output string to console. More... | |
typedef int32_t PLC_FUNC_CDECL | RTWPRINTF_LONG(PLC_CONST_STRING strFormat, int32_t lVal) |
Output long value (32bit signed integer) to console. More... | |
typedef int32_t PLC_FUNC_CDECL | SWPRINTF(PLC_STRING buffer, size_t sizeOfBuffer, PLC_CONST_STRING strFormat,...) |
Formatted sprintf-like output to buffer. More... | |
typedef void PLC_FUNC_CDECL | SLEEPFT(PLC_PLARGE_INTEGER Pause) |
Wait for specified time. Do not use in Program_04() ! More... | |
typedef int32_t PLC_FUNC_CDECL | CAN_TRANSMIT(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data) |
Send CAN message. More... | |
typedef int32_t PLC_FUNC_CDECL | CAN_TRANSMITREMOTE(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data) |
Send CAN remote message. More... | |
typedef int32_t PLC_FUNC_CDECL | RTWPRINTF_EX(int32_t severity, PLC_CONST_STRING strFormat,...) |
Formatted printf-like output to console. More... | |
typedef HPE_MODULE PLC_FUNC_CDECL | LOADPEIMAGE(PLC_CONST_STRING fileNameWithFullPath) |
Load sub-DLL inside PLC. More... | |
typedef void *PLC_FUNC_CDECL | GETPEADDRESS(HPE_MODULE hModule, const char *funcName) |
Get function addres from module loaded by LOADPEIMAGE() More... | |
typedef struct _PLC_IMPORT_FUNCTIONS | PLC_IMPORT_FUNCTIONS |
Pointers to auxiliary functions usable in Virtual PLC. | |
typedef struct _PLC_DATA | PLC_DATA |
main structure for communication between TGMotion and Virtual PLC | |
Main include file for TG Motion. Can be used as the only include for virtual PLC projects.
Release notes
Definition in file TGM.h.
#define MAX_SERVO 256 |
#define MAX_DIO 256 |
#define MAX_INTERPOLATOR 3 |
#define MAX_CORES 3 |
#define MAX_INTERPOLATOR_BUFFER_SIZE 50000 |
#define MIN_INTERPOLATOR_BUFFER_SIZE 500 |
#define TG_IO_TYPE_BASIC 0x0000 |
typedef int32_t PLC_FUNC_CDECL RTWPRINTF_STRING(PLC_CONST_STRING strText) |
typedef int32_t PLC_FUNC_CDECL RTWPRINTF_LONG(PLC_CONST_STRING strFormat, int32_t lVal) |
typedef int32_t PLC_FUNC_CDECL SWPRINTF(PLC_STRING buffer, size_t sizeOfBuffer, PLC_CONST_STRING strFormat,...) |
typedef void PLC_FUNC_CDECL SLEEPFT(PLC_PLARGE_INTEGER Pause) |
typedef int32_t PLC_FUNC_CDECL CAN_TRANSMIT(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data) |
typedef int32_t PLC_FUNC_CDECL CAN_TRANSMITREMOTE(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data) |
typedef int32_t PLC_FUNC_CDECL RTWPRINTF_EX(int32_t severity, PLC_CONST_STRING strFormat,...) |
typedef HPE_MODULE PLC_FUNC_CDECL LOADPEIMAGE(PLC_CONST_STRING fileNameWithFullPath) |
typedef void* PLC_FUNC_CDECL GETPEADDRESS(HPE_MODULE hModule, const char *funcName) |
Get function addres from module loaded by LOADPEIMAGE()
hModule | Handle to module (got by LOADPEMODULE() funcion) |
funcName | Name of the function |
enum TGM_LOG_XXX : uint32_t |
Bitmasks for debug log output.
Values are set in the TgMotion4xx.ini file, entry Log=....
Enumerator | |
---|---|
TGM_LOG_MAIN | Log main TGM. |
TGM_LOG_INTEPOLATOR | Log TGM interpolator. |
TGM_LOG_CAN | Log TGM CAN. |
TGM_LOG_CAN1_SDO | Log TGM CAN SDO handling CAN1. |
TGM_LOG_CAN2_SDO | Log TGM CAN SDO handling CAN2. |
TGM_LOG_PG | Log PG profile generator. |
TGM_LOG_GEAR | Log GEAR generator. |
TGM_LOG_ETHERNET | TGMmini only: Log ethernet communication. |
TGM_LOG_ETHERCAT | Log basic Ethercat traffix. |
TGM_LOG_ETHERCAT_SDO | Log SDO traffix. |
TGM_LOG_ETHERCAT_STATUS | Log unexpected status change, display PDO structure for universal devices. |
TGM_LOG_ETHERCAT_DC | Log distributed clock capability & topology. |
TGM_LOG_ETHERCAT_FSM_STATE | Log detailed Ethercat master FSM states. |
TGM_LOG_VERBOSE_PE | Log PLC loading - PE image analysis. |
TGM_LOG_VERBOSE_RELOC | Log PLC loading - PE image relocation. |
TGM_LOG_VERBOSE_EXPORTS | Log PLC loading - list of exported functions. |
enum SERVO_TYPES_XXX : int32_t |
Servo types.
enum OSC_MEMORY_TYPES : uint32_t |
Oscilloscope memory numbers.
The same numbers are used as memory types in TGM_Comm_Int_2.dll.
Enumerator | |
---|---|
OSC_SYSTEM_MEMORY | SYSTEM memory. |
OSC_DATA_MEMORY | Virtual PLC private memory. TG Motion never writes to this memory. |
OSC_CAM_PROFILE_MEMORY | CAM memory. |
OSC_OSCILLOSCOPE_MEMORY | Oscilloscope memory. Stores oscilloscope values. Read-only. |
OSC_SERVO_MEMORY | All servos. |
OSC_DIO_MEMORY | All I/O modules. |
OSC_INTEROPLATOR_MEMORY | Interface to all interpolators. |
OSC_INTERPOLATOR_WRITE_MEMORY | Internal memory for CNC modules. |
OSC_INTERPOLATOR_READ_MEMORY | Internal memory for CNC modules. |
OSC_ODS_MEMORY | Stores debug, warning and error messages in a circular buffer. |
OSC_CNCEX_MEMORY | Interface to CNC modules. |
OSC_GCODE_MEMORY | Stores compiled G-code. |
OSC_CNCEX_LOCAL_MEMORY | local DLL memory, ignored by TGMotion oscilloscope |
OSC_CNCINI_MEMORY | INI file, ignored by TGMotion oscilloscope. |
OSC_UNIVERSAL_MEMORY | Universal memory for general devices, etc. |
OSC_LAST_MEMORY_IDX | total number of shared memories |
enum OSC_DATA_TYPES : uint32_t |
Oscilloscope data types.
enum INTERPOLATOR_COMMANDS : int32_t |
Interpolator commands (INTERPOLATOR::Command)
Enumerator | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
INTERPOLATOR_CMD_NONE | No command or previous command finished. | ||||||||||
INTERPOLATOR_CMD_SET_AXIS_RATIO | Sets the INTERPOLATOR::Ratio as a fraction
| ||||||||||
INTERPOLATOR_CMD_SET_COORDS_ON_TRAJ | Sets the actual position, keep the on_trajectory status. All the positions are in Command_Parametr array. | ||||||||||
INTERPOLATOR_CMD_SET_COORDS_OUT_TRAJ | Sets the actual position, set the off_trajectory status. All the positions are in Command_Parametr array. | ||||||||||
INTERPOLATOR_CMD_EMERGENCY_STOP | Stop the interpolator and keep it on actual status. Uses emergency stop deceleration | ||||||||||
INTERPOLATOR_CMD_EMERGENCY_STOP_OUT_TRAJ | Stop the interpolator and set off trajectory status Uses emergency stop deceleration | ||||||||||
INTERPOLATOR_CMD_NORMAL_STOP | Stop the interpolator and keep it on actual status. Uses normal stop deceleration | ||||||||||
INTERPOLATOR_CMD_NORMAL_STOP_OUT_TRAJ | Stop the interpolator and set off trajectory status Uses normal stop deceleration | ||||||||||
INTERPOLATOR_CMD_SET_FILTER_PARAMETERS | Sets the IIR filter parameters
| ||||||||||
INTERPOLATOR_CMD_SET_SPLINE_PARAMETERS | Sets the spline parameters
|
enum EXT_SDO_CONTROL : int32_t |
enum EXT_SDO_STATUS : int32_t |
extended SDO communication status (the smae as for legacy SDO)
Enumerator | |
---|---|
EXT_SDO_STATUS_OK | command completed OK |
EXT_SDO_STATUS_BUSY | command is in process |
EXT_SDO_STATUS_ERR | command ended with error, the error code is in EXT_SDO::Data[0] |