Problem with KNS81 mapping
-
We're speaking about the Baron and Bonanza? The outputs are definitely there in the code, so it's possible that I just gave you different variable names when I had you add them manually. Here is a list of what it output. Let me know if you need more information, please:
L:var_RNAV_WAYPOINT_NUMBER
L:var_RNAV_CHECKMODE
L:var_RNAV_RADIAL_NUMBER
L:var_RNAV_DISTANCE_NUMBERL:BKSQ_RNAV_TO_Degraded
L:BKSQ_RNAV_FROM_Degraded
L:BKSQ_RNAV_CDI_Degraded
L:BKSQ_RNAV_BRG_Degraded -
strange, yes, these are the ones I'm using
-
@Black-Square To clarify, the L:var's show up on my system, but I am not able to read anything other than zero from them.
-
Hi @GunStrauss, I have a very similar problem, maybe a worse problem. I am trying to create a page with SPAD.neXt for my Loupedeck Live device. I have assigned correctly four dials to the ones in the Analog Baron KNS 81 (lovely piece of avionics, by the way), and also I could map the USE, DATA and RTN keys. Thanks to one suggestion of you in another place I am able to see the Nav 3 value [FRQ] in one of the Loupedeck's buttons.
BUT I cannot find the RAD or the CHK buttons, and, regarding the LVars, I can only find RADIAL_NUMBER and DISTANCE_NUMBER, but the only value that I obtain is zero. Finnally, the WAYPOINT_NUMBER and the DISTANCE_NUMBER are not in the SPAD.neXt list. You have them, but they don't work, I have only two of them, and they don't work.
Finnaly, regarding the another four BKSQ_RNAV vars, I would like to ask how they work in the KNS 81, I had no idea about them.
Thanks a lot in advance and best regards,
Felix FdC (Oviedo, Spain)
-
Both the KNS-81 and -80 still requires some manual edits to get proper output for the LVARS when the navigation aids are not in range. I'm coming back to you when I know more! Best, GS
-
From the developer:
KNS80:
Move the three lines containing, "var_RNAV_WAYPOINT_NUMBER", "var_RNAV_RADIAL_NUMBER", and "var_RNAV_DISTANCE_NUMBER" up a couple of lines in KNS80.js so that they are right after the function declaration "sendRnavVariables(){"KNS81:
Replacing all the code between the line: "sendRnavVariables(){", and the line: "sendAutopilotVariables(){"...SimVar.SetSimVarValue("L:var_RNAV_WAYPOINT_NUMBER", "number", this.displayChannel);
if(SimVar.GetSimVarValue("NAV HAS DME:"+this.navSourceIndex, "Bool") && SimVar.GetSimVarValue("NAV SIGNAL:"+this.navSourceIndex, "number")){ if(!SimVar.GetSimVarValue("L:var_RNAV_CHECKMODE", "bool")){ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", this.memoryRadials[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.memoryOffsets[this.displayChannel - 1]); } else{ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", (this.actualVorRadialDegrees + 180) % 360); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.interpolatedDmeRange); } SimVar.SetSimVarValue("L:var_RNAV_BEARING", "number", this.rnavBearing); //console.log("Sending CDI Value: " + this.rnavAngularDeviation + " --> " + (Math.max(Math.min(this.rnavAngularDeviation, 12.0), -12.0) * 10.583333) ); //0=VOR, 1=VOR/PAR, 2=RNAV-ENR, 3=RNAV-APR switch(this.navigationMode){ case 0: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavAngularDeviation, 12.0), -12.0) * 10.583333) ); break; case 1: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 5.0), -5.0) * 25.4) ); break; case 2: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 5.0), -5.0) * 25.4) ); break; case 3: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 1.25), -1.25) * 101.6) ); break; } SimVar.SetSimVarValue("L:var_RNAV_TOFROM", "number", this.toFromFlag); } else{ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", this.memoryRadials[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.memoryOffsets[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_TOFROM", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_BEARING", "number", 0); } if(!SimVar.GetSimVarValue("L:var_RNAV_DMEHOLD", "Bool")){ if(SimVar.GetSimVarValue("NAV HAS DME:"+this.navSourceIndex, "Bool") && SimVar.GetSimVarValue("NAV SIGNAL:"+this.navSourceIndex, "number")){ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", this.rnavDmeDistance); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", this.rnavDmeSpeed); } else{ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", 0); } } else{ if(this.calculatedDmeDistanceHOLD < 145.7){ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", this.calculatedDmeDistanceHOLD); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", this.calculatedDmeSpeedHOLD); } else{ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", 0); } }
}
-
This post is deleted!
-
@felixfer *NOTICE THAT THE FORUM SYSTEM REFORMATS THE CODE. The first line and the last } is outside of the "code-box".
-
Hi, @GunStrauss , first at all a big THANK YOU for your kind and generous help. I am really touched.
I have put the code you sen to me in my KNS81.js file. I hope I have done well the replacement you suggest. This is the result:
send__ThisLineIsOnlyForAvoidingTheBoxCodeProblem__(){ sendRnavVariables(){ SimVar.SetSimVarValue("L:var_RNAV_WAYPOINT_NUMBER", "number", this.displayChannel); if(SimVar.GetSimVarValue("NAV HAS DME:"+this.navSourceIndex, "Bool") && SimVar.GetSimVarValue("NAV SIGNAL:"+this.navSourceIndex, "number")){ if(!SimVar.GetSimVarValue("L:var_RNAV_CHECKMODE", "bool")){ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", this.memoryRadials[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.memoryOffsets[this.displayChannel - 1]); } else{ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", (this.actualVorRadialDegrees + 180) % 360); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.interpolatedDmeRange); } SimVar.SetSimVarValue("L:var_RNAV_BEARING", "number", this.rnavBearing); //console.log("Sending CDI Value: " + this.rnavAngularDeviation + " --> " + (Math.max(Math.min(this.rnavAngularDeviation, 12.0), -12.0) * 10.583333) ); //0=VOR, 1=VOR/PAR, 2=RNAV-ENR, 3=RNAV-APR switch(this.navigationMode){ case 0: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavAngularDeviation, 12.0), -12.0) * 10.583333) ); break; case 1: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 5.0), -5.0) * 25.4) ); break; case 2: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 5.0), -5.0) * 25.4) ); break; case 3: SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", (Math.max(Math.min(this.rnavLinearDeviation, 1.25), -1.25) * 101.6) ); break; } SimVar.SetSimVarValue("L:var_RNAV_TOFROM", "number", this.toFromFlag); } else{ SimVar.SetSimVarValue("L:var_RNAV_RADIAL_NUMBER", "number", this.memoryRadials[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_DISTANCE_NUMBER", "number", this.memoryOffsets[this.displayChannel - 1]); SimVar.SetSimVarValue("L:var_RNAV_CDI", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_TOFROM", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_BEARING", "number", 0); } if(!SimVar.GetSimVarValue("L:var_RNAV_DMEHOLD", "Bool")){ if(SimVar.GetSimVarValue("NAV HAS DME:"+this.navSourceIndex, "Bool") && SimVar.GetSimVarValue("NAV SIGNAL:"+this.navSourceIndex, "number")){ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", this.rnavDmeDistance); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", this.rnavDmeSpeed); } else{ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", 0); } } else{ if(this.calculatedDmeDistanceHOLD < 145.7){ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", this.calculatedDmeDistanceHOLD); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", this.calculatedDmeSpeedHOLD); } else{ SimVar.SetSimVarValue("L:var_RNAV_DME", "number", 0); SimVar.SetSimVarValue("L:var_RNAV_DMESPEED", "number", 0); } } } sendAutopilotVariables(){ send__ThisLineIsOnlyForAvoidingTheBoxCodeProblem__(){
-
And I must say that it has worked for the RADIAL and DISTANCE vars, now I can access to them and show their values.
The only remaining problem is the WAYPOINT_NUMBER var, I have not been able to find it. I feel that I am abusing your trust, but I would like to ask you if you find any possible cause for this absence.
Thanks again for your unvaluable help and best regards,
FĂ©lix FdC
-
@felixfer No problem, but not sure if I understand why you don't get the waypoint number. I belive this is the piece of code that makes the waypoint number display:
SimVar.SetSimVarValue("L:var_RNAV_WAYPOINT_NUMBER", "number", this.displayChannel);
My post (where the code is weirdly formatted) is taken directly from the .js file running on my system. Are you using the latest build? What aircraft?
-
Hi again, @GunStrauss . Sorry for my mistake before. I just reloaded the sim and the Waypoint_Number Var was there, indeed. Now I can have almost all the KNS81 values in my Loupedeck. Thanks again for all your support.
P.S. My aircraft is the Analog Baron, by the way
-
I'm happy you got it to work!