dwilliams Posted May 10, 2015 Report Posted May 10, 2015 Hi. I am interfacing a custom radio panel controlled via Arduino with FSX via FSUIPC/Lua. My question is which of these two architectures would be better in terms of performance. First, the micro could send encoder closures that Lua will translate on the fly. For example, for Nav1 increment, Lua would execute a bunch of ipc.control(1038) to tune up, and rely on event.offset (0x0350, "UW", someFunction) to get the updated freq back to the Arduino/panel for display. Or, second, the micro could keep track of frequency locally during tuning and write the absolute value periodically (every few ticks). For example, send an ipc.writeUW (0x0350, val) to hard set the sim and display the same freq locally without looking for an update from Lua. If this is the wrong kind of question for this forum, please advise, but if not, does anyone have an opinion or an alternate suggestion? Regards, Dave Long Beach (very near KLGB)
Pete Dowson Posted May 10, 2015 Report Posted May 10, 2015 Hi. I am interfacing a custom radio panel controlled via Arduino with FSX via FSUIPC/Lua. My question is which of these two architectures would be better in terms of performance. First, the micro could send encoder closures that Lua will translate on the fly. For example, for Nav1 increment, Lua would execute a bunch of ipc.control(1038) to tune up, and rely on event.offset (0x0350, "UW", someFunction) to get the updated freq back to the Arduino/panel for display. Or, second, the micro could keep track of frequency locally during tunign and write the absolute value periodically (every few ticks) during tuning. For example, send an ipc.writeUW (0x0350, val) to hard set the sim and display the same freq locally without looking for an update from Lua. Definitely the second option. I've implemented this sort of thing (Flightlink and PFC radio stacks and MCPs) and the first method is not good at all, you get overruns due to queuing. With the second, just update the value in the Sim when you haven't seen an update from the device for a time, say 500 mSecs (but experiment with that, it depends on the device and so on). There's not really any point in updating it before, unless it is adjusting something visually in FS which you need to see as well (eg the heading pointer on a PFD). Then I suppose you'd need your regular timed updates. Of course, if something else in the Sim updates the value (eg loading a flight) then display that straight away, discarding any as yet unwritten value from recent local changes. Pete
dwilliams Posted May 10, 2015 Author Report Posted May 10, 2015 Thanks Pete: the quickest response I ever got on a forum - you even beat my immediate edits for misspelling. I'll remember to post during London evenings. And exactly the advice I was looking for, from someone who has already done it. Many thanks. -Dave
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now