June 25, 20232 yr Thanks for the application - really changes the game! I have been working on the Blackbird Corsair, specifically on the Supercharger handle. I'd like to map an axis on my Honeycomb Bravo to the handle. The handle has a Lvar (L:FG1D021) for position, but that, while settable, is not actually controlling the supercharger application, and is intended for output animation only. I figured out that control is done via two events sent through the EVENTS_ID, and implemented a dirt simple script bound for the moment to a up/down toggle switch on the Honeycomb (the permanent "flap" switch over on the far right - NOT the axis at the far right). The scripts are rather simply: 0x1101B (>L:EVENTS_ID,enum) // to decrement the handle (to neutral from low, or high to low) 0x1101A (>L:EVENTS_ID,enum) // to increment the handle (to low from neutral, or low to high) The above does work to increment and decrement the handle, and the animated position of the handle moves as well without me having the set it. FG1D021 gets set to 0, 50, or 100 depending on the increment/descrement. What I'd love to do is map sending those events to the an axis. I feel like I'd have to set a variable for the current state, though I suppose I could just read the enum or number value for FG1D021 lvar, and then do a comparison against where the axis is (LVAR is mapped 0 to 100 range). From what I can see using dev mode "Tools->Behaviors", the output is 0, 50, or 100 for the lvar. So ... if axis <25, and enum value is 50, then decrement once. if enum is 100, decrement twice.. if 26-80 axis, and enum value is 0, then increment once. If enum is 100, decrement once if >80 axis, and enum value is 50, then increment once. If enum is 0, increment twice. I guess depending on how fast I move, it would really only ever decrement or increment once. But regardless, I could write a routine like this in C, basic, fortran, and python. But I can't for the life of me figure out how to do it in RPN script. I am missing something obvious here methinks. Anyway - if someone can point me in the right direction, I think I could figure it out. Thanks!
June 25, 20232 yr Commercial Member I could offer a different solution. 1. Create the following script: Group: Corsair Name: SuperCharger Code: (L:Corsair-SuperCharger)·50·*·(L:FG1D021,·Number)·<·if{·0x1101B·(>L:EVENTS_ID,·enum)·}·els{·0x1101A·(>L:EVENTS_ID,·enum)·}· The Group and Script Name are important, because they determine the name of the "Script Variable" = the LVar at the beginning. OK? If you rename the group or the script, you have to rename the LVar accordingly (or use the "Insert Script Var" button). be mindful that AAOs RPN dialect is case sensitive. 2. Create an axis assignment to your phyiscal lever where you set Axis Min = 0, Axis Max = 2 and Rounding to "Int". That should do the trick. What will happen is, that moving the lever will transmit the axis output value (0, 1 or 2) to the script through the script variable. The script then compares that variable times 50 to the position of the lever in the cockpit (which is 0, 50 or 100) and then sends either the up or the down event. Edited June 25, 20232 yr by Lorby_SI LORBY-SI
June 25, 20232 yr Commercial Member Same can be done with the flaps lever: Group: CorsairName: FlapLeverCode: (L:Corsair-FlapLever)·20·*·(L:FLAP_LEVER,·Number)·<·if{·0x11164·(>L:EVENTS_ID,·enum)·}·els{·0x11165·(>L:EVENTS_ID,·enum)·}· Axis assignment in this case is Axis Min = 0, Axis Max = 5, Rounding "Int". LORBY-SI
June 25, 20232 yr Commercial Member And the tail hook Group: CorsairName: TailHookCode: (L:Corsair-TailHook)·(L:FG1D189,·Number)·<·if{·0x1111F·(>L:EVENTS_ID,·enum)·}·els{·0x1111E·(>L:EVENTS_ID,·enum)·}· Axis assignment in this case is Axis Min = 0, Axis Max = 2, Rounding "Int". LORBY-SI
June 25, 20232 yr Commercial Member Downside is, that you will have to move the levers at least once when you jump in the cockpit. Best would be to do a full checklist where all levers are moved through their entire range. LORBY-SI
June 26, 20232 yr Author Thanks so much! I'll give that a shot later, having a long flight at the moment in airliner.
Archived
This topic is now archived and is closed to further replies.