#define TMRUNTIME_API extern "C" __declspec(dllexport) // Feedback struct for API function calls. Initialize prior to call, and include address of as indicated parameter... typedef struct tagSYSFEEDBACK { int iResponseCode; // will contain an code other than 0 if function could not be completed... bool bMsgAvailable; // flag indicating a string msg is available in the szMsg param... TCHAR szMsg[256]; // message from the system with specific information regarding the result of the call (not always available, so check the flag above first). }SYSFEEDBACK, *PSYSFEEDBACK; typedef struct tagSYSTEMINPUT { int id; // id of this input... int iType; // type of this input... double dValue; // value of this input... TCHAR szName[100]; // name of this input... double* pdValue; // pointer to this input's value... }SYSTEMINPUT, *PSYSTEMINPUT; typedef struct tagSYSTEMOUTPUT { int id; // id of this output... int iType; // type of this input... double dValue; // value of this output... TCHAR szName[100]; // name of this output... double* pdValue; // pointer to this output's value... int iCountValues; // should be one, unless this is an array of values, then initialize new array and copy indexed pdValues... }SYSTEMOUTPUT, *PSYSTEMOUTPUT; #define INPUTTYPE_INT 0 #define INPUTTYPE_DOUBLE 1 #define INPUTTYPE_ARRAY 2 #define INPUTTYPE_STRING 3 #define OUTPUTTYPE_INT 0 #define OUTPUTTYPE_DOUBLE 1 #define OUTPUTTYPE_ARRAY 2 #define OUTPUTTYPE_STRING 3 #define ARRAYTYPE_DOUBLE 10 #define ARRAYTYPE_INT 12 // error codes for system loading / initialization... #define TMLOADERROR_SUCCESS 1 #define TMLOADERROR_NOTENOUGHMEMORY 2 #define TMLOADERROR_PERMISSIONDENIED 4 #define TMLOADERROR_FILENOTFOUND 8 #define TMLOADERROR_FILEREAD 32 #define TMLOADERROR_UNKNOWN 64 // error codes for normal system processing... #define TMERRORCODE_SUCCESS 0 #define TMERRORCODE_NOSYSTEMLOADED -1 #define TMERRORCODE_SYSTEMITEM_NOTFOUND -2 TMRUNTIME_API double tmAISystem_GetVersion(void); TMRUNTIME_API int tmAISystem_Load(const char* szFileName, int idAISystem, PSYSFEEDBACK pFeedback); TMRUNTIME_API int tmAISystem_Unload(int idAISystem); TMRUNTIME_API int tmAISystem_Execute(int idAISystem); TMRUNTIME_API int tmAISystem_SetValue(int idInput, double dValue); TMRUNTIME_API int tmAISystem_SetArrayValues(int idInput, double* pdValues, int iCountValues); // calling app is responsible for deletion of array variable... TMRUNTIME_API int tmAISystem_GetCountSystemInputs(int idAISystem); TMRUNTIME_API int tmAISystem_GetCountSystemOutputs(int idAISystem); TMRUNTIME_API int tmAISystem_GetSystemInputInfo(int idAISystem, int idInput, PSYSTEMINPUT pInputOUT); TMRUNTIME_API int tmAISystem_GetSystemInputValue(int idAISystem, int idInput, double* pdValue); TMRUNTIME_API int tmAISystem_GetSystemOutputInfo(int idAISystem, int idOutput, PSYSTEMOUTPUT pOutputOUT); TMRUNTIME_API int tmAISystem_GetSystemOutputValue(int idAISystem, int idOutput, double* pdValue); TMRUNTIME_API int tmAISystem_GetAllSystemInputs(int idAISystem, PSYSTEMINPUT pInputsOUT); TMRUNTIME_API int tmAISystem_GetAllSystemOutputs(int idAISystem, PSYSTEMOUTPUT putputsOUT);