Jump to content
The simFlight Network Forums

FSUIPC Client DLL for .NET - Version 2.0


Recommended Posts

Hi Paul,

You are correct. the sleeping ones does not have any flight number.

Also tried the below code. Still the same

FSUIPCConnection.AITrafficServices.RefreshAITrafficInformation(True, True)

FSUIPCConnection.AITrafficServices.ApplyFilter(True, True, 0, 360, Nothing, Nothing, 1000)

So, there is no way to have flight numbers for those sleeping ones?

Link to comment
Share on other sites

So, there is no way to have flight numbers for those sleeping ones?

I'm pretty sure there is no way to get flight numbers for sleeping planes. They just don't have flight numbers assigned to them by Flight Sim. Certainly FSUIPC is not providing the information so I can only assume it doesn't exist.

Paul

Link to comment
Share on other sites

I'm pretty sure there is no way to get flight numbers for sleeping planes. They just don't have flight numbers assigned to them by Flight Sim. Certainly FSUIPC is not providing the information so I can only assume it doesn't exist.

The flight number provided by FS for sleeping planes is actually the one embedded in their AIRCRAFT.CFG file, which would be the same for all instances of that aircraft, so it isn't useful and in fact is downright misleading. So FSUIPC suppresses it in that state. The flight number becomes available after the aircraft has submitted its plan and obtained "clearance". That's usually so close to push-back and taxi that effectively you don't often see the flight number until the taxi stage.

Regards

Pete

Link to comment
Share on other sites

  • 4 months later...

Anyone know why this will pop up when starting my app?

BindingFailure was detected

Message: The assembly with display name 'FSUIPCClient' failed to load in the 'Load' binding context of the AppDomain with ID 1. The cause of the failure was: System.BadImageFormatException: Could not load file or assembly 'FSUIPCClient, Version=2.0.4008.2, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format.

File name: 'FSUIPCClient, Version=2.0.4008.2, Culture=neutral, PublicKeyToken=null'

=== Pre-bind state information ===

LOG: User = Gray-PC\Gray

LOG: DisplayName = FSUIPCClient, Version=2.0.4008.2, Culture=neutral, PublicKeyToken=null

(Fully-specified)

LOG: Appbase = file:///C:/Users/Gray/Desktop/Development/FSFlight Instructor/Flight Monitor NEW/Flight Monitor/bin/Debug/

LOG: Initial PrivatePath = NULL

Calling assembly : Flight Monitor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.

===

LOG: This bind starts in default load context.

LOG: No application configuration file found.

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).

LOG: Attempting download of new URL file:///C:/Users/Gray/Desktop/Development/FSFlight Instructor/Flight Monitor NEW/Flight Monitor/bin/Debug/FSUIPCClient.DLL.

ERR: Failed to complete setup of assembly (hr = 0x8007000b). Probing terminated.

Link to comment
Share on other sites

  • 1 month later...

Hello Paul, to start with, I am a young French developer which does not speak English a lot, then I use a converter. I work on a Lark 2 which I transform into simulator. It is whom(that) that begins to clamp(stick): I decided to keep(preserve) the instruments in which I put servos or step by step engine. The problem it is the part(party) codes: I do not arrive has to extract the height, the vertical speed and the fuel by serving me as your DLL. It works well for the heading and Eng RPM. These data are sent back(dismissed) on a port(bearing) COM for a card(map) Arduino.

Could you say to me of what you think of it?

In advance thank you.

I invite you has to follow this link or you will see my Alouette 2 : www.mediafx.fr/318

Look almost everywhere and especially Panel....

FX ;op

private Offset<int> airspeed = new Offset<int>(0x02BC); // Basic integer read example

private Offset<int> rotorRpm = new Offset<int>(0x0908); // rotor rpm

private Offset<int> turbRpm = new Offset<int>(0x0896);

private Offset<Double> pressEngOil = new Offset<Double>(0x3B60);

