ganebur ivanlli fairley

0 views
Skip to first unread message

Matthias Briggs

unread,
Aug 2, 2024, 8:55:26 PM8/2/24
to bonasofmers

I want to send data to an Excel spreadsheet from Datarefs. Namely, I want to track the distance from the next waypoint. I need sim/cockpit/gps/course, sim/cockpit/radios/gps_dme_dist_m, sim/cockpit2/radios/indicators/gps_nav_id. I know it has something to do with the COM port and connection strings, but I'm lost at this point.

I'm writing a program that emulates the ATC clearance as to when to descend to the next WP at a certain distance from that WP (my program calculates the precise distance required for a proper descent). Then when the dist_m gets to that distance, a voice file is triggered.

Why make it complicated? Assuming your discretion i.e., no traffic conflicts or Xing restrictions, note your current ALT and the one you need to descend to, subtract, drop the remainder thousands, and multiply by 3. Fudge it slightly for hundreds, and +/- 2nm per 10kts head/tail wind correction if you want to get fancy. Done. Takes all of two seconds to do, and that's only if you're no good at math.

My question was how to pull a dataref in from XPlane to populate a cell in Excel so I can trigger a voice file when the plane gets X miles from the next waypoint. I project the dataref to my screen, but I need to send it to Excel.

Are you aware that excel wont just "magically notice" you write behind its back something to disk and auto-magically reload everything and re-calculate to make things happen ? Or you would have to create some excel addon that makes excel accept external input in real time. That is likely a good PhD thesis for a software engineer kind of a project. I would judge that part some hundred times more complicated than the other half of such a project - make X-Plane periodically print a dataref to disk - that part is open source, well documented and actually made to be used for purposes like that.

So while it may look easy to you to create a excel spreadsheet that plays a sound after analyzing some cell in there - turning excel into an automated background process is a handful. There is some toolkit to use matlab for things similar to what you describe, but that is an entirely different animal than excel. And still WAY overkill for just evaluating a simple "if (dataref > x) play sound" kind of a thing.

The Excel project started out as a quick solution to a simple set of criteria, and it grew organically, becoming a large, complex but extremely useful multi-task tool. It is almost all written in VB, which is a clunky compiler, admittedly. But that's what I have. According to a contact at XP, importing a dataref item fluidly into Excel is quite doable if I have the connection COM strings properly set. That's where my knowledge base train falls off the bridge. I thought... I expected... that my question had a simple answer.

I was reading the PDF when it blew up. And I developed the 'adventure' language and compiler with BAO (Bruce Artwick and Hugo) in the earliest days of Flight Sim. I wrote dozens of flight commercial adventures and a powerful professional ATC-emulation program for ELITE. I know my way around OOP coding.

@TimSim, Just because you have a hammer does not mean that everything is a nail... You may have an Excel spreadsheet and be comfortable with it but, as others have noted before me, I don't think it is the right tool for what you describe wanting to do.

I would also go with a LUA tool. SASL (that's what I am familiar with...) or FlyWithLUA. FWL is probably the easiest to learn. But you have to learn the far end of your project. How datarefs work and how to extract their value out of X-Plane. For that, you will have to read instructions and manuals. There are some with the package you downloaded. And you will also find a manual for the scripted language.

Anyway, after all our time spent here, it sounds like you are actually just asking how to set up UDP comms with XP. The info is in '.../X-Plane 11/Instructions//X-Plane SPECS from Austin/Exchanging Data with X-Plane.rtfd'.

I downloaded LUA and played with it a bit. Nice program, but it doesn't give me what I want without rebuilding the work I've already done in VB. I'll write a few scripts though just for fun. Rusty on in C or C++, so it might help keep the brain alive.

And if you go any route of exporting data from x-plane - dont use COM port stuff, but UDP networking. The COM port stuff was intended for 1990's hardware - not maintained for well over a decade and not using programming techniques that have any place in a multi-threaded real-time software like x-plane.

Hi, again. Apparently, passing datarefs through a firewall is not working... or smart. So, I writing a simple--at least I thought it was simple--program in LUA. The problems are: it doesn't seem to pick up the right values for the math required to trigger the voice. And, the voice plays every ten seconds (do_sometimes which is okay) but keeps executing and playing. Isn't there a do_once or something like that? Here's the code.

These are your bug - they define local variables that contain the value of the global variables linked to the datarefs at the time the locals are defined. And that occurs once, at the time the script loads. They do not bind to or create additional references to the datarefs (i.e. they get set once at script load, and then never change)

Your problem is that you then use those local static values in your doCalc() function - so clearly that does the same calculation every time it runs (every 10 seconds when it is called due to do_sometimes() ), so you get the same result every time.

Well, it triggers every 10 seconds because that's what your code tells it to do (due to the bugs above). If you really want it to play only once (after you fix the bugs), then you would need to control that yourself with another boolean/flag that you set when you trigger the the voice command, and check every time so that you don't trigger it multiple times

Believe it or not, buried deep within Microsoft Excel 97 is a hidden flight simulator that allows you to take to the skies and fly like a bird. This little-known feature was not officially supported by Microsoft, but it quickly became one of the most popular Easter Eggs in computer history.

While the flight simulator Easter Egg was not officially supported by Microsoft, it was a fun and unexpected feature that brought joy to millions of Excel users. Unfortunately, this Easter Egg was removed in later versions of the software, but its legacy lives on.

Aviation enthusiasts traveling through will have the opportunity to sleep next to the functioning simulator, which features two cockpit seats, flight controls, and birds-eye views through the flight deck window. To actually jump into the captain's seat, however, prospective pilots need to book a 90-minute lesson with a flight instructor. Otherwise, the simulator stays behind a "transparent acrylic board," the hotel says on its website. Customers who only rent the room without booking time with the instructor can only gaze at the controls and simulated views out of the window without sitting in the pilot's seat.

For those who spring for the lesson, the simulator is loaded with an hour-and-a-half flight plan. Taking off from Haneda Airport, pilots in training will navigate the plane to Itami Airport in Osaka. "You can experience the maneuvering of an airplane under the guidance of an instructor who is familiar with the equipment, including a former captain who has actually experienced flying," Haneda Excel Hotel Tokyu says on its website.

Even before the installation of the hotel's cockpit room, Haneda Airport has been an aviation geek haven: the airport itself has four flight simulators in its Tiat Sky Road corridor that can be used for a fee, as well as a free observation deck on its fifth floor where any passenger can watch planes take off and land.

By signing up you agree to our User Agreement (including the class action waiver and arbitration provisions), our Privacy Policy & Cookie Statement and to receive marketing and account-related emails from Traveller. You can unsubscribe at any time. This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

So it boils down to almost useless. It doesn't track time correctly, especially on long flights and it keeps incomplete flights that may have been a test. Too bad it's so poorly designed. All the achievements in the world won't even buy you a cup of coffee. Hopefully, 2024 will include a workable log book.

I agree with you that the MSFS 2029 logbook is a disaster. I spend a good deal of study time in new aircraft models, mostly payware, as they continue to add realism and depth. Not something I need logged but it gives me no choice. And no method to edit the logbook. Do I hear "seconds" to my motion of "Microfsoft! I do not need your measurement of so-called accomplishments!" In fact, subLogic created high success with that back in the early 1990's with their 50 "graded" flight assignments in their Flight Assignment:ATP simulation. If Microsoft feels that is of so much value then at least create something equal of better than what was in place 30 years ago. Same thing with ATC by the way. Flight Assignment:ATP had much more realistic ATC back in the day.

c01484d022
Reply all
Reply to author
Forward
0 new messages