Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

How to detect if elevator trim is changed manually ?

Featured Replies

  • Commercial Member

Hi,I'm finishing up my A300B4 panel right now (C gauges and freeware) and I'm trying to add the final touches. One of the things I haven't been able to do was add the trim wheel sound that the real panel uses when the elevator trim is changed manually (so not when the AP changes the trim). Manually trimming while the AP is turned should also disable the AP.So how do you detect this ? Anybody have an idea ?Thx,Bj

simcheck_sig_banner_devteam.jpg

 

Bj

You can either store the last trim setting in a variable and compare it to the current setting to detect changes or use an event handler which captures keyboard/joystick input:// Prototypevoid FSAPI msys_EventHandler(ID32 event, UINT32 evdata, PVOID userdata);// in your gauge callback function:case PANEL_SERVICE_POST_INSTALL:register_key_event_handler((GAUGE_KEY_EVENT_HANDLER)msys_EventHandler, 0);break;case PANEL_SERVICE_PRE_KILL:unregister_key_event_handler((GAUGE_KEY_EVENT_HANDLER)msys_EventHandler, 0);break;// and the event handler function itselfvoid FSAPI msys_EventHandler(ID32 event, UINT32 evdata, PVOID userdata){switch (event){case KEY_ELEV_TRIM_DN:case KEY_ELEV_TRIM_UP:// do something herebreak;}}That should do what you want.

  • Author
  • Commercial Member

Hans,Thing is that, as far as I understand, the FS autopilot also uses the trim to make changes in the aircraft pitch so detecting a change in the trim will not detect wether this change was made by the autopilot or by the pilot. Bj

simcheck_sig_banner_devteam.jpg

 

Bj

Hi,In XMl I should add a custom variable to generate sound when trimming manually.May be in C++ that is possible too.Jan"Beatus Ille Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author
  • Commercial Member

Jan,That's what I plan to do, but how to distinguish manual trimming from FS AP trimming ? That's the question !Bj

simcheck_sig_banner_devteam.jpg

 

Bj

The event handler code I posted above, only reacts on key commands, not on trim changes made by the autopilot. This is actually the code I used on the Flight1 ATR to switch off the autopilot when the user moves the yoke.

  • Author
  • Commercial Member

Thx Hans,Will give it a try tonight, I'll keep you posted how it works out...Bj

simcheck_sig_banner_devteam.jpg

 

Bj

I use this one to see when AP is trimming:(A:ELEVATOR TRIM PCT,percent) (>G:Var1) (A:AUTOPILOT MASTER,bool) if{ (A:ELEVATOR TRIM PCT,percent) (G:Var1) 0.1 + > if{ 1 } els{ (A:ELEVATOR TRIM PCT,percent) (G:Var1) 0.1 - < if{ 2 } } } els{ 0 }Manual trimming disconnects the autopilot through the custom var.Jan"Beatus Ille Procul Negotiis"

Jan

 

 

 

"Beatus ille qui procul negotiis..."

  • Author
  • Commercial Member

Hans,Tried the code, is it possible that this is FS2004 only ? Can't seem to get it to work in FS2002. Is a similar interception of events possible in FS2002 ?Bj

simcheck_sig_banner_devteam.jpg

 

Bj

No idea, sorry. I never tried this in FS2002.

deleted... answered without thinking ;)

  • Author
  • Commercial Member

Well works fine in FS2004 so thx a million for the great tip !Bj

simcheck_sig_banner_devteam.jpg

 

Bj

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.