Jump to content
The simFlight Network Forums

Problem with reading TCAS- and AI-Traffic-data with VB


Recommended Posts

Hi to everyone.

I have a problem with VB and FSUIPC:

I'm programming an application which should show you important flight data, e.g. altitude, position (in a map), gear status and so on.

In the map, where my position is shown, you should see other aircrafts (AI-Traffic), too.

And now here's my problem:

All AI-Traffic- and TCAS-variables which I want to read, return the value "0". An example: I want to read F084 to F087 (TCAS traffic Latitude of aircraft index 1). Return: "0".

"FS-Interrogate" shows me the correct value. Not the value "0".

Another programm called "TCAS2v7" works very well, too. And TCAS2v7 is programmed in VB!

What's the problem?

Link to comment
Share on other sites

What's the problem?

Sorry, I cannot help with VB. But have you tried to help yourself at all?

First of all, look in the FSUIPC options screen and find the Tab "Logging". On the left-hand side check "IPC Read" logging. Then run your program and look in the FSUIPC.LOG to see exactly what you are actually asking for.

That's exactly what these facilities are provided for, to help you develop and debug your program.

Another tool which you should find some place in your VB compiler installation is a debugger, Try that too. It is a great help when developing programs as you can see exactly what is happening.

Pete

Link to comment
Share on other sites

Thank you very much!

Now it works!

That was wrong:

There was a conversion mistake at the conversion from hex to decimal.

I found it by reading the FSUIPC.log.

My programm doesn't want to read F084 but 8FF084.

I don't want to talk to much in detail.

Instead of F084 I write the decimal number (61572).

And know all is well!

Later I will write my own conversion function to use hex codes again.

I'm sorry for my English. I'm from Germany.

Link to comment
Share on other sites

My programm doesn't want to read F084 but 8FF084.

I don't want to talk to much in detail.

Instead of F084 I write the decimal number (61572).

And know all is well!

AhI know about that problem. Apparently, in VB, for some reason best known to Microsoft only I think, if you write:

$F084

it assumes you meant $FFFFF084 in the whole 32 bits. I'm told it even does this if you say $0000F084, which is quite bizarre.

Now FSUIPC reserves some of those bits for special uses (the Advanced Weather Interface for one), and the best it can come up with is the 8FF084 you saw.

I believe that you can stop VB from doing this silly thing by adding another $ at the end, thus:

$F084$

I would have thought that it would be documented someplace in the VB guides/manuals.

Regards,

Pete

Link to comment
Share on other sites

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.