October 3, 2025Oct 3 Hi. I'm currently using the AxisandOhs streamdeck plugin to control aircraft in MSFS24 (A&O ver 4.55 b26 and streamdeck plugin ver 45.01). Works great - thanks LorbySi. I have an issue with the read variables for on/off functionality for the newly released SAS autopilot module for CS Helis. For each button light, they use the same variable with a different integer: Sim Variable: L:CS_HeliSAS_Lights_Green Integers: LED Mask AP 1 HDG 2 NAV 4 SPD 8 ALT 16 VRT 32 I want to create a script that checks specific LED states from the HeliSAS system via the local simvar (L:CS_HeliSAS_Lights_Green) with bitmask values for different modes (HDG, NAV, ALT, etc.) The integr can change based on which button/s are switched on. EG Autopilot on state is value 1, but when the HDG state is also on, the integer becomes 3 (1 + 2) so both lights on the toggle button go out. I tried using chatgpt and it gave me the following but I cant seem to get it to work: Example OHS Axis Script (per LED state) For each LED (say HDG), you can define a script like: // HDG LED (L:CS_HeliSAS_Lights_Green) 2 & if{ 1 } els{ 0 } Explanation: (L:CS_HeliSAS_Lights_Green) → retrieves the integer value. 2 & → performs bitwise AND with 2 (HDG’s bit). if{1} els{0} → returns 1 if active, otherwise 0. You’d repeat this for each mode, just changing the mask: AUTOPILOT → (L:CS_HeliSAS_Lights_Green) 1 & if{ 1 } els{ 0 } HDG → (L:CS_HeliSAS_Lights_Green) 2 & if{ 1 } els{ 0 } NAV → (L:CS_HeliSAS_Lights_Green) 4 & if{ 1 } els{ 0 } SPD → (L:CS_HeliSAS_Lights_Green) 8 & if{ 1 } els{ 0 } ALT → (L:CS_HeliSAS_Lights_Green) 16 & if{ 1 } els{ 0 } VRT → (L:CS_HeliSAS_Lights_Green) 32 & if{ 1 } els{ 0 } Using in Axis & OHS / StreamDeck In AxisAndOhs, create a script for each LED state with the above expressions. In the StreamDeck plugin, bind each button’s “LED logic” or “indicator” to the corresponding script. Example: HDG button uses the HDG LED script, NAV uses NAV LED script, etc. This way, your StreamDeck button will light up only if the bit for that mode is active. Would really appreciate the help. Thanks.
October 3, 2025Oct 3 Commercial Member If those are simulator LVars, they have to have a unit. Otherwise they never leave AAO. See AAO manual, chapter about Scripting (L:CS_HeliSAS_Lights_Green) -> this is an AAO internal LVar. It will not be synchronized with the simulator (L:CS_HeliSAS_Lights_Green, Number) -> is a simulator LVar. That is what you have to use in your case The first syntax is for variables that you only use in your own scripts. The latter is what you have to use when reading data from the sim Edited October 3, 2025Oct 3 by Lorby_SI LORBY-SI
October 3, 2025Oct 3 Commercial Member To implement the scripts in the SD Action, select Type "S:" for the read variable, then enter the script code into the box. Don't forget to supply the return value too. I think that in most cases you can lose the if{} els{} branch. The value of the operation is the bit you were testing for (=if the third bit is set in the Lvar, then "4 &" will yield a result of 4). In most actions you should be able to use that result directly. ... for "1 &" the ON value is 1, for "16 &" the ON value is 16 etc. Not having to process the if/els saves a few processor cycles. Edited October 3, 2025Oct 3 by Lorby_SI LORBY-SI
October 3, 2025Oct 3 Author Thanks for the quick response. I think the issue is that each button can have more than 1 state/value but the variable is the same for each button. EG AP Master can have values: 1 = Autopilot Master on 3 = Autopilot Master on AND HDG On 11 = Autopilot Master, HDG AND SPD on 18 = Autopilot Master, HDG AND ALT on (SPD & ALT cancel each other out - only 1 can be used at a time) etc For 1 x toggle switch, how do I add all of the values for on and any other value = off? The same will be for other switches - they will have multiple values depending on which switches are on at the time. I can map out the different values that each button could be, but I don't know how to either script this or add to a toggle button or gauge.
October 3, 2025Oct 3 Author SOmeone who is using Mobilflight said the follwoing work in that app but I prefer AxisANDOhs and streamdeck doesnt see to work with Mobiflight. From another group: For my Mobiflight profile i configure: AUTOPILOT led state **(L:CS_HeliSAS_Lights_Green) int 1 &** HDG led State **(L:CS_HeliSAS_Lights_Green) int 2 &** NAV led State **(L:CS_HeliSAS_Lights_Green) int 4 &** SPD led State **(L:CS_HeliSAS_Lights_Green) int 8 &** ALT led State **(L:CS_HeliSAS_Lights_Green) int 16 &** VRT led State **(L:CS_HeliSAS_Lights_Green) int 32 &**
October 4, 2025Oct 4 Commercial Member 7 hours ago, DaveM1970 said: I think the issue is that each button can have more than 1 state/value but the variable is the same for each button. ... For 1 x toggle switch, how do I add all of the values for on and any other value = off? I'm sorry, but I don't understand. A toggle button can only display two states anyway? Like On or Off. You cannot display more information than that? To show the state of the 6 LEDs in question, you need 6 Toggle buttons. Right? Did you want to show the state of all 6 lights on the same button?? That would be possible using a MultiGauge, but I doubt that this would be useful (or even what that is supposed to look like?). To implement dedicated Toggle buttons for each light just follow my screenshot. It is not using a single variable, it is using a script to extract the desired bit (that is what type "S:" means). This script must obviously be different for every button. In my example, I am testing for "4 &", that is the third bit in the LVar = the "NAV" LED. On the next Toggle button you change the code to test for "8 &" with the value being "8", which is the fourth bit = the SPD LED etc. This would be the AAO variant: "Read" must be set to "S:" then put the appropriate code into the box: AUTOPILOT led state (L:CS_HeliSAS_Lights_Green, Number) 1 & ON value: 1 HDG led State (L:CS_HeliSAS_Lights_Green, Number) 2 & ON value: 2 NAV led State (L:CS_HeliSAS_Lights_Green, Number) 4 & ON value: 4 SPD led State (L:CS_HeliSAS_Lights_Green, Number) 8 & ON value: 8 ALT led State (L:CS_HeliSAS_Lights_Green, Number) 16 & ON value: 16 VRT led State (L:CS_HeliSAS_Lights_Green, Number) 32 & ON value: 32 Edited October 4, 2025Oct 4 by Lorby_SI LORBY-SI
October 4, 2025Oct 4 Commercial Member 8 hours ago, DaveM1970 said: the newly released SAS autopilot module for CS Helis What is a "CS Heli"? Where can I find that module? Edited October 4, 2025Oct 4 by Lorby_SI LORBY-SI
October 6, 2025Oct 6 Author Thanks again for the quick response. Yes - it is a single toggle button for each item (AP, HDg, etc). I'll try your suggestion. The CS HELI is the CowanSim HELISAS module - new Autopilot for Cowna sim Helicopters. Currently running it on The CS H125.
October 6, 2025Oct 6 Author Thanks Lorby_Si - works like a charm. There are a couple of toggles though that have multiple states - is there any way of adding these states to a single toggle? The toggles are: NAV led State (L:CS_HeliSAS_Lights_Green, Number) 4 & ON value: 4 also has: NAV led State (L:CS_HeliSAS_Lights_White, Number) 4 & ON value: 4 VRT led State (L:CS_HeliSAS_Lights_Green, Number) 32 & ON value: 32 also has: VRT led State (L:CS_HeliSAS_Lights_White, Number) 32 & ON value: 32 So, the buttons once pressed should be white, and then when Nav kicks in (once it captures lock, it needs to go to green. Would that be via multigauge & if so, could you direct me how to accomplish it? There's a great video of how the HeliSAS autopilot works here: Many thanks again for your time & support - very much appreciated 🙂
October 6, 2025Oct 6 Author Apologies Lorbi, the above toggles have 3 states: 1 = off 2 = armed (white) 3 = captured (Green) Thanks again.
October 6, 2025Oct 6 Commercial Member On 10/6/2025 at 5:35 PM, DaveM1970 said: Apologies Lorbi, the above toggles have 3 states: 1 = off 2 = armed (white) 3 = captured (Green) Thanks again. Either Slider or Multi. First you have to create three images, "off", "white" and "green" as PNG, 144x144 pixel. With a Slider gauge you would glue all three images together side by side, so they form a strip of 432x144. Upload that into the gauge and then figure out a script that moves the strip to the correct location for every value. Example: (L:CS_HeliSAS_Lights_Green, Number) 4 & 4 == 2 * (L:CS_HeliSAS_Lights_White, Number) 4 & 4 == + 144 * I know that this looks weird, but it should work, assuming that "White" is zero when "Green" is on and vice versa. If both are off, the result is zero. If White is on, the result is 144 (=moves the image strip one notch); if White is off but Green is on, the result is 2, moving the strip by 288 pixel. In a MultiGauge you would not glue the images together but keep them separate. Then create three Image Definitions, one for each image in the order off->white->green. In the "White" and "Green" Image Definitions use the individual LED scripts above for the "Visibility" option (leave "off" alone, that's just the background) Edited October 8, 2025Oct 8 by Lorby_SI LORBY-SI
October 7, 2025Oct 7 Author 23 hours ago, Lorby_SI said: Either Slider or Multi. First you have to create three images, "off", "white" and "green" as PNG, 144x144 pixel. With a Slider gauge you would glue all three images together side by side, so they form a strip of 432x144. Upload that into the gauge and then figure out a script that moves the strip to the correct location for every value. Example: (L:CS_HeliSAS_Lights_Green, Number) 4 & 4 == 2 * (L:CS_HeliSAS_Lights_White, Number) 4 & 4 == + 144 * I know that this looks weird, but it should work, assuming that "White" is zero when "Green" is on and vice versa. If both are off, the result is zero. If White is on, the result is 144 (=moves the image strip one notch); if White is off but Green is on, the result is 2, moving the strip by 288 pixel. In a MultiGauge you would not glue the images together but keep them separate. Then create three Image Definitions, one for each image in the order off->white->green. In the "White" and "Green" Image Definitions use the scripts above for the "Visibility" option (leave "off" alone, that's just the background) Thanks again for the prompt response. I'll give that a go.
October 10, 2025Oct 10 Commercial Member On 10/7/2025 at 9:20 PM, DaveM1970 said: Thanks again for the prompt response. I'll give that a go. Here are examples for the NAV LED, one MultiGauge, one Slider Gauge, with the images that I used. https://www.dropbox.com/scl/fi/keaik5gy03up0469zj48u/BitwiseTriState.zip?rlkey=fojgmnstemzhq3p2wv0fjdks0&dl=0 Both SD actions do the same, but the Slider Gauge is a little easier on performance than the Multi. On the other hand, the Multi is easier to make - the Slider requires a script that shifts the image strip "just so", while with a Multi you only have to decide when you want to display the individual images (with the Visibility option). LORBY-SI
Create an account or sign in to comment