Pulling airbrake data from OR for driving physical gauges in real time

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Tfed2020
    New Member
    • Jul 2020
    • 2

    #1

    Pulling airbrake data from OR for driving physical gauges in real time

    I am trying to find a way to access airbrake data in almost real time to drive a set of actual duplex air gauges for my simulator's control stand. The goal is to be able to watch the physical needles rather than anything on the screen. The gauges have been modified such that servos now run the needles and an Arduino drives the servos. At this point all I need is to get the BP, BC, ER, and MR pressures into the Arduino in as close to real time as possible.

    The ideas I have been toying with are:
    1) Tap into the existing OR logging feature. Enabling physics data in the content logger includes the BP, BC, ER, and MR pressures in the OpenRailsDump.csv file. The arduino can then open this file regularly and update the gauges from there.

    Problem: The OpenRailsDump.csv file only updates when the sim session is closed. Also a very clunky method and likely too slow of a refresh rate due to having to open a large csv file. Would need a way to A) refresh the OpenRailsDump file at a steady rate while OR runs and B) delete the contents of the csv file after reading to keep the processing time down.

    2) Modify OR to log just the BP, BC, ER, and MR parameters to a csv file and have the Arduino regularly open the file, take the values, then clear the file for the next output from OR.

    Problem: I'm an amateur when it comes to coding, I wouldn't know what to modify to get this working. It also still relies on file I/O, which might add restrictive amounts of lag no matter how small the file is.

    3) Run a separate program in parallel that uses text detection to read the HUD parameters from a known location on the screen and send the values I need to the Arduino.

    Problem: This is also above my experience level, although if no better solutions exist then it is at least documented well enough that I could likely figure my way through it.

    Has anyone tried anything like this or know of ways to resolve the problems listed above? Or is there a better approach than my clunky inexperienced ideas?

    If this can be accomplished then the last goal will be getting the load meter to work. This is more dynamic than brake pressures though so it will only work well if I can update it at a high enough rate.

    Thanks in advance!
    Tyler
  • baldwin
    6000 Post Veteran


    • Nov 1999
    • 6358
    • Chippenham, Wiltshire, UK.
    • ORTS

    #2
    Probably a better way would be to get the required OR outputs to go to your Arduino at the same time as OR updates the screen dials. Above my pay grade to do, but I think it is possible.
    Beer is not a matter of life or death, it is much more serious than that.

    Comment

    • R. Steele
      3500 Post Veteran

      • Feb 2013
      • 3928
      • known universe
      • ORTS

      #3
      Search term "control stand" --- there are a few threads about this --- you may find some of the posts helpful.
      Cheers, Gerry
      "A mind is like a parachute. It doesn't work if it is not open." Frank Zappa
      It's my railroad and I'll do what I want! Historically accurate attitude of US Railroad Barons.
      Forever, ridin' drag in railroad knowledge.
      Audi, Vide, Tace, Si Vis Vivere In Pace​

      https://www.trainsim.com/forums/filedata/fetch?filedataid=79656&type=medium​ https://www.trainsim.com/forums/filedata/fetch?filedataid=79654&type=small

      Comment

      • rman
        Member
        • Nov 2011
        • 99
        • California, USA

        #4
        You should check out the new web server feature. It allows you to retrieve data from the simulator through HTTP. You can add API calls to get the properties you want.

        Comment

        • Tfed2020
          New Member
          • Jul 2020
          • 2

          #5
          Thanks for the replies! You have given me some new ideas, hopefully one will be a winner.

          Comment

          • cjakeman
            Senior Member
            • Mar 2010
            • 137

            #6
            Originally posted by rman
            You should check out the new web server feature. It allows you to retrieve data from the simulator through HTTP. You can add API calls to get the properties you want.
            One of these APIs gets all the data that the HUD provides including the brake values.
            Chris Jakeman

            sigpic

            Comment

            • BB22210
              New Member
              • May 2010
              • 4
              • France

              #7
              Hello,
              ### I Just wanted to report that an exhibition will take place next 30/31 October 2021 at the major Ferroviaire Show (Railway Modelling) in Chambery, France

              exhibition of unusual - a reconstruction of a SNCF BB22200 electric locomotive cab with reclaimed and re-constructed 100% instruments and controls.
              pupitrexx.jpg

              This cab is harnessed to the Open Rails simulator with a route "The Maurienne" line created by me (7 years of development)

              more infos at : https://www.facebook.com/AlpiSim

              Rgds
              BB22210

              Comment

              Working...