August 18, 2025Aug 18 Hi, I'm learning how to create scripts to complement Stream Deck profiles. I'm starting with a profile for the Miltech MH60. First challenge: a 3-position switch: (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) 1 = OFF, 2 = ENGINE and 0 = APU Unless I'm mistaken, you need to use a SliderGauge on the Stream Deck, but beyond that, I don't know. My attempts (based on examples from other scripts) have been unsuccessful. My Test : (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH, number) 1 == if{ 0 (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH, number) ) els ( 1 (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH, number) } Thanks for help
August 18, 2025Aug 18 Commercial Member 1. "(IE:" reads from the variable, "(>IE:" writes to it (this is the same for all variables, A: L: B:, whatever) 2. IE's don't have units, they aren't variables in the true sense of the word 3. Make sure that when you read from the IE you really get these values. It doesn't have to be that way. (IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) 1 == if{ 0 (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) ) els ( 1 (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) } For a tri-state switch (or more), you would use the "seq" or "iseq" RPN operators. I'm not at my computer at the moment, so this is off the top of my head, untested: 0 1 2 1 (IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) (L:OvdAiSoSw) 4 iseq (>IE:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) (>L:OvdAiSoSw) or 0 1 2 1 (B:INSTRUMENT_OVD_AIR_SOURCE_SWITCH) (L:OvdAiSoSw) 4 iseq (>B:INSTRUMENT_OVD_AIR_SOURCE_SWITCH_Set) (>L:OvdAiSoSw) The LVar is just an invented internal one. You need a different LVar for every iseq script. The correct SD Action would be either a Slider or a MultiGauge (Slider is more performance friendly) Edited August 18, 2025Aug 18 by Lorby_SI LORBY-SI
August 23, 2025Aug 23 Author The script works perfectly now. But I'm having trouble with the Stream Deck section. Here are my settings: Read Variable L:MH60-Air Source X Multiplier: -144 Button Setting K:MH60-Air Source Background image: upload Sliding the attached image But I only get states 0 <-> 2, never state 1. Thanks for help
August 23, 2025Aug 23 Author The script : 0·2·1·0·(B:INSTRUMENT_OVD_AIR_SOURCE_SWITCH)·(L:OvdAiSoSw)·4·iseq·(>B:INSTRUMENT_OVD_AIR_SOURCE_SWITCH_Set)·(>L:OvdAiSoSw) And the correct assign is = 1 = OFF, 2 = APU and 0 = ENG
August 23, 2025Aug 23 Commercial Member 6 hours ago, pascalmartin said: Read Variable L:MH60-Air Source This is wrong. First, the script does not return a value (and if it did you would use type S:). Using the script variable here makes no sense, sorry. Read variable must be the actual state variable of the switch: B:INSTRUMENT_OVD_AIR_SOURCE_SWITCH Edited August 23, 2025Aug 23 by Lorby_SI LORBY-SI
Create an account or sign in to comment