Global Variables in open9x

openTx has introduced a range of new features, ideas and bling. It is fast becoming the firmware of choice for many users. openTx will run on ALL current hardware platforms, including the gruvin9x and sky9x boards. Work has already started to support the new FrSky X9D radio!
Post Reply
rcgyuk
Posts: 325
Joined: Sat Sep 15, 2012 2:51 pm
Country: -

Global Variables in open9x

Post by rcgyuk » Sun Jan 20, 2013 8:28 pm

Hi,

I had just about got my head round er9x, when I decided to move on to open9x.

I am having trouble understanding what you would want to do with global variables.

Could some one give me a simple example I can try out to help me understand?

Thanks

User avatar
GTiDon
Posts: 177
Joined: Wed Mar 28, 2012 6:15 am
Country: -

Re: Global Variables in open9x

Post by GTiDon » Sun Jan 20, 2013 8:44 pm

Subscribed

Sent from my LT18i using Tapatalk 2
Er9X Flashed
Speaker Mod Done
Haptic Feedback Mod Done
Telemetry Mod Done with FRSky TTL Lite
Voice Mod Done with Emartee Board
HK Backlight Done
FRSky Telemetry DIY Module Installed
----All these mods removed and installed Sky 3.0 board with DJT Module.

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Global Variables in open9x

Post by bertrand35 » Sun Jan 20, 2013 8:55 pm

I think it's well explained here:
viewtopic.php?f=45&t=2095&p=29236&hilit=GVARS#p29236
Bertrand.

rcgyuk
Posts: 325
Joined: Sat Sep 15, 2012 2:51 pm
Country: -

Re: Global Variables in open9x

Post by rcgyuk » Mon Jan 21, 2013 10:05 am

Thank for the reply.

This has helped my understanding, however, one think I am still unclear on.

Suppose I use GV1 in a dual rate, and GV2 in an expo, how would you alter these while flying?

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Global Variables in open9x

Post by bertrand35 » Mon Jan 21, 2013 10:24 am

Ok you have to use the Custom Function "Adjust GVAR".

Bertrand.


User avatar
Peter
Posts: 232
Joined: Thu Dec 29, 2011 8:45 pm
Country: -
Location: Zuid-Holland

Re: Global Variables in open9x

Post by Peter » Tue Jan 22, 2013 2:01 pm

For me that was also unclear. Is there a possibility to add a trim or encoder assignment in the gvars screen? And add the function automatically from there.

There are more functions that could benefit from a more clear location. Such as volume control on sky9x, vario, telemetry log.

bertrand35
9x Developer
Posts: 2764
Joined: Fri Dec 30, 2011 11:11 pm
Country: -

Re: Global Variables in open9x

Post by bertrand35 » Tue Jan 22, 2013 3:36 pm

Peter wrote:For me that was also unclear. Is there a possibility to add a trim or encoder assignment in the gvars screen? And add the function automatically from there.

There are more functions that could benefit from a more clear location. Such as volume control on sky9x, vario, telemetry log.
The problem in doing this is that you will assign functions in many different screens. I do prefer to assign all functions in the same screen so that I can see in a glance all enabled functions and which is the switch associated.

I remember a crash due to TRN switch assigned in the same time to the Trainer function and to the Instant Trim function in a previous version of er9x.

Bertrand.

bbrackeen
Posts: 1
Joined: Wed Jan 09, 2013 5:21 pm
Country: -

Re: Global Variables in open9x

Post by bbrackeen » Mon Jan 28, 2013 7:04 pm

I am having trouble understanding what you would want to do with global variables.
Suppose I use GV1 in a dual rate, and GV2 in an expo, how would you alter these while flying?
This is exactly what I did, and was my "AHH HAA!!" moment for global vars.

(I'm going on memory so bare with me)

On the Custom Functions screen add a "Adjust GV1" entry and assign it to the ruder (RUD) switch, now set the source to the P1 knob.

Next go under your dual rates, and go into the adjustment screen. Select the Weight and [Menu Long]. You should see GV1 (you can select GV1-5 now).

To use, go to main screen [Exit Long], flip the RUD switch and turn P1. Vuala! You will see a popup for the global variable as you turn the P1 knob. As you turn the knob the value for GV1 changes, and is reflected in the radio in real time. Its an amazing feature.

Now do the same thing for GV2, the Gear (GEA) switch, and P2; assign this all to a flight mode (if you haven't figured these out, then its worth understanding just for a better way to compartmentalize your expo/dr modes and add a meaniful name too).

To make things even more interesting, you can start triggering your flight modes by custom switches. So say that I want to make sure that any time the trottle switch is disengaged/off, no flight modes are on (or you are on the default flight mode you labeled as SAFETY). Also assign !THR to SafetyChX on the FUNC Switches page and set the value at -100. Back to the custom switches page choose CS1, "AND" as the condition, THR and ID0 as the switches to evaluate. So what we are saying is CS1 == THR AND ID0 (both switches are engaged). Assign this to flight mode 1, and repeat the same logic for CS2, CS3 and ID1, ID2.

Say we did all this (and I did, perfect for my helis), and assigned our dual rates/expo to flight modes 1-3. So with THR switch ON, ID0==FM1 and Low Rates, ID1==FM2 and High Rates, and finally ID2==FM3 and custom rates defined by global variables and can be adjusted in flight without going into the DR/Expo page. (FM0 is now my default safety mode, and nothing is selected).

All this configured with warnings, you will never turn on your radio with a live model and have it go nuts without being warned, plus have adjustable rates in flight. ;)

Very powerful stuff, and this is only one scenario. Hope it helps.

Helle
Posts: 574
Joined: Sat Jul 21, 2012 7:08 am
Country: -

Re: Global Variables in open9x

Post by Helle » Tue Jan 29, 2013 9:04 pm

Hy,

here a pfd with exapmles GV at Dr/Expo
(in German)

Helle
Attachments
Beispiel DR_Expo mit globalen Variablen 29012013_001.pdf
(81.73 KiB) Downloaded 172 times

Post Reply

Return to “openTx”