rafaelcoronel Posted January 30, 2012 Report Share Posted January 30, 2012 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); fsuipc.FSUIPC_Process(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 More sharing options...
Paul Henty Posted January 30, 2012 Report Share Posted January 30, 2012 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); fsuipc.FSUIPC_Process(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 (??) The most likely cause of your problem is that throttle_1 is declared and 'int' (4 bytes) and not 'short' 2 bytes. Therefore, at the same time you're writing to 0x088C you are also trampling over 0x88E which is the 'prop lever'. Could this possibly be the collective in helicopters? Changing the collective on a helicopter would certainly account for a change in N1. Paul Link to comment Share on other sites More sharing options...
Pete Dowson Posted January 30, 2012 Report Share Posted January 30, 2012 Pete/people, can you give me a clue about what is happening to it? You posted this twice. I answered the other post, but I see Paul has given you a good answer here. Please only post in one place at a time. Regards Pete Link to comment Share on other sites More sharing options...
rafaelcoronel Posted January 30, 2012 Author Report Share Posted January 30, 2012 Paul, Thank you. I was working with INT instead of SHORT. Sounds like we need to be more specific when working with C# than with C++. Indeed, the last to bytes of my INT went to 0x88E address. However, I still cannot understand how it worked fine with Jet Aircrafts (737 for instance), since the N1 value increased as the throttle position also increased. Best Regards Rafael Link to comment Share on other sites More sharing options...
Pete Dowson Posted January 30, 2012 Report Share Posted January 30, 2012 I still cannot understand how it worked fine with Jet Aircrafts (737 for instance), since the N1 value increased as the throttle position also increased. The prop control has no effect on jets. It isn't used. Pete Link to comment Share on other sites More sharing options...
rafaelcoronel Posted January 30, 2012 Author Report Share Posted January 30, 2012 Alright Pete, now I got it. I appreciate it. Thank you. Rafael Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now