Jump to content
The simFlight Network Forums

Offsets for Pax onboard - Visibility - QNH set - AutoPilot on/off


Recommended Posts

Hello Paul,

 

 

How to:

 

1) How to return number off pax onboard (I mean update by PayloadServices)

1.a) Takeoff Weight: 65054 kg

2) weather doecoded like this( Weather: Wind 196/1 | Temperature 25°C | Visibility 9999 m | QNH 1015)

3) QNH set to auto pilot (Altimeter setting changed to 1013 at 10 ft AGL)

4) Auto pilot on/off dual or single

5) Find ils etablished by NAV 1

6) Recognition Lights

7) Push back mine doesn't work anymore

Thanks by advance

Regards Fred

Link to comment
Share on other sites

1. The number of passengers on board is not recorded in FS. Each plane, depending on how it's written, has a different number of payload stations. For example, the default 737 has playload stations representing rows of seats: e.g. First Class, Coach 3-10. All you can do is read and write the total weight for all these passengers.

 

Some complex payware aircraft have a payload station per seat.

 

 

1a. The Max Takeoff Weight is not available in FS. You can get the Max Gross Weight which is usually close. I've added this to the PayloadServices (new DLL attached). Either use the Max Gross Weight or you can just hold the real-world information in a table in your application.

        Dim ps As PayloadServices = FSUIPCConnection.PayloadServices
        ps.RefreshData()
        MsgBox(ps.MaxGrossWeightKgs.ToString("F0") & "Kg")

2. You can get back a weather structure from the weather services. You can then construct your string from the various properties. There is full Intellisense documentation to help with this. For example, making a temperature string:

        Dim ws As WeatherServices = FSUIPCConnection.WeatherServices
        Dim weather As FsWeather = ws.GetWeatherAtAircraft()
        Dim message As String = "Temperature " & weather.TemperatureLayers(0).DayCelsius & "°C"
        MsgBox(message)

3. The QNH can be set at offset 0x0330. The altitude above ground can be calculated by subtracting the height of the terrain (0x0020) from the altitude above sea level (0x6020).

 

 

4. Dual autopilots are not supported in FS. The main autopilot switch is at 0x07BC. Some payware aircraft may have dual autopilots, but you'll need to find out if/how you can access this information. Each aircraft will be different. 

 

 

5. See offsets 0x0C48 and 0x0C49 to get the position of the ILS/Glideslope indicators.

 

 

6. Offset 0x0D06, bit 6. See this thread on how to use a bitarray to make it easier. http://forum.simflight.com/topic/79536-little-understanding-problem-reading-from-project-magenta-offset/

 

 

7. Offset 0x31F4 controls the pushback. I cannot see anywhere in your application that this is declared or used. Looks like to need to add this.

 

 

Paul

 

FSUIPCClient3.0_BETA.zip

Link to comment
Share on other sites

1. The number of passengers on board is not recorded in FS. Each plane, depending on how it's written, has a different number of payload stations. For example, the default 737 has playload stations representing rows of seats: e.g. First Class, Coach 3-10. All you can do is read and write the total weight for all these passengers.

 

Some complex payware aircraft have a payload station per seat.

 

Maybe ask to TOPCAT dev ?! I will make a try.

 

1a. The Max Takeoff Weight is not available in FS. You can get the Max Gross Weight which is usually close. I've added this to the PayloadServices (new DLL attached). Either use the Max Gross Weight or you can just hold the real-world information in a table in your application.

        Dim ps As PayloadServices = FSUIPCConnection.PayloadServices
        ps.RefreshData()
        MsgBox(ps.MaxGrossWeightKgs.ToString("F0") & "Kg")

Thank for improve your DLL ;)

 

2. You can get back a weather structure from the weather services. You can then construct your string from the various properties. There is full Intellisense documentation to help with this. For example, making a temperature string:

        Dim ws As WeatherServices = FSUIPCConnection.WeatherServices
        Dim weather As FsWeather = ws.GetWeatherAtAircraft()
        Dim message As String = "Temperature " & weather.TemperatureLayers(0).DayCelsius & "°C"
        MsgBox(message)

I'm thinking to get part of string (METAR return)

 

6. Offset 0x0D06, bit 6. See this thread on how to use a bitarray to make it easier. http://forum.simflight.com/topic/79536-little-understanding-problem-reading-from-project-magenta-offset/

Sorry in your FSUIPCClientExample_VB you have already answer to my question. So in the forum I have seen that it's seem easiest method to check value

Private Sub chkAvionics_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkAvionics.CheckedChanged
        Me.avionics.Value = IIf(chkAvionics.Checked, 1, 0)
    End Sub

7. Offset 0x31F4 controls the pushback. I cannot see anywhere in your application that this is declared or used. Looks like to need to add this.

Yes it is but with bad offset

Public pushback As Offset(Of Integer) = New Offset(Of Integer)(&H31F0)

Public Function getpushbackflag()
        Return pushback.Value < 3
    End Function
 

Thanks again,

 

Regards,

 

Fred

Link to comment
Share on other sites

Hi Paul,
 
Need help setting up QNH (Hp)
 
 

    Public qnh As Offset(Of Integer) = New FSUIPC.Offset(Of Integer)(&H330)


   Public Function getqnh()
        Dim qhn As Integer = CInt(qnh.Value / 16)
        Return qhn.ToString()
    End Function

 
I have  value for 1015 Hp -> 66520055

 

I think all is wrong  :???:

 

 

Regards Fred

Link to comment
Share on other sites

Hi Fred,

 

Offset 0x0330 is only 2 bytes. You've declared the offset as 'Integer' which is a 4 bytes in VB. The type tells the DLL how many bytes to read. A 2-Byte integer is a Short. This value is also unsigned so it's best to use UShort like this:

 

Public qnh As Offset(Of UShort) = New FSUIPC.Offset(Of UShort)(&H330)

 

My userguide.pdf explains which VB types to use. See the table on page 7.

 

Regards,

 

Paul

Link to comment
Share on other sites

Paul, it's possible to write a zero to switch off Autopilot on offset 0x07BC?

 

Yes, this works if the plane is using the built-in FS autopilot. This may not work on Third-party payware where they have coded their own autopilot.

 

You can also send the Autopilot off control as follows (Must be using Version 3.0 of my DLL. It's attached to a previous reply in this thread.)

FSUIPCConnection.SendControlToFS(FsControl.AUTOPILOT_OFF, 0)

In other hand, is there an offset for Autobrakes possition?

 

 

 

Yes it's 0x2F80. Again, this will not work where aircraft developers have coded their own autobrake system.

 

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.