Jump to content
The simFlight Network Forums

FSX Problem!


A320_Pilot

Recommended Posts

Hi,

 

Things you can try:

 

1. If you are running FSX 'as administrator' you need to run your client program 'as administrator' as well.  If you're not running FSX 'as administrator' then make sure you don't run your client program 'as administrator'.

 

2. If your FSUIPC4 is registered make sure the date on the PC is set correctly.

 

3. Test your FSUIPC4 installation by running a different FSUIPC program (e.g. FSInterrogate that comes with the FSUIPC SDK, or TrafficLook available in the downloads sub-forum). If other FSUIPC programs do not connect then something is wrong with your FSUIPC4 installation.

 

Paul

  • Upvote 1
Link to comment
Share on other sites

Well if other FSUIPC programs are working then I don't know what else to suggest.

 

The whole point about FSUIPC is that there is no difference between connecting to FSUIPC3 or FSUIPC4. 

 

What is the line that is throwing this error? Is it the FSUIPCConnection.Open() or one of the Process() calls?

 

Is there anything shown in the FSUIPC4 log file (in the FSX Modules folder)? Maybe post the contents of the log file here; it might help.

 

Paul

  • Upvote 1
Link to comment
Share on other sites

You have not answered this question yet:

 

What is the line that is throwing this error? Is it the FSUIPCConnection.Open() or one of the Process() calls?

 

Also when you say "In log file nothing!", do you mean you can't see anything interesting or there is no text at all in the log file? I still think you should paste the contents of FSUIPC4.log here.

 

Paul

  • Upvote 1
Link to comment
Share on other sites

End strings from FSUIPC log:

Running inside FSX (SimConnect Acc/SP2 Oct07)
Module base=61000000
Wind smoothing fix is fully installed
DebugStatus=255
       62 System time = 01:52:00
       78 FLT UNC path = "\\AEROFLOT\Users\Георгий\Documents\Flight Simulator X Files\"
       78 FS UNC path = "C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\"
      609 LogOptions=00000001
      609 SimConnect_Open succeeded: waiting to check version okay
    11453 Running in "Microsoft Flight Simulator X", Version: 10.0.61472.0 (SimConnect: 10.0.61259.0)
    11453 Initialising SimConnect data requests now
    11453 FSUIPC Menu entry added
    11484 C:\Users\Георгий\Documents\Flight Simulator X Files\Flight.FLT
    11484 C:\Program Files (x86)\Microsoft Games\Microsoft Flight Simulator X\SimObjects\Airplanes\Aerosoft Airbus X A320 Extended CFM\A320.AIR
    61984 System time = 01:53:02
    61984 *** FSUIPC log file being closed
Memory managed: 2 Allocs, 2 Freed
********* FSUIPC Log file closed ***********

 

 

What is the line that is throwing this error? Is it the FSUIPCConnection.Open() or one of the Process() calls?

This write then i click "start flight" button!

Link to comment
Share on other sites

I think you want the 'simulation rate' at 0C1A. Lookup this offset in "FSUIPC4 Offset Status.pdf" as there are some limitations writing to this offset for FSX. Reading is fine though.

 

You need to declare it as 'ushort' and you need to divide the .value by 256 to get the correct value.

 

Paul

  • Upvote 1
Link to comment
Share on other sites

Well there isn't a single offset that makes the plane refuel is that's what you mean.

 

You can set the level of each fuel tank in the aircraft. These offsets start at 0B7C, but it's much easier to set fuel using the payload services in my DLL.  Please see this post for details:

 

http://forum.simflight.com/topic/74848-fsuipc-client-dll-for-net-version-24/?p=457925

 

Using the payload services makes it easy to set the fuel by % level, weight (lbs or kgs) or volume (litres or gallons).

 

Paul

  • Upvote 1
Link to comment
Share on other sites

While I still like this:

