Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Gentlemen,

I am trying to get FSUIPC to access TCAS data. I have tried this code in my gauge, but for some reason the TCAS data is empty. I checked with TrafficLook.exe,a nd there are aircraft nearby.

//In PANEL_SERVICE_PRE_INITIALIZE
FSUIPC_Open2(FSReq, &Result, Mem, Size);
//where I have these declarations right above the case statement
DWORD FSReq = SIM_ANY; 
DWORD Result; 
BYTE Mem[1024]; 
DWORD Size=1024; 


//in PANEL_SERVICE_PRE_UPDATE
FSUIPC_Read (0xE080, 96 * sizeof(TCAS_DATA), (BYTE *) ground, &Result);
FSUIPC_Read (0xF080, 96 * sizeof(TCAS_DATA), (BYTE *) airborne, &Result); 

FSUIPC_Process(&Result); 

Sincerely,

Tiberiu Brasov

Posted

The TCAS_DATA structure is 40 bytes in size. You are attempting to read a data block consisting of of 96 of these structures - that's 3840 bytes for each of each of the FSUIPC reads. You have only allocated 1024 bytes for FSUIPC to work with. Increase the allocation accordingly.

Doug

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.