Sign in to follow this  
dragonflightdesign

Setting XML K vars from C

Recommended Posts

After reading an old post of Bill's over on flightsim.com, I think this is correct for setting left flaps. However, I'm not that familiar with setting K vars from C (I usually just read them) but the _FLAPS_SET token variables in C are completely fubar. I'd be grateful if someone could cast an eye over this and tell me where the error is:

execute_calculator_code("(A:TRAILING EDGE FLAPS LEFT PERCENT,percent) (>K:TRAILING EDGE FLAPS LEFT PERCENT)", NULL, &return_value, NULL);

'percent' would contain the required position of the flaps.

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

K: values are the ones in the Event ID lists under the String column.  You're trying to use a variable as an event.  While the variable you've chosen is writable... it is only writable via SimConnect.

Share this post


Link to post
Share on other sites

Oh well. Looks like it's going to have to be a SimConnect command. The aircraft I'm working on doesn't have flap positions; you press a switch and an electric motor drives the flaps until you release the switch and there they stay - subject to maximum deflection of course!

Any idea which SimConnect method I need?

Share this post


Link to post
Share on other sites

Uh... method?

SimConnect_Open, SimConnect_AddToDataDefinition, SimConnect_SetDataOnSimObject at the bare minimum.

Share this post


Link to post
Share on other sites

Okay - I asked for that! :laugh: However, you have confirmed that I was looking in the right place when reading the 'Input Data' example in the SDK. Not sure if 'Input Data' is the correct title as I'm not at home and don't have the SDK on this machine but it is the example that sends ctrl+shift+U to activate something-or-other.

Share this post


Link to post
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
Sign in to follow this