69 #ifndef TGM_H_INCLUDED 70 #define TGM_H_INCLUDED 75 #if defined _MSC_VER && !defined __GNUC__ 76 # if _MSC_VER < 1800 // below Visual Studio 2013 77 # pragma warning(push) 78 # pragma warning(disable: 4480) // Visual Studio 2010 emits warning for enum with type specified 85 #define TGM_VERSION 421 88 #define ID_COMPATIBILITY 4033 91 #define ID_MEMORY_COMPATIBILITY 904 94 #define ID_CNC_COMPATIBILITY 121 100 #define MAX_SERVO 256 111 #ifndef MAX_INTERPOLATOR 112 #define MAX_INTERPOLATOR 3 125 #if MAX_CORES > MAX_INTERPOLATOR 126 #error "MAX_CORES must be equal or less than MAX_INTERPOLATOR" 129 #define _MAX_INTERPOLATOR 16 133 #define MAX_INTERPOLATOR_BUFFER_SIZE 50000 137 #define MIN_INTERPOLATOR_BUFFER_SIZE 500 140 #define MAX_INTERPOLATOR_AXES 10 143 #define MAX_TIMER_UP 64 146 #define MAX_TIMER_DOWN 64 175 #define NAME_SYSTEM_MEMORY TEXT("TGM_System") 176 #define NAME_DATA_MEMORY TEXT("TGM_Data") 177 #define NAME_CAM_PROFILE_MEMORY TEXT("TGM_Cam_Profile") 178 #define NAME_OSCILLOSCOPE_MEMORY TEXT("TGM_Oscilloscope") 179 #define NAME_SERVO_MEMORY TEXT("TGM_Servo") 180 #define NAME_DIO_MEMORY TEXT("TGM_Dio") 181 #define NAME_INTERPOLATOR_MEMORY TEXT("TGM_Interpolator") 182 #define NAME_INTERPOLATOR_WRITE_MEMORY TEXT("InterpolatorWriteMemory") 183 #define NAME_INTERPOLATOR_READ_MEMORY TEXT("InterpolatorReadMemory") 184 #define NAME_ODS_MEMORY TEXT("TGM_ODS") 185 #define NAME_CNCEX_MEMORY TEXT("TGM_CNCEX") 186 #define NAME_GCODE_MEMORY TEXT("TGM_GCODE") 187 #define NAME_CNCINI_MEMORY TEXT("TGM_CNCINI") 188 #define NAME_UNIVERSAL_MEMORY TEXT("TGM_Universal") 192 #define SIZE_SYSTEM_MEMORY 65536 193 #define SIZE_DATA_MEMORY 524288 194 #define SIZE_CAM_PROFILE_MEMORY 1048576 195 #ifndef SIZE_OSCILLOSCOPE_MEMORY 196 #define SIZE_OSCILLOSCOPE_MEMORY (32*1048576) // 32MB (TGM420 on PC upwards, otherwise 1MB) 198 #define SIZE_SERVO_MEMORY 524288 199 #define SIZE_DIO_MEMORY 524288 200 #define SIZE_INTEROPLATOR_MEMORY 65536 201 #define SIZE_INTERPOLATOR_WRITE_MEMORY 65536 202 #define SIZE_INTERPOLATOR_READ_MEMORY 65536 203 #define SIZE_ODS_MEMORY 1048576 204 #define SIZE_CNCEX_MEMORY 65536 205 #define SIZE_GCODE_MEMORY_MINIMAL 1048576 206 #define SIZE_CNCINI_MEMORY 65536 207 #define SIZE_UNIVERSAL_MEMORY 1048576 229 #define CAN_DIO_VIRTUAL 0 231 #define CAN_DIO_BK1120 3 236 #define TG_IO_TYPE_BASIC 0x0000 237 #define TG_IO_TENZOMETER 0x0008 238 #define TG_IO_TYPE_NEW 0x0014 239 #define TG_IO_TYPE_BASIC_LITE 0x00E0 240 #define TG_IO_TYPE_NEW_LITE 0x00F4 241 #define PIERCE_IO_TYPE_149D 0x0007 242 #define PIERCE_IO_TYPE_147D 0x000F 243 #define PIERCE_IO_TYPE_149E 0x0017 244 #define PIERCE_IO_TYPE_147E 0x001F 245 #define BECKHOF_IO_TYPE_BK1120 0x0100 246 #define BECKHOF_IO_TYPE_EK1100 0x0101 247 #define BR_IO_TYPE 0x0200 248 #define FESTO_IO_TYPE 0x0400 249 #define TENZO_IO_TYPE 0x0800 250 #define TGM_MINI_DIO_TYPE 0x1000 251 #define DFC_IO_TYPE 0x7B90 253 #define USER_DIO_PDO_SIZE 256 300 #define MFUNC_NUMBER_PAR 26 404 #define MAX_PLC_FILE_NAME_SIZE 512 405 #define MAX_ECAT_DRIVER_FILE_NAME_SIZE 512 408 #define PLC_CTRL_LOAD_BIT 0x01 409 #define PLC_CTRL_RESET_BIT 0x02 410 #define PLC_CTRL_PAUSE_BIT 0x04 411 #define PLC_CTRL_ERROR_BIT 0x08 412 #define PLC_CTRL_DISABLE_DIO_BIT 0x10 444 uint32_t Interpolator_CycleTime[3];
446 uint32_t Max_Interpolator_Cycle_Time[3];
455 uint16_t PLC_Name[MAX_PLC_FILE_NAME_SIZE];
459 uint16_t EtherCatDriver[MAX_ECAT_DRIVER_FILE_NAME_SIZE];
488 unsigned char RESERVE[4096 -
sizeof(
struct MAIN)];
515 #define N_OSC_CHANNELS 32 550 uint32_t function_id;
553 uint32_t nPacketsSent;
554 uint32_t nPacketsRecv;
557 uint32_t errIgnoringPackets;
558 uint32_t errSplitPackets;
561 uint32_t errTimeStamp;
562 uint32_t errReserve[4];
566 #define SIZE_EEPROM_MEMORY (8192 - sizeof(TIMERS) - sizeof(OSC) - 2 * sizeof(ECAT_DRIVER) - 2* sizeof(int32_t) - sizeof(RESERVE_MAIN) - sizeof(MAIN) - sizeof(HEADER)) 587 struct RESERVE_MAIN Reserve_Main;
614 int32_t IReserve[13];
649 int32_t IReserve[15];
658 volatile int32_t Control;
659 int32_t Typ_ExtCapture;
665 double PExt_Position;
666 double NExt_Position;
667 double Write_Position;
669 double Zero_Position;
687 #define SDO_CONTROL_FINISHED 0 688 #define SDO_CONTROL_WRITE 1 690 #define SDO_CONTROL_READ 2 694 #define SDO_STATUS_OK 0 695 #define SDO_STATUS_BUSY 1 697 #define SDO_STATUS_ERR -1 813 int32_t IReserve[94];
844 #define MAX_TX_RX_BUFFER_SIZE 32 998 int32_t IReserve1[403];
1022 uint32_t IReserve[108];
1025 uint8_t User_PDO_Output[USER_DIO_PDO_SIZE];
1028 uint8_t User_PDO_Input[USER_DIO_PDO_SIZE];
1031 #define MAX_UNIVERSAL_DEVICES 32 1067 uint32_t reserved2[8];
1070 uint8_t User_PDO_Output[USER_DIO_PDO_SIZE];
1073 uint8_t User_PDO_Input[USER_DIO_PDO_SIZE];
1076 #define MAX_GENERAL_DEVICES 16 1096 #define _N_INTERPOLATOR_AXES 10 1098 #define _MAX_LOOKHEAD_BUFFER_SIZE 8 // maximal lookahead array size 1099 #define _MAX_M_PARAMS 26 // number of letters on english alphabet 1107 double allParams[_MAX_M_PARAMS];
1125 double endPos[_N_INTERPOLATOR_AXES];
1159 #define _DESIRED_INTERPOLATOR_STRUCT_SIZE 16384 1160 #define _PREVIOUS_INTERPOLATOR_STRUCT_SIZE 2048 1161 #define _TOTAL_SIZE_FOR_LOOKAHEAD_BUFFER_IN_BYTES ((_DESIRED_INTERPOLATOR_STRUCT_SIZE-_PREVIOUS_INTERPOLATOR_STRUCT_SIZE)) 1162 #define _SIZE_FOR_ONE_LOOKAHEAD_BUFFER_IN_BYTES (_TOTAL_SIZE_FOR_LOOKAHEAD_BUFFER_IN_BYTES/_MAX_LOOKHEAD_BUFFER_SIZE) 1163 #define _RESERVE_SIZE_IN_BYTES (_SIZE_FOR_ONE_LOOKAHEAD_BUFFER_IN_BYTES - sizeof(INTERPOLATOR_LOOK_AHEAD_ENTRY)) 1164 #define _RESERVE_SIZE_IN_DOUBLES (_RESERVE_SIZE_IN_BYTES/sizeof(double)) 1173 double allReserves[_RESERVE_SIZE_IN_DOUBLES];
1179 #define CONT_MFUNC_HISTORY_SIZE 8 1207 int32_t Command_Parametr[12];
1264 double Orig_Position[_N_INTERPOLATOR_AXES];
1265 double Position[_N_INTERPOLATOR_AXES];
1266 double PositionInc[_N_INTERPOLATOR_AXES];
1267 double Backlash[_N_INTERPOLATOR_AXES];
1268 double Offset[_N_INTERPOLATOR_AXES];
1269 double Speed[_N_INTERPOLATOR_AXES];
1270 double Ratio[_N_INTERPOLATOR_AXES];
1271 double M_Funkce_Parametr[26];
1273 double M_Func_Params_Reserved[6];
1278 double DReserve[32 + 70];
1285 struct INTERNAL_INTERPOLATOR_CHECK_SIZE
1287 static_assert(
sizeof(
INTERPOLATOR) == _DESIRED_INTERPOLATOR_STRUCT_SIZE,
"Invalid size of INTERPOLATOR structure");
1295 # define PLC_FUNC_CDECL 1297 # define PLC_FUNC_CDECL __cdecl 1306 # if !defined(_UNICODE) 1307 # error "_UNICODE must be defined for WIN32" 1310 typedef const wchar_t * PLC_CONST_STRING;
1311 typedef wchar_t * PLC_STRING;
1317 typedef const char * PLC_CONST_STRING;
1318 typedef char * PLC_STRING;
1327 typedef union _PLC_LARGE_INTEGER {
1333 } PLC_LARGE_INTEGER;
1334 typedef PLC_LARGE_INTEGER * PLC_PLARGE_INTEGER;
1339 #define _countof(array) (sizeof(array)/sizeof(array[0])) 1346 # define x_offsetof(s,m) (reinterpret_cast<size_t>(&reinterpret_cast<const volatile char&>(((reinterpret_cast<s *>(0))->m)))) 1348 # define x_offsetof(s,m) (reinterpret_cast<uint32_t>(&reinterpret_cast<const volatile char&>(((reinterpret_cast<s *>(0))->m)))) 1353 typedef HMODULE HPE_MODULE;
1355 typedef struct _PE_INFO {
1359 } PE_INFO, *HPE_MODULE;
1378 typedef int32_t PLC_FUNC_CDECL
RTWPRINTF_LONG(PLC_CONST_STRING strFormat, int32_t lVal);
1386 typedef int32_t PLC_FUNC_CDECL
SWPRINTF(PLC_STRING buffer,
size_t sizeOfBuffer, PLC_CONST_STRING strFormat, ...);
1391 typedef void PLC_FUNC_CDECL
SLEEPFT(PLC_PLARGE_INTEGER Pause);
1400 typedef int32_t PLC_FUNC_CDECL
CAN_TRANSMIT(uint32_t Number, uint32_t Id, uint32_t Dlc,
unsigned char * Tx_Data);
1409 typedef int32_t PLC_FUNC_CDECL
CAN_TRANSMITREMOTE(uint32_t Number, uint32_t Id, uint32_t Dlc,
unsigned char * Tx_Data);
1416 typedef int32_t PLC_FUNC_CDECL
RTWPRINTF_EX(int32_t severity, PLC_CONST_STRING strFormat, ...);
1422 typedef HPE_MODULE PLC_FUNC_CDECL
LOADPEIMAGE(PLC_CONST_STRING fileNameWithFullPath);
1429 typedef void * PLC_FUNC_CDECL
GETPEADDRESS(HPE_MODULE hModule,
const char *funcName);
1470 #define CAN_RECIEVE_DATA_BUFFER_SIZE 2048 1503 enum ods_threads : uint32_t {
1504 ods_thread_MAIN = 0,
1505 ods_thread_SERVO_TIMER,
1506 ods_thread_CAN_DIO_TIMER,
1507 ods_thread_CAN_RECIEVE_TIMER,
1508 ods_thread_PROGRAM_01,
1509 ods_thread_PROGRAM_02,
1510 ods_thread_PROGRAM_03,
1511 ods_thread_INTERPOLATOR_THREAD,
1512 ods_thread_EEPROM_THREAD,
1515 ods_thread_N_THREADS
1518 enum ods_identifier : uint32_t {
1524 ods_id_INTERPOLATOR = 5,
1526 ods_id_ECAT_TIMER = 7,
1528 ods_id_PROGRAM_01 = 9,
1529 ods_id_PROGRAM_02 = 10,
1530 ods_id_PROGRAM_03 = 11,
1531 ods_id_PROGRAM_04 = 12,
1532 ods_id_PROGRAM_05 = 13,
1534 ods_id_CAN_DIO = 15,
1535 ods_id_CAN_FUNC = 16,
1536 ods_id_CAN_SERVO = 17,
1537 ods_id_CAN_TIMER = 18,
1538 ods_id_AKD_CONTROL = 19,
1539 ods_id_DCM_CONTROL = 20,
1540 ods_id_SP_CONTROL = 21,
1541 ods_id_SR700_CONTROL = 22,
1542 ods_id_TGA220_CONTROL = 23,
1543 ods_id_TGP_CONTROL = 24,
1544 ods_id_TGZ_CONTROL = 25,
1545 ods_id_ECAT_MASTER = 26,
1546 ods_id_ECAT_SLAVES = 27,
1547 ods_id_PE_IMAGE = 28,
1548 ods_id_MATH_DLL = 29,
1549 ods_id_INI_FILE = 30,
1553 enum ods_severity : uint32_t {
1557 ods_DISABLE_SERIAL = 0x800000
1560 #define ODS_SEVERITY_SHIFT 8 1561 #define ODS_ID_SEVERITY(id,severity) \ 1562 (static_cast<unsigned int>(id) | (static_cast<unsigned int>(severity) << ODS_SEVERITY_SHIFT)) 1564 #define ODS_ID_INFO(id) (static_cast<unsigned int>(id)) 1565 #define ODS_ID_WARNING(id) ODS_ID_SEVERITY(id,ods_WARNING) 1566 #define ODS_ID_ERROR(id) ODS_ID_SEVERITY(id,ods_ERROR) 1567 #define ODS_ID_INFO_NO_SERIAL(id) ODS_ID_SEVERITY(id,ods_DISABLE_SERIAL) 1568 #define ODS_GET_ID(idSeverity) ((idSeverity) & 0xFF) 1569 #define ODS_GET_SEVERITY(idSeverity) ((idSeverity) >> ODS_SEVERITY_SHIFT) 1572 #ifndef UNREFERENCED_PARAM 1573 # define UNREFERENCED_PARAM(P) \ 1581 #if defined _MSC_VER && !defined __GNUC__ 1582 # if _MSC_VER < 1800 // below Visual Studio 2013 1583 # pragma warning(pop) 1587 #endif // TGM_H_INCLUDED Internal memory for CNC modules.
EXT_SDO CompleteSDO
extended SDO communication channel (up to 128 data bytes)
uint8_t Byte1
byte 1 of the message
#define MAX_TIMER_DOWN
Max number timers down.
int32_t CamExpLine2
Offset in byte to first data of external cam 2 in CAM_PROFILE_MEMORY or DATA_MEMORY.
int32_t In1
digital input octet (logical input slot 1)
uint32_t Max_Timer_CycleTime
maximal main loop cycle time
CAN_TRANSMITREMOTE * pCAN_TransmitRemote
transmit remote message to CAN port
int32_t In3
digital input octet (logical input slot 3)
uint32_t Offset_Trigger
Offset off trigger value [ byte ] W.
int32_t Ext_Out4
digital output octet (logical output slot 12)
uint32_t Number_Universal_Devices
number of general devices from .INI file
uint32_t Servo_Bus
Type of bus for servo communication 0 = virtual, 1 = CAN, 2 = ETHERCAT.
int32_t CamExpAddress1
Offset in bytes to output value of external cam 1.
uint32_t Dio_Bus
Type of bus for servo communication 0 = virtual, 1 = CAN, 2 = ETHERCAT.
SDO object communication.
double TransformedPosition
Value to be copied to WritePosition in case of Mode == 9 (MODE_USER)
int32_t Compatibility_Id
Compatibility code.
uint32_t RegisterIndex
EtherCAT register index (address)
struct _PLC_DATA PLC_DATA
main structure for communication between TGMotion and Virtual PLC
Servo drive TGP with 32bit control word.
Servo drive TGP with 32bit control word and external position from sin/cos encoder.
int32_t movementType
0 - invalid entry, 1 - Gxx, 2 - Mxx
volatile int32_t Control
Control of SDO communication 1 = write request, 2 = read request.
Virtual PLC private memory. TG Motion never writes to this memory.
volatile uint32_t TxPointerWrite
uint32_t Mem_Size_Cam
Size of shared cam profile memory.
uint32_t logicalReadAddress
logical FMMU address for LRD command. Set by TGMotion at device init, but can be overriden by PLC...
uint32_t Mem_Size_CncEx
Size of shared CNC Ex memory.
double WriteAcc
Actual acceleration writing to servo [ inc/s2 ] R.
uint32_t User_PDO_Input_Size
size of the input PDO (Slave->Master)
Servo drive Servostar 400 or Servostar 600 ( not supported on the ETHERCAT )
volatile uint32_t RxPointerWrite
uint32_t Number_Interpolators
Number of interpolators.
int32_t PLC_FUNC_CDECL RTWPRINTF_EX(int32_t severity, PLC_CONST_STRING strFormat,...)
Formatted printf-like output to console.
Interface to interpolator.
double Level_Trigger
Trigger level W.
RTWPRINTF_STRING * pRtWprintf_String
string output to console
int32_t Ext_MeasureAmpl5
output voltage of strain gauge 5
uint32_t reserved1
reserved
int32_t in binary representation, displayed bit by bit
int32_t Ext_AI2
analog input 6
UNIVERSAL_MEMORY * PUniversalMemory
pointer to universal memory
SERVO * PServo_Memory
pointer to servo memory
uint32_t Mem_Size_Ods
Size of shared Ods memory.
int32_t gCodeIndex
G code index.
uint32_t PLC_MaxCycleTime_Prg2
Maximal measured execution time PLC program 2 thread [ mikrosec ].
int32_t Out4
digital output octet (logical output slot 4)
void * PCam_Memory
pointer to cam memory
int32_t SourcePosition
Type of master position 1 = WritePosition, 2 = Position, 3 = servotick, 4 = ExtPosition.
Exteded SDO object communication (GENERAL_DEVICES only)
volatile uint32_t LogInterpolator_Ctrl
Control log output texts od inerpolators;.
uint8_t Byte4
byte 4 of the message
ECAT_REGISTER ecatRegister
ECAT register communication channel.
int32_t Internal_Reg6
Internal reg.
Log TGM CAN SDO handling CAN1.
double Dec
Desired deceleration of movenent [ inc/s2 ].
int32_t DigitalIn
State of servo digital inputs.
int32_t Ext_AO0
analog output 4
int32_t Status
Status of EEprom handling 0 = ready, 1 = command active, -1 = error R.
int32_t Ext_AI3
analog input 7
uint32_t Mem_Size_InterpolatorWrite
Size of shared interpolator write memory.
int32_t Data
read/write data of EtherCAT register, in case of error, 0 is returned and Control is set to 3 ...
OSC_DATA_TYPES Type_Value
OSC_DATA_TYPE_xxx W.
int32_t In6
digital input octet (logical input slot 6)
uint32_t Min_Timer_CycleTime
minimal main loop cycle time
uint32_t editorLine
editor line in source G code text
int32_t Ext_MeasureAmpl6
output voltage of strain gauge 6
int32_t In7
digital input octet (logical input slot 7)
uint8_t Byte3
byte 3 of the message
int32_t AO3
analog output 3
uint32_t fileIdx
actual file index
Log unexpected status change, display PDO structure for universal devices.
volatile uint32_t RxPointerRead
uint32_t Resolution
Motor resolution [ inc/rev ].
uint32_t Number_Axes
number of axes used for interpolation (2-10)
int32_t Ext_MeasureAmpl0
output voltage of strain gauge 0
Servo drive TGP with 16bit control word ( not supported on the ETHERCAT )
Log PG profile generator.
uint32_t User_PDO_Output_Size
size of the output PDO (Master->Slave)
int32_t CamExpControl
Control of external cam data bit0 = 1 - external cam data 1 active, bit1 = 1 - external cam data 2 ac...
double Move_Distance
actual total distance
uint32_t User_PDO_Input_Size
size of the input PDO (Slave->Master)
int64_t in binary representation, displayed bit by bit
void * PData_Memory
pointer to data memory
uint32_t PLC_SetCycleTime_Prg3
Adjusted cycle time of PLC program 3 thread [ mikrosec ].
#define MAX_TIMER_UP
Max number timers up.
main structure for communication between TGMotion and Virtual PLC
int32_t in binary representation
volatile int32_t Status
Oscilloscope status R.
int32_t AO0
analog output 0
int32_t CamTab
Location of cam profile 0 = cam profile is in CAM_PROFILE_MEMORY, 0 = cam profile is in DATA_MEMORY...
volatile int32_t Status
Servo status -1 = communications fault, 0 = no response, 1 = fault, 2 - ready disable, 3 - ready enable.
int32_t Axis
Axis number ( valid for multiaxis servodrives )
Log PLC loading - PE image relocation.
0 - SDO is ready for a next command
uint8_t Byte7
byte 7 of the message
uint32_t EthMaxPacketLenght
Max. lenght of packet.
uint32_t EthPacketErrorCounter
Counter of recieve packet error.
uint32_t Offset
Offset of channel in oscilloscope memory [ byte ] R.
int32_t Ext_MeasureAmpl1
output voltage of strain gauge 1
Maps interpolator axe to servo drive.
SWPRINTF * pswprintf
formatted text output to string
uint32_t Adrress_External_Position
offset of TGM_Data address, where external sensor position is saved
SERVO_TYPES_XXX
Servo types.
double Position
Actual position reading from the servo [ inc ] R.
int32_t Tool_Number
actual tool number, read only
int32_t Ext_AO2
analog output 6
int32_t AxisIndex
Attached interpolator axis number.
struct _PLC_IMPORT_FUNCTIONS PLC_IMPORT_FUNCTIONS
Pointers to auxiliary functions usable in Virtual PLC.
uint32_t ProductID
Product ID, set by TGMotion during EtherCAT network scan.
The HEADER struct - fixed size 128 bytes.
int32_t Ext_In2
digital input octet (logical input slot 10)
int32_t Node
Communication node number.
uint32_t ECATBusPosition
actual physical position on the ECAT bus
uint32_t Mem_Size_System
Size of shared system memory.
uint32_t Bufer_Size
size of the command buffer in items
OSC_MEMORY_TYPES
Oscilloscope memory numbers.
uint32_t VendorID
Vendor ID from .INI file for Universal I/O device.
double ExtPosition
Actual external position reading from the servo [ inc ] R.
double Correction
Correction of position [ inc ] W.
LOADPEIMAGE * pLoadPEImage
load external PLC DLL, Windows only
int32_t Number
number of the mapped I/O unit, interface logical number (unit 0 – Number = 0, unit 1 – Number = 1...
int64_t MasterClock
64-bit counter time in nanoseconds till DC started
int32_t tool
actual tool number
int32_t AO1
analog output 1
#define SDO_STATUS_ERR
SDO finished with error, the error code is in the SDO::Data.
int32_t CamExpAddress2
Offset in bytes to output value of external cam 2.
#define CONT_MFUNC_HISTORY_SIZE
holds history of continuous M functions
INI file, ignored by TGMotion oscilloscope.
int32_t In4
digital input octet (logical input slot 4)
SLEEPFT * pSleepFt
wait for specified number of time
INTERPOLATOR_COMMANDS
Interpolator commands (INTERPOLATOR::Command)
uint32_t Found_Total_Number_Of_ECAT_Devices
number of found device on ECAT bus
Internal memory for CNC modules.
EXT_SDO_STATUS
extended SDO communication status (the smae as for legacy SDO)
int32_t Ext_Out2
digital output octet (logical output slot 10)
uint32_t ECATBusPosition
actual physical position on the ECAT bus
uint32_t PLC_SetCycleTime_Prg4
Adjusted cycle time of PLC program 4 thread [ mikrosec ].
int32_t Ext_AO1
analog output 5
uint32_t Number_Periods
Number of periods for one sample W.
#define SDO_CONTROL_FINISHED
SDO channel is ready for a next command.
uint8_t Byte6
byte 6 of the message
Servo drive DMC ( not supported on the CAN )
Pointers to auxiliary functions usable in Virtual PLC.
uint32_t User_PDO_Output_Size
size of the output PDO (Master->Slave)
int32_t Ext_Out5
digital output octet (logical output slot 13)
int32_t In0
digital input octet (logical input slot 0)
int32_t Ext_MeasureAmpl4
output voltage of strain gauge 4
void * PReserve5_Memory
reserved
double endAngle
ending angle of arc (G2 and G3), for other (line, M func) is > 1e38
int32_t ControlWord
copy of CAN control word
int32_t In5
digital input octet (logical input slot 5)
int32_t Mode
Mode of profile generator 0 = speed mode, 1 = position mode, 2( only read ) = signalizing deceleratio...
double Rel_Speed
Realive speed of the movement, 0.01 - 2.0 (i.e 1 - 200 %)
int32_t StateDistributedClock
State of distributed clock on ETHERCAT 0 = off, 1 = on, -1 = error finding DC slave.
int32_t Internal_Reg2
Internal reg.
int32_t CamLen
Number dat of cam profile.
int32_t IntNumber
Attached interpolator number.
uint32_t editorLine
actual editor line
double MaxCurrent
Max. drive current [ mA ] - depends on servo type R.
int32_t NumberByte
Number read/write bytes (1, 2 or 4)
uint32_t Type_Trigger
Type of trigger value 0 - 3 = int32_t, 4 - 9 = double W.
uint32_t Mem_Size_Interpolator
Size of shared interpolator memory.
int32_t AI2
analog input 2
uint32_t Mem_Size_GCode
Size of shared G code memory, user can set in .INI file!
int32_t Out
Denominator of gear ratio.
int32_t sdoResponseTries
unsuccessful SDO request counter from PLC
int32_t TGMotion_Version
Version of TGM xxx DD MM YY.
int32_t in decimal representation
int32_t Index
Index of SDO object.
Interface to all interpolators.
double Act_Speed
actual speed
uint32_t mailBoxOutAddress
must be set by PLC before any SDO commands are performed
int32_t plane
circle plane: 17 - XY, 18 - XZ, 19 - YZ, others not defined
int32_t CompatibilityMem_Id
Memory compatibility code.
uint32_t mailBoxInAddress
must be set by PLC before any SDO commands are performed
double AnalogIn
Actual value from analog input [ inc ] - depends on servo type R.
uint32_t Servo_CAN_BaudRate
CAN Communications speed with servo axes [ kbit / s ].
int32_t Internal_Reg8
Internal reg.
One oscilloscope channel definition.
Describes one servo drive (or axis)
uint32_t LookAheadBufferValidStart
the first valid antry in INTERPOLATOR::LookAheadBuffer array, wraps around _MAX_LOOKHEAD_BUFFER_SIZE ...
uint32_t Servo_Tick
Counter of ticks servo thread.
int32_t Out7
digital output octet (logical output slot 7)
volatile RECEIVE_DATA_CAN * PReciveDataCan1
Pointer to CAN receive data buffer, size is CAN_RECIEVE_DATA_BUFFER_SIZE, can be null. First CAN channel (Servo).
int32_t ActualIn
Actual value of numerator gear ratio.
uint32_t Servo_SetCycleTime
Adjusted cycle time of servo thread [ mikrosec ].
uint8_t Byte2
byte 2 of the message
Timers with fixed 1ms period.
int32_t PLC_FUNC_CDECL CAN_TRANSMITREMOTE(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data)
Send CAN remote message.
int32_t TorqueFeedForward
Torque feed forward scaling is 0.001 of rated torque.
SYSTEM * PSystem_Memory
pointer to system memory
INTERPOLATOR * PInterpolator_Memory
pointer to interpolator memory
int32_t Ext_AI1
analog input 5
uint32_t PLC_SetCycleTime_Prg5
Adjusted cycle time of PLC program 5 thread [ mikrosec ].
int32_t Internal_Reg7
Internal reg.
uint32_t PLC_CycleTime_Prg3
Time of execute PLC program 3 thread [ mikrosec ].
volatile uint32_t TxPointerRead
int64_t in hexadecimal representation
History of continuous M functions.
uint32_t PLC_SetCycleTime_Prg2
Adjusted cycle time of PLC program 2 thread [ mikrosec ].
Servo drive RETROFIT for Pierce controls ( not supported on the CAN )
Log TGM CAN SDO handling CAN2.
int64_t in binary representation
CAN_TRANSMIT * pCAN_Transmit
transmit message to CAN port
No command or previous command finished.
int32_t AI0
analog input 0
uint32_t correction
actual tool compensation (41 - left, 42 - right, any other value - off)
uint32_t Mem_Size_Servo
Size of shared servo memory.
local DLL memory, ignored by TGMotion oscilloscope
RTWPRINTF_EX * pRtWprintf_Ex
formated text output to console
uint32_t Servo_CycleTime
Time of execute servo thread [ mikrosec ].
char * PCNCIni
pointer to CNC ini memory (copy of CNC_Exe.INI file)
double ASpeed
Actual speed of movenent[ inc/s ].
int32_t AO2
analog output 2
int32_t In
Numerator of gear ratio.
double CamPosition
Output position for cam gearing [ inc ].
int32_t Ext_Out6
digital output octet (logical output slot 14)
uint32_t Number_Chanels
Number of channels [ 1 - 32 ] W.
int32_t Ext_Out3
digital output octet (logical output slot 11)
double tangens
tangent of the movement in radians, M functions have value > 1e38
double partLength
length of the actual part
int32_t Distributed_Clock
copy of CONFIG_TGMOTION.Distributed_Clock
uint32_t NumberByte
Number read/write bytes (1, 2 or 4), invalid value will be changed to 4.
uint32_t PLC_CycleTime_Prg5
Time of execute PLC program 5 thread [ mikrosec ].
size_t structSize
structure size
int32_t Last_ContMFunc
last continuos M function number (M > 1000)
double RefPosition
Actual shift position from the servo [ inc ] R.
uint32_t ECATBusPosition
found physical position on the bus
uint32_t smOutputsAddress
must be set by PLC before any ECAT commands are performed
int32_t Type
Type of speed profile 0 = harmonic non symetric, 1 = harmonic symetric, 2 = full harmonic, 3 = trapezoidal.
Universal memory contains several general structures.
double DPos
Destination position of movenent[ inc ].
void * Pointer_interpolator_params
pointer to InterpolatorWrite memory
double Speed
Desired speed of movenent in speed mode[ inc/s ].
Servo drive TGA24 ( not supported on the ETHERCAT )
Describes one general module.
uint32_t Index
EtherCAT register address.
volatile uint32_t PLC_Ctrl
Control PLC ( load, run, stop... )
int32_t Ext_In3
digital input octet (logical input slot 11)
int32_t PLC_FUNC_CDECL SWPRINTF(PLC_STRING buffer, size_t sizeOfBuffer, PLC_CONST_STRING strFormat,...)
Formatted sprintf-like output to buffer.
void * POsc_Memory
pointer to oscilloscope memory
uint32_t Mem_Number
Number of shared memory.
int32_t SysTimeDifference
last known difference between local time and reference time in ns
int32_t Internal_Reg3
Internal reg.
HPE_MODULE PLC_FUNC_CDECL LOADPEIMAGE(PLC_CONST_STRING fileNameWithFullPath)
Load sub-DLL inside PLC.
uint32_t PLC_CycleTime_Prg2
Time of execute PLC program 2 thread [ mikrosec ].
uint32_t Max_Servo_Cycle_Time
calculated maximum of servo loop time
uint32_t Mem_Size_Universal
Size of shared Universal memory.
uint32_t NumberByte
Number of read/write bytes (1 - 256 bytes)
int32_t EtherCATState
I/O unit communication status from EtherCAT point of view.
TGMmini only: Log ethernet communication.
int32_t Act_MFunc
actual M function number
uint32_t ProductID
Product ID from .INI file.
int32_t PLC_FUNC_CDECL RTWPRINTF_STRING(PLC_CONST_STRING strText)
Output string to console.
uint32_t PLC_CycleTime_Prg1
Time of execute PLC program 1 thread [ mikrosec ].
int32_t sdoResponseTries
unsuccessful SDO request counter from PLC
int32_t Ext_AO3
analog output 7
uint32_t PLC_MaxCycleTime_Prg3
Maximal measured execution time PLC program 3 thread [ mikrosec ].
volatile int32_t Act_Part
index of the actual part of the G code
int32_t SubIndex
SubIndex of SDO object.
uint32_t Interpolator_SetCycleTime
Adjusted cycle time of INTERPOLATOR thread [ mikrosec ].
int32_t Out1
digital output octet (logical output slot 1)
double PosSpeed
Desired speed of movenent in position mode[ inc/s ].
int32_t Out0
digital output octet (logical output slot 0)
uint32_t PLC_CycleTime_Prg4
Time of execute PLC program 4 thread [ mikrosec ].
int32_t SerialNumber
Serial number of servo drives.
uint32_t LookAheadBufferValidEnd
the last valid entry in INTERPOLATOR::LookAheadBuffer array
double PositionError
Actual position error [ inc ] R.
TGM_LOG_XXX
Bitmasks for debug log output.
volatile int32_t Control
Oscilloscope control W.
uint32_t NewData
flag that new data has been received
uint32_t Number_Dios
Number of dio modules.
uint32_t SysTimeDifference
last known difference between local time and reference time in ns
int32_t Out3
digital output octet (logical output slot 3)
double Set_Speed
wanted speed from the G-code
int32_t NumberAI
number of connected analog inputs
uint32_t TGMmini_CPU_Temperature
TGMmini only: CPU chip temperature in degrees of Celsius, if zero, no measurement done yet...
GETPEADDRESS * pGetPEAddress
get address of a function in external PLC DLL
int32_t SubIndex
SubIndex of SDO object.
uint32_t PLC_MaxCycleTime_Prg1
Maximal measured execution time PLC program 1 thread [ mikrosec ].
double AccMaxTorqueFeedForward
Acceleration for max feedforward [ inc/s2 ] W.
uint32_t PLC_MaxCycleTime_Prg5
Maximal measured execution time PLC program 5 thread [ mikrosec ].
EtherCAT registers communication.
int32_t Internal_Reg0
Internal reg.
The MAIN struct - fixed size of 4096 bytes.
#define SDO_STATUS_OK
SDO completed OK.
int32_t Ext_Out7
digital output octet (logical output slot 15)
Servo drive TGP with 16bit control word and external position from sin/cos encoder ( not supported on...
int32_t EtherCATState
State of communications on the ETHERCAT.
int32_t DigitalOut
State of servo digital outputs, writing causes setting servo digital outputs.
#define MAX_TX_RX_BUFFER_SIZE
size of TX and RX buffers for ECAT to serial converters (currently BK1120+EL6041 only) ...
Log basic Ethercat traffix.
int32_t Internal_Reg9
Internal reg.
uint32_t bUseLRW
if set to 1, use LRW command for PDO (User_PDO_Output_Size and User_PDO_Input_Size must be the same)...
uint32_t Life_Tick
Life tick counter.
int32_t Internal_Reg5
Internal reg.
#define SDO_CONTROL_READ
Read SDO command for SDO::Control value.
int32_t Out2
digital output octet (logical output slot 2)
uint32_t correction
correction value (41 - left correction, 42 - right correction, any other value - no correction) ...
uint64_t in decimal representation
uint32_t Number_Servos
Number of servo drives.
uint32_t VendorID
Vendor ID, set by TGMotion during EtherCAT network scan.
double Position
Output position for linear gearinig or pointer to CAM for cam gearing [ inc ].
Lookahead informations about the G-code.
int32_t Ext_In7
digital input octet (logical input slot 15)
uint32_t Act_Timer_CycleTime
actual measured main loop cycle time [ mikrosec ]
#define SDO_STATUS_BUSY
SDO is in progress.
double Acc
Desired acceleration of movement [ inc/s2 ].
int32_t NumberIn
the number of bytes used for digital inputs (1 byte = 8 digital inputs)
int32_t CamExpLine1
Offset in byte to first data of external cam 1 in CAM_PROFILE_MEMORY or DATA_MEMORY.
int32_t Internal_Reg1
Internal reg.
int32_t NumberAO
number of connected analog outputs
command ended with error, the error code is in EXT_SDO::Data[0]
double LimitCurrent
Drive current limitation [ inc ] - depends on servo type W.
int32_t NumberOut
the number of bytes used for digital outputs (1 byte = 8 digital outputs)
int64_t MasterClockToReferenceClockDifference
MasterClock - ReferenceClock.
int32_t NumberByte
Number of read/write bytes (1 - 128)
int32_t Number_MeasureAmpl
number of connected strain gauges
int32_t Ext_MeasureAmpl7
output voltage of strain gauge 7
int32_t Ext_In4
digital input octet (logical input slot 12)
int32_t TGMathDll_Version
Version of math library xxx DD MM YY (not used in TGM420 upwards)
total number of shared memories
double radius
radius of the arc; for G0, G1, Mxx is set to zero
void PLC_FUNC_CDECL SLEEPFT(PLC_PLARGE_INTEGER Pause)
Wait for specified time. Do not use in Program_04() !
double ActualShift
Actual shift of pointer to cam [ inc ].
int32_t in hexadecimal representation
uint8_t Byte5
byte 5 of the message
int32_t Ext_In1
digital input octet (logical input slot 9)
int32_t CompatibilityCnc_Id
Cnc compatibility code.
int32_t Data
read/write data of SDO object, error code if SDO::Status is -1
volatile uint32_t Control
EtherCAT R/W control: 1 = write request, 2 = read request, 3 - error (set by TGMotion, must be cleared manually), 0 = ready.
uint32_t PLC_MaxCycleTime_Prg4
Maximal measured execution time PLC program 4 thread [ mikrosec ].
volatile INTERPOLATOR_COMMANDS Command
command to interpolator
Interface to CNC modules.
Stores informations about CNC code parts ahead of the actual one.
PLC_IMPORT_FUNCTIONS functions
structure with all imported functions
uint32_t TX_PDO
Master->Slave PDO index from .INI file (numbers in range 0x1600 - 0x17FF)
Log PLC loading - list of exported functions.
uint32_t Memory_Type_Trigger
Type memory of trigger value W.
uint32_t SystemTimeDifferenceSum
ORed value of all DC slaves system time difference.
volatile uint32_t Log_Ctrl
Control log output texts of TGM.
double Speed
Actual speed reading from the servo [ inc/s ] R.
int32_t PLC_FUNC_CDECL RTWPRINTF_LONG(PLC_CONST_STRING strFormat, int32_t lVal)
Output long value (32bit signed integer) to console.
uint32_t logicalReadWriteAddress
logical FMMU address for LRW command. Set by TGMotion at device init, but can be overriden by PLC...
int32_t Ext_In6
digital input octet (logical input slot 14)
int32_t Ext_MeasureAmpl2
output voltage of strain gauge 2
uint8_t Byte0
byte 0 of the message
int32_t AI1
analog input 1
Log detailed Ethercat master FSM states.
double WritePosition
Wanted servo position [ inc ] RW.
void * PCNCEx
pointer to CNC memory
int32_t Rdy
Flag end of movemnet 1 = Destination position is reached.
int32_t Ext_Out0
digital output octet (logical output slot 8)
double Shift
Desired shift of pointer to cam [ inc ].
uint32_t smInputsAddress
must be set by PLC before any ECAT commands are performed
int32_t PLC_FUNC_CDECL CAN_TRANSMIT(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data)
Send CAN message.
int32_t Mode
Gear generator modes 0 = gear generator off, 1 = linear gearing is active, 2 = cam gearinig is active...
One entry of incoming CAN data.
int32_t SourceNumber
Number of logical servo used for source of master position.
uint32_t CAN_Transmit_Buffer_Fullness
fullness of the CAN transmit buffer, PC: 0 or 1, TGMmini: 0 - 55
int32_t Out5
digital output octet (logical output slot 5)
void *PLC_FUNC_CDECL GETPEADDRESS(HPE_MODULE hModule, const char *funcName)
Get function addres from module loaded by LOADPEIMAGE()
uint32_t logicalWriteAddress
logical FMMU address for LWR command. Set by TGMotion at device init, but can be overriden by PLC...
Servo drive TGA220 ( not supported on the CAN )
void * PGCode
pointer to G code memory
Shared memory named "TGM_System".
int32_t Ext_MeasureAmpl3
output voltage of strain gauge 3
uint32_t Mode_Trigger
Trigger mode 0 = off 1 = rising edge 2 = falling edge W.
uint32_t mailBoxSize
both mailBoxOut and mailBoxIn should be set to the same size. This value must be set by PLC before an...
double startAngle
starting angle of arc (G2 and G3), for other (line, M func) is > 1e38
int32_t StatusWord
copy of CAN status word
uint32_t Max_Timer_Latency
calculated main loop timer latency
Stores debug, warning and error messages in a circular buffer.
32 bits real data type (single data type Pascal)
volatile EXT_SDO_STATUS Status
Status of SDO communication 0 = finished, 1 = active, -1 = error.
#define SDO_CONTROL_WRITE
Write SDO command for SDO::Control value.
int32_t Ext_AI0
analog input 4
int32_t movementCode
G or M function number.
int32_t Ext_Out1
digital output octet (logical output slot 9)
double WriteSpeed
Actual speed writing to servo [ inc/s ] R.
uint32_t in decimal representation
volatile int32_t Status
Status of SDO communication 0 = finished, 1 = active, -1 = error.
OSC_MEMORY_TYPES Memory_Type_Value
Type memory of value W.
uint32_t Sample_Time
Actual time of one sample [ mikrosec ] R.
Servo drive TGZ ( not supported on the CAN )
int32_t AI3
analog input 3
Describes which PCI device is ised as a EtherCAT device.
double CamScale
Scaling faktor of cam profile.
int32_t Ext_In0
digital input octet (logical input slot 8)
double Current
Actual drive current [ inc ] - depends on servo type R.
uint32_t Dio_CAN_BaudRate
CAN Communications speed with DIO modules [ kbit / s ].
uint32_t SetECATBusPosition
desired physical position on the bus
Oscilloscope memory. Stores oscilloscope values. Read-only.
volatile int32_t Control
bit 0 = fault reset, bit 2 = EtherCAT communication reset
volatile EXT_SDO_CONTROL Control
Control of SDO communication 1 = write request, 2 = read request.
Describes one general module.
Capture position from servo.
Servo drive TGA24 ( not supported on the ETHERCAT )
double IncShift
Increment of shift pointer to cam [ inc / servotick ].
double Offset
Shift of the position [ inc ] W.
#define N_OSC_CHANNELS
Max number of oscilloscope numbers.
CONT_MFUNC_HISTORY Cont_MFunc_History
continuous M funcs history
int32_t TGM_TgMotionKill
Kill the TGM by setting to 0x4C4C494B value.
uint32_t Number
interpolator number
uint32_t PLC_SetCycleTime_Prg1
Adjusted cycle time of PLC program 1 thread [ mikrosec ].
DIO * PDio_Memory
pointer to dio memory
int64_t in decimal representation
Universal memory for general devices, etc.
uint32_t Mem_Size_InterpolatorRead
Size of shared interpolator read memory.
uint32_t Mem_Size_CncIni
Size of shared CNC INI memory.
double Offset
Offset of output position [ inc ].
void * Pointer_interpolator_get_position
pointer to InterpolatorRead memory
uint32_t fileIdx
index of source G code text file
uint32_t Mem_Size_Dio
Size of shared dio memory.
volatile uint32_t Control
Control of register communication 1 = write request, 2 = read request, 3 - error, 0 = ready...
int32_t CamType
Type of cam 0 = reversable cam, 1 = forward cam.
double APos
Actual position of movenent[ inc ].
int32_t Internal_Reg4
Internal reg.
int32_t Out6
digital output octet (logical output slot 6)
int32_t In2
digital input octet (logical input slot 2)
int64_t ReferenceClock
read 64-bit counter of the first slave with DC
Log PLC loading - PE image analysis.
uint32_t lastValidEntry
index to mFuncs array - points to last entered continuous M func
int32_t Node
address of the physical I/O unit, which is set on the unit directly
int32_t Control
Control of EEprom handling 1 = load, 2 = save W.
uint32_t CAN_Sync_Act_Time
Actual time between two CAN SYNCs.
double IncIn
Increment of ramp Gear.ActualIn [ inc / servotick ].
double CamIncPosition
Increment of position incremental cam [ inc ].
RTWPRINTF_LONG * pRtWprintf_Long
prints value of lVal to console
#define SIZE_EEPROM_MEMORY
Size eeprom memory [ bytes ].
uint32_t ECATBusPosition
actual physical position on the ECAT bus
uint32_t Size_EEPROM_Memory
size of EEPROM memory, zero means size of 512 bytes (compatibility with previous TGM versions) ...
int32_t Number
Logical servo number.
uint32_t Number_Samples
Number of samples per channel R.
int32_t EtherCATState
I/O unit communication status from EtherCAT point of view.
Servo drive Servostar 300 or Servostar 700.
Log distributed clock capability & topology.
uint32_t Actual_Samples
Actual number of samples per chanel R.
int32_t Index
Index of SDO object.
uint32_t Offset_Value
Offset of value in memory value [ byte ] W.
OSC_DATA_TYPES
Oscilloscope data types.
int32_t CamLine
Offset in bytes to first data of cam profile in CAM_PROFILE_MEMORY or DATA_MEMORY.
uint32_t RX_PDO
Slave->Master PDO index from .INI file (numbers in range 0x1A00 - 0x1BFF)
uint32_t Dlc
length of the message
volatile RECEIVE_DATA_CAN * PReciveDataCan2
Pointer to CAN receive data buffer, size is CAN_RECIEVE_DATA_BUFFER_SIZE, can be null. Second CAN channel if available (DIO).
uint32_t Mem_Size_Data
Size of shared data memory.
EXT_SDO_CONTROL
extended SDO commands (more than 4 bytes of data available)
Describes one servo input/output module.
int32_t Ext_In5
digital input octet (logical input slot 13)