Jump to content
The simFlight Network Forums

ScKevin

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by ScKevin

  1. Ok while writing here a reply I think I have found my mistake. I simply added a PS.RefreshData() and it seems to work now: Dim PS As PayloadServices = FSUIPCConnection.PayloadServices PS.RefreshData() PS.PayloadStations(0).WeightLbs = 187 PS.WriteChanges() PS.RefreshData() [/CODE] So the problem is solved as far as I can see :) Thanks for your help (again) :)
  2. Hey Paul, sorry for making you mad again I am however hanging on one part: In the aircraft.cfg the index for payload stations starts from 0 to 13. I use this code to load these payloadstations: PS.PayloadStations([u][b]INDEX[/b][/u]).WeightLbs = 187[/CODE] However I do not get it to make it work for the following one: [CODE]PS.PayloadStations(0).WeightLbs = 374[/CODE] This one is the weight of the pilot & co-pilots so basically it is everytime 374, but my FSX does not want to accept this although the rest of the 13 stations do work as they should. What is my mistake here? The index starts from "0" and goes up. And based that the other stations work, my code should be fine no?
  3. Ok I copied it now exactly like this into my application: Try FSUIPCConnection.Open(FlightSim.FSX) Dim ps As PayloadServices = FSUIPCConnection.PayloadServices ps.RefreshData() ps.FuelTanks(FSFuelTanks.Left_Main).LevelUSGallons = 50 ps.WriteChanges() MsgBox("Done") Catch ex As Exception MessageBox.Show(ex.Message) End Try [/CODE] but nothig changes. My fuel tank is still fuel. I am missing surely one thing here or?
  4. First of all thanks Paul for a new version of your amazing .dll! Then I used the way you gave me the example with this code: Try FSUIPCConnection.Open(FlightSim.FSX) Dim ps As PayloadServices = FSUIPCConnection.PayloadServices ps.FuelTanks(FSFuelTanks.Left_Main).LevelUSGallons = 50 ps.WriteChanges() MsgBox("Done") Catch ex As Exception MessageBox.Show(ex.Message) End Try [/CODE] And I always get an error saying the following: "Index is out of bounds. He shouldn't be negative und be below the list. Parametername: Index" (Since my PC is a German one, I get the German message of it: "Der Index lag außerhalb des Bereichs. Er muss nicht negativ und kleiner als die Auflistung sein.Parametername: index" and I translated it into English as best as I can) That makes me mad. My aircraft.cfg says the following under fuel: [CODE] LeftMain = X.X, X.X, X.X, 158.0, 3.6 //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons) RightMain = X.X, X.X, X.X, 158.0, 3.6 //Longitudinal (feet), Lateral (feet), Vertical (feet), Usable(gallons), Unusable (gallons) [/CODE] I cannot find again my mistake since FSX is running and the airplane is loaded. This also happens with different airplanes like Majestic Q400, so basically it is wrong or? thanks for your help
  5. Hey Paul (and all the other readers here), since a few weeks I am working on a fuel & CG planner and I got everything I should get. My application saves the "passenger" load into the aircraft.cfg, however the fuel is the only thing which cannot be saved that simple. I tried a lot of things with SimConnect but this made me mad. I searched for alternatives and finally I found one with your DLL. For this now already a big THANK YOU! Makes life much easier :) Although I am digging in this, my application seems to have a problem. I am programming in VB.net but it seems I am too dumb to find my mistake. I debugged it and all my values are calculated correctly (at least I think so) but when it comes to send it to FSX I just get instead of a loaded fuel tank an empty one. I just did the case to fill my left tank with 50 gallons of fuel (just to get the thing running..) however as said instead that I get 50 gallons in my tank I always get 0 gallons after the process is finished. Here my code: Private Sub ButtonSend_Click(sender As Object, e As EventArgs) Handles Button1.Click 'Open a connection to FSUIPC on FSX Try FSUIPCConnection.Open(FlightSim.FSX) Dim FuelLeftCapacity As Offset(Of Integer) = New Offset(Of Integer)(&HB80) Dim FuelLeftTankLevel As Offset(Of Integer) = New Offset(Of Integer)(&HB7C, True) Dim FuelRightCapacity As Offset(Of Integer) = New Offset(Of Integer)(&HB98) Dim FuelRightTankLevel As Offset(Of Integer) = New Offset(Of Integer)(&HB94, True) 'Let the application load once the data FSUIPCConnection.Process() 'Calculate now the values to have finally 50 gallons fuel in my left tank Dim LeftTankLevelGallons As Double = 50 Dim LeftTankLevel As Double = (LeftTankLevelGallons / FuelLeftCapacity.Value) * 128D * 65535D Dim LeftTankLevelPercentage As Double = LeftTankLevel / 128D / 65535D * 100D FuelLeftTankLevel.Value = LeftTankLevelPercentage 'Send data to FSX FSUIPCConnection.Process() Catch ex As Exception MessageBox.Show(ex.Message) End Try FSUIPCConnection.Close() End Sub [/CODE] Can anybody help me here please?
×
×
  • 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.