Jump to content
The simFlight Network Forums
efratomer

Newbe with connection to FSUIPC (Via Visual Basic)

Recommended Posts

One question the is any way to while the application is running the crash is active?

For example i usually dont use crashes but when i run the application it will turn on the crashes...

Share this post


Link to post
Share on other sites

One question the is any way to while the application is running the crash is active?

For example i usually dont use crashes but when i run the application it will turn on the crashes...

Sorry, i don't quite understand the question. You want to make the aircraft crash? Or you want to detect crashes? What do you mean by "crash is active"?

Pete

Share this post


Link to post
Share on other sites

in the settings you can say to the Flight Simulator to dont detect crashes and i want to if the crashes detector is off turn it on while the application is running

Share this post


Link to post
Share on other sites

in the settings you can say to the Flight Simulator to dont detect crashes and i want to if the crashes detector is off turn it on while the application is running

FSX or FS9?

In FSX you can only turn it on or off via the menu. I think you can detect whether it is on or off -- try offsets 0832 (own aircraft crash) or 0833 (crash with other aircraft).

In FS9 and before you could try offset 0830, as documented. I'm afraid I don't recall whether it worked to switch it on and off, though -- it may also have only been a read-out.

Pete

Share this post


Link to post
Share on other sites

but we can check if its on or off correct?

Yes, those offsets I mentined should be working okay. I've not actually used them myself. The FSX ones are from SimConnect, the FS9 and before are from FS internals I think. To verify if they are working I'd have to load up both sims and use the logging or the Monitor facilities, and i don't have time at present. Why not just try them yourself?

Regards

Pete

Share this post


Link to post
Share on other sites

Can we use this in Java(eclipse)?

Sorry, I've no idea. Have you looked in the SDK? There is a JAVA contribution in there. not sure whether that means "eclipse" too, whatever that is, but it'll be a start. If you need to change it to make it work, send me the updated package and I'll inlcude it in future updates.

Regards

Pete

Share this post


Link to post
Share on other sites

Eclipse is the most common program to create games and plugins and scripts etc.. in java..

Ok i will see in the SDK

Share this post


Link to post
Share on other sites

I have some questions:

First one, in the Fs-Interrogate2std in this case Pause Flag it says:

Addr: 0264

Field-Name: Pause Flag

Var.Type: S16

Size: 2

Read/Write: Read(only )

Category: Simulation

Expression: #

Usage: 0=Running, 1=Paused

then in the code we have to write this:

Dim pause As Offset(Of Short) = New FSUIPC.Offser(Of Short)(&H264)

so what is actually the &H264? I mean the 264 its the Addr and the &H where did it came from?

Second, lets see if this is correct and what i would like somebody to explain me

Addr its like the "name" of the information we want to know and we and to put it in the code.

Field-Name Its The name.

Var. Type i Would like to know what is it

Size its the max number off characters that cames on the FSUIPC response.

Read/Write its if that information can be only Read or Write or Both.

Category its the Category....

Expression I would like to know what is it..

Usage its the type off response that the FSUIPC give us.

And to end in this code:

Dim AircraftName As Offset(Of String) = New FSUIPC.Offset(Of String)("AircraftInfo", &H3160, 24)

in this what is actually the 24 and the "AircraftInfo" means something or if I want a can change it for ex. to "Plane" it will still works?

Thanks

Share this post


Link to post
Share on other sites

First one, in the Fs-Interrogate2std in this case Pause Flag it says

Please do NOT use whatever is written in FSInterrogate as being main reference material. It is very old and unchecked and unmaintained. The references for offset usage are the documents, the Programmers Guide and the FSUIPC4 Offsets Status.

so what is actually the &H264? I mean the 264 its the Addr and the &H where did it came from?

don't you have any references for Visual Basic at all? How are you learning it if not?

As far as I know the &H prefix just means "Hexadecimal". In C/C++ the prefix is 0x.

I think you really need to refer to VB reference books or learning guides to learn VB. FSUIPC references cannot teach you VB.

Addr its like the "name" of the information we want to know and we and to put it in the code.

It is actually the OFFSET of the ADDRESS, in the section of COMPUTER MEMORY containing all the FSUIPC data, of the data item. The "OFFSET" is the number of bytes from the base address, which is unknown, except inside FSUIPC, and variable in any case.

Var. Type i Would like to know what is it

I'm sure the FSInterrogate documentation defines its type abbreviations. And I think they are the same or similar to those used in FSUIPC's Logging -- see the FSUIPC User Guide section on logging options, particularly the right-hand side window for Monitoring values.

e.g S16 = Signed 16-bit integer, or word.

But beware, not all of those in FSInterrogate are correct, and there are many offsets missing. Use the offset lists instead.

Size its the max number off characters that cames on the FSUIPC response.

Number of BYTES, not CHARACTERS. They are not always the same. Unicode and Wide Characters are 2 bytes each. I think VB uses 2 bytes per character by default.

Expression I would like to know what is it..

Why not read FSInterrogate's documentation? I think the expression is how the value provided in the offset is converted to regular units. It is derived from the Offset documentation I already referred you to.

Please please please use the documentation, and refer to VB manuals about VB.

Regards

Pete

Share this post


Link to post
Share on other sites

Hello,

Thanks for the help.

