Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi,

I think will be the most stupid question, but I need to do it. I know a little bit about .NET and I´m learning more, and using FSUIPC SDK. I see the VB example it is beatiful. But, If I want to do another comands like flaps register. It isn´t in the VB example. Where I see all the comands I can use for .NET?

Posted

I think will be the most stupid question, but I need to do it. I know a little bit about .NET and I´m learning more, and using FSUIPC SDK. I see the VB example it is beatiful. But, If I want to do another comands like flaps register. It isn´t in the VB example. Where I see all the comands I can use for .NET?

Commands? The FSUIPC interface is the same no matter whcich offsets you want to handle. If by "commands" you mean "offsets", then the list is provided in documents (one for FS9 and before, one for FSUIPC4 and FSx) within the FSUIPC SDK.

I'm afraid I cannot help specifically with VB.NET, but you might do well looking in the Download Links subforum, in the thread FSUIPC Client DLL for .NET - Version 2.0 .

Regards

Pete

Posted

Commands? The FSUIPC interface is the same no matter whcich offsets you want to handle. If by "commands" you mean "offsets", then the list is provided in documents (one for FS9 and before, one for FSUIPC4 and FSx) within the FSUIPC SDK.

I'm afraid I cannot help specifically with VB.NET, but you might do well looking in the Download Links subforum, in the thread FSUIPC Client DLL for .NET - Version 2.0.

Regards

Pete

Ok, I find the offsets in the VB .NET document. It load the offsets like this:


' Register the Offsets we're interesing in for this application
Dim airSpeed As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2BC) ' Basic integer read example
Dim avionics As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H2E80) ' Basic integer read and write example
Dim fsLocalDateTime As Offset(Of Byte()) = New FSUIPC.Offset(Of Byte())(&H238, 10) ' Example of reading an arbitary set of bytes.
Dim aircraftType As Offset(Of String) = New FSUIPC.Offset(Of String)("AircraftInfo", &H3160, 24) ' Example of string and use of a group
Dim lights As Offset(Of BitArray) = New FSUIPC.Offset(Of BitArray)(&HD0C, 2) ' Example of BitArray used to manage a bit field type offset.
Dim compass As Offset(Of Double) = New FSUIPC.Offset(Of Double)(&H2CC) ' Example for disconnecting/reconnecting
Dim pause As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H262, True) ' Example of a write only offset.
Dim com2bcd As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&H3118) ' Example of reading a frequency coded in Binary Coded Decimal
Dim playerLatitude As Offset(Of Long) = New Offset(Of Long)(&H560) ' Offset for Lat/Lon features
Dim playerLongitude As Offset(Of Long) = New Offset(Of Long)(&H568) ' Offset for Lat/Lon features
Dim onGround As Offset(Of Short) = New Offset(Of Short)(&H366) ' Offset for Lat/Lon features
Dim magVar As Offset(Of Short) = New Offset(Of Short)(&H2A0) ' Offset for Lat/Lon features
Dim playerHeadingTrue As Offset(Of UInteger) = New Offset(Of UInteger)(&H580) ' Offset for moving the plane
Dim playerAltitude As Offset(Of Long) = New Offset(Of Long)(&H570) ' Offset for moving the plane
Dim slewMode As Offset(Of Short) = New Offset(Of Short)(&H5DC, True) ' Offset for moving the plane
Dim sendControl As Offset(Of Integer) = New Offset(Of Integer)(&H3110, True) ' Offset for moving the plane
[/CODE]

But the code number isn´t all like the PDF. In some offsets the number it is without &H and in other &H is the same than 0. Why?

Posted

But the code number isn´t all like the PDF. In some offsets the number it is without &H and in other &H is the same than 0. Why?

Sorry, I don't really know what you are talking about.

The offsets list in my PDFs are in herxadecimal. Don't you know what that is? I don't know VB but I think, in that language, hexadecimal numbers are denoted by that &H preceding them. I think that for unsigned numbers you should also have & at the end, otherwise &H8440, for example, becomes &HFFFF8440, which you most certainly do not want as an offset. But don't take my word for it, look it up in VB manuals.

In C/C++ hexadecimal is denoted by a preceding 0x. In Assembly code it is denoted by a trailing h. I expect other languages use different conventions. You should learn the language you intend to program in before attempting to make a complex program!

Regards

Pete

Posted

But the code number isn´t all like the PDF. In some offsets the number it is without &H and in other &H is the same than 0. Why?

In Visual Basic hexadecimal numbers are written with &H in front of them. The offsets in the PDF are all given in hexadecimal so that's why the &H is needed.

VB also deletes any leading 0s because they are technically not needed. For example 0570 is the same number as 570. So in VB this appears as &H570 (Even if you type in &H0570, the code editor will delete the first 0).

Just put '&H' in front of the offset given in the PDF. If the code editor deletes the leading 0 don't worry about it.

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.