Jump to content
The simFlight Network Forums

MBS

Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling
  • Location
    EDDS

Recent Profile Visitors

306 profile views

MBS's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi Paul, I was able to test today. First test was looking good. I solved it with your suggestion to make a group and delete it at the end of the sub. Thank you very much for your support. Matthias
  2. Hello Paul, thank you very much for your fast reply. I will check and rewrite the code to Groups and report in a few days. I don't think I have declared the variables multiple times. But I check it also. Matthias
  3. Hi, I have the same problem in my program, but only after when start a second flight. When I start my program the code works fine. The aircraft is loaded and refueled. When doing a second flight and run the code again I get the Message FSUIPC Error #15: FSUIPC_ERR_SIZE. I have declared the variables only once and don't know how to fix. Here is my code with the error: Errorline is marked as 'Error in this line...' and is when I run the line FSUIPCConnection.Process() Thanks in advance for your help. Protected Sub refuel() If Not FSUIPCConnection.IsOpen Then Try FSUIPCConnection.Open() Catch ex As Exception Response.Write("<script>alert('no connection to FSUIPC. Check and reload Aircraft manual');</script>") Exit Sub End Try End If Dim fuelTanks As FsFuelTanksCollection = Nothing Dim PayloadStations As List(Of FsPayloadStation) = Nothing Dim Parkingbrk As Offset(Of Short) = New FSUIPC.Offset(Of Short)(&HBC8) FSUIPCConnection.PayloadServices.RefreshData() fuelTanks = FSUIPCConnection.PayloadServices.FuelTanks PayloadStations = FSUIPCConnection.PayloadServices.PayloadStations If Aircraft = "Prosim A320 2020" Or Aircraft = "Prosim A320" Then For Each tank In fuelTanks If fuelTanks IsNot Nothing AndAlso tank.IsPresent Then If tank.Tank = 0 Then CT = tank.WeightKgs.ToString("F0") CTMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 1 Then TankL = tank.WeightKgs.ToString("F0") TankLMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 2 Then TankR = tank.WeightKgs.ToString("F0") TankRMax = tank.CapacityKgs.ToString("F0") End If End If Next ElseIf Aircraft = "JeeHell Airbus" Then For Each tank In fuelTanks If fuelTanks IsNot Nothing AndAlso tank.IsPresent Then If tank.Tank = 0 Then CT = tank.WeightKgs.ToString("F0") CTMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 1 Then TankL = tank.WeightKgs.ToString("F0") TankLMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 2 Then TankR = tank.WeightKgs.ToString("F0") TankRMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 3 Then AuxL = tank.WeightKgs.ToString("F0") AuxLMax = tank.CapacityKgs.ToString("F0") ElseIf tank.Tank = 4 Then AuxR = tank.WeightKgs.ToString("F0") AuxRMax = tank.CapacityKgs.ToString("F0") End If End If Next End If FSUIPCConnection.Process() 'Error in this line...' If Parkingbrk.Value > 0 Then If Aircraft = "Prosim A320 2020" Or Aircraft = "Prosim A320" Then Dim MaxFuel As Double = CDbl(CTMax) + CDbl(TankLMax) + CDbl(TankRMax) Dim Refuel As Double = CDbl(FOB) If Refuel > MaxFuel Then Refuel = MaxFuel Response.Write("<script>alert('Fuel limited by Max Fuel capacity');</script>") End If If Refuel > CDbl(TankLMax) + CDbl(TankRMax) Then Dim Wing As Double Dim CT As Double CT = Refuel - (CDbl(TankLMax) + CDbl(TankRMax)) Wing = Refuel - CT For Each tank In fuelTanks If tank.Tank = 0 Then tank.WeightKgs = CT ElseIf tank.Tank = 1 Then tank.WeightKgs = Wing / 2 ElseIf tank.Tank = 2 Then tank.WeightKgs = Wing / 2 End If Next Else For Each tank In fuelTanks If tank.Tank = 1 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 2 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 0 Then tank.WeightKgs = 0 End If Next End If FSUIPCConnection.PayloadServices.WriteChanges() Dim PLPassengers, FClass, Coach1, Coach2, Coach3, Baggage, PLCargo, FWDBaggage, AftBaggage As Double PLPassengers = CDbl(Passengers) PLCargo = CDbl(Cargo) FClass = Math.Round((PLPassengers / 100) * 18.19, 0) Coach1 = Math.Round((PLPassengers / 100) * 22.73, 0) Coach2 = Math.Round((PLPassengers / 100) * 27.28, 0) Coach3 = Math.Truncate(Passengers - FClass - Coach1 - Coach2) Baggage = (Passengers * 11) + PLCargo FWDBaggage = Math.Round(((PLPassengers * 11) / 2) + (Cargo / 2), 0) AftBaggage = Baggage - FWDBaggage For Each station As FsPayloadStation In PayloadStations If station.Index = 0 Then station.WeightKgs = 77 ElseIf station.Index = 1 Then station.WeightKgs = 77 ElseIf station.Index = 2 Then station.WeightKgs = 352 ElseIf station.Index = 3 Then station.WeightKgs = FClass * 88 ElseIf station.Index = 4 Then station.WeightKgs = Coach1 * 88 ElseIf station.Index = 5 Then station.WeightKgs = Coach2 * 88 ElseIf station.Index = 6 Then station.WeightKgs = Coach3 * 88 ElseIf station.Index = 7 Then station.WeightKgs = FWDBaggage ElseIf station.Index = 8 Then station.WeightKgs = AftBaggage End If Next FSUIPCConnection.PayloadServices.WriteChanges() ElseIf Aircraft = "JeeHell Airbus" Then Dim MaxFuel As Double = CDbl(CTMax) + CDbl(TankLMax) + CDbl(TankRMax) + CDbl(AuxLMax) + CDbl(AuxRMax) Dim Refuel As Double = CDbl(FOB) If Refuel > MaxFuel Then Refuel = MaxFuel Response.Write("<script>alert('Fuel limited by Max Fuel capacity');</script>") End If If Refuel > CDbl(TankLMax) + CDbl(TankRMax) Then For Each tank In fuelTanks If tank.Tank = 1 Then tank.WeightKgs = TankLMax ElseIf tank.Tank = 2 Then tank.WeightKgs = TankRMax End If Next Refuel = Refuel - CDbl(TankLMax) - CDbl(TankRMax) If Refuel > CDbl(AuxLMax) + CDbl(AuxRMax) Then Dim Wing As Double Dim CT As Double CT = Refuel - (CDbl(AuxLMax) + CDbl(AuxRMax)) Wing = Refuel - CT For Each tank In fuelTanks If tank.Tank = 0 Then tank.WeightKgs = CT ElseIf tank.Tank = 3 Then tank.WeightKgs = Wing / 2 ElseIf tank.Tank = 4 Then tank.WeightKgs = Wing / 2 End If Next Else For Each tank In fuelTanks If tank.Tank = 3 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 4 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 0 Then tank.WeightKgs = 0 End If Next End If Else For Each tank In fuelTanks If tank.Tank = 1 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 2 Then tank.WeightKgs = Refuel / 2 ElseIf tank.Tank = 0 Then tank.WeightKgs = 0 ElseIf tank.Tank = 3 Then tank.WeightKgs = 0 ElseIf tank.Tank = 4 Then tank.WeightKgs = 0 End If Next End If FSUIPCConnection.PayloadServices.WriteChanges() Dim PLPassengers, PLCargo, Baggage, CABOA, CABOB, CABOC, CPT1, CPT3, CPT4, CPT5 As Double PLPassengers = CDbl(Passengers) * 84 PLCargo = Cargo CABOA = Math.Round((PLPassengers / 100) * 33.33, 0) CABOB = Math.Round((PLPassengers / 100) * 33.33, 0) CABOC = Math.Truncate(PLPassengers - CABOA - CABOB) Baggage = (Passengers * 11) + PLCargo CPT1 = (Baggage / 100) * 36.11 CPT3 = (Baggage / 100) * 25.55 CPT4 = (Baggage / 100) * 22.22 CPT5 = Baggage - (CPT1 + CPT3 + CPT4) For Each station As FsPayloadStation In PayloadStations If station.Index = 0 Then station.WeightKgs = CABOA ElseIf station.Index = 1 Then station.WeightKgs = CABOB ElseIf station.Index = 2 Then station.WeightKgs = CABOC ElseIf station.Index = 3 Then station.WeightKgs = CPT1 ElseIf station.Index = 4 Then station.WeightKgs = CPT3 ElseIf station.Index = 5 Then station.WeightKgs = CPT4 ElseIf station.Index = 6 Then MsgBox(Aircraft) station.WeightKgs = CPT5 End If Next FSUIPCConnection.PayloadServices.WriteChanges() End If FSUIPCConnection.WriteLVar("FSDT_GSX_NUMPASSENGERS", Passengers) FSUIPCConnection.WriteLVar("FSDT_GSX_PILOTS_NOT_DEBOARDING", 1) FSUIPCConnection.WriteLVar("FSDT_GSX_CREW_NOT_DEBOARDING", 1) FSUIPCConnection.WriteLVar("FSDT_GSX_PILOTS_NOT_BOARDING", 1) FSUIPCConnection.WriteLVar("FSDT_GSX_CREW_NOT_BOARDING", 1) Else Response.Write("<script>alert('Reload only with Parking Brakes set. Set Parking Brakes and reload Aircraft again');</script>") End If FSUIPCConnection.Close() fuelTanks = Nothing PayloadStations = Nothing Parkingbrk = Nothing End Sub
  4. Hi Paul, Thank you for your quick answer and your support. Matthias
  5. Hi Paul, I have the same Problem when reading several LVars on my Application. I don't have the possibility to run it on the FS Computer. Is there a solution possible to get it with the Client.dll, I read about 10 LVars and that every second. I can extend the time if needed? Regards Matthias
  6. Hi, Thank you for your answer. I fixed the problem by reinstalling fsuipc and ivap. But I don't know what solved the problem.
  7. Hi, I have Prepar3D V2.3 installed and also the latest FSUIPC4 (4.936). When I set a freq. to the radio in P3D and set it active it does not change in IVAP. Also my AC position does not move in IVAO. In P3D V2.2 it worked fine. Can you help me solving this problem or does someone have the same problem? Regards Matthias
×
×
  • 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.