TG Motion  version 502 - 4034/906 cnc 126
MAIN Struct Reference

The MAIN struct - fixed size of 4096 bytes. More...

#include <tgm.h>

Public Attributes

uint32_t TGMotion_Version
 Version of TGM xxx DD MM YY.
 
uint32_t TGM_TgMotionCmd
 
volatile uint32_t Log_Ctrl
 Control log output texts of TGM.
 
volatile uint32_t LogInterpolator_Ctrl
 Control log output texts from interpolators.
 
uint32_t Reserve0
 Reserved.
 
uint32_t Reserve1
 Reserved.
 
uint32_t Reserve2
 Reserved.
 
volatile uint32_t PLC_Ctrl
 Control PLC ( load, run, stop... )
 
uint16_t PLC_Name [MAX_PLC_FILE_NAME_SIZE]
 Name of PLC program file (always UNICODE - UTF16)
 
uint32_t Size_EEPROM_Memory
 size of EEPROM memory, zero means size of 512 bytes (compatibility with previous TGM versions)
 
uint32_t Number_Servos
 Actual number of servo drives (from .INI file), read-only.
 
uint32_t Number_Dios
 Actual number of DIO modules (from .INI file), read-only.
 
uint32_t TGMmini_internal_dio_idx
 TGMmini only: Internal DIO index number, otherwise unused.
 
uint32_t Number_Interpolators
 Actual number of interpolators (from .INI file), read-only.
 
uint32_t Implemented_Features
 Additional implemented features (new oscilloscope functions)
 
uint32_t Reserve4
 Reserved.
 
uint32_t Reserve5
 reserved
 
uint32_t Servo_Tick
 Counter of servo thread ticks.
 
uint32_t Servo_SetCycleTime
 Adjusted cycle time of servo thread [us].
 
uint32_t Servo_CycleTime
 Time of execute servo thread [us].
 
uint32_t Servo_MaxCycle_Time
 calculated maximum of servo loop time

 
uint32_t PLC_SetCycleTime_Prg1
 Wanted cycle time of PLC program 1 thread [us].
 
uint32_t PLC_CycleTime_Prg1
 Time of execute PLC program 1 thread [us].
 
uint32_t PLC_MaxCycleTime_Prg1
 Maximal measured execution time PLC program 1 thread [us].
 
uint32_t PLC_SetCycleTime_Prg2
 Wanted cycle time of PLC program 2 thread [us].
 
uint32_t PLC_CycleTime_Prg2
 Time of execute PLC program 2 thread [us].
 
uint32_t PLC_MaxCycleTime_Prg2
 Maximal measured execution time PLC program 2 thread [us].
 
uint32_t PLC_SetCycleTime_Prg3
 Wanted cycle time of PLC program 3 thread [us].
 
uint32_t PLC_CycleTime_Prg3
 Time of execute PLC program 3 thread [us].
 
uint32_t PLC_MaxCycleTime_Prg3
 Maximal measured execution time PLC program 3 thread [us].
 
uint32_t PLC_SetCycleTime_Prg4
 Wanted cycle time of PLC program 4 thread [us] (always equal to MAIN::Servo_SetCycleTime)
 
uint32_t PLC_CycleTime_Prg4
 Time of execute PLC program 4 thread [us].
 
uint32_t PLC_MaxCycleTime_Prg4
 Maximal measured execution time PLC program 4 thread [us].
 
uint32_t Act_Timer_CycleTime
 actual measured main loop cycle time [us]
 
uint32_t Min_Timer_CycleTime
 minimal main loop cycle time
 
uint32_t Max_Timer_CycleTime
 maximal main loop cycle time
 
uint32_t Max_Timer_Latency
 calculated main loop timer latency
 
uint32_t Interpolator_SetCycleTime
 Adjusted cycle time of INTERPOLATOR thread [us].
 
uint32_t Interpolator_CycleTime [FIXED_NUMBER_OF_INTERPOLATORS]
 Time execute of INTERPOLATORS [us].
 
uint32_t Max_Interpolator_Cycle_Time [FIXED_NUMBER_OF_INTERPOLATORS]
 calculated maximum of interpolator time
 
uint32_t ECAT_ElapsedTime
 Actual time of execute ECAT packet processing [us].
 
uint32_t Max_ECAT_ElapsedTime
 Maximal measured execution time of ECAT processing [us].
 
uint32_t PLC_CAN_BaudRate
 CAN Communications speed for PLC [kbit/s].
 
uint32_t CAN_Transmit_Buffer_Fullness
 fullness of the CAN transmit buffer, PC: 0 or 1, TGMmini: 0 - 55
 
uint32_t TGMmini_CPU_Temperature
 TGMmini only: CPU chip temperature in degrees of Celsius, if zero, no measurement done yet.
 
uint32_t SafetyEvent
 
uint32_t SystemTimeDifferenceSum
 ORed value of all DC slaves system time difference.
 
uint32_t EthPacketErrorCounter
 Counter of receive packet error.
 
uint32_t EthNumberOfPackets
 Actual number of packets for one cycle time.
 
int64_t MasterClock
 64-bit counter time in nanoseconds till DC started
 
int64_t ReferenceClock
 read 64-bit counter of the first slave with DC
 
int64_t MasterClockToReferenceClockDifference
 MasterClock - ReferenceClock.
 
int32_t Distributed_Clock
 copy of CONFIG_TGMOTION.Distributed_Clock
 
int32_t StateDistributedClock
 State of distributed clock on ETHERCAT 0 = off, 1 = on, -1 = error finding DC slave.
 
uint16_t EtherCatDriver [MAX_ECAT_DRIVER_FILE_NAME_SIZE]
 Name of ETHERCAT driver (UNICODE, PC only)
 
uint32_t Found_Total_Number_Of_ECAT_Devices
 number of found device on ECAT bus
 
TGM_CHAR User_Device_Name [MAX_USER_DEVICE_NAME_SIZE]
 user device name, copied from TGMotion.ini file
 
std::atomic< uint32_t > Data_Memory_Access_Lock
 lock for modbus and Profinet servers (TGMcontroller, TGZ+Motion)
 
uint32_t Reserve11
 reserved
 
uint32_t Reserve12
 reserved (padding to 64 bits)
 

Detailed Description

The MAIN struct - fixed size of 4096 bytes.

Member Data Documentation

◆ SafetyEvent

uint32_t MAIN::SafetyEvent

safety event value (read-only):

Value Description
0 no safety event
0x36363636 immediate stop: keep the actual servo positions
0x2A2A2A2A EtherCAT communication is broken (no link)
0x4E4E4E4E controlled stop to servo zero speed, set all DIO outputs to zero

◆ TGM_TgMotionCmd

uint32_t MAIN::TGM_TgMotionCmd

Special controls to TGM itself: KILL = 0x4C4C494B - exit TGMotion (PC only) RBUS = 0x53554252 - reset EtherCAT bus BOOT = 0x544F4F42 - reboot computer (TGMmini, TGMcontroller, TGZ+Motion) LINI = 0x494E494C - reload INI file (internal TGMotion reset without boot or kill)


The documentation for this struct was generated from the following file: