Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
Collapse
Just Flight Community Forum
  1. Home
  2. Just Flight
  3. MSFS Products
  4. Black Square Add-Ons
  5. Starship
  6. Which variables can I use to read your custom variables Black Square?

Which variables can I use to read your custom variables Black Square?

Scheduled Pinned Locked Moved Starship
22 Posts 4 Posters 1.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • toby23T Offline
    toby23T Offline
    toby23
    wrote on last edited by
    #7

    I really appreciate you sharing these variables, thank you.

    1 Reply Last reply
    0
    • Black SquareB Offline
      Black SquareB Offline
      Black Square
      Black Square Developer
      wrote on last edited by
      #8

      Of course! Let me know what else I can do for you!

      1 Reply Last reply
      0
      • toby23T Offline
        toby23T Offline
        toby23
        wrote on last edited by toby23
        #9
        This post is deleted!
        1 Reply Last reply
        0
        • toby23T Offline
          toby23T Offline
          toby23
          wrote on last edited by toby23
          #10

          I cannot find a way to read if IAS or DES mode is active using SimVars.

          I am reading A:AUTOPILOT FLIGHT LEVEL CHANGE, Bool to turn the 'green light' on for either the IAS or DES switch. Currently it turns both lights on when either mode is activated.

          How can I 'read' which mode is active?

          I can use RPN scripts but I cannot write them myself.

          Thank you

          1 Reply Last reply
          0
          • Black SquareB Offline
            Black SquareB Offline
            Black Square
            Black Square Developer
            wrote on last edited by
            #11

            That's what the (A:INDICATED ALTITUDE:1, FEET) 250 - (A:AUTOPILOT ALTITUDE LOCK VAR:1, FEET) < and... sections of the code above is meant to do. It simply looks at whether the preselected altitude is commanding a climb or descent from the current altitude.

            1 Reply Last reply
            0
            • toby23T Offline
              toby23T Offline
              toby23
              wrote on last edited by toby23
              #12

              I thought so but adding it as a Script to the entry field doesn't work and I cannot figure out why. I use something similar to detect if 100 or 1000 ft is selected for the altitude dial in another profile, that uses this script.

              image.png

              but if I use your RPN code, it doesn't detect between IAS (IASP) or DES.

              68327126-fc05-4f48-80e9-6c9daecc15bc-image.png

              I will ask on the AAO forum and see if Lorby can help too. Thank you

              1 Reply Last reply
              0
              • toby23T Offline
                toby23T Offline
                toby23
                wrote on last edited by toby23
                #13

                @Black-Square It is slowly coming together...

                One question for you, how have you configured the V/S readout?

                In the image below, 2.1 shows the A:Var AUTOPILOT VERTICAL HOLD VAR, Feet/minute
                BUT this is only correctly displayed when V/S mode is active.

                In reverse, when the ALT mode is active, the ALT readout does not change on the Stream Deck profile but it does in the sim.

                Q. When I turn the dial, I can see the VSpeed change in the sim cockpit but the correct value is ONLY displayed on the Stream Deck when V/S mode is active, why?

                N.B.The Starship is the only aircraft where my profiles don't seem to work 'normally'.

                eeafd10a-1756-403a-af0a-3e0e1831584b-image.png

                1 Reply Last reply
                0
                • Black SquareB Offline
                  Black SquareB Offline
                  Black Square
                  Black Square Developer
                  wrote on last edited by
                  #14

                  For both of them, you could try this technique:

                  Vertical Speed Select:

                  (A:AUTOPILOT VERTICAL HOLD, bool) if{
                      (AUTOPILOT VERTICAL HOLD VAR:1, feet per minute)
                  }
                  els{
                      (L:bksq_VerticalSpeedPreselect_1, feet per minute)
                  }
                  

                  Altitude Select:

                  (A:AUTOPILOT ALTITUDE LOCK, bool) if{
                      (AUTOPILOT ALTITUDE LOCK VAR:1, feet)
                  }
                  els{
                      (L:bksq_AltitudePreselect_1, feet)
                  }
                  

                  I'm not sure why that should be necessary for the selected altitude, but if it works, it works.

                  toby23T 1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SaabFAN86
                    wrote on last edited by
                    #15

                    I'm also looking into getting data out of the starship, but for a different purpose: I want to use the WinWing MCDU or even a self-made CDU (the button-layout transfer from the MCDU to the Starship-CDU is way less intuitive than I thought) to interact with the starship CDU.
                    Best case, this includes the display of the Starship CDU being mirrored on the device.
                    I am using Mobiflight for this, so I need the data that is on screen in plain text form, including color information.

                    Is there any way to get that data? Or does it require an update of the Starship?

                    Black SquareB 1 Reply Last reply
                    0
                    • S SaabFAN86

                      I'm also looking into getting data out of the starship, but for a different purpose: I want to use the WinWing MCDU or even a self-made CDU (the button-layout transfer from the MCDU to the Starship-CDU is way less intuitive than I thought) to interact with the starship CDU.
                      Best case, this includes the display of the Starship CDU being mirrored on the device.
                      I am using Mobiflight for this, so I need the data that is on screen in plain text form, including color information.

                      Is there any way to get that data? Or does it require an update of the Starship?

                      Black SquareB Offline
                      Black SquareB Offline
                      Black Square
                      Black Square Developer
                      wrote on last edited by
                      #16

                      @SaabFAN86 I have no idea what format that text and color information is supposed to be presented in, nor how to get it to you. Can you give me an idea of how these other units work? I suspect this is not something that's possible from the JavaScript context, but I will do it if it's remotely possible, or send you a custom solution if it's not something I want to include for all users.

                      S 1 Reply Last reply
                      0
                      • Black SquareB Black Square

                        For both of them, you could try this technique:

                        Vertical Speed Select:

                        (A:AUTOPILOT VERTICAL HOLD, bool) if{
                            (AUTOPILOT VERTICAL HOLD VAR:1, feet per minute)
                        }
                        els{
                            (L:bksq_VerticalSpeedPreselect_1, feet per minute)
                        }
                        

                        Altitude Select:

                        (A:AUTOPILOT ALTITUDE LOCK, bool) if{
                            (AUTOPILOT ALTITUDE LOCK VAR:1, feet)
                        }
                        els{
                            (L:bksq_AltitudePreselect_1, feet)
                        }
                        

                        I'm not sure why that should be necessary for the selected altitude, but if it works, it works.

                        toby23T Offline
                        toby23T Offline
                        toby23
                        wrote on last edited by toby23
                        #17

                        @Black-Square Thank you so much for sharing this code.
                        I still couldn't get this to work as as a script in Stream Deck software but I was able to get both dial readouts populated using the LVars (as you originally suggested). Thank you.

                        1 Reply Last reply
                        0
                        • Black SquareB Black Square

                          @SaabFAN86 I have no idea what format that text and color information is supposed to be presented in, nor how to get it to you. Can you give me an idea of how these other units work? I suspect this is not something that's possible from the JavaScript context, but I will do it if it's remotely possible, or send you a custom solution if it's not something I want to include for all users.

                          S Offline
                          S Offline
                          SaabFAN86
                          wrote on last edited by
                          #18

                          @Black-Square I can't say exactly, how other planes provide this data. But from a cursory reading of the python scripts responsible for getting the data from the airplanes, parsing it and then sending it to Mobiflight, it seems that Websocket is commonly used to get the data. After that, it's parsed in the appropriate manner and then transmitted to the external Hardware.
                          With that in mind, I guess, a JSON-String that is pushed to this script through a Websocket-Connection, could be all that's needed to get the data to Mobiflight.

                          See here for the Mobiflight-Scripts: https://github.com/MobiFlight/MobiFlight-Connector/tree/main/Scripts/Winwing

                          1 Reply Last reply
                          0
                          • V Offline
                            V Offline
                            vanislepilot
                            wrote last edited by
                            #19

                            @Black-Square Hey Nick, just getting under the hood here a bit too for my StreamDeck set-up. I've been scouring for DH and MDA variables (I'm tracking the H: var commands to inc/dec), but I would like to have a display of the DH and MDA on my SD+ as well. Could you point me to it, if it exists? Thanks in advance!

                            Black SquareB 1 Reply Last reply
                            0
                            • V vanislepilot

                              @Black-Square Hey Nick, just getting under the hood here a bit too for my StreamDeck set-up. I've been scouring for DH and MDA variables (I'm tracking the H: var commands to inc/dec), but I would like to have a display of the DH and MDA on my SD+ as well. Could you point me to it, if it exists? Thanks in advance!

                              Black SquareB Offline
                              Black SquareB Offline
                              Black Square
                              Black Square Developer
                              wrote last edited by Black Square
                              #20

                              @vanislepilot Unfortunately, I don't have those variables exposed at the moment. Tracking them with the H:Events might be a very simple solution, since they will always initialize to the same values. On the other hand, if doing some simple code edits doesn't scare you, then you can add the following lines immediately after screentimeUpdate_L(){ in PFD.js.

                              SimVar.SetSimVarValue("L:var_DecisionHeight_L", "feet", this.decisionHeight_L);
                              SimVar.SetSimVarValue("L:var_AlertAltitude_L", "feet", this.alertAltitude_L);
                              

                              That should do the trick!

                              1 Reply Last reply
                              0
                              • V Offline
                                V Offline
                                vanislepilot
                                wrote last edited by
                                #21

                                Thanks Nick, I tried sliding them in above the "let newActiveNav..." line, but the result seems to be all cockpit displays, including the EFB stayed blank, despite engines running, gens connected. Removing those additional lines of code fixed the problem.

                                image.png

                                1 Reply Last reply
                                0
                                • Black SquareB Offline
                                  Black SquareB Offline
                                  Black Square
                                  Black Square Developer
                                  wrote last edited by
                                  #22

                                  Ah, that would be because I missed a quotation mark. I've fixed my post above. Give that a try.

                                  1 Reply Last reply
                                  0
                                  Reply
                                  • Reply as topic
                                  Log in to reply
                                  • Oldest to Newest
                                  • Newest to Oldest
                                  • Most Votes


                                  • Login

                                  • Don't have an account? Register

                                  • Login or register to search.
                                  • First post
                                    Last post
                                  0
                                  • Categories
                                  • Recent
                                  • Tags
                                  • Popular
                                  • Users