Jump to content
The simFlight Network Forums

AP_ALT_VAR_DEC Event


Fabio Drago

Recommended Posts

I have a rotary encoder to control the autopilot Altitude Lock and Vertical Hold offset. At the moment I calculate the new values (according to the encoder input) and set directly to the Offsets.
I have experienced different behaviour between MSFS2020 and X-plane so I have found another way to do it raising Events. 

 

Is it possible to raise an Event (like the AP_ALT_VAR_DEC) with FSUIPC client DLL ?


Thanks,
Fabio

Link to comment
Share on other sites

Hi Fabio,

You can. Events are also known as Controls. Make a call like this:

FSUIPCConnection.SendControlToFS(FsControl.AP_ALT_VAR_DEC, 0);

If the event requires a parameter value (e.g. the amount to decrement) then put this as the second parameter. Just pass in 0 if there is no parameter needed.

Paul

Link to comment
Share on other sites

Thank you very much. It's much easier to use those events instead manage the offset directly. However it's work only on MSFS and not for Xplane.

Sorry for the silly question and maybe it could be off topic but I'm confused about the various Control like FSUIPCControl and FsControl. Both have properties for the same thing (I think).

Could you please help me to understand ?

F.

 

Link to comment
Share on other sites

Quote

 However it's work only on MSFS and not for Xplane.

I guess XPUIPC hasn't implemented events/controls then.

Quote

 I'm confused about the various Control like FSUIPCControl and FsControl

The FsControl list contains all the controls that are built into the flight sim.

The FSUIPCControl are extra controls provided by FSUIPC. These are either useful controls that affect the flight sim, or controls to operate features in FSUIPC itself.

For example:

FsControl has a control to automatically starting all the engines. (ENGINE_AUTO_START)

FSUIPCControl provides extra controls to automatically start each of the 4 engines separately.(e.g. ENGINE_3_AUTOSTART)

FSUIPCControl provides a control to remove the AI Traffic (TRAFFIC_ZAPALL). This is a feature provided by FSUIPC itself. The control allows programs to activate this FSUIPC feature.

There are also other control lists:

  • FSUIPCAutoPilotControl
  • FSUIPCAxisControl
  • PMControl (Controlling glass cockpit software from Project Magenta)
  • PMDG_737_NGX_Control (Controlling the 737 from PMDG)

Paul

Link to comment
Share on other sites

Understood.

Last question (promised) is about the parameter value: Where I can find a documentation? 

I can activate the altitude hold with this statement FSUIPCConnection.SendControlToFS(FsControl.AP_ALT_HOLD, 0) but I can't activate the VS with this one             FSUIPCConnection.SendControlToFS(FsControl.AP_VS_HOLD, 0);
 

 

Do the AP_VS_HOLD require a parameter?

 

Thanks,
Fabio

Link to comment
Share on other sites

FSUIPCControls are listed in "FSUIPC For Advanced Users". These have notes about their parameters.

There is no documentation for the basic FS control parameters as far as I know. The list of known FS/P3D controls is in the FSUIPC documentation folder called "The 2016 List of FSX and P3D Controls.pdf" (or similar). There is no info about the parameters however.

If you turn on the FSUIPC logging for 'Events (non-axis controls)' and 'Send to a console window' you can see in real time what events are being generated. With this active you can operate the VS hold switch in the sim and then see what event was generated. The event names displayed will match the Enum and controls documentation. I think it also shows the parameter values.

Paul

 

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.