Jump to content
The simFlight Network Forums

Inputting throttle data via FSUIPC


Recommended Posts

Has anyone used FSUIPC to input throttle data?

I am using a potentiometer with a microprocessor that sends a value between 0% and 100%. I thought that I could use this to write to the throttle offset, 0x3ae8, since I am able to read the throttle value with this offset, and it is formatted exactly how i want to send the data. Is there a reason why I can't write to this offset?

If this is not an option, can someone interpret the data from the 0x88c offset. How can i map 0% throttle - 100% throttle to the range of -4096 -- +16384?

Link to comment
Share on other sites

Has anyone used FSUIPC to input throttle data?

Yes. Most external autothrottle programs do, and my own drivers for PFC and Aerosoft GA28R cockpits do so too. I think there are some add-on aircraft using such a method too.

I am using a potentiometer with a microprocessor that sends a value between 0% and 100%. I thought that I could use this to write to the throttle offset, 0x3ae8, since I am able to read the throttle value with this offset, and it is formatted exactly how i want to send the data.

The offset isn't a percentage between 0 and 100, but a value between 0 and 1 (or negative for reverse) in 64-bit double float format.

Is there a reason why I can't write to this offset?

It should work okay in FSX as SimConnect lists the variable it is tied to as writable, but I've never tried. I've always used the original offsets dating back to FS98 days, the 16-bit integer values in the 088C etc ranges.

Whether the offset(s) you've chosen work in FS9 or before I don't know. They link direct into values in SIM1's innards. If the Sim engine is using them as source data they'll work, but if they are result data they won't.

If this is not an option, can someone interpret the data from the 0x88c offset. How can i map 0% throttle - 100% throttle to the range of -4096 -- +16384?

You can't. You can map -0.25 to 1.0 onto -4096 to +16384 by simple arithmetic -- multiply by 16384. If you really have a value from 0 to 100 then you have no reverse, so multiply by 16384 and divide by 100 to give you all the positive range.

If you want to allow the throttle to be disconnected by options FSUIPC provides for things like external auto-throttles or fly-by-wire applications you should consider using the offsets 089A etc instead, as described in my offset documentation.

Regards

Pete

Link to comment
Share on other sites

  • 1 year later...

Hi all,

I'm in trouble with the 0x88C offset, which is very odd because I've been using it for a long time in my external A/T in c/c++. However, as I'm now working with c# it turns out that weird things are happening. In this case I'm designing an A/T system for a HELICOPTER. To illustrate such thing, to write a determined throttle lever position (a value between -16384 to +16384) in Borland c++ Builder I simply input the following command:

FSUIPC_Write(0x88C, 2, &throttle_pos, &dwResult);

FSUIPC_Process(&dwResult);

and all works simply fine. Perfect.

In the other hand, in c# (MS Visual C#) I'm supposed to write the following command to achieve the same effect:

fsuipc.FSUIPC_Write(0x88C, throttle_1, ref token, ref dwResult);

and guess what happens. The Helicopter lever position works fine but the Helicopter just gains power for a brief instant (1 second) and then it looses power. I notice that N1 rotation (in this case) decreases as I the throttle lever position increases. At least to me it is extremely nonsense.

Observation #1: It perfectly works for aircraft, not to helicopters (in C#).

Observation #2: It perfectly works for all aircrafts in FS (in C++)

Observation #3: I tested the command line to many other offsets and they worked fine also. It seems to be a bug in 0x88C offset for c# applications (??)

Pete/people, can you give me a clue about what is happening to it?

Link to comment
Share on other sites

Observation #3: I tested the command line to many other offsets and they worked fine also. It seems to be a bug in 0x88C offset for c# applications (??)

FSUIPC has no idea what language you use. On its side of the interface a write to 088C is a write to 088C no matter how it was done. It sounds like your program is writing more than once, or writing to more than once place. Why not use the Logging facilities in FSUIPC to find out what it is doing? That's what they are there for. Just enable IPC write logging and see what really gets written.

Maybe your code is writing more than 2 bytes, the size of the 088C offset? For instance, if it were writing 4 bytes (the size of a normal 32-bit integer) then it would also overwrite 088E, the prop lever setting, with zero. This wouldn't have any effect on normal jets which don't use it, but it certainly would on props and helos.

Pete/people, can you give me a clue about what is happening to it?

I'm afraid I have no idea about C#. It is completely alien to me. Have you thought about using Paul Henty's DLL for such a lanugage? See the link in the Download Links subforum.

Regards

Pete

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.