private Offset<Double> tempEngOil = new Offset<Double>(0x3B58); private String tmpEnOil, tmpEnOilold;

private Offset<int> torque = new Offset<int>(0x08F4); private String Tork, TorkOld; // rotor torq

private Offset<int> temptur = new Offset<int>(0x08F0); private String TempTur, TempTurOld; // temp turb

private Offset<Double> banke = new Offset<Double>(0x2F78); private String Bank, BankOld; // HA_Bank

private Offset<Double> pitche = new Offset<Double>(0x2F70);private String Pitch,PitchOld; // HA_Pitch

private Offset<Double> comp = new Offset<double>(0x2B00);

private String data = "";

private Offset<Double> test = new Offset<Double>(0x3544); // test 0360 08BA

public Form1()

{

InitializeComponent();

serialPort1.PortName = "COM7";

serialPort1.BaudRate = 115200;

button9.Text = "connecter";

button10.Text = "déconnecté";

button10.Enabled = false;

..../....

private void timer1_Tick(object sender, EventArgs e)

{

// Process the default group

try

{

FSUIPCConnection.Process();

double airpeedKnots = ((double)airspeed.Value / 128d*1.852);// ias en Km/H

this.txtIAS.Text = airpeedKnots.ToString("f0");

int rotorrpm = ((int)rotorRpm.Value / (16384 / 100));

this.rotorBox.Text = rotorrpm.ToString("f1");

double Torque = ( (int)torque.Value / (16384 / 100) );

this.torqBox.Text = Torque.ToString();

Tork = "T" + Torque.ToString("f1");

if ((serialPort1.IsOpen) && (Tork != TorkOld)) { TorkOld = Tork; serialPort1.Write(Tork); };

int TempTur = ((int)temptur.Value / 16384);

this.tempturbbox.Text = TempTur.ToString();

int Bank2 = ((int)banke.Value);

this.bankBox.Text = Bank2.ToString("f1");

Bank = "B" + Bank2.ToString();

if ((serialPort1.IsOpen) && (Bank != BankOld)) { BankOld = Bank; serialPort1.Write(Bank); };

int Pitch2 = ((int)pitche.Value);

this.pitchBox.Text = Pitch2.ToString();

Pitch = "A" + Pitch2.ToString();

if ((serialPort1.IsOpen) && (Pitch != PitchOld)) { PitchOld = Pitch; serialPort1.Write(Pitch); };

int TEO = (((int)tempEngOil.Value * 140/16384)*14);

this.ToilBox.Text = TEO.ToString();

double PEO = (((double)pressEngOil.Value *55/16384)/7.25);

this.PoilBox.Text = PEO.ToString("f1");

int TR = ((int)turbRpm.Value *(100/16384));

this.rpmTurBox.Text = TR.ToString("f1");

double COMP = ((double)comp.Value);

this.capBox.Text = COMP.ToString("f0");

/////////////test

double Test = ( (double)test.Value );

this.testBox.Text = Test.ToString("f0");

data = Pitch + Bank + Tork; textBox10.Text = data;

}

..../....

Edited by fixair
Link to comment
Share on other sites

Could you say to me of what you think of it?

The code looks good to me. The only mistake I can see is that turbRpm (0x0896) is only 2 bytes and should therefore be declared as 'short' not 'int'.

private Offset&lt;short&gt; turbRpm = new Offset&lt;short&gt;(0x0896);

I'm not sure if you had a problem you want help with. If you do, please be more specific about what the problem is.

Regards,

Paul

Link to comment
Share on other sites

And indeed if, I need help(assistant), I am really a beginner in the coding of software. Thank you for your answer it works. Nevertheless I always stumble over the speed vertical ( 0x02C8 ) and the height. I pedal very very also with my card(map) Arduino, I do not arrive has to have a flow of dated fluids: my servos is jerky, would have you an idea? One thousand excuses to have made a double(doubloon) of this comment while, I had not seen your answer.

Thank you again for your help(assistant). For information, one bets of my simulator will be present at the end of the month in 7 ° World Lounge(Show) of the Simulation in Bourget ( LFPB) with the association FAFZONE.

Cordially FX ;op

Link to comment
Share on other sites

Nevertheless I always stumble over the speed vertical ( 0x02C8 ) and the height.

Here is the code to read and display the vertical speed and height. I've included the conversions for metres and feet.

Declare the offsets as follows:

		private Offset&lt;int&gt; verticalSpeed = new Offset&lt;int&gt;(0x02C8);
		private Offset&lt;long&gt; altitude = new Offset&lt;long&gt;(0x0570);

Get the values (after the Process()) like this:

			double verticalSpeed_MetresPerSecond = (double)verticalSpeed.Value / 256d;
			double verticalSpeed_FeetPerMinute = (double)verticalSpeed.Value * 60d * 3.28084d / 256d;
			double altitude_Metres = (double)altitude.Value / (65536d * 65536d);
			double altitude_Feet = (double)altitude.Value / (65536d * 65536d) * 3.28084d;

I do not arrive has to have a flow of dated fluids: my servos is jerky, would have you an idea?

The first thing to look at would be the interval for 'timer1'. This sets how often the timer1_Tick() method runs. If you want it smooth you need something like 20 ticks per second. This is an interval of 50ms. So set the timer1.Interval property to 50.

If you used my example application as a starting point, the interval is set to 200 in the method openFSUIPC(). This is only 5 times per second so it will be jerky. This is the line you should change.

Paul

Link to comment
Share on other sites

Good evening Paul,

Thank you again once for your help so precious.

I followed your indications as for Offset

double verticalSpeed_MetresPerSecond = (double)verticalSpeed.Value / 256d;

double verticalSpeed_FeetPerMinute = (double)verticalSpeed.Value * 60d * 3.28084d / 256d;

double altitude_Metres = (double)altitude.Value / (65536d * 65536d);

double altitude_Feet = (double)altitude.Value / (65536d * 65536d) * 3.28084d;

The first thing to look at would be the interval for 'timer1'. This sets how often the timer1_Tick() method runs. If you want it smooth you need something like 20 ticks per second. This is an interval of 50ms. So set the timer1.Interval property to 50.

If you used my example application as a starting point, the interval is set to 200 in the method openFSUIPC(). This is only 5 times per second so it will be jerky. This is the line you should change.

, and the modifications brought to Timer1 are effective. I confirm you that I leaned on your tuto to make my soft.

I me low now for him(it) 0x036E Turn co-ordinator ball position, it seems to me that it is a soft, but I do not take(bring) out there, I crossed(spent) three hours there today. I do not discourage to arrive there one day...

Cordially FX

Link to comment
Share on other sites

  • 2 weeks later...

One question how i can use FSUIPClient for connect with Prepar3d?

I don't think there would be anything special or different about connecting to FSUIPC running inside Pepar3d. It should be the same as connecting to FSUIPC running in FSX or FS9. The FSUIPC interface is the same.

If you've tried to connect to Prepar3d but cannot, then please describe the problem. Are there any error messages?

Paul

Link to comment
Share on other sites

i mean that when i call open API in c# i should pass it an Enum (FSX ESP ...) this enum is a number (9 for ESP) but for connect to prepar3d i should pass 10 in FSUIPC ... i can pass an integer to your OpenConnection API?

OK I understand.

How do you know Prepar3d is 10? If I look at the current FSUIPC SDK (February 2012) the FSUIPC_User.h file only goes up to ESP (9).

I can only keep my DLL in line with the current SDK. If you can point me to an official source that says Prepar3d = 10 then I'll happy to amend my DLL.

At the moment you can just pass 'Any' for the enum, or just don't pass any parameters into Open() and it will connect.

You cannot pass an integer at the moment, but I'll think about adding that.

Paul

Link to comment
Share on other sites

How do you know Prepar3d is 10? If I look at the current FSUIPC SDK (February 2012) the FSUIPC_User.h file only goes up to ESP (9).

Sorry, but i don't often update all the source code itself, only the documentation. I'll update the C one now ready for the next release, but all of the example source stuff is supplied by volunteers. However, the value of 10 for P3D has been defined in the both the "FSUIPC for Programmers" and the "FSUIPC4 Offsets Status" documents for a while now.

I can only keep my DLL in line with the current SDK. If you can point me to an official source that says Prepar3d = 10 then I'll happy to amend my DLL.

As well as the documents mentioned above, the README.TXT included in the SDK says this:

NOTE that not all the parts have been updated for FS2004, FSX or ESP.

The only real change usually is the definition of:

SIM_FS2K4 as number 7 (FS2K2 was 6).

SIM_FSX as number 8

SIM_ESP as number 9

SIM_P3D (for Prepare3D) as number 10.

Sorry if this is not clear enough. I'll change the .h file for C/C++ now.

At least I really doubt there'll ever be any other version numbers to be added! But maybe the programmer of the XPUIPC version for X-Plane uses the "reserved" value (5), which was for X-Plane originally before I decided against it, or maybe he's purloined 9 or 10?

Best Regards

Pete

Link to comment
Share on other sites

Uhm in FSUIPC_SDK in readme ... tell Prepar3D it is 10 .... or i wrong ?!?

You're right.

Attached is a new DLL (version 2.3) with the new enum value for Prepar3d. It also has extra overloads on Open() to pass an integer.

You need to copy over your existing DLL and XML files. (Make backups first in case you need to go back).

Paul

FSUIPCClient.Beta2.3.zip

Link to comment
Share on other sites

the value of 10 for P3D has been defined in the both the "FSUIPC for Programmers" and the "FSUIPC4 Offsets Status" documents for a while now.

...

As well as the documents mentioned above, the README.TXT included in the SDK says this:

...

Sorry if this is not clear enough. I'll change the .h file for C/C++ now.

That's fair enough Pete. It's very clear, I just didn't think to look anywhere other than the .h file for these values.

Now I know where this info is likely to be I'll be able to find it in the future.

Thanks,

Paul

Link to comment
Share on other sites

  • 2 months later...

Hi guys!,

Are there a way to change aircraft lights across FSUIPC?

I tried the example on FSUIPC Client DLL for .NET. On default aircrafts works well, but when i try with paid aircraft, does not work correctly... i can see how my program try to change the light but shuts down instantly.

Regards!!!

Link to comment
Share on other sites

but when i try with paid aircraft, does not work correctly...

Which 'paid aircraft'? I know that PMDG (with the exception of the NGX which has the lights mapped to different offsets as per the manuals with FSUIPC) and Level-D lights cannot be accessed via standard addressed offsets and assume there will be many others that don't fully integrate themselves like the default aircraft.

Link to comment
Share on other sites

Which 'paid aircraft'? I know that PMDG (with the exception of the NGX which has the lights mapped to different offsets as per the manuals with FSUIPC) and Level-D lights cannot be accessed via standard addressed offsets and assume there will be many others that don't fully integrate themselves like the default aircraft.

I tried with ATR of Flight One, Wilco Airbus and iFly 737 NGX.

Link to comment
Share on other sites

I tried with ATR of Flight One, Wilco Airbus and iFly 737 NGX.

As Graham says, some paid aircraft do not use the underlying Flight Sim systems, they write their own. With these kind of aircraft it's not possible to use FSUIPC and therefore my DLL to access the data. You'll need to investigate how to access the lights for each paid aircraft individually. This could be through their own SDK or using L:VARS etc. There are many ways that can be used but each plane is different. With some planes it may not be possible at all.

It's probably best to ask in the support forums of makers of the aircraft.

Paul

Link to comment
Share on other sites

  • 4 weeks later...
Guest
This topic is now closed to further replies.
×
×
  • 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.