45 #ifndef TGMCOMMINT2_DLL_H 46 #define TGMCOMMINT2_DLL_H 51 #define COM_CALLTYPE _cdecl 54 #define MAX_OFFLINE_COUNT 100 63 #elif !defined UNDER_RTSS 74 # define TGM_HWND TGM_HWND 75 typedef HWND TGM_HWND;
78 # if !defined _UNICODE 79 # error "_UNICODE must be defined for WIN32" 83 # define TGM_TCHAR TGM_TCHAR 84 typedef wchar_t TGM_TCHAR;
88 # define TGM_WCHAR TGM_WCHAR 89 typedef wchar_t TGM_WCHAR;
93 # define TGM_TEXT(a) TEXT(a) 96 #else // linux or rtss 99 # define TGM_HWND TGM_HWND 100 typedef intptr_t TGM_HWND;
104 # define TGM_TCHAR TGM_TCHAR 105 typedef char TGM_TCHAR;
109 # define TGM_WCHAR TGM_WCHAR 110 typedef uint16_t TGM_WCHAR;
117 # define TGM_TEXT(a) (a) 126 #define TGM_COMM_INT_VIRTUAL 131 # if _MSC_VER < 1800 // below Visual Studio 2013 132 # pragma warning(push) 133 # pragma warning(disable : 4480) // VS2010: disable warning: non-standard extension used 134 # endif // Visual Studio 2013+ 137 #ifndef ENUM_CLASS_DEFINED 139 # define ENUM_CLASS class 140 # elif _MSC_VER < 1800 // below Visual Studio 2013 142 # else // Visual Studio 2013+ 143 # define ENUM_CLASS class 144 # endif // _MSC_VER < 1800 145 # define ENUM_CLASS_DEFINED 146 #endif // !ENUM_CLASS_DEFINED 192 static int32_t errorCodeToInt(
error_code errorCode)
194 return static_cast<int32_t
>(errorCode);
209 static uint32_t deviceToInt(
device deviceType)
211 return static_cast<uint32_t
>(deviceType);
213 static device intToDevice(uint32_t deviceType)
217 case static_cast<uint32_t
>(device::Local_TGM) :
218 return device::Local_TGM;
219 case static_cast<uint32_t
>(device::TGM_Mini) :
220 return device::TGM_Mini;
221 case static_cast<uint32_t
>(device::TGM_REMOTE) :
222 return device::TGM_REMOTE;
224 return device::Local_TGM;
247 return static_cast<int32_t
>(mem);
257 App_Mem_ID_None = -1,
263 return static_cast<int32_t
>(comp);
272 Simulation_Mode_TGM = 2,
287 static int32_t statusToInt(
status statusCode)
289 return static_cast<int32_t
>(statusCode);
310 static int32_t readWriteToInt(
read_write rwCode)
312 return static_cast<int32_t
>(rwCode);
343 return static_cast<uint32_t
>(memoryType);
350 case 0:
return shared_memory::SYSTEM;
351 case 1:
return shared_memory::DATA;
352 case 2:
return shared_memory::CAM;
353 case 3:
return shared_memory::OSC;
354 case 4:
return shared_memory::SERVO;
355 case 5:
return shared_memory::DIO;
356 case 6:
return shared_memory::INTERP;
357 case 7:
return shared_memory::INTERP_W;
358 case 8:
return shared_memory::INTERP_R;
359 case 9:
return shared_memory::ODS;
360 case 10:
return shared_memory::CNC_EX;
361 case 11:
return shared_memory::G_CODE;
362 case 12:
return shared_memory::CNC_EX_LOCAL;
363 case 13:
return shared_memory::CNC_INI;
364 case 14:
return shared_memory::UNIVERSAL;
368 static_assert(static_cast<uint32_t>(shared_memory::NMemories) == 15,
"Number of shared memories must be 15");
369 return shared_memory::NMemories;
396 assert(fileName !=
nullptr);
398 if (rv != error_code::Success)
400 m_pCREATE_INTERFACE_2 =
reinterpret_cast<TGM_CREATE_INTERFACE_2 *
>(getFuncAddress(fileName,
"Create_Interface_2"));
401 m_pDESTROY_INTERFACE =
reinterpret_cast<TGM_DESTROY_INTERFACE *
>(getFuncAddress(fileName,
"Destroy_Interface"));
402 m_pOPEN_CONNECTION =
reinterpret_cast<TGM_OPEN_CONNECTION *
>(getFuncAddress(fileName,
"Open_Connection"));
403 m_pCHANGE_CONNECTION =
reinterpret_cast<TGM_CHANGE_CONNECTION *
>(getFuncAddress(fileName,
"Change_Connection"));
404 m_pCLOSE_CONNECTION =
reinterpret_cast<TGM_CLOSE_CONNECTION *
>(getFuncAddress(fileName,
"Close_Connection"));
405 m_pGET_DLL_INFO =
reinterpret_cast<TGM_GET_DLL_INFO *
>(getFuncAddress(fileName,
"Get_DLL_Info"));
406 m_pSET_APP_COMPATIBILITY_VN =
reinterpret_cast<TGM_SET_APP_COMPATIBILITY_VN *
>(getFuncAddress(fileName,
"Set_App_Compatibility_VN"));
407 m_pGET_STATUS =
reinterpret_cast<TGM_GET_STATUS *
>(getFuncAddress(fileName,
"Get_Status"));
408 m_pGET_STATUS_GRAPHICS =
reinterpret_cast<TGM_GET_STATUS_GRAPHICS *
>(getFuncAddress(fileName,
"Get_Status_Graphics"));
409 m_pGET_CONNECTIONS_INFO_2 =
reinterpret_cast<TGM_GET_CONNECTIONS_INFO_2 *
>(getFuncAddress(fileName,
"Get_Connections_Info_2"));
410 m_pGET_SERVER_INFO =
reinterpret_cast<TGM_GET_SERVER_INFO *
>(getFuncAddress(fileName,
"Get_Server_Info"));
412 m_pSHOW_CONNECTIONS_INFO_WIN =
reinterpret_cast<TGM_SHOW_CONNECTIONS_INFO_WIN *
>(getFuncAddress(fileName,
"Show_Connections_Info_Win"));
413 m_pCLOSE_CONNECTIONS_INFO_WIN =
reinterpret_cast<TGM_CLOSE_CONNECTIONS_INFO_WIN *
>(getFuncAddress(fileName,
"Close_Connections_Info_Win"));
414 m_pGET_CONNECTIONS_INFO_WIN_DIMENSION =
reinterpret_cast<TGM_GET_CONNECTIONS_INFO_WIN_DIMENSION *
>(getFuncAddress(fileName,
"Get_Connections_Info_Win_Dimension"));
416 m_pREAD_I32 =
reinterpret_cast<TGM_READ_I32 *
>(getFuncAddress(fileName,
"Read_I32"));
417 m_pREAD_I64 =
reinterpret_cast<TGM_READ_I64 *
>(getFuncAddress(fileName,
"Read_I64"));
418 m_pREAD_double =
reinterpret_cast<TGM_READ_double *
>(getFuncAddress(fileName,
"Read_Double"));
419 m_pREAD_BLOCK =
reinterpret_cast<TGM_READ_BLOCK *
>(getFuncAddress(fileName,
"Read_Block"));
420 m_pREAD_LPSTR =
reinterpret_cast<TGM_READ_LPSTR *
>(getFuncAddress(fileName,
"Read_LPSTR"));
421 m_pREAD_LPWSTR =
reinterpret_cast<TGM_READ_LPWSTR *
>(getFuncAddress(fileName,
"Read_LPWSTR"));
422 m_pWRITE_I32 =
reinterpret_cast<TGM_WRITE_I32 *
>(getFuncAddress(fileName,
"Write_I32"));
423 m_pWRITE_I64 =
reinterpret_cast<TGM_WRITE_I64 *
>(getFuncAddress(fileName,
"Write_I64"));
424 m_pWRITE_double =
reinterpret_cast<TGM_WRITE_double *
>(getFuncAddress(fileName,
"Write_Double"));
425 m_pWRITE_BLOCK =
reinterpret_cast<TGM_WRITE_BLOCK *
>(getFuncAddress(fileName,
"Write_Block"));
426 m_pWRITE_LPSTR =
reinterpret_cast<TGM_WRITE_LPSTR *
>(getFuncAddress(fileName,
"Write_LPSTR"));
427 m_pWRITE_LPWSTR =
reinterpret_cast<TGM_WRITE_LPWSTR *
>(getFuncAddress(fileName,
"Write_LPWSTR"));
428 m_pSET_BIT_I32 =
reinterpret_cast<TGM_SET_BIT_I32 *
>(getFuncAddress(fileName,
"SetB_I32"));
429 m_pSET_BIT_I64 =
reinterpret_cast<TGM_SET_BIT_I64 *
>(getFuncAddress(fileName,
"SetB_I64"));
430 m_pCLR_BIT_I32 =
reinterpret_cast<TGM_CLR_BIT_I32 *
>(getFuncAddress(fileName,
"ClrB_I32"));
431 m_pCLR_BIT_I64 =
reinterpret_cast<TGM_CLR_BIT_I64 *
>(getFuncAddress(fileName,
"ClrB_I64"));
432 m_pTGL_BIT_I32 =
reinterpret_cast<TGM_TGL_BIT_I32 *
>(getFuncAddress(fileName,
"TglB_I32"));
433 m_pTGL_BIT_I64 =
reinterpret_cast<TGM_TGL_BIT_I64 *
>(getFuncAddress(fileName,
"TglB_I64"));
434 m_pREAD_I32_DIRECT =
reinterpret_cast<TGM_READ_I32_DIRECT *
>(getFuncAddress(fileName,
"Read_I32_Direct"));
435 m_pREAD_I64_DIRECT =
reinterpret_cast<TGM_READ_I64_DIRECT *
>(getFuncAddress(fileName,
"Read_I64_Direct"));
436 m_pREAD_double_DIRECT =
reinterpret_cast<TGM_READ_double_DIRECT *
>(getFuncAddress(fileName,
"Read_Double_Direct"));
437 m_pREAD_BLOCK_DIRECT =
reinterpret_cast<TGM_READ_BLOCK_DIRECT *
>(getFuncAddress(fileName,
"Read_Block_Direct"));
438 m_pREAD_LPSTR_DIRECT =
reinterpret_cast<TGM_READ_LPSTR_DIRECT *
>(getFuncAddress(fileName,
"Read_LPSTR_Direct"));
439 m_pREAD_LPWSTR_DIRECT =
reinterpret_cast<TGM_READ_LPWSTR_DIRECT *
>(getFuncAddress(fileName,
"Read_LPWSTR_Direct"));
440 m_pWRITE_I32_DIRECT =
reinterpret_cast<TGM_WRITE_I32_DIRECT *
>(getFuncAddress(fileName,
"Write_I32_Direct"));
441 m_pWRITE_I64_DIRECT =
reinterpret_cast<TGM_WRITE_I64_DIRECT *
>(getFuncAddress(fileName,
"Write_I64_Direct"));
442 m_pWRITE_double_DIRECT =
reinterpret_cast<TGM_WRITE_double_DIRECT *
>(getFuncAddress(fileName,
"Write_Double_Direct"));
443 m_pWRITE_BLOCK_DIRECT =
reinterpret_cast<TGM_WRITE_BLOCK_DIRECT *
>(getFuncAddress(fileName,
"Write_Block_Direct"));
444 m_pWRITE_LPSTR_DIRECT =
reinterpret_cast<TGM_WRITE_LPSTR_DIRECT *
>(getFuncAddress(fileName,
"Write_LPSTR_Direct"));
445 m_pWRITE_LPWSTR_DIRECT =
reinterpret_cast<TGM_WRITE_LPWSTR_DIRECT *
>(getFuncAddress(fileName,
"Write_LPWSTR_Direct"));
446 m_pSET_BIT_I32_DIRECT =
reinterpret_cast<TGM_SET_BIT_I32_DIRECT *
>(getFuncAddress(fileName,
"SetB_I32_Direct"));
447 m_pSET_BIT_I64_DIRECT =
reinterpret_cast<TGM_SET_BIT_I64_DIRECT *
>(getFuncAddress(fileName,
"SetB_I64_Direct"));
448 m_pCLR_BIT_I32_DIRECT =
reinterpret_cast<TGM_CLR_BIT_I32_DIRECT *
>(getFuncAddress(fileName,
"ClrB_I32_Direct"));
449 m_pCLR_BIT_I64_DIRECT =
reinterpret_cast<TGM_CLR_BIT_I64_DIRECT *
>(getFuncAddress(fileName,
"ClrB_I64_Direct"));
450 m_pTGL_BIT_I32_DIRECT =
reinterpret_cast<TGM_TGL_BIT_I32_DIRECT *
>(getFuncAddress(fileName,
"TglB_I32_Direct"));
451 m_pTGL_BIT_I64_DIRECT =
reinterpret_cast<TGM_TGL_BIT_I64_DIRECT *
>(getFuncAddress(fileName,
"TglB_I64_Direct"));
452 m_pFLUSH_BUFFER =
reinterpret_cast<TGM_FLUSH_BUFFER *
>(getFuncAddress(fileName,
"Fluh_Buffer"));
454 #if defined __linux__ 455 QFileInfo dirAndPath(fileName);
459 wchar_t dirAndPath[_MAX_DIR + _MAX_PATH], path[_MAX_PATH];
460 int wchars_num = MultiByteToWideChar(CP_UTF8, 0, fileName, -1, NULL, 0);
463 return error_code::Invalid_Data;
465 WCHAR* fileNameW =
new WCHAR[
static_cast<size_t>(wchars_num)];
466 MultiByteToWideChar(CP_UTF8, 0, fileName, -1, fileNameW, wchars_num);
468 _wsplitpath_s(fileNameW, dirAndPath,
_countof(dirAndPath), path,
_countof(path),
nullptr, 0,
nullptr, 0);
471 wcscat_s(dirAndPath, path);
483 assert(DLL_Directory !=
nullptr);
484 if (m_nCreateInterfaceCalled > 0)
485 return error_code::Interface_Already_Exists;
487 if (m_pCREATE_INTERFACE_2)
490 if (statusCode == status::Offline_Interface_Not_Create)
492 m_offlineCounter = 0;
493 error_code code = dispErrorCode((
"Create_Interface_2"), m_pCREATE_INTERFACE_2(DLL_Directory));
494 if (code == error_code::Success)
496 m_nCreateInterfaceCalled++;
497 m_bCreateInterfaceAlreadyCalledByApplication =
false;
503 m_nCreateInterfaceCalled++;
506 m_bCreateInterfaceAlreadyCalledByApplication =
true;
507 return error_code::Success;
510 return error_code::Not_Detect_Comm_DLL;
517 m_nCreateInterfaceCalled--;
518 if(m_nCreateInterfaceCalled != 0)
521 if (m_pDESTROY_INTERFACE)
526 if (m_bCreateInterfaceAlreadyCalledByApplication ==
false)
527 m_pDESTROY_INTERFACE();
543 if (m_nCreateInterfaceCalled != 1)
544 return error_code::Interface_Not_Create;
548 if (statusCode == status::Offline_Interface_Not_Create)
549 return error_code::Interface_Not_Create;
552 if (m_nOpenConnectionCalled > 0)
553 return error_code::Connection_Already_Exists;
555 m_nOpenConnectionCalled++;
557 error_code rv = error_code::Not_Detect_Comm_DLL;
558 if (statusCode == status::Offline_Connection_Not_Opened)
560 m_offlineCounter = 0;
561 if (m_pOPEN_CONNECTION)
563 m_bOpenConnectionAlreadyCalledByApplication =
false;
564 rv = dispErrorCode((
"Open_Connection"), m_pOPEN_CONNECTION(keepOnline, commTimeout, deviceType, IPAddress));
571 m_bOpenConnectionAlreadyCalledByApplication =
true;
582 if (m_nCreateInterfaceCalled != 1)
583 return error_code::Interface_Not_Create;
587 if (statusCode == status::Offline_Interface_Not_Create)
588 return error_code::Interface_Not_Create;
590 m_nOpenConnectionCalled--;
591 if(m_nOpenConnectionCalled != 0)
593 return error_code::Connection_Not_Open;
597 if (m_bOpenConnectionAlreadyCalledByApplication ==
false)
599 if (m_pCLOSE_CONNECTION)
600 return dispErrorCode((
"Close_Connection"), m_pCLOSE_CONNECTION());
601 return error_code::Not_Detect_Comm_DLL;
603 return error_code::Success;
613 if (m_nCreateInterfaceCalled != 1)
614 return error_code::Interface_Not_Create;
618 if (statusCode == status::Offline_Interface_Not_Create)
619 return error_code::Interface_Not_Create;
622 if(m_nOpenConnectionCalled != 1)
624 return error_code::Connection_Not_Open;
627 return dispErrorCode((
"CHANGE_CONNECTION"), m_pCHANGE_CONNECTION(deviceType, IPAddress));
639 assert(pVersion !=
nullptr);
640 assert(pCompatibilityID !=
nullptr);
641 assert(pCompatibilityMemID !=
nullptr);
643 return dispErrorCode((
"GET_DLL_INFO"), m_pGET_DLL_INFO(deviceType, pVersion, pCompatibilityID, pCompatibilityMemID));
644 return error_code::Not_Detect_Comm_DLL;
660 assert(appName !=
nullptr);
661 if (m_pSET_APP_COMPATIBILITY_VN)
662 m_pSET_APP_COMPATIBILITY_VN(compatibilityID, compatibilityMemID, version, appName);
671 return m_pGET_STATUS();
672 return status::Offline_Not_Detect_Comm_DLL;
685 if (m_pGET_STATUS_GRAPHICS)
686 return m_pGET_STATUS_GRAPHICS(pBackgroundColor, pTextColor, statusText);
687 return status::Offline_Not_Detect_Comm_DLL;
699 if (m_pSHOW_CONNECTIONS_INFO_WIN)
700 return m_pSHOW_CONNECTIONS_INFO_WIN(parent, enableChangeConnection);
701 return error_code::Not_Detect_Comm_DLL;
710 if (m_pCLOSE_CONNECTIONS_INFO_WIN)
711 return m_pCLOSE_CONNECTIONS_INFO_WIN();
712 return error_code::Not_Detect_Comm_DLL;
724 assert(pWidth !=
nullptr);
725 assert(pHeight !=
nullptr);
726 if (m_pGET_CONNECTIONS_INFO_WIN_DIMENSION)
727 m_pGET_CONNECTIONS_INFO_WIN_DIMENSION(pWidth, pHeight);
740 assert(pDeviceType !=
nullptr);
741 assert(IPAddress !=
nullptr);
742 assert(pConnectedMemory !=
nullptr);
743 if (m_pGET_CONNECTIONS_INFO_2)
744 return dispErrorCode((
"GET_CONNECTIONS_INFO_2"), m_pGET_CONNECTIONS_INFO_2(pDeviceType, IPAddress, pConnectedMemory));
745 return error_code::Not_Detect_Comm_DLL;
758 int32_t *pCompatibilityID,
759 int32_t *pCompatibilityMemID,
760 status *pConnectionStatus)
762 assert(pCompatibilityID !=
nullptr);
763 assert(pCompatibilityMemID !=
nullptr);
764 assert(pConnectionStatus !=
nullptr);
765 if (m_pGET_SERVER_INFO)
766 return dispErrorCode((
"GET_SERVER_INFO"), m_pGET_SERVER_INFO(deviceType, pCompatibilityID, pCompatibilityMemID, pConnectionStatus));
767 return error_code::Not_Detect_Comm_DLL;
782 assert(pValue !=
nullptr);
783 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
784 return read_write::ERR_Device_Busy;
786 return dispErrorCode((
"READ_I32"), m_pREAD_I32(memoryType, offset, pValue));
787 return read_write::ERR_Not_Detect_Comm_DLL;
801 assert(pValue !=
nullptr);
802 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
803 return read_write::ERR_Device_Busy;
805 return dispErrorCode((
"READ_I64"), m_pREAD_I64(memoryType, offset, pValue));
806 return read_write::ERR_Not_Detect_Comm_DLL;
820 assert(pValue !=
nullptr);
821 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
822 return read_write::ERR_Device_Busy;
824 return dispErrorCode((
"READ_double"), m_pREAD_double(memoryType, offset, pValue));
825 return read_write::ERR_Not_Detect_Comm_DLL;
840 assert(buffer !=
nullptr);
841 assert(bufferLength > 0);
842 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
843 return read_write::ERR_Device_Busy;
845 return dispErrorCode((
"READ_BLOCK"), m_pREAD_BLOCK(memoryType, offset, buffer, bufferLength));
846 return read_write::ERR_Not_Detect_Comm_DLL;
863 assert(buffer !=
nullptr);
864 assert(buffer_Char_Len > 0);
865 assert(pRead_Char_Count !=
nullptr);
866 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
867 return read_write::ERR_Device_Busy;
869 return dispErrorCode((
"Read_LPSTR"), m_pREAD_LPSTR(memoryType, offset, buffer, buffer_Char_Len, pRead_Char_Count));
870 return read_write::ERR_Not_Detect_Comm_DLL;
885 assert(buffer !=
nullptr);
886 assert(buffer_Char_Len > 0);
887 assert(pRead_Char_Count !=
nullptr);
888 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
889 return read_write::ERR_Device_Busy;
891 return dispErrorCode((
"Read_LPWSTR"), m_pREAD_LPWSTR(memoryType, offset, buffer, buffer_Char_Len, pRead_Char_Count));
892 return read_write::ERR_Not_Detect_Comm_DLL;
904 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
905 return read_write::ERR_Device_Busy;
907 return dispErrorCode((
"WRITE_I32"), m_pWRITE_I32(memoryType, offset, Value));
908 return read_write::ERR_Not_Detect_Comm_DLL;
920 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
921 return read_write::ERR_Device_Busy;
923 return dispErrorCode((
"WRITE_I64"), m_pWRITE_I64(memoryType, offset, Value));
924 return read_write::ERR_Not_Detect_Comm_DLL;
937 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
938 return read_write::ERR_Device_Busy;
940 return dispErrorCode((
"WRITE_double"), m_pWRITE_double(memoryType, offset, Value));
941 return read_write::ERR_Not_Detect_Comm_DLL;
958 assert(buffer !=
nullptr);
959 assert(bufferLength > 0);
960 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
961 return read_write::ERR_Device_Busy;
963 return dispErrorCode((
"WRITE_BLOCK"), m_pWRITE_BLOCK(memoryType, offset, buffer, bufferLength));
964 return read_write::ERR_Not_Detect_Comm_DLL;
982 assert(buffer !=
nullptr);
983 assert(Write_Char_Len > 0);
984 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
985 return read_write::ERR_Device_Busy;
987 return dispErrorCode((
"Write_LPSTR"), m_pWRITE_LPSTR(memoryType, offset, buffer, Write_Char_Len));
988 return read_write::ERR_Not_Detect_Comm_DLL;
1006 assert(buffer !=
nullptr);
1007 assert(Write_Char_Len > 0);
1008 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1009 return read_write::ERR_Device_Busy;
1010 if (m_pWRITE_LPWSTR)
1011 return dispErrorCode((
"Write_LPWSTR"), m_pWRITE_LPWSTR(memoryType, offset, buffer, Write_Char_Len));
1012 return read_write::ERR_Not_Detect_Comm_DLL;
1025 assert((offset & 0x3) == 0);
1026 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1027 return read_write::ERR_Device_Busy;
1029 return dispErrorCode((
"SET_BIT_I32"), m_pSET_BIT_I32(memoryType, offset, Value));
1030 return read_write::ERR_Not_Detect_Comm_DLL;
1043 assert((offset & 0x7) == 0);
1044 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1045 return read_write::ERR_Device_Busy;
1047 return dispErrorCode((
"SET_BIT_I64"), m_pSET_BIT_I64(memoryType, offset, Value));
1048 return read_write::ERR_Not_Detect_Comm_DLL;
1061 assert((offset & 0x3) == 0);
1062 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1063 return read_write::ERR_Device_Busy;
1065 return dispErrorCode((
"CLR_BIT_I32"), m_pCLR_BIT_I32(memoryType, offset, Value));
1066 return read_write::ERR_Not_Detect_Comm_DLL;
1079 assert((offset & 0x7) == 0);
1080 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1081 return read_write::ERR_Device_Busy;
1083 return dispErrorCode((
"CLR_BIT_I64"), m_pCLR_BIT_I64(memoryType, offset, Value));
1084 return read_write::ERR_Not_Detect_Comm_DLL;
1097 assert((offset & 0x3) == 0);
1098 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1099 return read_write::ERR_Device_Busy;
1101 return dispErrorCode((
"TGL_BIT_I32"), m_pTGL_BIT_I32(memoryType, offset, Value));
1102 return read_write::ERR_Not_Detect_Comm_DLL;
1115 assert((offset & 0x7) == 0);
1116 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1117 return read_write::ERR_Device_Busy;
1119 return dispErrorCode((
"TGL_BIT_I64"), m_pTGL_BIT_I64(memoryType, offset, Value));
1120 return read_write::ERR_Not_Detect_Comm_DLL;
1135 assert(pValue !=
nullptr);
1136 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1137 return read_write::ERR_Device_Busy;
1138 if (m_pREAD_I32_DIRECT)
1139 return dispErrorCode((
"READ_I32_DIRECT"), m_pREAD_I32_DIRECT(memoryType, offset, pValue));
1140 return read_write::ERR_Not_Detect_Comm_DLL;
1154 assert(pValue !=
nullptr);
1155 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1156 return read_write::ERR_Device_Busy;
1157 if (m_pREAD_I64_DIRECT)
1158 return dispErrorCode((
"READ_I64_DIRECT"), m_pREAD_I64_DIRECT(memoryType, offset, pValue));
1159 return read_write::ERR_Not_Detect_Comm_DLL;
1173 assert(pValue !=
nullptr);
1174 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1175 return read_write::ERR_Device_Busy;
1176 if (m_pREAD_double_DIRECT)
1177 return dispErrorCode((
"READ_double_DIRECT"), m_pREAD_double_DIRECT(memoryType, offset, pValue));
1178 return read_write::ERR_Not_Detect_Comm_DLL;
1193 assert(buffer !=
nullptr);
1194 assert(bufferLength > 0);
1195 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1196 return read_write::ERR_Device_Busy;
1197 if (m_pREAD_BLOCK_DIRECT)
1198 return dispErrorCode((
"READ_BLOCK_DIRECT"), m_pREAD_BLOCK_DIRECT(memoryType, offset, buffer, bufferLength));
1199 return read_write::ERR_Not_Detect_Comm_DLL;
1216 assert(buffer !=
nullptr);
1217 assert(buffer_Char_Len > 0);
1218 assert(pRead_Char_Count !=
nullptr);
1219 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1220 return read_write::ERR_Device_Busy;
1222 return dispErrorCode((
"Read_LPSTR_DIRECT"), m_pREAD_LPSTR(memoryType, offset, buffer, buffer_Char_Len, pRead_Char_Count));
1223 return read_write::ERR_Not_Detect_Comm_DLL;
1240 assert(buffer !=
nullptr);
1241 assert(buffer_Char_Len > 0);
1242 assert(pRead_Char_Count !=
nullptr);
1243 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1244 return read_write::ERR_Device_Busy;
1246 return dispErrorCode((
"Read_LPWSTR_DRIECT"), m_pREAD_LPWSTR(memoryType, offset, buffer, buffer_Char_Len, pRead_Char_Count));
1247 return read_write::ERR_Not_Detect_Comm_DLL;
1259 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1260 return read_write::ERR_Device_Busy;
1261 if (m_pWRITE_I32_DIRECT)
1262 return dispErrorCode((
"WRITE_I32_DIRECT"), m_pWRITE_I32_DIRECT(memoryType, offset, Value));
1263 return read_write::ERR_Not_Detect_Comm_DLL;
1275 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1276 return read_write::ERR_Device_Busy;
1277 if (m_pWRITE_I64_DIRECT)
1278 return dispErrorCode((
"WRITE_I64_DIRECT"), m_pWRITE_I64_DIRECT(memoryType, offset, Value));
1279 return read_write::ERR_Not_Detect_Comm_DLL;
1291 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1292 return read_write::ERR_Device_Busy;
1293 if (m_pWRITE_double_DIRECT)
1294 return dispErrorCode((
"WRITE_double_DIRECT"), m_pWRITE_double_DIRECT(memoryType, offset, Value));
1295 return read_write::ERR_Not_Detect_Comm_DLL;
1312 assert(buffer !=
nullptr);
1313 assert(bufferLength > 0);
1314 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1315 return read_write::ERR_Device_Busy;
1316 if (m_pWRITE_BLOCK_DIRECT)
1317 return dispErrorCode((
"WRITE_BLOCK_DIRECT"), m_pWRITE_BLOCK_DIRECT(memoryType, offset, buffer, bufferLength));
1318 return read_write::ERR_Not_Detect_Comm_DLL;
1333 assert(buffer !=
nullptr);
1334 assert(Write_Char_Len > 0);
1335 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1336 return read_write::ERR_Device_Busy;
1337 if (m_pWRITE_LPSTR_DIRECT)
1338 return dispErrorCode((
"Write_LPSTR_Direct"), m_pWRITE_LPSTR_DIRECT(memoryType, offset, buffer, Write_Char_Len));
1339 return read_write::ERR_Not_Detect_Comm_DLL;
1355 assert(buffer !=
nullptr);
1356 assert(Write_Char_Len > 0);
1357 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1358 return read_write::ERR_Device_Busy;
1359 if (m_pWRITE_LPWSTR_DIRECT)
1360 return dispErrorCode((
"Write_LPWSTR_Direct"), m_pWRITE_LPWSTR_DIRECT(memoryType, offset, buffer, Write_Char_Len));
1361 return read_write::ERR_Not_Detect_Comm_DLL;
1374 assert((offset & 0x3) == 0);
1375 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1376 return read_write::ERR_Device_Busy;
1377 if (m_pSET_BIT_I32_DIRECT)
1378 return dispErrorCode((
"SET_BIT_I32_DIRECT"), m_pSET_BIT_I32_DIRECT(memoryType, offset, Value));
1379 return read_write::ERR_Not_Detect_Comm_DLL;
1392 assert((offset & 0x7) == 0);
1393 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1394 return read_write::ERR_Device_Busy;
1395 if (m_pSET_BIT_I64_DIRECT)
1396 return dispErrorCode((
"SET_BIT_I64_DIRECT"), m_pSET_BIT_I64_DIRECT(memoryType, offset, Value));
1397 return read_write::ERR_Not_Detect_Comm_DLL;
1410 assert((offset & 0x3) == 0);
1411 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1412 return read_write::ERR_Device_Busy;
1413 if (m_pCLR_BIT_I32_DIRECT)
1414 return dispErrorCode((
"CLR_BIT_I32_DIRECT"), m_pCLR_BIT_I32_DIRECT(memoryType, offset, Value));
1415 return read_write::ERR_Not_Detect_Comm_DLL;
1428 assert((offset & 0x7) == 0);
1429 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1430 return read_write::ERR_Device_Busy;
1431 if (m_pCLR_BIT_I64_DIRECT)
1432 return dispErrorCode((
"CLR_BIT_I64_DIRECT"), m_pCLR_BIT_I64_DIRECT(memoryType, offset, Value));
1433 return read_write::ERR_Not_Detect_Comm_DLL;
1446 assert((offset & 0x3) == 0);
1447 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1448 return read_write::ERR_Device_Busy;
1449 if (m_pTGL_BIT_I32_DIRECT)
1450 return dispErrorCode((
"TGL_BIT_I32_DIRECT"), m_pTGL_BIT_I32_DIRECT(memoryType, offset, Value));
1451 return read_write::ERR_Not_Detect_Comm_DLL;
1464 assert((offset & 0x7) == 0);
1465 if (m_offlineCounter >= MAX_OFFLINE_COUNT)
1466 return read_write::ERR_Device_Busy;
1467 if (m_pTGL_BIT_I64_DIRECT)
1468 return dispErrorCode((
"TGL_BIT_I64_DIRECT"), m_pTGL_BIT_I64_DIRECT(memoryType, offset, Value));
1469 return read_write::ERR_Not_Detect_Comm_DLL;
1478 if (m_pFLUSH_BUFFER)
1479 return dispErrorCode((
"FLUSH_BUFFER"), m_pFLUSH_BUFFER());
1480 return read_write::ERR_Interface_Not_Create;
1494 case device::Local_TGM:
1495 return TGM_TEXT(
"Device_Local_TGM");
1496 case device::TGM_Mini:
1497 return TGM_TEXT(
"Device_TGM_Mini");
1498 case device::TGM_REMOTE:
1499 return TGM_TEXT(
"Device_TGM_REMOTE");
1502 return TGM_TEXT(
"<Unknown device>");
1514 case status::Simulation_Mode_TGM:
1515 return TGM_TEXT(
"Status_Simulation_Mode_TGM");
1516 case status::Online:
1517 return TGM_TEXT(
"Status_Online");
1518 case status::Offline_Connection_Proceeds:
1519 return TGM_TEXT(
"Status_Offline_Connection_Proceeds");
1520 case status::Offline_Device_Offline:
1521 return TGM_TEXT(
"Status_Offline_Device_Offline");
1522 case status::Offline_Incompatible_DLL_ID:
1523 return TGM_TEXT(
"Status_Offline_Incompatible_DLL_ID");
1524 case status::Offline_Incompatible_DLL_Mem_ID:
1525 return TGM_TEXT(
"Status_Offline_Incompatible_DLL_Mem_ID");
1526 case status::Offline_Incompatible_DEVICE_ID:
1527 return TGM_TEXT(
"Status_Offline_Incompatible_DEVICE_ID");
1528 case status::Offline_Incompatible_DEVICE_Mem_ID:
1529 return TGM_TEXT(
"Status_Offline_Incompatible_DEVICE_Mem_ID");
1530 case status::Offline_Not_Detect_Comm_DLL:
1531 return TGM_TEXT(
"Status_Offline_Not_Detect_Comm_DLL");
1532 case status::Offline_Open_Connection_Failed:
1533 return TGM_TEXT(
"Status_Offline_Open_Connection_Failed");
1534 case status::Offline_Init_Connection_Failed:
1535 return TGM_TEXT(
"Status_Offline_Init_Connection_Failed");
1536 case status::Offline_Connection_Not_Opened:
1537 return TGM_TEXT(
"Status_Offline_Connection_Not_Opened");
1538 case status::Offline_Interface_Not_Create:
1539 return TGM_TEXT(
"Status_Offline_Interface_Not_Create");
1542 return TGM_TEXT(
"<Unknown status>");
1554 case read_write::OK:
1555 return TGM_TEXT(
"RW_OK");
1556 case read_write::OK_Offline_Data:
1557 return TGM_TEXT(
"RW_OK_Offline_Data");
1558 case read_write::ERR_Invalid_Data:
1559 return TGM_TEXT(
"RW_ERR_Invalid_Data");
1560 case read_write::ERR_Device_Busy:
1561 return TGM_TEXT(
"RW_ERR_Device_Busy");
1562 case read_write::ERR_Interface_Not_Create:
1563 return TGM_TEXT(
"RW_ERR_Interface_Not_Create");
1564 case read_write::ERR_Unsupported_Function:
1565 return TGM_TEXT(
"RW_ERR_Unsupported_Function");
1566 case read_write::ERR_Connection_Not_Open:
1567 return TGM_TEXT(
"RW_ERR_Connection_Not_Open");
1568 case read_write::ERR_Not_Detect_Comm_DLL:
1569 return TGM_TEXT(
"RW_ERR_Not_Detect_Comm_DLL");
1572 return TGM_TEXT(
"<Unknown RW_ERR>");
1585 case device::Local_TGM:
1586 return (
"Device_Local_TGM");
1587 case device::TGM_Mini:
1588 return (
"Device_TGM_Mini");
1589 case device::TGM_REMOTE:
1590 return (
"Device_TGM_REMOTE");
1593 return (
"<Unknown device>");
1605 case status::Simulation_Mode_TGM:
1606 return (
"Status_Simulation_Mode_TGM");
1607 case status::Online:
1608 return (
"Status_Online");
1609 case status::Offline_Connection_Proceeds:
1610 return (
"Status_Offline_Connection_Proceeds");
1611 case status::Offline_Device_Offline:
1612 return (
"Status_Offline_Device_Offline");
1613 case status::Offline_Incompatible_DLL_ID:
1614 return (
"Status_Offline_Incompatible_DLL_ID");
1615 case status::Offline_Incompatible_DLL_Mem_ID:
1616 return (
"Status_Offline_Incompatible_DLL_Mem_ID");
1617 case status::Offline_Incompatible_DEVICE_ID:
1618 return (
"Status_Offline_Incompatible_DEVICE_ID");
1619 case status::Offline_Incompatible_DEVICE_Mem_ID:
1620 return (
"Status_Offline_Incompatible_DEVICE_Mem_ID");
1621 case status::Offline_Not_Detect_Comm_DLL:
1622 return (
"Status_Offline_Not_Detect_Comm_DLL");
1623 case status::Offline_Open_Connection_Failed:
1624 return (
"Status_Offline_Open_Connection_Failed");
1625 case status::Offline_Init_Connection_Failed:
1626 return (
"Status_Offline_Init_Connection_Failed");
1627 case status::Offline_Connection_Not_Opened:
1628 return (
"Status_Offline_Connection_Not_Opened");
1629 case status::Offline_Interface_Not_Create:
1630 return (
"Status_Offline_Interface_Not_Create");
1633 return (
"<Unknown status>");
1645 case read_write::OK:
1647 case read_write::OK_Offline_Data:
1648 return "RW_OK_Offline_Data";
1649 case read_write::ERR_Invalid_Data:
1650 return "RW_ERR_Invalid_Data";
1651 case read_write::ERR_Device_Busy:
1652 return "RW_ERR_Device_Busy";
1653 case read_write::ERR_Interface_Not_Create:
1654 return "RW_ERR_Interface_Not_Create";
1655 case read_write::ERR_Unsupported_Function:
1656 return "RW_ERR_Unsupported_Function";
1657 case read_write::ERR_Connection_Not_Open:
1658 return "RW_ERR_Connection_Not_Open";
1659 case read_write::ERR_Not_Detect_Comm_DLL:
1660 return "RW_ERR_Not_Detect_Comm_DLL";
1663 return (
"<Unknown RW_ERR>");
1675 case error_code::Success:
1677 case error_code::Device_Type:
1678 return "ERR_Device_Type";
1679 case error_code::Interface_Not_Create:
1680 return "ERR_Interface_Not_Create";
1681 case error_code::Connection_Not_Open:
1682 return "ERR_Connection_Not_Open";
1683 case error_code::Not_Detect_Comm_DLL:
1684 return "ERR_Not_Detect_Comm_DLL";
1685 case error_code::Interface_Already_Exists:
1686 return "ERR_Interface_Already_Exists";
1687 case error_code::Interface_Create_Off_Mem:
1688 return "ERR_Interface_Create_Off_Mem";
1689 case error_code::Connection_Already_Exists:
1690 return "ERR_Connection_Already_Exists";
1691 case error_code::Connection_Create_Thread:
1692 return "ERR_Connection_Create_Thread";
1693 case error_code::Invalid_Data:
1694 return "ERR_Invalid_Data";
1697 return (
"<Unknown error code>");
1709 case CTGM_COMM_INT_2::shared_memory::SYSTEM:
1710 return "TGM_System";
1711 case CTGM_COMM_INT_2::shared_memory::DATA:
1713 case CTGM_COMM_INT_2::shared_memory::CAM:
1714 return "TGM_Cam_Profile";
1715 case CTGM_COMM_INT_2::shared_memory::OSC:
1716 return "TGM_Oscilloscope";
1717 case CTGM_COMM_INT_2::shared_memory::SERVO:
1719 case CTGM_COMM_INT_2::shared_memory::DIO:
1721 case CTGM_COMM_INT_2::shared_memory::INTERP:
1722 return "TGM_interpolator";
1723 case CTGM_COMM_INT_2::shared_memory::INTERP_W:
1724 return "InterpolatorWriteMemory";
1725 case CTGM_COMM_INT_2::shared_memory::INTERP_R:
1726 return "InterpolatorReadMemory";
1727 case CTGM_COMM_INT_2::shared_memory::ODS:
1729 case CTGM_COMM_INT_2::shared_memory::CNC_EX:
1731 case CTGM_COMM_INT_2::shared_memory::G_CODE:
1733 case CTGM_COMM_INT_2::shared_memory::CNC_INI:
1734 return "TGM_CNCINI";
1735 case CTGM_COMM_INT_2::shared_memory::UNIVERSAL:
1736 return "TGM_Universal";
1737 case CTGM_COMM_INT_2::shared_memory::CNC_EX_LOCAL:
1738 return "<TGM_CNCEX_Local>";
1739 case CTGM_COMM_INT_2::shared_memory::NMemories:
1740 return "<Unknown memory type>";
1743 return "<Unknown memory type>";
1753 typedef void _xFunctionPointer();
1754 typedef _xFunctionPointer *x_FunctionPointer;
1759 x_Library() : m_hModule(NULL) { m_fileName[0] =
'\0'; }
1766 x_FunctionPointer resolve(
const char * funcName)
const 1768 assert(funcName !=
nullptr);
1769 if (m_hModule != NULL)
1770 return reinterpret_cast<x_FunctionPointer
>(GetProcAddress(m_hModule, funcName));
1773 void setFileName(
const char * fileName) { strcpy_s(m_fileName, fileName); }
1774 void load() { m_hModule = LoadLibraryA(m_fileName); }
1775 bool isLoaded() {
return m_hModule == NULL ? false :
true; }
1776 HMODULE GetHModule()
const {
return m_hModule; }
1780 if (m_hModule != NULL)
1782 if(FreeLibrary(m_hModule) != FALSE)
1785 m_hModule =
nullptr;
1790 char m_fileName[_MAX_PATH];
1794 typedef QLibrary x_Library;
1795 typedef QFunctionPointer x_FunctionPointer;
1802 void x_warning(
const char * pszFormat, ...)
1804 assert(pszFormat !=
nullptr);
1806 va_start(args, pszFormat);
1809 const int outLastIndex =
static_cast<int>(
_countof(out) - 1);
1811 int nChars = vsnprintf_s(out, _TRUNCATE, pszFormat, args);
1814 out[outLastIndex] =
'\0';
1815 nChars =
static_cast<int>(strlen(out));
1819 if (nChars > 0 && nChars < outLastIndex)
1821 if (out[nChars - 1] !=
'\n')
1824 out[nChars + 1] =
'\0';
1828 OutputDebugStringA(out);
1832 # define x_warning(strFormat, ...) qWarning(strFormat, ##__VA_ARGS__) 1836 x_Library m_hModule;
1840 TGM_COMM_INT_VIRTUAL
void errDllNotFound(
const char *aFileName)
1842 x_warning(
"CTGM_COMM_INT_2: Dynamic library %s not found", aFileName);
1844 perror(
"Additional info:");
1847 TGM_COMM_INT_VIRTUAL
void errFuncNotFound(
const char *aFileName,
const char *funcName)
1849 x_warning(
"CTGM_COMM_INT_2: Function %s not found in library %s", funcName, aFileName);
1851 perror(
"Additional info:");
1855 x_FunctionPointer getFuncAddress(
const char *aFileName,
const char *funcName)
1857 assert(aFileName !=
nullptr);
1858 assert(funcName !=
nullptr);
1859 x_FunctionPointer func = m_hModule.resolve(funcName);
1862 errFuncNotFound(aFileName, funcName);
1868 assert(aFileName !=
nullptr);
1869 m_hModule.setFileName(aFileName);
1871 if (m_hModule.isLoaded() ==
false)
1873 errDllNotFound(aFileName);
1874 return error_code::Not_Detect_Comm_DLL;
1876 return error_code::Success;
1881 assert(funcName !=
nullptr);
1884 case error_code::Success:
1885 m_offlineCounter = 0;
1887 case error_code::Device_Type:
1888 x_warning(
"%s ERR_Device_Type", funcName);
1890 case error_code::Interface_Not_Create:
1891 x_warning(
"%s ERR_Interface_Not_Create", funcName);
1893 case error_code::Connection_Not_Open:
1894 x_warning(
"%s ERR_Connection_Not_Open", funcName);
1896 case error_code::Not_Detect_Comm_DLL:
1897 x_warning(
"%s ERR_Not_Detect_Comm_DLL", funcName);
1899 case error_code::Interface_Already_Exists:
1900 x_warning(
"%s ERR_Interface_Already_Exists", funcName);
1902 case error_code::Interface_Create_Off_Mem:
1903 x_warning(
"%s ERR_Interface_Create_Off_Mem", funcName);
1905 case error_code::Connection_Already_Exists:
1906 x_warning(
"%s ERR_Connection_Already_Exists", funcName);
1908 case error_code::Connection_Create_Thread:
1909 x_warning(
"%s ERR_Connection_Create_Thread", funcName);
1911 case error_code::Invalid_Data:
1912 x_warning(
"%s ERR_Invalid_Data", funcName);
1920 assert(funcName !=
nullptr);
1923 case read_write::OK:
1924 m_offlineCounter = 0;
1926 case read_write::OK_Offline_Data:
1927 m_offlineCounter = 0;
1929 case read_write::ERR_Invalid_Data:
1930 x_warning(
"%s RW_ERR_Invalid_Data", funcName);
1932 case read_write::ERR_Device_Busy:
1933 if (m_offlineCounter < MAX_OFFLINE_COUNT)
1935 x_warning(
"%s RW_ERR_Device_Busy", funcName);
1937 case read_write::ERR_Interface_Not_Create:
1938 x_warning(
"%s RW_ERR_Interface_Not_Create", funcName);
1940 case read_write::ERR_Unsupported_Function:
1941 x_warning(
"%s RW_ERR_Unsupported_Function", funcName);
1943 case read_write::ERR_Connection_Not_Open:
1944 x_warning(
"%s RW_ERR_Connection_Not_Open", funcName);
1946 case read_write::ERR_Not_Detect_Comm_DLL:
1947 x_warning(
"%s RW_ERR_Not_Detect_Comm_DLL", funcName);
1955 typedef error_code COM_CALLTYPE TGM_CREATE_INTERFACE_2(
const TGM_TCHAR *DLL_Directory);
1956 typedef void COM_CALLTYPE TGM_SET_APP_COMPATIBILITY_VN(int32_t compatibilityID, int32_t compatibilityMemID, int32_t version,
const TGM_TCHAR *appName);
1957 typedef void COM_CALLTYPE TGM_DESTROY_INTERFACE();
1958 typedef error_code COM_CALLTYPE TGM_OPEN_CONNECTION(int32_t keepOnline, int32_t commTimeout,
device deviceType, uint32_t IPAddress);
1959 typedef error_code COM_CALLTYPE TGM_CHANGE_CONNECTION(
device deviceType, uint32_t IPAddress);
1960 typedef error_code COM_CALLTYPE TGM_CLOSE_CONNECTION();
1961 typedef error_code COM_CALLTYPE TGM_GET_DLL_INFO(
device deviceType, int32_t *pVersion, int32_t *pCompatibilityID, int32_t *pCompatibilityMemID);
1962 typedef status COM_CALLTYPE TGM_GET_STATUS();
1963 typedef status COM_CALLTYPE TGM_GET_STATUS_GRAPHICS(int32_t *pBackColor, int32_t *pTextColor, TGM_TCHAR *buffer);
1966 typedef error_code COM_CALLTYPE TGM_GET_SERVER_INFO(
device deviceType, int32_t *pCompatibilityID, int32_t *pCompatibilityMemID,
status *pConnectionStatus);
1967 typedef error_code COM_CALLTYPE TGM_SHOW_CONNECTIONS_INFO_WIN(TGM_HWND parent, int32_t enableChangeConnection);
1968 typedef error_code COM_CALLTYPE TGM_CLOSE_CONNECTIONS_INFO_WIN();
1969 typedef void COM_CALLTYPE TGM_GET_CONNECTIONS_INFO_WIN_DIMENSION(int32_t *Width, int32_t *Height);
1974 typedef read_write COM_CALLTYPE TGM_READ_BLOCK(
shared_memory memoryType, uint32_t offset,
void *buffer, uint32_t bufferLength);
1975 typedef read_write COM_CALLTYPE TGM_READ_LPSTR(
shared_memory memoryType, uint32_t offset,
char *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count);
1976 typedef read_write COM_CALLTYPE TGM_READ_LPWSTR(
shared_memory memoryType, uint32_t offset, TGM_WCHAR *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count);
1980 typedef read_write COM_CALLTYPE TGM_WRITE_BLOCK(
shared_memory memoryType, uint32_t offset,
const void *buffer, uint32_t bufferLength);
1981 typedef read_write COM_CALLTYPE TGM_WRITE_LPSTR(
shared_memory memoryType, uint32_t offset,
const char *Buffer, uint32_t Write_Char_Len);
1982 typedef read_write COM_CALLTYPE TGM_WRITE_LPWSTR(
shared_memory memoryType, uint32_t offset,
const TGM_WCHAR *Buffer, uint32_t Write_Char_Len);
1990 typedef read_write COM_CALLTYPE TGM_READ_I32_DIRECT(
shared_memory memoryType, uint32_t offset, int32_t *pValue);
1991 typedef read_write COM_CALLTYPE TGM_READ_I64_DIRECT(
shared_memory memoryType, uint32_t offset, int64_t *pValue);
1992 typedef read_write COM_CALLTYPE TGM_READ_double_DIRECT(
shared_memory memoryType, uint32_t offset,
double *pValue);
1993 typedef read_write COM_CALLTYPE TGM_READ_BLOCK_DIRECT(
shared_memory memoryType, uint32_t offset,
void *buffer, uint32_t bufferLength);
1994 typedef read_write COM_CALLTYPE TGM_READ_LPSTR_DIRECT(
shared_memory memoryType, uint32_t offset,
char *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count);
1995 typedef read_write COM_CALLTYPE TGM_READ_LPWSTR_DIRECT(
shared_memory memoryType, uint32_t offset, TGM_WCHAR *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count);
1997 typedef read_write COM_CALLTYPE TGM_WRITE_I32_DIRECT(
shared_memory memoryType, uint32_t offset, int32_t Value);
1998 typedef read_write COM_CALLTYPE TGM_WRITE_I64_DIRECT(
shared_memory memoryType, uint32_t offset, int64_t Value);
1999 typedef read_write COM_CALLTYPE TGM_WRITE_double_DIRECT(
shared_memory memoryType, uint32_t offset,
double Value);
2000 typedef read_write COM_CALLTYPE TGM_WRITE_BLOCK_DIRECT(
shared_memory memoryType, uint32_t offset,
const void *buffer, uint32_t bufferLength);
2001 typedef read_write COM_CALLTYPE TGM_WRITE_LPSTR_DIRECT(
shared_memory memoryType, uint32_t offset,
const char *Buffer, uint32_t Write_Char_Len);
2002 typedef read_write COM_CALLTYPE TGM_WRITE_LPWSTR_DIRECT(
shared_memory memoryType, uint32_t offset,
const TGM_WCHAR *Buffer, uint32_t Write_Char_Len);
2004 typedef read_write COM_CALLTYPE TGM_SET_BIT_I32_DIRECT(
shared_memory memoryType, uint32_t offset, int32_t Value);
2005 typedef read_write COM_CALLTYPE TGM_SET_BIT_I64_DIRECT(
shared_memory memoryType, uint32_t offset, int64_t Value);
2006 typedef read_write COM_CALLTYPE TGM_CLR_BIT_I32_DIRECT(
shared_memory memoryType, uint32_t offset, int32_t Value);
2007 typedef read_write COM_CALLTYPE TGM_CLR_BIT_I64_DIRECT(
shared_memory memoryType, uint32_t offset, int64_t Value);
2008 typedef read_write COM_CALLTYPE TGM_TGL_BIT_I32_DIRECT(
shared_memory memoryType, uint32_t offset, int32_t Value);
2009 typedef read_write COM_CALLTYPE TGM_TGL_BIT_I64_DIRECT(
shared_memory memoryType, uint32_t offset, int64_t Value);
2011 typedef read_write COM_CALLTYPE TGM_FLUSH_BUFFER();
2013 TGM_CREATE_INTERFACE_2 *m_pCREATE_INTERFACE_2 =
nullptr;
2014 TGM_DESTROY_INTERFACE *m_pDESTROY_INTERFACE =
nullptr;
2015 TGM_OPEN_CONNECTION *m_pOPEN_CONNECTION =
nullptr;
2016 TGM_CHANGE_CONNECTION *m_pCHANGE_CONNECTION =
nullptr;
2017 TGM_CLOSE_CONNECTION *m_pCLOSE_CONNECTION =
nullptr;
2018 TGM_GET_DLL_INFO *m_pGET_DLL_INFO =
nullptr;
2019 TGM_SET_APP_COMPATIBILITY_VN *m_pSET_APP_COMPATIBILITY_VN =
nullptr;
2020 TGM_GET_STATUS *m_pGET_STATUS =
nullptr;
2021 TGM_GET_STATUS_GRAPHICS *m_pGET_STATUS_GRAPHICS =
nullptr;
2022 TGM_GET_CONNECTIONS_INFO_2 *m_pGET_CONNECTIONS_INFO_2 =
nullptr;
2023 TGM_GET_SERVER_INFO *m_pGET_SERVER_INFO =
nullptr;
2024 TGM_SHOW_CONNECTIONS_INFO_WIN *m_pSHOW_CONNECTIONS_INFO_WIN =
nullptr;
2025 TGM_CLOSE_CONNECTIONS_INFO_WIN *m_pCLOSE_CONNECTIONS_INFO_WIN =
nullptr;
2026 TGM_GET_CONNECTIONS_INFO_WIN_DIMENSION *m_pGET_CONNECTIONS_INFO_WIN_DIMENSION =
nullptr;
2027 TGM_READ_I32 *m_pREAD_I32 =
nullptr;
2028 TGM_READ_I64 *m_pREAD_I64 =
nullptr;
2029 TGM_READ_double *m_pREAD_double =
nullptr;
2030 TGM_READ_BLOCK *m_pREAD_BLOCK =
nullptr;
2031 TGM_READ_LPSTR *m_pREAD_LPSTR =
nullptr;
2032 TGM_READ_LPWSTR *m_pREAD_LPWSTR =
nullptr;
2033 TGM_WRITE_I32 *m_pWRITE_I32 =
nullptr;
2034 TGM_WRITE_I64 *m_pWRITE_I64 =
nullptr;
2035 TGM_WRITE_double *m_pWRITE_double =
nullptr;
2036 TGM_WRITE_BLOCK *m_pWRITE_BLOCK =
nullptr;
2037 TGM_WRITE_LPSTR *m_pWRITE_LPSTR =
nullptr;
2038 TGM_WRITE_LPWSTR *m_pWRITE_LPWSTR =
nullptr;
2039 TGM_SET_BIT_I32 *m_pSET_BIT_I32 =
nullptr;
2040 TGM_SET_BIT_I64 *m_pSET_BIT_I64 =
nullptr;
2041 TGM_CLR_BIT_I32 *m_pCLR_BIT_I32 =
nullptr;
2042 TGM_CLR_BIT_I64 *m_pCLR_BIT_I64 =
nullptr;
2043 TGM_TGL_BIT_I32 *m_pTGL_BIT_I32 =
nullptr;
2044 TGM_TGL_BIT_I64 *m_pTGL_BIT_I64 =
nullptr;
2045 TGM_READ_I32_DIRECT *m_pREAD_I32_DIRECT =
nullptr;
2046 TGM_READ_I64_DIRECT *m_pREAD_I64_DIRECT =
nullptr;
2047 TGM_READ_double_DIRECT *m_pREAD_double_DIRECT =
nullptr;
2048 TGM_READ_BLOCK_DIRECT *m_pREAD_BLOCK_DIRECT =
nullptr;
2049 TGM_READ_LPSTR_DIRECT *m_pREAD_LPSTR_DIRECT =
nullptr;
2050 TGM_READ_LPWSTR_DIRECT *m_pREAD_LPWSTR_DIRECT =
nullptr;
2051 TGM_WRITE_I32_DIRECT *m_pWRITE_I32_DIRECT =
nullptr;
2052 TGM_WRITE_I64_DIRECT *m_pWRITE_I64_DIRECT =
nullptr;
2053 TGM_WRITE_double_DIRECT *m_pWRITE_double_DIRECT =
nullptr;
2054 TGM_WRITE_BLOCK_DIRECT *m_pWRITE_BLOCK_DIRECT =
nullptr;
2055 TGM_WRITE_LPSTR_DIRECT *m_pWRITE_LPSTR_DIRECT =
nullptr;
2056 TGM_WRITE_LPWSTR_DIRECT *m_pWRITE_LPWSTR_DIRECT =
nullptr;
2057 TGM_SET_BIT_I32_DIRECT *m_pSET_BIT_I32_DIRECT =
nullptr;
2058 TGM_SET_BIT_I64_DIRECT *m_pSET_BIT_I64_DIRECT =
nullptr;
2059 TGM_CLR_BIT_I32_DIRECT *m_pCLR_BIT_I32_DIRECT =
nullptr;
2060 TGM_CLR_BIT_I64_DIRECT *m_pCLR_BIT_I64_DIRECT =
nullptr;
2061 TGM_TGL_BIT_I32_DIRECT *m_pTGL_BIT_I32_DIRECT =
nullptr;
2062 TGM_TGL_BIT_I64_DIRECT *m_pTGL_BIT_I64_DIRECT =
nullptr;
2063 TGM_FLUSH_BUFFER *m_pFLUSH_BUFFER =
nullptr;
2065 size_t m_offlineCounter = 0;
2067 int32_t m_nCreateInterfaceCalled = 0;
2068 int32_t m_nOpenConnectionCalled = 0;
2079 bool m_bCreateInterfaceAlreadyCalledByApplication =
false;
2080 bool m_bOpenConnectionAlreadyCalledByApplication =
false;
2082 #endif // UNDER_RTSS 2124 # if _MSC_VER < 1800 // below Visual Studio 2013 2125 # pragma warning(pop) 2129 #endif // TGMCOMMINT2_DLL_H enum ENUM_CLASS TGM_Mini
TGM mini connected via network, valid IP address is needed for Open_Connection()
read_write Write_LPSTR(shared_memory memoryType, uint32_t offset, const char *buffer, uint32_t Write_Char_Len)
Write ANSI string to shared memory.
#define _countof(array)
determine number of elements in an array (not bytes)
enum ENUM_CLASS Offline_Init_Connection_Failed
Offline -.
read_write Read_LPWSTR(shared_memory memoryType, uint32_t offset, TGM_WCHAR *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count)
Read UTF-16 string from memory. For remote devices, the read request is sent and the function returns...
enum ENUM_CLASS read_write
return values of Read_xxx and Write_xxx functions
CTGM_COMM_INT_2::read_write TGM_IF_RW
Simplify write of CTGM_COMM_INT_2::read_write.
enum ENUM_CLASS Connection_Create_Thread
working thread cannot be created
enum ENUM_CLASS REM_Client_Offline
client offline memories (TGM_REMOTE)
enum ENUM_CLASS Offline_Incompatible_DLL_ID
Offline - wrong App ID compatibility number of DLL and application.
enum ENUM_CLASS Device_Type
unknown device type
CTGM_COMM_INT_2::shared_memory TGM_IF_MEM
Simplify write of CTGM_COMM_INT_2::shared_memory.
enum ENUM_CLASS TGM_REMOTE
TG Motion running on remote PC.
read_write Read_I64_DIRECT(shared_memory memoryType, uint32_t offset, int64_t *pValue)
Read 64bit integer from shared memory. For remote devices the function always waits for response...
error_code Close_Connections_Info_Win()
Closes connection info window opened by Show_Connections_Info_Win.
enum ENUM_CLASS INTERP_R
InterpolatorReadMemory.
enum ENUM_CLASS OK_Offline_Data
OK - data are read from offline memory (TGM simulation)
enum ENUM_CLASS Interface_Create_Off_Mem
Offline shared memory cannot be created.
enum ENUM_CLASS INTERP
TGM_Interpolator.
enum ENUM_CLASS CNC_INI
TGM_CNCINI (cnc ini file)
static const char * ReadWriteCodeToStringA(read_write code)
Converts read_write error code to ANSI string.
enum ENUM_CLASS Connection_Not_Open
Open_Connection not called
read_write Read_BLOCK(shared_memory memoryType, uint32_t offset, void *buffer, uint32_t bufferLength)
Read block of shared memory. For remote devices, the read request is sent and the function returns th...
enum ENUM_CLASS REM_Server
server memories (TGM_REMOTE)
enum ENUM_CLASS Offline_Connection_Not_Opened
Offline - no connection opened.
enum ENUM_CLASS Online
Online - connection established.
read_write Clr_Bit_I64(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical NAND on 64bit integer in shared memory. (i.e. originalValue &= ~Value).
enum ENUM_CLASS ERR_Interface_Not_Create
ERR - Create_Interface not called.
enum ENUM_CLASS NMemories
number of memories (without the CNC_EX_LOCAL)
enum ENUM_CLASS ERR_Connection_Not_Open
ERR - Open_Connection not called.
static const char * ErrorCodeToStringA(error_code code)
Converts error_code to ANSI string.
error_code Create_Interface_2(const TGM_TCHAR *DLL_Directory)
Create communication interface.
error_code Show_Connections_Info_Win(TGM_HWND parent, int32_t enableChangeConnection)
Displays Connection Info window with an info of all the connections and plug-in modules.
enum ENUM_CLASS error_code
Error codes returned by most of the functions.
enum ENUM_CLASS Local_Offline
local offline memories (TGM simulation)
read_write Set_Bit_I32_DIRECT(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical OR on 32bit integer in shared memory. (i.e. originalValue |= Value). For remote devices the function always wait for acknowledge.
enum ENUM_CLASS Offline_Open_Connection_Failed
Offline - invalid parameters of Open_Connection() function.
enum ENUM_CLASS DATA
TGM_DATA.
read_write Read_Double(shared_memory memoryType, uint32_t offset, double *pValue)
Read double floating point value (8 bytes) from shared memory. For remote devices, the read request is sent and the function returns the last (previous) stored local value.
error_code Close_Connection()
Close already opened connection. Each call to Open_Connection must match the Close_Connection.
error_code Open_Connection(int32_t keepOnline, int32_t commTimeout, device deviceType, uint32_t IPAddress)
Establishes a communication with a given device.
CTGM_COMM_INT_2::device TGM_IF_DEV
Simplify write of CTGM_COMM_INT_2::device.
read_write Write_BLOCK_DIRECT(shared_memory memoryType, uint32_t offset, const void *buffer, uint32_t bufferLength)
Write double to shared memory. For remote devices the function always waits for acknowledge.
read_write Clr_Bit_I32_DIRECT(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical NAND on 32bit integer in shared memory. (i.e. originalValue &= ~Value). For remote devices the function always wait for acknowledge.
enum ENUM_CLASS Offline_Device_Offline
Offline - device is not connected (ether TG Motion is not running locally or remote device is not con...
enum ENUM_CLASS CAM
TGM_Cam_Profile.
static const TGM_TCHAR * DeviceToString(device deviceType)
Converts device type to UNICODE (Windows) or ANSI (Linux) string.
read_write Write_LPWSTR_DIRECT(shared_memory memoryType, uint32_t offset, const TGM_WCHAR *buffer, uint32_t Write_Char_Len)
Write UNICODE string (UTF-16) to shared memory. For remote devices the function always waits for ackn...
enum ENUM_CLASS Offline_Interface_Not_Create
Offline - interface not created.
enum ENUM_CLASS compatibility
Compatibility types.
read_write Write_LPWSTR(shared_memory memoryType, uint32_t offset, const TGM_WCHAR *buffer, uint32_t Write_Char_Len)
Write UNICODE string (UTF-16) to shared memory.
read_write Read_LPSTR_DIRECT(shared_memory memoryType, uint32_t offset, char *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count)
Read ANSI string from memory. For remote devices the function always waits for response, i.e. it returns the actual data.
Describes one servo drive (or axis)
enum ENUM_CLASS Local_TGM_Online
local TGM memories (TGM running under real-time)
enum ENUM_CLASS ERR_Device_Busy
ERR - timeout R/W.
read_write Write_LPSTR_DIRECT(shared_memory memoryType, uint32_t offset, const char *buffer, uint32_t Write_Char_Len)
Write ANSI string to shared memory. For remote devices the function always waits for acknowledge...
enum ENUM_CLASS status
connection status (return codes of Get_Status())
enum ENUM_CLASS shared_memory
Shared memory numbers.
enum ENUM_CLASS ERR_Invalid_Data
ERR - invalid memory type, offset, length, etc.
read_write Set_Bit_I64(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical OR on 64bit integer in shared memory. (i.e. originalValue |= Value).
read_write Read_I32_DIRECT(shared_memory memoryType, uint32_t offset, int32_t *pValue)
Read 32bit integer from shared memory. For remote devices the function always waits for response...
enum ENUM_CLASS Offline_Incompatible_DLL_Mem_ID
Offline - wrong App Mem ID compatibility number of DLL and application.
read_write Read_LPSTR(shared_memory memoryType, uint32_t offset, char *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count)
Read ANSI string from memory. For remote devices, the read request is sent and the function returns t...
static const TGM_TCHAR * StatusToString(status code)
Converts status value to its text representation - UNICODE (Windows) or ANSI (Linux) ...
enum ENUM_CLASS Offline_Connection_Proceeds
Offline - waiting for connection (usually for remote devices)
static const char * StatusToStringA(status code)
Converts status value to ANSI string.
enum ENUM_CLASS Invalid_Data
invalid data - memory number, offset, etc.
C++ wrapper class for TGM_Comm_Int_2 library functions.
read_write Set_Bit_I32(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical OR on 32bit integer in shared memory. (i.e. originalValue |= Value).
read_write Tgl_Bit_I32_DIRECT(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical XOR on 32bit integer in shared memory. (i.e. originalValue ^= Value). For remote devices the function always wait for acknowledge.
enum ENUM_CLASS CNC_EX
TGM_CNCEX (CNC module)
static const char * MemoryTypeToStringA(shared_memory memory)
Converts memory type to its ANSI name.
CTGM_COMM_INT_2::connected_memory TGM_IF_CONN_MEM
Simplify write of CTGM_COMM_INT_2::connected_memory.
error_code Get_Connections_Info_2(device *pDeviceType, uint32_t *IPAddress, connected_memory *pConnectedMemory)
Returns information about actually opened communication.
read_write Tgl_Bit_I32(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical XOR on 32bit integer in shared memory. (i.e. originalValue ^= Value).
enum ENUM_CLASS UNIVERSAL
TGM_Universal.
read_write Tgl_Bit_I64(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical XOR on 64bit integer in shared memory. (i.e. originalValue ^= Value).
enum ENUM_CLASS Interface_Already_Exists
Create_Interface_2 already called
enum ENUM_CLASS Offline_Incompatible_DEVICE_ID
Offline - wrong Device ID compatibility number of DLL and application.
read_write Flush_Buffer()
For remote devices, send all the requests stored in command queue (i.e. sends all non-direct Read and...
read_write Read_LPWSTR_DIRECT(shared_memory memoryType, uint32_t offset, TGM_WCHAR *buffer, uint32_t buffer_Char_Len, uint32_t *pRead_Char_Count)
Read UTF-16 string from memory. For remote devices the function always waits for response, i.e. it returns the actual data.
static const TGM_TCHAR * ReadWriteCodeToString(read_write code)
Converts return valud of Read_XXX and Write_XXX functions to UNICODE (Windows) or ANSI (Linux) string...
enum ENUM_CLASS REM_Server_Offline
server offline memories (TGM_REMOTE)
read_write Tgl_Bit_I64_DIRECT(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical XOR on 64bit integer in shared memory. (i.e. originalValue ^= Value). For remote devices the function always wait for acknowledge.
enum ENUM_CLASS G_CODE
TGM_GCODE (gcode in binary format storage)
read_write Read_BLOCK_DIRECT(shared_memory memoryType, uint32_t offset, void *buffer, uint32_t bufferLength)
Read data from shared memory. For remote devices the function always waits for response, i.e. it returns the actual data.
error_code Get_Dll_Info(device deviceType, int32_t *pVersion, int32_t *pCompatibilityID, int32_t *pCompatibilityMemID)
Get information about communication library (depending on device type)
read_write Write_I64(shared_memory memoryType, uint32_t offset, int64_t Value)
Write 64bit integer to shared memory. For remote devices, the write request is sent and the function ...
status Get_Status_Graphics(int32_t *pBackgroundColor, int32_t *pTextColor, TGM_TCHAR *statusText)
Returns actual status and its text representation.
enum ENUM_CLASS Interface_Not_Create
Create_Interface_2 function not called
void Get_Connections_Info_Win_Dimension(int32_t *pWidth, int32_t *pHeight)
Returns recommended width and height of the Connection Info window.
void Destroy_Interface()
Closes created interface. Need to be called during application termination.
read_write Clr_Bit_I64_DIRECT(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical NAND on 64bit integer in shared memory. (i.e. originalValue &= ~Value). For remote devices the function always wait for acknowledge.
status Get_Status()
Returns actual status.
enum ENUM_CLASS Connection_Already_Exists
Open_Connection already called
enum ENUM_CLASS ERR_Unsupported_Function
ERR - function is not supported by device.
Shared memory named "TGM_System".
error_code Change_Connection(device deviceType, uint32_t IPAddress)
Change connection type on the fly.
CTGM_COMM_INT_2::error_code TGM_IF_ERR
Simplify write of CTGM_COMM_INT_2::error_code.
error_code Get_Server_Info(device deviceType, int32_t *pCompatibilityID, int32_t *pCompatibilityMemID, status *pConnectionStatus)
Returns information about the remote server.
read_write Write_I32_DIRECT(shared_memory memoryType, uint32_t offset, int32_t Value)
Write 32bit integer to shared memory. For remote devices the function always waits for acknowledge...
enum ENUM_CLASS ERR_Not_Detect_Comm_DLL
TGM_Comm_Int_2.dll or suplemental DLL not found (TGM_MINI.dll, TGM_Remote.dll)
CTGM_COMM_INT_2::status TGM_IF_STAT
Simplify write of CTGM_COMM_INT_2::status.
read_write Set_Bit_I64_DIRECT(shared_memory memoryType, uint32_t offset, int64_t Value)
Performs logical OR on 64bit integer in shared memory. (i.e. originalValue |= Value). For remote devices the function always wait for acknowledge.
enum ENUM_CLASS INTERP_W
InterpolatorWriteMemory.
enum ENUM_CLASS TGM_Mini_Offline
offline memory of TGMmini (remote)
read_write Write_I32(shared_memory memoryType, uint32_t offset, int32_t Value)
Write 32bit integer to shared memory. For remote devices, the write request is sent and the function ...
static const char * DeviceToStringA(device deviceType)
Convert device type to ANSI string.
enum ENUM_CLASS TGM_Mini_Online
TGMmini memories (remote)
enum ENUM_CLASS Not_Detect_Comm_DLL
TGM_Comm_Int_2.dll or supplemental DLL not found (TGM_MINI.dll, TGM_Remote.dll)
enum ENUM_CLASS Offline_Incompatible_DEVICE_Mem_ID
Offline - wrong Device memory ID compatibility number of DLL and application.
read_write Write_Double(shared_memory memoryType, uint32_t offset, double Value)
Write double floating point value (8 bytes) to shared memory. For remote devices, the write request i...
read_write Write_BLOCK(shared_memory memoryType, uint32_t offset, const void *buffer, uint32_t bufferLength)
Write block (any memory structure) to shared memory.
enum ENUM_CLASS Offline_Not_Detect_Comm_DLL
Offline - suplemental comm dll not found.
read_write Read_Double_DIRECT(shared_memory memoryType, uint32_t offset, double *pValue)
Read double floating point value (8 bytes) from shared memory. For remote devices the function always...
read_write Clr_Bit_I32(shared_memory memoryType, uint32_t offset, int32_t Value)
Performs logical NAND on 32bit integer in shared memory. (i.e. originalValue &= ~Value).
read_write Read_I64(shared_memory memoryType, uint32_t offset, int64_t *pValue)
Read 64bit integer from shared memory. For remote devices, the read request is sent and the function ...
read_write Write_I64_DIRECT(shared_memory memoryType, uint32_t offset, int64_t Value)
Write 64bit integer to shared memory. For remote devices the function always waits for acknowledge...
void Set_App_Compatibility_VN(int32_t compatibilityID, int32_t compatibilityMemID, int32_t version, const TGM_TCHAR *appName)
Set application compatibility request values.
error_code LoadDll(const char *fileName)
First function to be called. Loads the TGM_Comm_Int_2.dll and gets pointers to all of its exported fu...
enum ENUM_CLASS connected_memory
Connected memory types.
read_write Write_Double_DIRECT(shared_memory memoryType, uint32_t offset, double Value)
Write double floating point value (8 bytes) to shared memory. For remote devices the function always ...
enum ENUM_CLASS ODS
TGM_ODS (OutputDebugString)
enum ENUM_CLASS CNC_EX_LOCAL
local device only, DLL shadow of shared TGM_CNCEX
enum ENUM_CLASS device
Allowed device types.
read_write Read_I32(shared_memory memoryType, uint32_t offset, int32_t *pValue)
Read 32bit integer from shared memory. For remote devices, the read request is sent and the function ...
Describes one servo input/output module.