hks76 Posted December 28, 2012 Report Posted December 28, 2012 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?
mgh Posted December 28, 2012 Report Posted December 28, 2012 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);
Paul Henty Posted December 28, 2012 Report Posted December 28, 2012 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
hks76 Posted December 31, 2012 Author Report Posted December 31, 2012 Thanks al lot!!!!! :razz: I will try this, I hope I can get it working. greetings and best wish voor 2013
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now