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.

Trim reset

Featured Replies

Hello to everyone, 

I'm still a newbie in RPN and in AAO. I already annoyed you with a problem about the simrate. Now, I have a new one with the trim. 

I would like to reset it using a button on my stream deck. I tried using this code but it never stops. I would like it to exit the script when the trim reaches 0 or-0 but it loops between 0 and 1 or so. Do you have any idea ?

In this one, the script name is RESET_TRIM :

if(·0·<>(P:AILERON·TRIM·PCT,·percent)(GOTO:·srloop)·)·\n
:srloop·\n
(P:AILERON·TRIM·PCT,·percent)·(L:Scripts-RESET_TRIM)·<·if{·0·(>K:AILERON_TRIM_RIGHT)·(GOTO:srloop)·}·\n
(P:AILERON·TRIM·PCT,·percent)·(L:Scripts-RESET_TRIM)·>·if{·0·(>K:AILERON_TRIM_LEFT)·(GOTO:srloop)·}·\n
(END)·\n

In this second one, the script name is RESET_TRIM_test

(L:Scripts-RESET_TRIM_test)·2·log·near·-2·max·7·min·
(P:AILERON·TRIM·PCT,·percent)·2·log·-·sp0·
l0·0·<·if{·l0·abs·iterate{·1·(>K:AILERON_TRIM_LEFT)·}next·}
l0·0·>·if{·l0·iterate{·1·(>K:AILERON_TRIM_RIGHT)·}next·}
 

  • Commercial Member
22 minutes ago, PiLVaLK said:

P:AILERON

This is wrong. These are A: variables, not P: 

Why not just do this?
0.0·(>A:AILERON·TRIM·PCT,·Percent)

The variable is not read-only, check the SDK documentation.

Or in your case

(L:Scripts-RESET_TRIM)·(>A:AILERON·TRIM·PCT,·Percent)

Just make sure that the LVar is in the correct value range for this AVar (see SDK documentation or try it out)

Edited by Lorby_SI

LORBY-SI

  • Commercial Member
25 minutes ago, PiLVaLK said:

Do you have any idea ?

Most likely the result is never exactly 0.0, that is why your loop doesn't terminate. You would have to implement a "range" that stops it. I'm also not sure what the first line is supposed to do, the if- code is wrong and it doesn't really make sense to advance to the label when that is in the next line anyway.

I also have no idea what your second script is supposed to achieve. This looks like a clone of a sim rate script that I've seen somewhere - which has a completely different value range and purpose. For a script like this to work you would have to figure out by how many percent the K-Events change the trim -exactly. Only then can you calculate how many Ks you would need to dial in a specific value. But I am pretty sure that this increment will be different for different aircraft, so not really suitable.

Edited by Lorby_SI

LORBY-SI

  • Author

The second code is a clone of a script you made for me a few weeks ago for the sim rate.

I will try to make it simple as you suggested. I didn't know how to do so, once again, thank you !!

  • Author
22 minutes ago, Lorby_SI said:

This is wrong. These are A: variables, not P: 

Why not just do this?
0.0·(>A:AILERON·TRIM·PCT,·Percent)

The variable is not read-only, check the SDK documentation.

Or in your case

(L:Scripts-RESET_TRIM)·(>A:AILERON·TRIM·PCT,·Percent)

Just make sure that the LVar is in the correct value range for this AVar (see SDK documentation or try it out)

OK, you suggested to make it simple.... It works.  I used the first suggestion. Thanks a lot !!

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.