private void start_fuel_Click(object sender, EventArgs e)
        {
            try
            {
            PayloadServices ps = FSUIPCConnection.PayloadServices;
            ps.RefreshData();
            //---------------------------------------------------------------------------------//
            //Refueling aircraft and start the flight
            //---------------------------------------------------------------------------------//
            string external1 = external1_m.Text;
            string external2 = external2_m.Text;
            string center = center_m.Text;
            string center2 = center2_m.Text;
            string center3 = center3_m.Text;
            string left_main = left_main_m.Text;
            string right_main = right_main_m.Text;
            string left_aux = left_aux_m.Text;
            string right_aux = right_aux_m.Text;
            string left_tip = left_tip_m.Text;
            string right_tip = right_tip_m.Text;
            //---------------------------------------------------------------------------------//
            foreach (FsPayloadStation payloadStation in ps.PayloadStations)
            {
                payloadStation.WeightLbs = 0;
            }
            ps.WriteChanges();
            }
            catch
                (Exception ex)
            {
                MessageBox.Show(ex.Message,
                    FSUIPC_ERR0_RU,
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Error);
            }
            //---------------------------------------------------------------------------------//
Link to comment
Share on other sites

Hi,

 

You seem to be working with the payload stations rather than the fuel tanks.

 

It's not well documented so I've written some examples of working with fuel. I think these will cover your requirements.

 

Example 1: Setting all fuel tanks to 100% full.

            // Fill all fuel tank
            PayloadServices ps = FSUIPCConnection.PayloadServices;
            ps.RefreshData();
            foreach(FsFuelTank fuelTank in ps.FuelTanks)
            {
                if (fuelTank.CapacityLitres > 0)  // If the tank is not in use for this aircraft, capacity = 0
                {
                    fuelTank.LevelPercentage = 100;
                }
            }
            ps.WriteChanges();

Example 2: Setting individual tanks from text boxes on a form:

            // Add fuel levels from textboxes
            // Example covers only three main tanks
            // Capacity is tested to make sure the tank is in use for current aircraft
            PayloadServices ps = FSUIPCConnection.PayloadServices;
            ps.RefreshData();
            if (ps.GetFuelTank(FSFuelTanks.Centre_Main).CapacityLitres > 0)
            {
                ps.GetFuelTank(FSFuelTanks.Centre_Main).LevelPercentage = double.Parse(this.txtCentreTankLevel.Text);
            }
            if (ps.GetFuelTank(FSFuelTanks.Left_Main).CapacityLitres > 0)
            {
                ps.GetFuelTank(FSFuelTanks.Left_Main).LevelPercentage = double.Parse(this.txtLeftTankLevel.Text);
            }
            if (ps.GetFuelTank(FSFuelTanks.Right_Main).CapacityLitres > 0)
            {
                ps.GetFuelTank(FSFuelTanks.Right_Main).LevelPercentage = double.Parse(this.txtRightTankLevel.Text);
            }
            ps.WriteChanges();

Example 3: Showing/Hiding textboxes according to tanks used by current aircraft

            // Show hide textboxes according to tank usage on current aircraft
            PayloadServices ps = FSUIPCConnection.PayloadServices;
            ps.RefreshData();
            this.txtCentreTankLevel.Visible = ps.GetFuelTank(FSFuelTanks.Centre_Main).CapacityLitres > 0;
            this.txtLeftTankLevel.Visible = ps.GetFuelTank(FSFuelTanks.Left_Main).CapacityLitres > 0;
            this.txtRightTankLevel.Visible = ps.GetFuelTank(FSFuelTanks.Right_Main).CapacityLitres > 0;

Paul

  • Upvote 1
Link to comment
Share on other sites

  • 4 weeks later...

 

I still do not understand how to be a database, how to extract from them ICAO codes and how to measure the distance between the two airports ((((

 

 

Run makerwys.exe, copy the r5.csv file to your project folder or path directly to the file in the FS directory.

 

Code a parser reader to find the two airports that you want from the r5.csv file and to obtain the lat/lon co-ordinates of those two airports

 

Read here for the formulae you'll need for the distance between two lat/lon points. You'll have to decide which point you want to use for each airport

 

http://williams.best.vwh.net/avform.htm

Link to comment
Share on other sites

Run makerwys.exe, copy the r5.csv file to your project folder or path directly to the file in the FS directory.

 

Code a parser reader to find the two airports that you want from the r5.csv file and to obtain the lat/lon co-ordinates of those two airports

 

Read here for the formulae you'll need for the distance between two lat/lon points. You'll have to decide which point you want to use for each airport

 

http://williams.best.vwh.net/avform.htm

Base airports made, and here's the code to C # can not write (((

Link to comment
Share on other sites

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.