Jump to content
The simFlight Network Forums
Sign in to follow this  
dwilliams

Request advice on radio panel interface architecture

Recommended Posts

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)

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.