Jump to content
The simFlight Network Forums

FSUIPC TCAS data


Recommended Posts

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.