Jump to content
The simFlight Network Forums

Recommended Posts

Posted

Hi Mr Pete Dowson

 

 

Sir I'm a newbie to FSX and FSUIPC as well. So please bear with me if I have asked you a silly question and not googled hard for a similar question/solution  already asked and answered.

 

I have a requirement in which I wanted to read/write Pitch & Elevator Trim executed via lua scripting triggered by a button in a Joystick.

 

I'm new to FSUIPC and hence started browsing example code from your collection of lua scripts ... and slightly modified "Display Vals".

 

The offset document and code example( display vals, liar)  is neat and clear when it comes to reading/writing Pitch/Altitude, etc but I could not find any example for reading/writing elevator trim...especially how to convert the value read from offset 0x2EA0.

 

I have a gauge( XML in Panel) displaying ( digital readout ) of Elevator Trim( <String>T:%((A:Elevator Trim Position,degrees))%!2.2f!</String>)  and I was trying to verify the data read from offset with the digital read out. 

 

My question

 

a) what is the formula to convert value read from offset 0X2EA0 ( so that it would match my reading from gauge)

b) if i write ( as per the example code in  "Liar" example LUA plug-in for FSUIPC4/ESPIPC only, by Pete Dowson, January 2009) will it reflect really the changes in FS). The reason I'm asking is based on your comment "alter them all to values we want to fool other FSUIPC clients to believe"

 

Need your guidance  

 

Thanks very much

 

Regards

Janakiraman Swaminathan

display vals.txt

Posted

what is the formula to convert value read from offset 0X2EA0 ( so that it would match my reading from gauge)

 

2EA0 is in radians. Looks like your gauge has it in degrees. There are 2*PI radians in a circle (360 degrees), so it is simple arithmetic, no? This is not an FS or FSUIPC question, but one of simple maths. Or have you never hear of radians?

 

 if i write ( as per the example code in  "Liar" example LUA plug-in for FSUIPC4/ESPIPC only, by Pete Dowson, January 2009) will it reflect really the changes in FS). The reason I'm asking is based on your comment "alter them all to values we want to fool other FSUIPC clients to believe"

 

 

Sorry, I don't really understand the question. Are you trying to change the actual trim being used by the aircraft, or just make the value look different to some external program of which you have no control over? If the latter, what FSUIPC Clients are you using which you wish to fool?

 

Pete

Posted

so how do i convert the value obtained ( from offset 0x2EA0 ) to degrees

 

P.S: Not good in maths :)

 

I'm not a maths teacher either ... this is not really the Forum in which to learn any.thing you forgot from 1st grade. But:

 

If 2*PI radians = 360 degrees, as I said, then obviously 1 radian = 360 / (2 * PI) degrees, or 180/PI.

 

So multiply radians by 180/PI to get degrees.

 

Surely, if you intend to fly at all you need some idea of simple arithmetic like this? :-(

 

Pete

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.