Jump to content
The simFlight Network Forums
Priyasloka Arya

TCAS Simulation using FSUIPC

Recommended Posts

<p>Hi

I was trying to simulate TCAS traffic on FS2004 using FSUIPC V4.999W and later verifying the TCAS info via Pete's TrafficLook tool.

I simulated a plane and could see the plane on Traffic look.

-------------------------------------

AI.id=0xFFFFFFF5;

AI.lat=47.431507;

AI.lon=237.692002-360;

AI.alt=432;

AI.hdg=62697;

AI.gs=95;

AI.vs=817;

strcpy(AI.idATC,"N72577");

AI.bState=0x8C;

AI.com1=0x2010;

FSobj.WriteAndProcess(0x1F80,sizeof(TCAS_DATA),&AI);

-----------------------------------------------------------------------

AI is a TCAS_DATA data type. Offset is 0x1F80

I am unable to simulate more planes, i do not know what i am doing wrong.

Next offset i am choosing 0x1F80+sizeof(TCAS_DATA),&

Am i missing anything

Share this post


Link to post
Share on other sites

I am unable to simulate more planes, i do not know what i am doing wrong.

Next offset i am choosing 0x1F80+sizeof(TCAS_DATA),&

Am i missing anything

Hi,

You need to write every plane to 0x1F80. You don't add sizeof(TCAS_DATA) every time. You can write multiple planes to 0x1F80 before calling Process(). Even though they all have the same offset they won't overwrite each other because offsets do not refer to real memory locations. They are just tokens that tell FSUIPC what to do with the data.

Paul

Share this post


Link to post
Share on other sites

thanks.

i tried accordingly , it is working. Here enclosed code snippet

--------------------------------------------------------

AI.id=1;

AI.lat=47.431507;

AI.lon=237.692002-360;

AI.alt=432;

AI.hdg=62697;

AI.gs=95;

AI.vs=817;

strcpy(AI.idATC,"MY PLANE1");

AI.bState=0x8C;

AI.com1=0x2010;

FSobj.Write(0x1F80,sizeof(TCAS_DATA),&AI); //setting autopilot master switch

strcpy(AI.idATC,"");

AI.id=5;

AI.lat=48.431507;

AI.lon=123.0;

AI.alt=832;

AI.hdg=62697;

AI.gs=95;

AI.vs=817;

strcpy(AI.idATC,"MY PLANE2");

AI.bState=0x8C;

AI.com1=0x2010;

FSobj.Write(0x1F80,sizeof(TCAS_DATA),&AI);

FSobj.Process();

---------------------------------------------------

Share this post


Link to post
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...

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