TG Motion  version 421 - 4033/904 cnc 121
Real-time system for controlling servo drives and I/O modules
TGM.h
Go to the documentation of this file.
1 /*
2 +-----------------------------------------------------------------------------+
3 | ******************************** TGM.h ************************************ |
4 +-----------------------------------------------------------------------------+
5 | Copyright 2007 by TG Drives s.r.o. |
6 | |
7 | TG Drives s.r.o. |
8 | Jeneweinova 37 |
9 | CZ-617 00 Brno |
10 | Czech republic |
11 | |
12 +-----------------------------------------------------------------------------+
13 |Description: |
14 | |
15 | |
16 | |
17 | |
18 +-----------------------------------------------------------------------------+
19 |Author: Antonin SAUER, started at: Jul, 20 th, 2011 |
20 +-----------------------------------------------------------------------------+
21 */
22 
67 //#################################################################################################
68 
69 #ifndef TGM_H_INCLUDED
70 #define TGM_H_INCLUDED
71 
72 // standard data types
73 #include <stdint.h>
74 
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
79 # endif
80 #endif
81 
82 //################################### Constants definitions #######################################
83 
85 #define TGM_VERSION 421
86 
88 #define ID_COMPATIBILITY 4033
89 
91 #define ID_MEMORY_COMPATIBILITY 904
92 
94 #define ID_CNC_COMPATIBILITY 121
95 // note: must be the same as the last number of DLL version, file src/Qt/common/WIN32_versions.rc
96 
99 #ifndef MAX_SERVO
100 #define MAX_SERVO 256
101 #endif
102 
105 #ifndef MAX_DIO
106 #define MAX_DIO 256
107 #endif
108 
111 #ifndef MAX_INTERPOLATOR
112 #define MAX_INTERPOLATOR 3
113 #endif
114 
117 #ifndef MAX_CORES
118 # ifdef ZYNQ
119 # define MAX_CORES 1
120 # else
121 # define MAX_CORES 3
122 # endif
123 #endif
124 
125 #if MAX_CORES > MAX_INTERPOLATOR
126 #error "MAX_CORES must be equal or less than MAX_INTERPOLATOR"
127 #endif
128 
129 #define _MAX_INTERPOLATOR 16
130 
133 #define MAX_INTERPOLATOR_BUFFER_SIZE 50000
134 
137 #define MIN_INTERPOLATOR_BUFFER_SIZE 500
138 
140 #define MAX_INTERPOLATOR_AXES 10
141 
143 #define MAX_TIMER_UP 64
144 
146 #define MAX_TIMER_DOWN 64
147 
148 // Indentification of communcation
149 #define CAN 1
150 #define ETHERCAT 2
151 
155 enum TGM_LOG_XXX : uint32_t {
156  TGM_LOG_MAIN = 0x0001,
158  TGM_LOG_CAN = 0x0004,
159  TGM_LOG_CAN1_SDO = 0x0008,
160  TGM_LOG_CAN2_SDO = 0x0010,
161  TGM_LOG_PG = 0x0020,
162  TGM_LOG_GEAR = 0x0040,
163  TGM_LOG_ETHERNET = 0x0080,
164  TGM_LOG_ETHERCAT = 0x0100,
172 };
173 
174 // Names of shared memories
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")
189 
190 // Maximal sizes of shared memories [ bytes ]
191 // always read actual sizes in HEADER structure below!
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)
197 #endif
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
208 
212 enum SERVO_TYPES_XXX : int32_t {
214  TGA = 2,
215  TGA_21 = 21,
221  AKD = 5,
222  TGA220 = 6,
224  SERVO_DCM = 8,
225  SERVO_TGZ = 9,
226 };
227 
228 // CAN DIO types (CAN only, EtherCAT dio types are found automatically)
229 #define CAN_DIO_VIRTUAL 0
230 #define CAN_DIO_TG 1
231 #define CAN_DIO_BK1120 3
232 #define CAN_DIO_BR 4
233 
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
252 
253 #define USER_DIO_PDO_SIZE 256
254 
259 enum OSC_MEMORY_TYPES : uint32_t {
276 };
277 
281 enum OSC_DATA_TYPES : uint32_t {
296 };
297 
298 // Interpolator definitions
300 #define MFUNC_NUMBER_PAR 26
301 
305 enum INTERPOLATOR_COMMANDS : int32_t {
308 
317 
321 
325 
329 
333 
337 
341 
351 
359 };
360 
361 //#################################################################################################
362 // ******************************** Header - fixed size 128 byte **********************************
366 struct HEADER
367 {
368  uint32_t Life_Tick;
371  uint32_t Mem_Number;
372  uint32_t Mem_Size_System;
373  uint32_t Mem_Size_Data;
374  uint32_t Mem_Size_Cam;
375  uint32_t Mem_Size_Osc;
376  uint32_t Mem_Size_Servo;
378  uint32_t Mem_Size_Dio;
382  uint32_t Mem_Size_Ods;
383  uint32_t Mem_Size_CncEx;
384  uint32_t Mem_Size_GCode;
385  uint32_t Mem_Size_CncIni;
387  int32_t Reserve7;
388  int32_t Reserve8;
389  int32_t Reserve9;
391  int32_t Internal_Reg0;
392  int32_t Internal_Reg1;
393  int32_t Internal_Reg2;
394  int32_t Internal_Reg3;
395  int32_t Internal_Reg4;
396  int32_t Internal_Reg5;
397  int32_t Internal_Reg6;
398  int32_t Internal_Reg7;
399  int32_t Internal_Reg8;
400  int32_t Internal_Reg9;
401 };
402 
403 // string sizes
404 #define MAX_PLC_FILE_NAME_SIZE 512
405 #define MAX_ECAT_DRIVER_FILE_NAME_SIZE 512
406 
407 // PLC control values
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
413 
414 
415 // *************************** Main memory area - fixed sizes 4096 bytes **************************
419 struct MAIN
420 {
424  volatile uint32_t Log_Ctrl;
425  volatile uint32_t LogInterpolator_Ctrl;
426 
427  uint32_t Servo_Tick;
429  uint32_t Servo_CycleTime;
440  uint32_t Number_Servos;
441  uint32_t Number_Dios;
444  uint32_t Interpolator_CycleTime[3];
446  uint32_t Max_Interpolator_Cycle_Time[3];
449  int32_t Reserve[7];
451  uint32_t Dio_CAN_BaudRate;
452  uint32_t Servo_Bus;
453  uint32_t Dio_Bus;
454 
455  uint16_t PLC_Name[MAX_PLC_FILE_NAME_SIZE];
457  volatile uint32_t PLC_Ctrl;
458 
459  uint16_t EtherCatDriver[MAX_ECAT_DRIVER_FILE_NAME_SIZE];
461 
465  int64_t MasterClock;
466  int64_t ReferenceClock;
473  uint32_t Max_Timer_Latency;
475  uint32_t CAN_Sync_Act_Time;
477 
484 };
485 
486 struct RESERVE_MAIN
487 {
488  unsigned char RESERVE[4096 - sizeof(struct MAIN)];
489 };
490 
491 // *************************** Timer memory area - fixed sizes 512 bytes *************************
496 struct TIMERS
497 {
498  uint32_t Timer_Up[MAX_TIMER_UP];
499  uint32_t Timer_Down[MAX_TIMER_DOWN];
500 };
501 
502 // ************************************ Osciloscope control area *********************************
506 struct CHANNEL
507 {
508  uint32_t Offset;
510  uint32_t Offset_Value;
512 };
513 
515 #define N_OSC_CHANNELS 32
516 
520 struct OSC
521 {
522  volatile int32_t Control;
523  volatile int32_t Status;
524  uint32_t Number_Periods;
525  uint32_t Number_Chanels;
527  uint32_t Offset_Trigger;
528  uint32_t Mode_Trigger;
529  uint32_t Type_Trigger;
530  double Level_Trigger;
531  struct CHANNEL Channel[N_OSC_CHANNELS];
532 
533  uint32_t Number_Samples;
534  uint32_t Actual_Samples;
535  uint32_t Sample_Time;
536  uint32_t Dummy;
537 };
538 
539 //**************************************** EEprom area ********************************************
540 
546 {
547  // values set by config
548  uint32_t bus_id;
549  uint32_t device_id;
550  uint32_t function_id;
551  uint32_t reserve_id;
552  // values set by TGM
553  uint32_t nPacketsSent;
554  uint32_t nPacketsRecv;
555  // extended (v3) driver errors
556  uint32_t errRcv;
557  uint32_t errIgnoringPackets;
558  uint32_t errSplitPackets;
559  uint32_t errFrame;
560  uint32_t errLength;
561  uint32_t errTimeStamp;
562  uint32_t errReserve[4];
563 };
564 
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))
567 
571 struct EEPROM
572 {
573  int32_t Control;
574  int32_t Status;
575  int32_t Data[SIZE_EEPROM_MEMORY / sizeof(int32_t)];
576 };
577 
578 // ########################### Organisation of shared memory "TGM_System" #########################
579 
583 struct SYSTEM
584 {
585  struct HEADER Header;
586  struct MAIN Main;
587  struct RESERVE_MAIN Reserve_Main;
588  struct TIMERS Timers;
589  struct OSC Osc;
590  struct ECAT_DRIVER Ecat_Driver[2];
591  struct EEPROM Eeprom;
592 };
593 
594 //#################################################################################################
595 
596 //************************************** Profile generator ****************************************
600 struct PG
601 {
602  double Acc;
603  double Dec;
604  double APos;
605  double DPos;
606  double ASpeed;
607  double PosSpeed;
608  double Speed;
609  double DReserve[10];
610 
611  int32_t Mode;
612  int32_t Rdy;
613  int32_t Type;
614  int32_t IReserve[13];
615 };
616 
617 //*************************************** Gear generator ******************************************
621 struct GEAR
622 {
623  double Position;
624  double CamPosition;
625  double Offset;
626  double Shift;
627  double ActualShift;
628  double IncShift;
629  double IncIn;
630  double CamIncPosition;
631  double CamScale;
632  double DReserve[8];
633 
634  int32_t SourceNumber;
635  int32_t SourcePosition;
636  int32_t Mode;
637  int32_t In;
638  int32_t Out;
639  int32_t ActualIn;
640  int32_t CamLine;
641  int32_t CamLen;
642  int32_t CamType;
643  int32_t CamTab;
644  int32_t CamExpControl;
645  int32_t CamExpLine1;
646  int32_t CamExpLine2;
647  int32_t CamExpAddress1;
648  int32_t CamExpAddress2;
649  int32_t IReserve[15];
650 };
651 
652 //********************************************** Capture ******************************************
656 struct CAPTURE
657 {
658  volatile int32_t Control;
659  int32_t Typ_ExtCapture;
660  int32_t Offset;
661  int32_t IData;
662  int32_t IReserve[4];
663  double PPosition;
664  double NPosition;
665  double PExt_Position;
666  double NExt_Position;
667  double Write_Position;
668  double DData;
669  double Zero_Position;
670  double DReserve[5];
671 };
672 
673 //******************************************** CNC map ********************************************
674 
678 struct MAP_CNC
679 {
680  int32_t IntNumber;
681  int32_t AxisIndex;
682  int32_t Reserve1;
683  int32_t Reserve2;
684 };
685 
687 #define SDO_CONTROL_FINISHED 0
688 #define SDO_CONTROL_WRITE 1
690 #define SDO_CONTROL_READ 2
692 
694 #define SDO_STATUS_OK 0
695 #define SDO_STATUS_BUSY 1
697 #define SDO_STATUS_ERR -1
699 
700 //********************************** SDO object communication *************************************
704 struct SDO
705 {
706  volatile int32_t Control;
707  volatile int32_t Status;
708  int32_t NumberByte;
709  int32_t Index;
710  int32_t SubIndex;
711  int32_t Data;
712 };
713 
716 enum EXT_SDO_CONTROL : int32_t {
720 };
721 
723 enum EXT_SDO_STATUS : int32_t {
727 };
728 
732 struct EXT_SDO {
733  // extended SDO control:
736  int32_t NumberByte;
737  int32_t Index;
738  int32_t SubIndex;
739  uint32_t Data[32];
740 };
741 
742 //********************************** EtherCAT registers communication *************************************
747 {
748  volatile uint32_t Control;
749  uint32_t NumberByte;
750  uint32_t Index;
751  int32_t Data;
752 };
753 
754 //************************************** Servo command ********************************************
758 struct COMMAND
759 {
760  volatile int32_t Control;
761  int32_t Reserve;
773  double Par[15];
774 };
775 
776 //********************************************** Servo ********************************************
777 
782 struct SERVO
783 {
784  int32_t Number;
785  int32_t Node;
786  int32_t Axis;
787  int32_t Type;
788  uint32_t Resolution;
789  int32_t SerialNumber;
790  volatile int32_t Control;
801  volatile int32_t Status;
802  int32_t Mode;
803  int32_t Error;
804  int32_t EtherCATState;
805  int32_t DigitalIn;
806  int32_t DigitalOut;
808  int32_t ControlWord;
809  int32_t StatusWord;
811  struct ECAT_REGISTER ecatRegister;
812  uint32_t ECATBusPosition;
813  int32_t IReserve[94];
814 
815  double WritePosition;
816  double Position;
817  double RefPosition;
818  double ExtPosition;
819  double Offset;
820  double Correction;
821  double PositionError;
822  double WriteSpeed;
823  double Speed;
824  double LimitCurrent;
825  double Current;
826  double MaxCurrent;
827  double AnalogIn;
828  double WriteAcc;
831  double DReserve[88];
832 
833  struct PG Pg;
834  struct SDO Sdo;
835  struct GEAR Gear;
836  struct MAP_CNC Cnc;
837  struct CAPTURE Capture;
838  struct COMMAND Command;
839 };
840 
841 //********************************************** Dio ********************************************
842 
844 #define MAX_TX_RX_BUFFER_SIZE 32
845 
850 struct DIO
851 {
852  int32_t Number;
853  int32_t Node;
854  int32_t Type;
855 
869  volatile int32_t Control;
870  volatile int32_t Status;
871 
875  int32_t Error;
876 
878  int32_t NumberIn;
879  int32_t In0;
880  int32_t In1;
881  int32_t In2;
882  int32_t In3;
883  int32_t In4;
884  int32_t In5;
885  int32_t In6;
886  int32_t In7;
887 
888  int32_t Ext_In0;
889  int32_t Ext_In1;
890  int32_t Ext_In2;
891  int32_t Ext_In3;
892  int32_t Ext_In4;
893  int32_t Ext_In5;
894  int32_t Ext_In6;
895  int32_t Ext_In7;
896 
897  int32_t NumberOut;
898  int32_t Out0;
899  int32_t Out1;
900  int32_t Out2;
901  int32_t Out3;
902  int32_t Out4;
903  int32_t Out5;
904  int32_t Out6;
905  int32_t Out7;
906 
907  int32_t Ext_Out0;
908  int32_t Ext_Out1;
909  int32_t Ext_Out2;
910  int32_t Ext_Out3;
911  int32_t Ext_Out4;
912  int32_t Ext_Out5;
913  int32_t Ext_Out6;
914  int32_t Ext_Out7;
915 
916  int32_t NumberAI;
917  int32_t AI0;
918  int32_t AI1;
919  int32_t AI2;
920  int32_t AI3;
921 
922  int32_t Ext_AI0;
923  int32_t Ext_AI1;
924  int32_t Ext_AI2;
925  int32_t Ext_AI3;
926 
927  int32_t NumberAO;
928  int32_t AO0;
929  int32_t AO1;
930  int32_t AO2;
931  int32_t AO3;
932 
933  int32_t Ext_AO0;
934  int32_t Ext_AO1;
935  int32_t Ext_AO2;
936  int32_t Ext_AO3;
937 
947 
948  int32_t EtherCATState;
949 
957  struct SDO Sdo;
959 
960  uint8_t RxBuffer[MAX_TX_RX_BUFFER_SIZE];
961  uint8_t TxBuffer[MAX_TX_RX_BUFFER_SIZE];
962 
963  int32_t TS_Data[8];
964 
965  uint32_t SysTimeDifference;
966 
967  struct ECAT_REGISTER ecatRegister;
968  uint32_t ECATBusPosition;
969 
970  volatile uint32_t RxPointerWrite;
976 
977  volatile uint32_t RxPointerRead;
983 
984  volatile uint32_t TxPointerWrite;
990 
991  volatile uint32_t TxPointerRead;
997 
998  int32_t IReserve1[403];
999 };
1000 
1001 
1007 {
1008  // values copied from .INI file
1009  uint32_t VendorID;
1010  uint32_t ProductID;
1011  uint32_t TX_PDO;
1012  uint32_t RX_PDO;
1014 
1015  // actual values
1016  int32_t EtherCATState;
1017  struct SDO Sdo;
1020  uint32_t ECATBusPosition;
1021 
1022  uint32_t IReserve[108];
1023 
1025  uint8_t User_PDO_Output[USER_DIO_PDO_SIZE];
1026 
1028  uint8_t User_PDO_Input[USER_DIO_PDO_SIZE];
1029 };
1030 
1031 #define MAX_UNIVERSAL_DEVICES 32
1032 
1040 {
1041  uint32_t VendorID;
1042  uint32_t ProductID;
1043  uint32_t reserved1;
1044 
1045  // actual values
1046  int32_t EtherCATState;
1047 
1048  volatile uint32_t Control;
1049  uint32_t NumberByte;
1050  uint32_t RegisterIndex;
1051  uint32_t Data[64];
1052 
1053  uint32_t ECATBusPosition;
1054  uint32_t bUseLRW;
1058 
1059  uint32_t mailBoxSize;
1061  uint32_t mailBoxInAddress;
1062  uint32_t smOutputsAddress;
1063  uint32_t smInputsAddress;
1064 
1066 
1067  uint32_t reserved2[8];
1068 
1070  uint8_t User_PDO_Output[USER_DIO_PDO_SIZE];
1071 
1073  uint8_t User_PDO_Input[USER_DIO_PDO_SIZE];
1074 };
1075 
1076 #define MAX_GENERAL_DEVICES 16
1077 
1083 {
1084  UNIVERSAL_DEVICE universal_devices[MAX_UNIVERSAL_DEVICES];
1085  GENERAL_DEVICE general_devices[MAX_GENERAL_DEVICES];
1091 
1092 };
1093 
1094 //******************************************* Interpolator ***************************************
1095 
1096 #define _N_INTERPOLATOR_AXES 10
1097 
1098 #define _MAX_LOOKHEAD_BUFFER_SIZE 8 // maximal lookahead array size
1099 #define _MAX_M_PARAMS 26 // number of letters on english alphabet
1100 
1105 {
1107  double allParams[_MAX_M_PARAMS]; // offset 0
1108 
1110  double tangens; // offset 26 * 8 = 208
1111 
1113  int32_t movementType; // offset 216
1114 
1116  int32_t movementCode; // offset 220
1117 
1119  int32_t plane; // offset 224
1120 
1122  int32_t tool; // offset 228
1123 
1125  double endPos[_N_INTERPOLATOR_AXES]; // offset 232
1126 
1128  double startAngle; // offset 312 (232 + 10*8)
1129 
1131  double endAngle; // offset 320
1132 
1134  double radius; // offset 328
1135 
1137  double partLength; // offset 336
1138 
1140  int32_t gCodeIndex;
1141 
1143  uint32_t editorLine;
1144 
1146  uint32_t fileIdx;
1147 
1149  uint32_t correction;
1150 
1151  // actual size 360 bytes
1152  // follows reserved values (see INTERPOLATOR_LOOK_AHEAD_BUFFER::allReserves below)
1153 };
1154 
1155 
1156 
1157 // 16384 = desired size of complete INTERPOLATOR struct
1158 // 2048 = previous size of INTERPOLATOR struct (TGM 414 and below)
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))
1165 
1170 {
1171  static_assert(_SIZE_FOR_ONE_LOOKAHEAD_BUFFER_IN_BYTES > sizeof(INTERPOLATOR_LOOK_AHEAD_ENTRY), "Invalid size of INTERPOLATOR_LOOK_AHEAD_ENTRY structure");
1173  double allReserves[_RESERVE_SIZE_IN_DOUBLES];
1174 };
1175 
1176 // one INTERPOLATOR_LOOK_AHEAD_BUFFER has 1792 bytes
1177 
1179 #define CONT_MFUNC_HISTORY_SIZE 8
1180 
1185 {
1187  uint32_t lastValidEntry;
1192  uint32_t mFuncs[CONT_MFUNC_HISTORY_SIZE];
1193 };
1194 
1195 // original size 2048 bytes, expanded by INTERPOLATOR_LOOK_AHEAD_BUFFER to 16384 bytes
1202 {
1203  uint32_t Number;
1204  uint32_t Number_Axes;
1205  uint32_t Bufer_Size;
1207  int32_t Command_Parametr[12];
1216  volatile int32_t Status;
1227  volatile int32_t Act_Part;
1229  volatile int32_t M_Func;
1230  int32_t Act_GFunc;
1233  int32_t Act_MFunc;
1234  int32_t Last_ContMFunc;
1235  int32_t Run_Flag;
1258  int32_t Tool_Number;
1260  uint32_t editorLine;
1261  uint32_t fileIdx;
1262  uint32_t correction;
1263  int32_t IReserve[65 - (sizeof(CONT_MFUNC_HISTORY)/sizeof(int32_t))];
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];
1274  double Rel_Speed;
1275  double Set_Speed;
1276  double Act_Speed;
1277  double Move_Distance;
1278  double DReserve[32 + 70];
1281  INTERPOLATOR_LOOK_AHEAD_BUFFER LookAheadBuffer[_MAX_LOOKHEAD_BUFFER_SIZE];
1283 };
1284 
1285 struct INTERNAL_INTERPOLATOR_CHECK_SIZE
1286 {
1287  static_assert(sizeof(INTERPOLATOR) == _DESIRED_INTERPOLATOR_STRUCT_SIZE, "Invalid size of INTERPOLATOR structure");
1288 };
1289 
1290 //*************************************************************************************************
1291 // structures for communicating with PLC
1292 // import functions table
1293 
1294 #ifdef __GNUC__
1295 # define PLC_FUNC_CDECL
1296 #else
1297 # define PLC_FUNC_CDECL __cdecl
1298 #endif
1299 
1300 // portable parameters definitions
1301 // Win32 - UNICODE strings
1302 // Linux - ANSI strings
1303 
1304 #ifdef WIN32
1305 
1306 # if !defined(_UNICODE)
1307 # error "_UNICODE must be defined for WIN32"
1308 # endif
1309 
1310 typedef const wchar_t * PLC_CONST_STRING;
1311 typedef wchar_t * PLC_STRING;
1312 
1313 #else // WIN32
1314 
1315 #include <stdlib.h>
1316 
1317 typedef const char * PLC_CONST_STRING;
1318 typedef char * PLC_STRING;
1319 
1320 // mark text as ANSI/UNICODE compatible
1321 #ifndef _T
1322 # define _T(a) (a)
1323 #endif
1324 
1325 #endif
1326 
1327 typedef union _PLC_LARGE_INTEGER {
1328  struct {
1329  uint32_t LowPart;
1330  int32_t HighPart;
1331  } u;
1332  int64_t QuadPart;
1333 } PLC_LARGE_INTEGER;
1334 typedef PLC_LARGE_INTEGER * PLC_PLARGE_INTEGER;
1335 
1336 // useful _countof macro
1337 // determine number of elements in an array (not bytes)
1338 #ifndef _countof
1339 #define _countof(array) (sizeof(array)/sizeof(array[0]))
1340 #endif
1341 
1342 // useful offsetof macro
1343 // get offset of structure (s) member (m)
1344 #ifndef x_offsetof
1345 # ifdef WIN64
1346 # define x_offsetof(s,m) (reinterpret_cast<size_t>(&reinterpret_cast<const volatile char&>(((reinterpret_cast<s *>(0))->m))))
1347 # else
1348 # define x_offsetof(s,m) (reinterpret_cast<uint32_t>(&reinterpret_cast<const volatile char&>(((reinterpret_cast<s *>(0))->m))))
1349 # endif // WIN64
1350 #endif
1351 
1352 #ifdef EMULATE_RTSS
1353 typedef HMODULE HPE_MODULE;
1354 #else
1355 typedef struct _PE_INFO {
1356  void * pBase; // pointer to executable memory
1357  void * pImage; // original file image
1358  void * entryPoint; // DLL or EXE entry point
1359 } PE_INFO, *HPE_MODULE;
1360 #endif
1361 
1362 #ifdef __cplusplus
1363 extern "C" {
1364 #endif
1365  typedef int32_t PLC_FUNC_CDECL RTWPRINTF_STRING(PLC_CONST_STRING strText);
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); // func name is ANSI!!
1430 #ifdef __cplusplus
1431 }
1432 #endif
1433 
1438 {
1449 
1450 #pragma pack(push)
1451 #pragma pack(1)
1452 struct RECEIVE_DATA_CAN
1456 {
1457  uint8_t Byte0;
1458  uint8_t Byte1;
1459  uint8_t Byte2;
1460  uint8_t Byte3;
1461  uint8_t Byte4;
1462  uint8_t Byte5;
1463  uint8_t Byte6;
1464  uint8_t Byte7;
1465  uint32_t Dlc;
1466  uint32_t NewData;
1467 };
1468 #pragma pack(pop)
1469 
1470 #define CAN_RECIEVE_DATA_BUFFER_SIZE 2048
1471 
1475 typedef struct _PLC_DATA
1476 {
1477  size_t structSize;
1480  void *POsc_Memory;
1481  void *PCam_Memory;
1487  void *PCNCEx;
1488  void *PGCode;
1489  char *PCNCIni;
1494 
1496 } PLC_DATA, *PPLC_DATA;
1497 
1498 //*************************************************************************************************
1499 // Output Debug String (ODS) definitions
1500 //*************************************************************************************************
1501 
1502 // reflects number of threads/timers for separate output debug string (ODS) areas
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,
1513  ods_thread_PLC,
1514  ods_thread_CNC,
1515  ods_thread_N_THREADS // must be the last entry!
1516 };
1517 
1518 enum ods_identifier : uint32_t {
1519  ods_id_MAIN = 0,
1520  ods_id_PG = 1,
1521  ods_id_GEAR = 2,
1522  ods_id_OSC = 3,
1523  ods_id_SERVO = 4,
1524  ods_id_INTERPOLATOR = 5,
1525  ods_id_PLC = 6,
1526  ods_id_ECAT_TIMER = 7,
1527  ods_id_EEPROM = 8,
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,
1533  ods_id_SPLINE = 14,
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,
1550  ods_id_CNC = 31
1551 };
1552 
1553 enum ods_severity : uint32_t {
1554  ods_INFO = 0,
1555  ods_WARNING = 1,
1556  ods_ERROR = 2,
1557  ods_DISABLE_SERIAL = 0x800000 // TGMmini only
1558 };
1559 
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))
1563 
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)
1570 
1571 
1572 #ifndef UNREFERENCED_PARAM
1573 # define UNREFERENCED_PARAM(P) \
1574 { \
1575  (void)(P); \
1576 }
1577 #endif
1578 
1579 //#################################################################################################
1580 
1581 #if defined _MSC_VER && !defined __GNUC__
1582 # if _MSC_VER < 1800 // below Visual Studio 2013
1583 # pragma warning(pop)
1584 # endif
1585 #endif
1586 
1587 #endif // TGM_H_INCLUDED
Internal memory for CNC modules.
Definition: TGM.h:267
EXT_SDO CompleteSDO
extended SDO communication channel (up to 128 data bytes)
Definition: TGM.h:1065
uint8_t Byte1
byte 1 of the message
Definition: TGM.h:1458
int32_t Type
Servo type.
Definition: TGM.h:787
#define MAX_TIMER_DOWN
Max number timers down.
Definition: TGM.h:146
int32_t CamExpLine2
Offset in byte to first data of external cam 2 in CAM_PROFILE_MEMORY or DATA_MEMORY.
Definition: TGM.h:646
int32_t In1
digital input octet (logical input slot 1)
Definition: TGM.h:880
uint32_t Max_Timer_CycleTime
maximal main loop cycle time
Definition: TGM.h:472
int32_t Reserve7
Reserve.
Definition: TGM.h:387
CAN_TRANSMITREMOTE * pCAN_TransmitRemote
transmit remote message to CAN port
Definition: TGM.h:1444
int32_t In3
digital input octet (logical input slot 3)
Definition: TGM.h:882
int32_t Type
Definition: TGM.h:854
uint32_t Offset_Trigger
Offset off trigger value [ byte ] W.
Definition: TGM.h:527
int32_t Ext_Out4
digital output octet (logical output slot 12)
Definition: TGM.h:911
uint32_t Number_Universal_Devices
number of general devices from .INI file
Definition: TGM.h:447
UNICODE (UTF-16) string.
Definition: TGM.h:293
uint32_t Servo_Bus
Type of bus for servo communication 0 = virtual, 1 = CAN, 2 = ETHERCAT.
Definition: TGM.h:452
int32_t CamExpAddress1
Offset in bytes to output value of external cam 1.
Definition: TGM.h:647
int32_t Reserve9
Reserve.
Definition: TGM.h:389
uint32_t Dio_Bus
Type of bus for servo communication 0 = virtual, 1 = CAN, 2 = ETHERCAT.
Definition: TGM.h:453
SDO object communication.
Definition: TGM.h:704
double TransformedPosition
Value to be copied to WritePosition in case of Mode == 9 (MODE_USER)
Definition: TGM.h:830
int32_t Mode
Servo modes.
Definition: TGM.h:802
int32_t Command_Status
Definition: TGM.h:1208
int32_t Compatibility_Id
Compatibility code.
Definition: TGM.h:369
uint32_t RegisterIndex
EtherCAT register index (address)
Definition: TGM.h:1050
struct _PLC_DATA PLC_DATA
main structure for communication between TGMotion and Virtual PLC
Servo drive TGP with 32bit control word.
Definition: TGM.h:217
Servo drive TGP with 32bit control word and external position from sin/cos encoder.
Definition: TGM.h:218
int32_t movementType
0 - invalid entry, 1 - Gxx, 2 - Mxx
Definition: TGM.h:1113
volatile int32_t Control
Control of SDO communication 1 = write request, 2 = read request.
Definition: TGM.h:706
Virtual PLC private memory. TG Motion never writes to this memory.
Definition: TGM.h:261
CAM memory.
Definition: TGM.h:262
volatile uint32_t TxPointerWrite
Definition: TGM.h:984
uint32_t Mem_Size_Cam
Size of shared cam profile memory.
Definition: TGM.h:374
uint32_t logicalReadAddress
logical FMMU address for LRD command. Set by TGMotion at device init, but can be overriden by PLC...
Definition: TGM.h:1056
volatile int32_t Control
Definition: TGM.h:760
uint32_t Mem_Size_CncEx
Size of shared CNC Ex memory.
Definition: TGM.h:383
double WriteAcc
Actual acceleration writing to servo [ inc/s2 ] R.
Definition: TGM.h:828
uint32_t User_PDO_Input_Size
size of the input PDO (Slave->Master)
Definition: TGM.h:1027
Servo drive Servostar 400 or Servostar 600 ( not supported on the ETHERCAT )
Definition: TGM.h:213
volatile uint32_t RxPointerWrite
Definition: TGM.h:970
uint32_t Number_Interpolators
Number of interpolators.
Definition: TGM.h:442
int32_t PLC_FUNC_CDECL RTWPRINTF_EX(int32_t severity, PLC_CONST_STRING strFormat,...)
Formatted printf-like output to console.
Definition: TGM.h:1416
Interface to interpolator.
Definition: TGM.h:1201
double Level_Trigger
Trigger level W.
Definition: TGM.h:530
RTWPRINTF_STRING * pRtWprintf_String
string output to console
Definition: TGM.h:1439
int32_t Ext_MeasureAmpl5
output voltage of strain gauge 5
Definition: TGM.h:944
uint32_t reserved1
reserved
Definition: TGM.h:1043
int32_t in binary representation, displayed bit by bit
Definition: TGM.h:294
int32_t Ext_AI2
analog input 6
Definition: TGM.h:924
UNIVERSAL_MEMORY * PUniversalMemory
pointer to universal memory
Definition: TGM.h:1490
SERVO * PServo_Memory
pointer to servo memory
Definition: TGM.h:1482
uint32_t Mem_Size_Ods
Size of shared Ods memory.
Definition: TGM.h:382
int32_t gCodeIndex
G code index.
Definition: TGM.h:1140
uint32_t PLC_MaxCycleTime_Prg2
Maximal measured execution time PLC program 2 thread [ mikrosec ].
Definition: TGM.h:479
int32_t Out4
digital output octet (logical output slot 4)
Definition: TGM.h:902
void * PCam_Memory
pointer to cam memory
Definition: TGM.h:1481
int32_t SourcePosition
Type of master position 1 = WritePosition, 2 = Position, 3 = servotick, 4 = ExtPosition.
Definition: TGM.h:635
Exteded SDO object communication (GENERAL_DEVICES only)
Definition: TGM.h:732
volatile uint32_t LogInterpolator_Ctrl
Control log output texts od inerpolators;.
Definition: TGM.h:425
uint8_t Byte4
byte 4 of the message
Definition: TGM.h:1461
ECAT_REGISTER ecatRegister
ECAT register communication channel.
Definition: TGM.h:1019
int32_t Internal_Reg6
Internal reg.
Definition: TGM.h:397
Log TGM CAN SDO handling CAN1.
Definition: TGM.h:159
double Dec
Desired deceleration of movenent [ inc/s2 ].
Definition: TGM.h:603
int32_t DigitalIn
State of servo digital inputs.
Definition: TGM.h:805
int32_t Ext_AO0
analog output 4
Definition: TGM.h:933
int32_t Status
Status of EEprom handling 0 = ready, 1 = command active, -1 = error R.
Definition: TGM.h:574
int32_t Ext_AI3
analog input 7
Definition: TGM.h:925
uint32_t Mem_Size_InterpolatorWrite
Size of shared interpolator write memory.
Definition: TGM.h:380
int32_t Data
read/write data of EtherCAT register, in case of error, 0 is returned and Control is set to 3 ...
Definition: TGM.h:751
OSC_DATA_TYPES Type_Value
OSC_DATA_TYPE_xxx W.
Definition: TGM.h:511
int32_t In6
digital input octet (logical input slot 6)
Definition: TGM.h:885
uint32_t Min_Timer_CycleTime
minimal main loop cycle time
Definition: TGM.h:471
uint32_t editorLine
editor line in source G code text
Definition: TGM.h:1143
int32_t Ext_MeasureAmpl6
output voltage of strain gauge 6
Definition: TGM.h:945
int32_t In7
digital input octet (logical input slot 7)
Definition: TGM.h:886
uint8_t Byte3
byte 3 of the message
Definition: TGM.h:1460
int32_t Reserve8
Reserve.
Definition: TGM.h:388
int32_t AO3
analog output 3
Definition: TGM.h:931
uint32_t fileIdx
actual file index
Definition: TGM.h:1261
Log unexpected status change, display PDO structure for universal devices.
Definition: TGM.h:166
volatile uint32_t RxPointerRead
Definition: TGM.h:977
ANSI (int8_t) string.
Definition: TGM.h:292
uint32_t Resolution
Motor resolution [ inc/rev ].
Definition: TGM.h:788
uint32_t Number_Axes
number of axes used for interpolation (2-10)
Definition: TGM.h:1204
int32_t Ext_MeasureAmpl0
output voltage of strain gauge 0
Definition: TGM.h:939
Servo drive TGP with 16bit control word ( not supported on the ETHERCAT )
Definition: TGM.h:219
Log PG profile generator.
Definition: TGM.h:161
uint32_t User_PDO_Output_Size
size of the output PDO (Master->Slave)
Definition: TGM.h:1069
int32_t CamExpControl
Control of external cam data bit0 = 1 - external cam data 1 active, bit1 = 1 - external cam data 2 ac...
Definition: TGM.h:644
double Move_Distance
actual total distance
Definition: TGM.h:1277
All I/O modules.
Definition: TGM.h:265
uint32_t User_PDO_Input_Size
size of the input PDO (Slave->Master)
Definition: TGM.h:1072
int64_t in binary representation, displayed bit by bit
Definition: TGM.h:295
void * PData_Memory
pointer to data memory
Definition: TGM.h:1479
uint32_t PLC_SetCycleTime_Prg3
Adjusted cycle time of PLC program 3 thread [ mikrosec ].
Definition: TGM.h:434
#define MAX_TIMER_UP
Max number timers up.
Definition: TGM.h:143
main structure for communication between TGMotion and Virtual PLC
Definition: TGM.h:1475
int32_t in binary representation
Definition: TGM.h:284
volatile int32_t Status
Oscilloscope status R.
Definition: TGM.h:523
int32_t AO0
analog output 0
Definition: TGM.h:928
int32_t CamTab
Location of cam profile 0 = cam profile is in CAM_PROFILE_MEMORY, 0 = cam profile is in DATA_MEMORY...
Definition: TGM.h:643
volatile int32_t Status
Servo status -1 = communications fault, 0 = no response, 1 = fault, 2 - ready disable, 3 - ready enable.
Definition: TGM.h:801
Oscilloscope control.
Definition: TGM.h:520
int32_t Axis
Axis number ( valid for multiaxis servodrives )
Definition: TGM.h:786
Log PLC loading - PE image relocation.
Definition: TGM.h:170
0 - SDO is ready for a next command
Definition: TGM.h:717
uint8_t Byte7
byte 7 of the message
Definition: TGM.h:1464
uint32_t EthMaxPacketLenght
Max. lenght of packet.
Definition: TGM.h:464
uint32_t EthPacketErrorCounter
Counter of recieve packet error.
Definition: TGM.h:463
uint32_t Offset
Offset of channel in oscilloscope memory [ byte ] R.
Definition: TGM.h:508
int32_t Ext_MeasureAmpl1
output voltage of strain gauge 1
Definition: TGM.h:940
Maps interpolator axe to servo drive.
Definition: TGM.h:678
SWPRINTF * pswprintf
formatted text output to string
Definition: TGM.h:1441
uint32_t Adrress_External_Position
offset of TGM_Data address, where external sensor position is saved
Definition: TGM.h:1228
SERVO_TYPES_XXX
Servo types.
Definition: TGM.h:212
double Position
Actual position reading from the servo [ inc ] R.
Definition: TGM.h:816
int32_t Tool_Number
actual tool number, read only
Definition: TGM.h:1258
int32_t Ext_AO2
analog output 6
Definition: TGM.h:935
int32_t AxisIndex
Attached interpolator axis number.
Definition: TGM.h:681
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.
Definition: TGM.h:1042
The HEADER struct - fixed size 128 bytes.
Definition: TGM.h:366
int32_t Ext_In2
digital input octet (logical input slot 10)
Definition: TGM.h:890
int32_t Node
Communication node number.
Definition: TGM.h:785
uint32_t ECATBusPosition
actual physical position on the ECAT bus
Definition: TGM.h:1053
uint32_t Mem_Size_System
Size of shared system memory.
Definition: TGM.h:372
uint32_t Bufer_Size
size of the command buffer in items
Definition: TGM.h:1205
volatile int32_t M_Func
Definition: TGM.h:1229
All servos.
Definition: TGM.h:264
OSC_MEMORY_TYPES
Oscilloscope memory numbers.
Definition: TGM.h:259
uint32_t VendorID
Vendor ID from .INI file for Universal I/O device.
Definition: TGM.h:1009
double ExtPosition
Actual external position reading from the servo [ inc ] R.
Definition: TGM.h:818
double Correction
Correction of position [ inc ] W.
Definition: TGM.h:820
LOADPEIMAGE * pLoadPEImage
load external PLC DLL, Windows only
Definition: TGM.h:1446
int32_t Number
number of the mapped I/O unit, interface logical number (unit 0 Number = 0, unit 1 Number = 1...
Definition: TGM.h:852
int64_t MasterClock
64-bit counter time in nanoseconds till DC started
Definition: TGM.h:465
int32_t tool
actual tool number
Definition: TGM.h:1122
Profile generator.
Definition: TGM.h:600
int32_t AO1
analog output 1
Definition: TGM.h:929
#define SDO_STATUS_ERR
SDO finished with error, the error code is in the SDO::Data.
Definition: TGM.h:698
int32_t CamExpAddress2
Offset in bytes to output value of external cam 2.
Definition: TGM.h:648
#define CONT_MFUNC_HISTORY_SIZE
holds history of continuous M functions
Definition: TGM.h:1179
INI file, ignored by TGMotion oscilloscope.
Definition: TGM.h:273
int32_t In4
digital input octet (logical input slot 4)
Definition: TGM.h:883
SLEEPFT * pSleepFt
wait for specified number of time
Definition: TGM.h:1442
INTERPOLATOR_COMMANDS
Interpolator commands (INTERPOLATOR::Command)
Definition: TGM.h:305
64 bits real data type
Definition: TGM.h:290
uint32_t Found_Total_Number_Of_ECAT_Devices
number of found device on ECAT bus
Definition: TGM.h:448
Internal memory for CNC modules.
Definition: TGM.h:268
EXT_SDO_STATUS
extended SDO communication status (the smae as for legacy SDO)
Definition: TGM.h:723
int32_t Ext_Out2
digital output octet (logical output slot 10)
Definition: TGM.h:909
uint32_t ECATBusPosition
actual physical position on the ECAT bus
Definition: TGM.h:1020
uint32_t PLC_SetCycleTime_Prg4
Adjusted cycle time of PLC program 4 thread [ mikrosec ].
Definition: TGM.h:436
int32_t Ext_AO1
analog output 5
Definition: TGM.h:934
uint32_t Number_Periods
Number of periods for one sample W.
Definition: TGM.h:524
#define SDO_CONTROL_FINISHED
SDO channel is ready for a next command.
Definition: TGM.h:687
uint8_t Byte6
byte 6 of the message
Definition: TGM.h:1463
Servo drive DMC ( not supported on the CAN )
Definition: TGM.h:224
Pointers to auxiliary functions usable in Virtual PLC.
Definition: TGM.h:1437
uint32_t User_PDO_Output_Size
size of the output PDO (Master->Slave)
Definition: TGM.h:1024
Log SDO traffix.
Definition: TGM.h:165
int32_t Ext_Out5
digital output octet (logical output slot 13)
Definition: TGM.h:912
int32_t In0
digital input octet (logical input slot 0)
Definition: TGM.h:879
int32_t Ext_MeasureAmpl4
output voltage of strain gauge 4
Definition: TGM.h:943
void * PReserve5_Memory
reserved
Definition: TGM.h:1491
1 - Write SDO
Definition: TGM.h:718
double endAngle
ending angle of arc (G2 and G3), for other (line, M func) is > 1e38
Definition: TGM.h:1131
int32_t ControlWord
copy of CAN control word
Definition: TGM.h:808
int32_t In5
digital input octet (logical input slot 5)
Definition: TGM.h:884
Servo command.
Definition: TGM.h:758
int32_t Mode
Mode of profile generator 0 = speed mode, 1 = position mode, 2( only read ) = signalizing deceleratio...
Definition: TGM.h:611
double Rel_Speed
Realive speed of the movement, 0.01 - 2.0 (i.e 1 - 200 %)
Definition: TGM.h:1274
int32_t StateDistributedClock
State of distributed clock on ETHERCAT 0 = off, 1 = on, -1 = error finding DC slave.
Definition: TGM.h:469
int32_t Internal_Reg2
Internal reg.
Definition: TGM.h:393
int32_t CamLen
Number dat of cam profile.
Definition: TGM.h:641
int32_t IntNumber
Attached interpolator number.
Definition: TGM.h:680
uint32_t editorLine
actual editor line
Definition: TGM.h:1260
double MaxCurrent
Max. drive current [ mA ] - depends on servo type R.
Definition: TGM.h:826
int32_t NumberByte
Number read/write bytes (1, 2 or 4)
Definition: TGM.h:708
uint32_t Type_Trigger
Type of trigger value 0 - 3 = int32_t, 4 - 9 = double W.
Definition: TGM.h:529
uint32_t Mem_Size_Interpolator
Size of shared interpolator memory.
Definition: TGM.h:379
int32_t AI2
analog input 2
Definition: TGM.h:919
uint32_t Mem_Size_GCode
Size of shared G code memory, user can set in .INI file!
Definition: TGM.h:384
int32_t Out
Denominator of gear ratio.
Definition: TGM.h:638
int32_t sdoResponseTries
unsuccessful SDO request counter from PLC
Definition: TGM.h:958
int32_t TGMotion_Version
Version of TGM xxx DD MM YY.
Definition: TGM.h:421
int32_t in decimal representation
Definition: TGM.h:282
int32_t Index
Index of SDO object.
Definition: TGM.h:737
Interface to all interpolators.
Definition: TGM.h:266
double Act_Speed
actual speed
Definition: TGM.h:1276
uint32_t mailBoxOutAddress
must be set by PLC before any SDO commands are performed
Definition: TGM.h:1060
int32_t plane
circle plane: 17 - XY, 18 - XZ, 19 - YZ, others not defined
Definition: TGM.h:1119
int32_t CompatibilityMem_Id
Memory compatibility code.
Definition: TGM.h:370
uint32_t mailBoxInAddress
must be set by PLC before any SDO commands are performed
Definition: TGM.h:1061
double AnalogIn
Actual value from analog input [ inc ] - depends on servo type R.
Definition: TGM.h:827
uint32_t Servo_CAN_BaudRate
CAN Communications speed with servo axes [ kbit / s ].
Definition: TGM.h:450
int32_t Internal_Reg8
Internal reg.
Definition: TGM.h:399
One oscilloscope channel definition.
Definition: TGM.h:506
Describes one servo drive (or axis)
Definition: TGM.h:782
uint32_t LookAheadBufferValidStart
the first valid antry in INTERPOLATOR::LookAheadBuffer array, wraps around _MAX_LOOKHEAD_BUFFER_SIZE ...
Definition: TGM.h:1279
uint32_t Servo_Tick
Counter of ticks servo thread.
Definition: TGM.h:427
int32_t Out7
digital output octet (logical output slot 7)
Definition: TGM.h:905
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).
Definition: TGM.h:1492
int32_t ActualIn
Actual value of numerator gear ratio.
Definition: TGM.h:639
uint32_t Servo_SetCycleTime
Adjusted cycle time of servo thread [ mikrosec ].
Definition: TGM.h:428
uint8_t Byte2
byte 2 of the message
Definition: TGM.h:1459
Timers with fixed 1ms period.
Definition: TGM.h:496
int32_t PLC_FUNC_CDECL CAN_TRANSMITREMOTE(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data)
Send CAN remote message.
Definition: TGM.h:1409
int32_t TorqueFeedForward
Torque feed forward scaling is 0.001 of rated torque.
Definition: TGM.h:807
SYSTEM * PSystem_Memory
pointer to system memory
Definition: TGM.h:1478
INTERPOLATOR * PInterpolator_Memory
pointer to interpolator memory
Definition: TGM.h:1484
int32_t Ext_AI1
analog input 5
Definition: TGM.h:923
uint32_t PLC_SetCycleTime_Prg5
Adjusted cycle time of PLC program 5 thread [ mikrosec ].
Definition: TGM.h:438
int32_t Internal_Reg7
Internal reg.
Definition: TGM.h:398
uint32_t PLC_CycleTime_Prg3
Time of execute PLC program 3 thread [ mikrosec ].
Definition: TGM.h:435
volatile uint32_t TxPointerRead
Definition: TGM.h:991
int64_t in hexadecimal representation
Definition: TGM.h:287
History of continuous M functions.
Definition: TGM.h:1184
uint32_t PLC_SetCycleTime_Prg2
Adjusted cycle time of PLC program 2 thread [ mikrosec ].
Definition: TGM.h:432
Servo drive RETROFIT for Pierce controls ( not supported on the CAN )
Definition: TGM.h:223
Log TGM CAN SDO handling CAN2.
Definition: TGM.h:160
int64_t in binary representation
Definition: TGM.h:288
CAN_TRANSMIT * pCAN_Transmit
transmit message to CAN port
Definition: TGM.h:1443
No command or previous command finished.
Definition: TGM.h:307
volatile int32_t Status
Definition: TGM.h:870
int32_t AI0
analog input 0
Definition: TGM.h:917
uint32_t correction
actual tool compensation (41 - left, 42 - right, any other value - off)
Definition: TGM.h:1262
uint32_t Mem_Size_Servo
Size of shared servo memory.
Definition: TGM.h:377
local DLL memory, ignored by TGMotion oscilloscope
Definition: TGM.h:272
RTWPRINTF_EX * pRtWprintf_Ex
formated text output to console
Definition: TGM.h:1445
uint32_t Servo_CycleTime
Time of execute servo thread [ mikrosec ].
Definition: TGM.h:429
char * PCNCIni
pointer to CNC ini memory (copy of CNC_Exe.INI file)
Definition: TGM.h:1489
double ASpeed
Actual speed of movenent[ inc/s ].
Definition: TGM.h:606
command completed OK
Definition: TGM.h:724
int32_t AO2
analog output 2
Definition: TGM.h:930
int32_t In
Numerator of gear ratio.
Definition: TGM.h:637
double CamPosition
Output position for cam gearing [ inc ].
Definition: TGM.h:624
int32_t Ext_Out6
digital output octet (logical output slot 14)
Definition: TGM.h:913
uint32_t Dummy
padding
Definition: TGM.h:536
uint32_t Number_Chanels
Number of channels [ 1 - 32 ] W.
Definition: TGM.h:525
int32_t Ext_Out3
digital output octet (logical output slot 11)
Definition: TGM.h:910
double tangens
tangent of the movement in radians, M functions have value > 1e38
Definition: TGM.h:1110
double partLength
length of the actual part
Definition: TGM.h:1137
int32_t Distributed_Clock
copy of CONFIG_TGMOTION.Distributed_Clock
Definition: TGM.h:468
uint32_t NumberByte
Number read/write bytes (1, 2 or 4), invalid value will be changed to 4.
Definition: TGM.h:749
uint32_t PLC_CycleTime_Prg5
Time of execute PLC program 5 thread [ mikrosec ].
Definition: TGM.h:439
size_t structSize
structure size
Definition: TGM.h:1477
Stores compiled G-code.
Definition: TGM.h:271
int32_t Last_ContMFunc
last continuos M function number (M > 1000)
Definition: TGM.h:1234
double RefPosition
Actual shift position from the servo [ inc ] R.
Definition: TGM.h:817
uint32_t ECATBusPosition
found physical position on the bus
Definition: TGM.h:812
uint32_t smOutputsAddress
must be set by PLC before any ECAT commands are performed
Definition: TGM.h:1062
int32_t Type
Type of speed profile 0 = harmonic non symetric, 1 = harmonic symetric, 2 = full harmonic, 3 = trapezoidal.
Definition: TGM.h:613
Universal memory contains several general structures.
Definition: TGM.h:1082
double DPos
Destination position of movenent[ inc ].
Definition: TGM.h:605
void * Pointer_interpolator_params
pointer to InterpolatorWrite memory
Definition: TGM.h:1485
double Speed
Desired speed of movenent in speed mode[ inc/s ].
Definition: TGM.h:608
Servo drive TGA24 ( not supported on the ETHERCAT )
Definition: TGM.h:215
Describes one general module.
Definition: TGM.h:1006
uint32_t Index
EtherCAT register address.
Definition: TGM.h:750
volatile uint32_t PLC_Ctrl
Control PLC ( load, run, stop... )
Definition: TGM.h:457
int32_t Ext_In3
digital input octet (logical input slot 11)
Definition: TGM.h:891
int32_t PLC_FUNC_CDECL SWPRINTF(PLC_STRING buffer, size_t sizeOfBuffer, PLC_CONST_STRING strFormat,...)
Formatted sprintf-like output to buffer.
Definition: TGM.h:1386
void * POsc_Memory
pointer to oscilloscope memory
Definition: TGM.h:1480
uint32_t Mem_Number
Number of shared memory.
Definition: TGM.h:371
int32_t SysTimeDifference
last known difference between local time and reference time in ns
Definition: TGM.h:810
int32_t Internal_Reg3
Internal reg.
Definition: TGM.h:394
HPE_MODULE PLC_FUNC_CDECL LOADPEIMAGE(PLC_CONST_STRING fileNameWithFullPath)
Load sub-DLL inside PLC.
Definition: TGM.h:1422
uint32_t PLC_CycleTime_Prg2
Time of execute PLC program 2 thread [ mikrosec ].
Definition: TGM.h:433
uint32_t Max_Servo_Cycle_Time
calculated maximum of servo loop time
Definition: TGM.h:445
uint32_t Mem_Size_Universal
Size of shared Universal memory.
Definition: TGM.h:386
uint32_t NumberByte
Number of read/write bytes (1 - 256 bytes)
Definition: TGM.h:1049
int32_t Run_Flag
Definition: TGM.h:1235
int32_t EtherCATState
I/O unit communication status from EtherCAT point of view.
Definition: TGM.h:1016
TGMmini only: Log ethernet communication.
Definition: TGM.h:163
int32_t Act_MFunc
actual M function number
Definition: TGM.h:1233
uint32_t ProductID
Product ID from .INI file.
Definition: TGM.h:1010
int32_t PLC_FUNC_CDECL RTWPRINTF_STRING(PLC_CONST_STRING strText)
Output string to console.
Definition: TGM.h:1371
uint32_t PLC_CycleTime_Prg1
Time of execute PLC program 1 thread [ mikrosec ].
Definition: TGM.h:431
int32_t sdoResponseTries
unsuccessful SDO request counter from PLC
Definition: TGM.h:1018
int32_t Ext_AO3
analog output 7
Definition: TGM.h:936
uint32_t PLC_MaxCycleTime_Prg3
Maximal measured execution time PLC program 3 thread [ mikrosec ].
Definition: TGM.h:480
volatile int32_t Act_Part
index of the actual part of the G code
Definition: TGM.h:1227
int32_t SubIndex
SubIndex of SDO object.
Definition: TGM.h:710
uint32_t Interpolator_SetCycleTime
Adjusted cycle time of INTERPOLATOR thread [ mikrosec ].
Definition: TGM.h:443
int32_t Out1
digital output octet (logical output slot 1)
Definition: TGM.h:899
double PosSpeed
Desired speed of movenent in position mode[ inc/s ].
Definition: TGM.h:607
int32_t Out0
digital output octet (logical output slot 0)
Definition: TGM.h:898
uint32_t PLC_CycleTime_Prg4
Time of execute PLC program 4 thread [ mikrosec ].
Definition: TGM.h:437
int32_t SerialNumber
Serial number of servo drives.
Definition: TGM.h:789
uint32_t LookAheadBufferValidEnd
the last valid entry in INTERPOLATOR::LookAheadBuffer array
Definition: TGM.h:1280
double PositionError
Actual position error [ inc ] R.
Definition: TGM.h:821
int32_t EtherCATState
Definition: TGM.h:948
TGM_LOG_XXX
Bitmasks for debug log output.
Definition: TGM.h:155
volatile int32_t Control
Oscilloscope control W.
Definition: TGM.h:522
uint32_t NewData
flag that new data has been received
Definition: TGM.h:1466
uint32_t Number_Dios
Number of dio modules.
Definition: TGM.h:441
uint32_t SysTimeDifference
last known difference between local time and reference time in ns
Definition: TGM.h:965
int32_t Out3
digital output octet (logical output slot 3)
Definition: TGM.h:901
double Set_Speed
wanted speed from the G-code
Definition: TGM.h:1275
int32_t NumberAI
number of connected analog inputs
Definition: TGM.h:916
uint32_t TGMmini_CPU_Temperature
TGMmini only: CPU chip temperature in degrees of Celsius, if zero, no measurement done yet...
Definition: TGM.h:476
Log main TGM.
Definition: TGM.h:156
GETPEADDRESS * pGetPEAddress
get address of a function in external PLC DLL
Definition: TGM.h:1447
int32_t SubIndex
SubIndex of SDO object.
Definition: TGM.h:738
uint32_t PLC_MaxCycleTime_Prg1
Maximal measured execution time PLC program 1 thread [ mikrosec ].
Definition: TGM.h:478
double AccMaxTorqueFeedForward
Acceleration for max feedforward [ inc/s2 ] W.
Definition: TGM.h:829
uint32_t PLC_MaxCycleTime_Prg5
Maximal measured execution time PLC program 5 thread [ mikrosec ].
Definition: TGM.h:482
EtherCAT registers communication.
Definition: TGM.h:746
EEPROM simulation.
Definition: TGM.h:571
volatile int32_t Control
Definition: TGM.h:790
int32_t Internal_Reg0
Internal reg.
Definition: TGM.h:391
The MAIN struct - fixed size of 4096 bytes.
Definition: TGM.h:419
#define SDO_STATUS_OK
SDO completed OK.
Definition: TGM.h:694
int32_t Error
Definition: TGM.h:875
int32_t Ext_Out7
digital output octet (logical output slot 15)
Definition: TGM.h:914
Servo drive TGP with 16bit control word and external position from sin/cos encoder ( not supported on...
Definition: TGM.h:220
int32_t EtherCATState
State of communications on the ETHERCAT.
Definition: TGM.h:804
int32_t DigitalOut
State of servo digital outputs, writing causes setting servo digital outputs.
Definition: TGM.h:806
#define MAX_TX_RX_BUFFER_SIZE
size of TX and RX buffers for ECAT to serial converters (currently BK1120+EL6041 only) ...
Definition: TGM.h:844
int32_t Reserve1
reserved
Definition: TGM.h:682
Log basic Ethercat traffix.
Definition: TGM.h:164
int32_t Internal_Reg9
Internal reg.
Definition: TGM.h:400
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)...
Definition: TGM.h:1054
uint32_t Life_Tick
Life tick counter.
Definition: TGM.h:368
int32_t Internal_Reg5
Internal reg.
Definition: TGM.h:396
#define SDO_CONTROL_READ
Read SDO command for SDO::Control value.
Definition: TGM.h:691
int32_t Out2
digital output octet (logical output slot 2)
Definition: TGM.h:900
int32_t Reserve2
reserved
Definition: TGM.h:683
uint32_t correction
correction value (41 - left correction, 42 - right correction, any other value - no correction) ...
Definition: TGM.h:1149
uint64_t in decimal representation
Definition: TGM.h:289
uint32_t Number_Servos
Number of servo drives.
Definition: TGM.h:440
uint32_t VendorID
Vendor ID, set by TGMotion during EtherCAT network scan.
Definition: TGM.h:1041
double Position
Output position for linear gearinig or pointer to CAM for cam gearing [ inc ].
Definition: TGM.h:623
Lookahead informations about the G-code.
Definition: TGM.h:1169
int32_t Ext_In7
digital input octet (logical input slot 15)
Definition: TGM.h:895
uint32_t Act_Timer_CycleTime
actual measured main loop cycle time [ mikrosec ]
Definition: TGM.h:470
#define SDO_STATUS_BUSY
SDO is in progress.
Definition: TGM.h:696
double Acc
Desired acceleration of movement [ inc/s2 ].
Definition: TGM.h:602
int32_t NumberIn
the number of bytes used for digital inputs (1 byte = 8 digital inputs)
Definition: TGM.h:878
int32_t CamExpLine1
Offset in byte to first data of external cam 1 in CAM_PROFILE_MEMORY or DATA_MEMORY.
Definition: TGM.h:645
int32_t Internal_Reg1
Internal reg.
Definition: TGM.h:392
int32_t NumberAO
number of connected analog outputs
Definition: TGM.h:927
command ended with error, the error code is in EXT_SDO::Data[0]
Definition: TGM.h:726
double LimitCurrent
Drive current limitation [ inc ] - depends on servo type W.
Definition: TGM.h:824
int32_t NumberOut
the number of bytes used for digital outputs (1 byte = 8 digital outputs)
Definition: TGM.h:897
SYSTEM memory.
Definition: TGM.h:260
Servo drive AKD.
Definition: TGM.h:221
int64_t MasterClockToReferenceClockDifference
MasterClock - ReferenceClock.
Definition: TGM.h:467
int32_t NumberByte
Number of read/write bytes (1 - 128)
Definition: TGM.h:736
int32_t Number_MeasureAmpl
number of connected strain gauges
Definition: TGM.h:938
int32_t Ext_MeasureAmpl7
output voltage of strain gauge 7
Definition: TGM.h:946
int32_t Ext_In4
digital input octet (logical input slot 12)
Definition: TGM.h:892
int32_t TGMathDll_Version
Version of math library xxx DD MM YY (not used in TGM420 upwards)
Definition: TGM.h:422
total number of shared memories
Definition: TGM.h:275
double radius
radius of the arc; for G0, G1, Mxx is set to zero
Definition: TGM.h:1134
void PLC_FUNC_CDECL SLEEPFT(PLC_PLARGE_INTEGER Pause)
Wait for specified time. Do not use in Program_04() !
Definition: TGM.h:1391
double ActualShift
Actual shift of pointer to cam [ inc ].
Definition: TGM.h:627
int32_t in hexadecimal representation
Definition: TGM.h:283
uint8_t Byte5
byte 5 of the message
Definition: TGM.h:1462
int32_t Ext_In1
digital input octet (logical input slot 9)
Definition: TGM.h:889
int32_t CompatibilityCnc_Id
Cnc compatibility code.
Definition: TGM.h:390
int32_t Data
read/write data of SDO object, error code if SDO::Status is -1
Definition: TGM.h:711
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.
Definition: TGM.h:1048
uint32_t PLC_MaxCycleTime_Prg4
Maximal measured execution time PLC program 4 thread [ mikrosec ].
Definition: TGM.h:481
volatile INTERPOLATOR_COMMANDS Command
command to interpolator
Definition: TGM.h:1206
Interface to CNC modules.
Definition: TGM.h:270
Stores informations about CNC code parts ahead of the actual one.
Definition: TGM.h:1104
PLC_IMPORT_FUNCTIONS functions
structure with all imported functions
Definition: TGM.h:1495
uint32_t TX_PDO
Master->Slave PDO index from .INI file (numbers in range 0x1600 - 0x17FF)
Definition: TGM.h:1011
Log PLC loading - list of exported functions.
Definition: TGM.h:171
uint32_t Memory_Type_Trigger
Type memory of trigger value W.
Definition: TGM.h:526
uint32_t SystemTimeDifferenceSum
ORed value of all DC slaves system time difference.
Definition: TGM.h:462
volatile uint32_t Log_Ctrl
Control log output texts of TGM.
Definition: TGM.h:424
double Speed
Actual speed reading from the servo [ inc/s ] R.
Definition: TGM.h:823
int32_t PLC_FUNC_CDECL RTWPRINTF_LONG(PLC_CONST_STRING strFormat, int32_t lVal)
Output long value (32bit signed integer) to console.
Definition: TGM.h:1378
command is in process
Definition: TGM.h:725
uint32_t logicalReadWriteAddress
logical FMMU address for LRW command. Set by TGMotion at device init, but can be overriden by PLC...
Definition: TGM.h:1055
int32_t Ext_In6
digital input octet (logical input slot 14)
Definition: TGM.h:894
int32_t Ext_MeasureAmpl2
output voltage of strain gauge 2
Definition: TGM.h:941
uint8_t Byte0
byte 0 of the message
Definition: TGM.h:1457
int32_t AI1
analog input 1
Definition: TGM.h:918
Log detailed Ethercat master FSM states.
Definition: TGM.h:168
double WritePosition
Wanted servo position [ inc ] RW.
Definition: TGM.h:815
void * PCNCEx
pointer to CNC memory
Definition: TGM.h:1487
int32_t Rdy
Flag end of movemnet 1 = Destination position is reached.
Definition: TGM.h:612
int32_t Ext_Out0
digital output octet (logical output slot 8)
Definition: TGM.h:907
double Shift
Desired shift of pointer to cam [ inc ].
Definition: TGM.h:626
uint32_t smInputsAddress
must be set by PLC before any ECAT commands are performed
Definition: TGM.h:1063
Log TGM interpolator.
Definition: TGM.h:157
int32_t PLC_FUNC_CDECL CAN_TRANSMIT(uint32_t Number, uint32_t Id, uint32_t Dlc, unsigned char *Tx_Data)
Send CAN message.
Definition: TGM.h:1400
int32_t Mode
Gear generator modes 0 = gear generator off, 1 = linear gearing is active, 2 = cam gearinig is active...
Definition: TGM.h:636
One entry of incoming CAN data.
Definition: TGM.h:1455
int32_t SourceNumber
Number of logical servo used for source of master position.
Definition: TGM.h:634
uint32_t CAN_Transmit_Buffer_Fullness
fullness of the CAN transmit buffer, PC: 0 or 1, TGMmini: 0 - 55
Definition: TGM.h:483
int32_t Out5
digital output octet (logical output slot 5)
Definition: TGM.h:903
void *PLC_FUNC_CDECL GETPEADDRESS(HPE_MODULE hModule, const char *funcName)
Get function addres from module loaded by LOADPEIMAGE()
Definition: TGM.h:1429
uint32_t logicalWriteAddress
logical FMMU address for LWR command. Set by TGMotion at device init, but can be overriden by PLC...
Definition: TGM.h:1057
Servo drive TGA220 ( not supported on the CAN )
Definition: TGM.h:222
void * PGCode
pointer to G code memory
Definition: TGM.h:1488
Shared memory named "TGM_System".
Definition: TGM.h:583
int32_t Ext_MeasureAmpl3
output voltage of strain gauge 3
Definition: TGM.h:942
int32_t Error
Fault code.
Definition: TGM.h:803
volatile int32_t Status
Definition: TGM.h:1216
uint32_t Mode_Trigger
Trigger mode 0 = off 1 = rising edge 2 = falling edge W.
Definition: TGM.h:528
uint32_t mailBoxSize
both mailBoxOut and mailBoxIn should be set to the same size. This value must be set by PLC before an...
Definition: TGM.h:1059
double startAngle
starting angle of arc (G2 and G3), for other (line, M func) is > 1e38
Definition: TGM.h:1128
int32_t StatusWord
copy of CAN status word
Definition: TGM.h:809
uint32_t Max_Timer_Latency
calculated main loop timer latency
Definition: TGM.h:473
Stores debug, warning and error messages in a circular buffer.
Definition: TGM.h:269
32 bits real data type (single data type Pascal)
Definition: TGM.h:291
volatile EXT_SDO_STATUS Status
Status of SDO communication 0 = finished, 1 = active, -1 = error.
Definition: TGM.h:735
#define SDO_CONTROL_WRITE
Write SDO command for SDO::Control value.
Definition: TGM.h:689
int32_t Ext_AI0
analog input 4
Definition: TGM.h:922
int32_t movementCode
G or M function number.
Definition: TGM.h:1116
int32_t Ext_Out1
digital output octet (logical output slot 9)
Definition: TGM.h:908
double WriteSpeed
Actual speed writing to servo [ inc/s ] R.
Definition: TGM.h:822
uint32_t in decimal representation
Definition: TGM.h:285
volatile int32_t Status
Status of SDO communication 0 = finished, 1 = active, -1 = error.
Definition: TGM.h:707
OSC_MEMORY_TYPES Memory_Type_Value
Type memory of value W.
Definition: TGM.h:509
uint32_t Sample_Time
Actual time of one sample [ mikrosec ] R.
Definition: TGM.h:535
Servo drive TGZ ( not supported on the CAN )
Definition: TGM.h:225
int32_t AI3
analog input 3
Definition: TGM.h:920
Describes which PCI device is ised as a EtherCAT device.
Definition: TGM.h:545
double CamScale
Scaling faktor of cam profile.
Definition: TGM.h:631
int32_t Ext_In0
digital input octet (logical input slot 8)
Definition: TGM.h:888
double Current
Actual drive current [ inc ] - depends on servo type R.
Definition: TGM.h:825
uint32_t Dio_CAN_BaudRate
CAN Communications speed with DIO modules [ kbit / s ].
Definition: TGM.h:451
uint32_t SetECATBusPosition
desired physical position on the bus
Definition: TGM.h:1013
Oscilloscope memory. Stores oscilloscope values. Read-only.
Definition: TGM.h:263
volatile int32_t Control
bit 0 = fault reset, bit 2 = EtherCAT communication reset
Definition: TGM.h:869
volatile EXT_SDO_CONTROL Control
Control of SDO communication 1 = write request, 2 = read request.
Definition: TGM.h:734
Describes one general module.
Definition: TGM.h:1039
uint32_t Mem_Size_Osc
Definition: TGM.h:375
Capture position from servo.
Definition: TGM.h:656
Log TGM CAN.
Definition: TGM.h:158
Servo drive TGA24 ( not supported on the ETHERCAT )
Definition: TGM.h:214
double IncShift
Increment of shift pointer to cam [ inc / servotick ].
Definition: TGM.h:628
double Offset
Shift of the position [ inc ] W.
Definition: TGM.h:819
#define N_OSC_CHANNELS
Max number of oscilloscope numbers.
Definition: TGM.h:515
CONT_MFUNC_HISTORY Cont_MFunc_History
continuous M funcs history
Definition: TGM.h:1259
int32_t TGM_TgMotionKill
Kill the TGM by setting to 0x4C4C494B value.
Definition: TGM.h:423
uint32_t Number
interpolator number
Definition: TGM.h:1203
uint32_t PLC_SetCycleTime_Prg1
Adjusted cycle time of PLC program 1 thread [ mikrosec ].
Definition: TGM.h:430
DIO * PDio_Memory
pointer to dio memory
Definition: TGM.h:1483
int64_t in decimal representation
Definition: TGM.h:286
Universal memory for general devices, etc.
Definition: TGM.h:274
uint32_t Mem_Size_InterpolatorRead
Size of shared interpolator read memory.
Definition: TGM.h:381
uint32_t Mem_Size_CncIni
Size of shared CNC INI memory.
Definition: TGM.h:385
double Offset
Offset of output position [ inc ].
Definition: TGM.h:625
void * Pointer_interpolator_get_position
pointer to InterpolatorRead memory
Definition: TGM.h:1486
Gear generator.
Definition: TGM.h:621
uint32_t fileIdx
index of source G code text file
Definition: TGM.h:1146
uint32_t Mem_Size_Dio
Size of shared dio memory.
Definition: TGM.h:378
volatile uint32_t Control
Control of register communication 1 = write request, 2 = read request, 3 - error, 0 = ready...
Definition: TGM.h:748
int32_t CamType
Type of cam 0 = reversable cam, 1 = forward cam.
Definition: TGM.h:642
double APos
Actual position of movenent[ inc ].
Definition: TGM.h:604
int32_t Internal_Reg4
Internal reg.
Definition: TGM.h:395
int32_t Out6
digital output octet (logical output slot 6)
Definition: TGM.h:904
int32_t In2
digital input octet (logical input slot 2)
Definition: TGM.h:881
int64_t ReferenceClock
read 64-bit counter of the first slave with DC
Definition: TGM.h:466
Log PLC loading - PE image analysis.
Definition: TGM.h:169
uint32_t lastValidEntry
index to mFuncs array - points to last entered continuous M func
Definition: TGM.h:1187
Log GEAR generator.
Definition: TGM.h:162
int32_t Node
address of the physical I/O unit, which is set on the unit directly
Definition: TGM.h:853
int32_t Control
Control of EEprom handling 1 = load, 2 = save W.
Definition: TGM.h:573
uint32_t CAN_Sync_Act_Time
Actual time between two CAN SYNCs.
Definition: TGM.h:475
double IncIn
Increment of ramp Gear.ActualIn [ inc / servotick ].
Definition: TGM.h:629
double CamIncPosition
Increment of position incremental cam [ inc ].
Definition: TGM.h:630
RTWPRINTF_LONG * pRtWprintf_Long
prints value of lVal to console
Definition: TGM.h:1440
#define SIZE_EEPROM_MEMORY
Size eeprom memory [ bytes ].
Definition: TGM.h:566
uint32_t ECATBusPosition
actual physical position on the ECAT bus
Definition: TGM.h:968
uint32_t Size_EEPROM_Memory
size of EEPROM memory, zero means size of 512 bytes (compatibility with previous TGM versions) ...
Definition: TGM.h:474
int32_t Number
Logical servo number.
Definition: TGM.h:784
uint32_t Number_Samples
Number of samples per channel R.
Definition: TGM.h:533
int32_t EtherCATState
I/O unit communication status from EtherCAT point of view.
Definition: TGM.h:1046
Servo drive Servostar 300 or Servostar 700.
Definition: TGM.h:216
Log distributed clock capability & topology.
Definition: TGM.h:167
uint32_t Actual_Samples
Actual number of samples per chanel R.
Definition: TGM.h:534
int32_t Index
Index of SDO object.
Definition: TGM.h:709
uint32_t Offset_Value
Offset of value in memory value [ byte ] W.
Definition: TGM.h:510
OSC_DATA_TYPES
Oscilloscope data types.
Definition: TGM.h:281
int32_t CamLine
Offset in bytes to first data of cam profile in CAM_PROFILE_MEMORY or DATA_MEMORY.
Definition: TGM.h:640
uint32_t RX_PDO
Slave->Master PDO index from .INI file (numbers in range 0x1A00 - 0x1BFF)
Definition: TGM.h:1012
uint32_t Dlc
length of the message
Definition: TGM.h:1465
2 - Read SDO
Definition: TGM.h:719
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).
Definition: TGM.h:1493
uint32_t Mem_Size_Data
Size of shared data memory.
Definition: TGM.h:373
EXT_SDO_CONTROL
extended SDO commands (more than 4 bytes of data available)
Definition: TGM.h:716
Describes one servo input/output module.
Definition: TGM.h:850
int32_t Ext_In5
digital input octet (logical input slot 13)
Definition: TGM.h:893