Now, I lerned VB by my hown so names and things like that I dont know...

And I have only 15 years so that why my bad English and Im not English im portuguese....

Now thanks again

Share this post


Link to post
Share on other sites

Im searching the Offset to Tuch Down Rate do you know? im searching in the FSUIPC4 Offsets Status but getting hard to find it....

Share this post


Link to post
Share on other sites

Im searching the Offset to Tuch Down Rate do you know? im searching in the FSUIPC4 Offsets Status but getting hard to find it....

Search on "vertical speed". You should find it soon after the current vertical speed -- I don't remember the offset offhand.

Pete

Share this post


Link to post
Share on other sites

Thanks again I found two Offsets 0842 : Vertical speed in metres per minute, but with –ve for UP, +ve for DOWN. Multiply by 3.28084 and reverse the sign for the normal fpm measure.

and 02C8 : Vertical speed, signed, as 256 * metres/sec. For the more usual ft/min you need to apply the conversion *60*3.28084/256

Now to get the Tuch Down Rate I have to get the 02C8 when tuch on the ground it that correct?

Both(02C8 and 0842) need some calculations but im not understanding how so lets see if this is correct :

Dim tuchdonwrate As Offset(Of Integer) = New Offset(Of Integer)(&H0842)

then

Me.tuch.Text = (tuchdownrate.Value * 3.28084)

And for the next one

Dim tuchdonwrate As Offset(Of Integer) = New Offset(Of Integer)(&H02C8)

then

Me.tuch.Text = (tuchdownrate.Value * 60 * 3.28081 / 256)

thats right?

Share this post


Link to post
Share on other sites

Thanks again I found two Offsets 0842 : Vertical speed in metres per minute, but with –ve for UP, +ve for DOWN. Multiply by 3.28084 and reverse the sign for the normal fpm measure.

and 02C8 : Vertical speed, signed, as 256 * metres/sec. For the more usual ft/min you need to apply the conversion *60*3.28084/256

Now to get the Tuch Down Rate I have to get the 02C8 when tuch on the ground it that correct?

Err, how did you miss the second one you should have found on the search, assuming you started at the beginning, 030C, which does that for you? You won't get good results doing the ones you looked at.

Me.tuch.Text = (tuchdownrate.Value * 60 * 3.28081 / 256)

Well apart from 3.28081 not quite being as accurate as the documented 3.28084, yes. That's what it says.

Pete

Share this post


Link to post
Share on other sites

Hello,

Tuch Down Rate done thanks for every thing..

Now I have other question using the FSUIPC 4 Offsets Status how can i now that is the type of the return value?

I mean the return value from the onGround is 0 = no or 1 = Yes..

What is the Offset to the Flaps ive searched but i really dont know wicht one to use....

Share this post


Link to post
Share on other sites

Now I have other question using the FSUIPC 4 Offsets Status how can i now that is the type of the return value?

There are numbers and there are strings. Strings are collections of ASCII characters and in FSUIPC can be up to 256 bytes long -- the max length is listed.

Numbers are any of many types, as listed in the references i've already given you. They vary by size (BYTE, 8 bits, WORD 16 bits, DWORD, 32 bits, Quadword or long long, ot _int64, 64 bits), signed or unsigned, and format (fixed point, integer, floating point). Floating point ones are 32-bit (float or FLT32) or 64 bit (doundle or FLT64). Please see the FAQ on nmubers in the FAQ subforum.

Different languages use different names for these various number formats. For VB you'll have to refer to VB documentation.

I mean the return value from the onGround is 0 = no or 1 = Yes..

The 0 and 1 are just numbers. you could read that one into a byte. normally, In C/C++ you'd call it a boolean variable, as it is either true (non-zero) or false (zero), but it is stll just a number nevertheless.

What is the Offset to the Flaps ive searched but i really dont know wicht one to use....

Depends what you want to use it for.

Pete

Share this post


Link to post
Share on other sites

I just want to read the FLAPS position.

Well, of course any of the flaps positions offsets will give you that, but in different ways, so it still depends what you want to use it for. You have to decide which is more suitable!

0BE0 and 0BE4 give them as a flap lever position between 0 and 16383 with the increment normally as that given in 3BGFA

0BFC (FSX only) gives it as the lever detente nmber (0- how ever many, see offset 3BF8 for number)

30E0-30EE gives more detailed ingformation for the separate flap components.

30F0-30FE is the same but with flaps angles rather than positions

Pete

Share this post


Link to post
Share on other sites

Hello,

In Fuel weight(0AF4) it says Fuel Wieght as pounds per gallon * 256.

If i want to change it to Kilo I have to do

((0AF4 result) * 256) * 3.7854118 its that right?

Share this post


Link to post
Share on other sites

In Fuel weight(0AF4) it says Fuel Wieght as pounds per gallon * 256.

If i want to change it to Kilo I have to do

((0AF4 result) * 256) * 3.7854118 its that right?

No!

"as poiunds per gallon * 256" means it is provided already times 256 (i.e. it is in 1/256ths). So you need to DIVIDE by 256 to get pounds!

And why multiply by 3.7854118? Do you think there are that many kilos in every pound? I thought it was only 2.2 something. I'd re-check that if I were you!

Pete

Share this post


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

×

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.