Hi Pete,
After a little more research, I've determined this is something much more suited to C/C++. Also, it seems the information I want from TCAS is better collected from offet 0xF080. Something like this (without the open, close and error checking);
struct TCAS { // TCAS_Table Structure DWORD ID; float lat; float lon; float alt; WORD hdg; WORD gs; short vs; char idATC[15]; BYTE bState; WORD com1; } MyTable[96];
unsigned int tcas_len = 96;
unsigned int tcas_base = 0xF080; unsigned int tcas_offset = 0x0028; unsigned int tcas_ID = 0x0000; unsigned int tcas_lat = 0x0004; unsigned int tcas_lon = 0x0008; unsigned int tcas_alt = 0x000C; unsigned int tcas_hdg = 0x0010; unsigned int tcas_gs = 0x0012; unsigned int tcas_vs = 0x0014; unsigned int tcas_idATC = 0x0016; unsigned int tcas_bState = 0x0025; unsigned int tcas_com1 = 0x0026; unsigned int i;
for(i = 0; i <= tcas_len; i++) { FSUIPC_Read(tcas_base+(i * tcas_offset), sizeof(DWORD), (void*)&MyTable.ID, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_lat, sizeof(float), (void*)&MyTable.lat, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_lon, sizeof(float), (void*)&MyTable.lon, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_alt, sizeof(float), (void*)&MyTable.alt, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_hdg, sizeof(WORD), (void*)&MyTable.hdg, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_gs, sizeof(WORD), (void*)&MyTable.gs, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_vs, sizeof(short), (void*)&MyTable.vs, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_idATC, 15, MyTable.idATC, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_bState, sizeof(byte), (void*)&MyTable.bState, &dwResult); FSUIPC_Read(tcas_base+(i * tcas_offset)+ tcas_com1, sizeof(WORD), (void*)&MyTable.com1, &dwResult); } FSUIPC_Process(&dwResult);
QUESTION#1 Should I put the "FSUIPC_Process" inside the loop? (too many reads to do at once with it outside the loop?)
QUESTION#2 If i use an external Win32 exe, will this also have less impact on the FSX VAS?
Thanks,
Terry