Results 1 to 6 of 6

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

  1. #1

    Default 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

  2. #2
    Join Date
    Nov 1999
    Location
    Chippenham, Wiltshire, UK.
    Posts
    6,898

    Default

    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.

  3. #3
    Join Date
    Feb 2013
    Location
    known universe
    Posts
    1,988

    Default

    Search term "control stand" --- there are a few threads about this --- you may find some of the posts helpful.
    Cheers, R. Steele [Gerry] It's my railroad and I'll do what I want! Historically accurate attitude of US Railroad Barons.


  4. #4
    Join Date
    Nov 2011
    Location
    California, USA
    Posts
    109

    Default

    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.

  5. #5

    Default

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

  6. #6

    Default

    Quote Originally Posted by rman View Post
    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


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •