Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hello,

Can anybody help me?

I want to read the pitch and roll in visual basic 2010.

But how do I program this?

I juse FSX and FSUIPC.

I can read the airspeed in visual basic 2010, but how has the vb 2010 program to look like voor the pitch and roll?

Posted

In exacly the same way as you read airspeed. Call the equivalent of

FSUIPC_Read(DWORD dwOffset, DWORD dwSize, void *pDest, DWORD *pdwResult);

with the appropriate arguments followed by

FSUIPC_Process(DWORD *pdwResult);

Posted

I want to read the pitch and roll in visual basic 2010.

To use any offset you need to follow this procedure: (This example will use Pitch)

1. Look in the "FSUIPC4 Offsets Status.pdf" (from the SDK) for the offset address. A search for "Pitch" finds 0578.

2. Get the size from the size column (in this case 4 bytes).

3. Read the description to see if a data type is mentioned and if the data is signed. (There is no data type mentioned in this case so we assume some kind of integer type. We can also read that the data is signed).

4. From the table on page 7 of my UserGuide.pdf we read that an integer type of size 4 that is signed corresponds to the VB.NET type of 'Integer'. Thus we declare the offset:

Dim Pitch As Offset(Of Integer) = New Offset(Of Integer)(&H578)[/CODE]

5. After the Process() call, when we want to use the data, we use the conversion described in the "FSUIPC4 Offsets Status.pdf" document to get the data into human readable format.

[CODE]
Dim PitchDegrees As Double
PitchDegrees = Pitch.Value * 360.0# / (65536.0# * 65536.0#)[/CODE]

(The # signs are appended to the values to tell the compiler that these are to be Doubles and not Integers.)

You can now apply this process to any offset you want and know how to use it. Roll (also called Bank) is at 057C.

Paul

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.